text
stringlengths 4
6.14k
|
|---|
//
// This file is part of Gambit
// Copyright (c) 1994-2016, The Gambit Project (http://www.gambit-project.org)
//
// FILE: src/libgambit/dvector.h
// Doubly-partitioned vector class
//
// 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 LIBGAMBIT_DVECTOR_H
#define LIBGAMBIT_DVECTOR_H
#include "pvector.h"
namespace Gambit {
template <class T> class DVector : public PVector<T> {
private:
int sum(int part, const PVector<int> &v) const;
void setindex(void);
bool Check(const DVector<T> &) const;
protected:
T ***dvptr;
Array<int> dvlen, dvidx;
public:
DVector(void);
DVector(const PVector<int> &sig);
DVector(const Vector<T> &val, const PVector<int> &sig);
DVector(const DVector<T> &v);
virtual ~DVector();
T &operator()(int a, int b, int c);
const T &operator()(int a, int b, int c) const;
// extract a subvector
void CopySubRow(int row, int col, const DVector<T> &v);
DVector<T> &operator=(const DVector<T> &v);
DVector<T> &operator=(const PVector<T> &v);
DVector<T> &operator=(const Vector<T> &v);
DVector<T> &operator=(T c);
DVector<T> operator+(const DVector<T> &v) const;
DVector<T> &operator+=(const DVector<T> &v);
DVector<T> operator-(void) const;
DVector<T> operator-(const DVector<T> &v) const;
DVector<T> &operator-=(const DVector<T> &v);
T operator*(const DVector<T> &v) const;
DVector<T> &operator*=(const T &c);
DVector<T> operator/(const T &c) const;
bool operator==(const DVector<T> &v) const;
bool operator!=(const DVector<T> &v) const;
const Array<int> &DPLengths(void) const;
};
} // end namespace Gambit
#endif // LIBGAMBIT_DVECTOR_H
|
/**
********************************************************************************
\file ctrlkcal.h
\brief Definitions for kernel ctrl CAL module
This file contains the definitions for the kernel ctrl CAL module.
*******************************************************************************/
/*------------------------------------------------------------------------------
Copyright (c) 2014, Bernecker+Rainer Industrie-Elektronik Ges.m.b.H. (B&R)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holders 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 COPYRIGHT HOLDERS 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 _INC_ctrlkcal_H_
#define _INC_ctrlkcal_H_
//------------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------------
#include <common/oplkinc.h>
#include <common/ctrl.h>
//------------------------------------------------------------------------------
// const defines
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// typedef
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// function prototypes
//------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C"
{
#endif
tOplkError ctrlkcal_init(void);
void ctrlkcal_exit(void);
tOplkError ctrlkcal_process(void);
tOplkError ctrlkcal_getCmd(tCtrlCmdType* pCmd_p);
void ctrlkcal_sendReturn(UINT16 retval_p);
void ctrlkcal_setStatus(UINT16 status_p);
UINT16 ctrlkcal_getStatus(void);
void ctrlkcal_updateHeartbeat(UINT16 heartbeat_p);
tOplkError ctrlkcal_readInitParam(tCtrlInitParam* pInitParam_p);
void ctrlkcal_storeInitParam(tCtrlInitParam* pInitParam_p);
#ifdef __cplusplus
}
#endif
#endif /* _INC_ctrlkcal_H_ */
|
extern sf::Time deltaTime;
|
/*
* YAFFS: Yet another Flash File System . A NAND-flash specific file system.
*
* Copyright (C) 2002-2007 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1 as
* published by the Free Software Foundation.
*
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
/* This is used to pack YAFFS2 tags, not YAFFS1tags. */
#ifndef __YAFFS_PACKEDTAGS2_H__
#define __YAFFS_PACKEDTAGS2_H__
#include "yaffs_guts.h"
#include "yaffs_ecc.h"
typedef struct {
unsigned sequenceNumber;
unsigned objectId;
unsigned chunkId;
unsigned byteCount;
} yaffs_PackedTags2TagsPart;
typedef struct{
yaffs_PackedTags2TagsPart t;
yaffs_ECCOther ecc;
} yaffs_PackedTags2;
/* Full packed tags with ECC, used for oob tags */
void yaffs_PackTags2(yaffs_PackedTags2 * pt, const yaffs_ExtendedTags * t);
void yaffs_UnpackTags2(yaffs_ExtendedTags * t, yaffs_PackedTags2 * pt);
/* Only the tags part (no ECC for use with inband tags */
void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart * pt, const yaffs_ExtendedTags * t);
void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags * t, yaffs_PackedTags2TagsPart * pt);
#endif
|
/*
* Copyright (C) 2014-2017 StormCore
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_TOTEM_H
#define TRINITYCORE_TOTEM_H
#include "TemporarySummon.h"
enum TotemType
{
TOTEM_PASSIVE = 0,
TOTEM_ACTIVE = 1,
TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
};
class TC_GAME_API Totem : public Minion
{
public:
Totem(SummonPropertiesEntry const* properties, Unit* owner);
virtual ~Totem() { }
void Update(uint32 time) override;
void InitStats(uint32 duration) override;
void InitSummon() override;
void UnSummon(uint32 msTime = 0) override;
uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; }
uint32 GetTotemDuration() const { return m_duration; }
void SetTotemDuration(uint32 duration) { m_duration = duration; }
TotemType GetTotemType() const { return m_type; }
bool UpdateStats(Stats /*stat*/) override { return true; }
bool UpdateAllStats() override { return true; }
void UpdateResistances(uint32 /*school*/) override { }
void UpdateArmor() override { }
void UpdateMaxHealth() override { }
void UpdateMaxPower(Powers /*power*/) override { }
void UpdateAttackPowerAndDamage(bool /*ranged*/) override { }
void UpdateDamagePhysical(WeaponAttackType /*attType*/) override { }
bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override;
protected:
TotemType m_type;
uint32 m_duration;
};
#endif
|
#ifndef _FFNet_Pattern_h_
#define _FFNet_Pattern_h_
/* FFNet_Pattern.h
*
* Copyright (C) 1997-2011, 2015 David Weenink
*
* 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.
*/
/*
djmw 19950113
djmw 20020712 GPL header
djmw 20110307 Latest modification
*/
#include "Pattern.h"
#include "FFNet.h"
void FFNet_Pattern_drawActivation( FFNet me, Pattern pattern, Graphics g, long ipattern );
#endif /* _FFNet_Pattern_h_ */
|
/***************************************************************************
* Project TUPITUBE DESK *
* Project Contact: info@maefloresta.com *
* Project Website: http://www.maefloresta.com *
* Project Leader: Gustav Gonzalez <info@maefloresta.com> *
* *
* Developers: *
* 2010: *
* Gustavo Gonzalez / xtingray *
* *
* KTooN's versions: *
* *
* 2006: *
* David Cuadrado *
* Jorge Cuadrado *
* 2003: *
* Fernado Roldan *
* Simena Dinas *
* *
* Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com *
* 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/>. *
***************************************************************************/
#ifndef TUPSOUNDPLAYER_H
#define TUPSOUNDPLAYER_H
#include "tglobal.h"
#include "timagebutton.h"
#include "tapplicationproperties.h"
#include "tuplibraryobject.h"
#include <QFrame>
#include <QBoxLayout>
#include <QSlider>
#include <QLabel>
#include <QSpinBox>
#include <QMediaPlayer>
#include <QUrl>
#include <QTime>
#include <QCheckBox>
/**
* @author Gustav Gonzalez
**/
class TUPITUBE_EXPORT TupSoundPlayer : public QFrame
{
Q_OBJECT
public:
TupSoundPlayer(QWidget *parent = nullptr);
~TupSoundPlayer();
QSize sizeHint() const;
void setSoundParams(TupLibraryObject *sound);
void stopFile();
bool isPlaying();
void reset();
QString getSoundID() const;
void updateInitFrame(int frame);
void enableLipSyncInterface(bool enabled, int frame);
signals:
void frameUpdated(int frame);
void muteEnabled(bool mute);
private slots:
void playFile();
void startPlayer();
void positionChanged(qint64 value);
void durationChanged(qint64 value);
void stateChanged(QMediaPlayer::State state);
void updateSoundPos(int pos);
void updateLoopState();
void muteAction();
private:
QLabel *frameLabel;
QMediaPlayer *player;
QSlider *slider;
QLabel *timer;
TImageButton *playButton;
TImageButton *muteButton;
bool playing;
qint64 duration;
QTime soundTotalTime;
QString totalTime;
QCheckBox *loopBox;
bool loop;
bool mute;
QSpinBox *frameBox;
QWidget *frameWidget;
QString soundID;
};
#endif
|
/***************************************************************************
*
* Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
* 2010, 2011 BalaBit IT Ltd, Budapest, Hungary
*
* 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.
*
* Note that this permission is granted for only version 2 of the GPL.
*
* As an additional exemption you are allowed to compile & link against the
* OpenSSL libraries as published by the OpenSSL project. See the file
* COPYING for details.
*
* 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.
*
* Author : Panther
* Auditor :
* Last audited version:
* Notes:
*
***************************************************************************/
#ifndef ZORP_ZORPADDR_H_INCLUDED
#define ZORP_ZORPADDR_H_INCLUDED
#include "ifcfg.h"
#include "zshmem.h"
#include "cfg.h"
#include "stats.h"
#endif
|
/* -*- c -*- */
/* $Id: sha.h 6172 2011-03-27 12:40:30Z cher $ */
#ifndef __SHA_H__
#define __SHA_H__ 1
/*
* 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
*/
/* This file is taken from textutils-2.1. Cher. */
/* sha.h - Declaration of functions and datatypes for SHA1 sum computing
library functions.
Copyright (C) 1999, Scott G. Miller
*/
#include "reuse_integral.h"
#include <stdio.h>
/* Structure to save state of computation between the single steps. */
struct sha_ctx
{
ruint32_t A;
ruint32_t B;
ruint32_t C;
ruint32_t D;
ruint32_t E;
ruint32_t total[2];
ruint32_t buflen;
char buffer[128];
};
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
void sha_process_block(const void *buffer, size_t len, struct sha_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
void sha_process_bytes(const void *buffer, size_t len, struct sha_ctx *ctx);
/* Initialize structure containing state of computation. */
void sha_init_ctx(struct sha_ctx *ctx);
/* Process the remaining bytes in the buffer and put result from CTX
in first 20 bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *sha_finish_ctx(struct sha_ctx *ctx, void *resbuf);
/* Put result from CTX in first 20 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *sha_read_ctx(const struct sha_ctx *ctx, void *resbuf);
/* Compute SHA1 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 20 bytes
beginning at RESBLOCK. */
int sha_stream(FILE *stream, void *resblock);
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
void *sha_buffer(const char *buffer, size_t len, void *resblock);
#endif /* __SHA_H__ */
|
/**************************************************************
* Copyright (C) 2010 STMicroelectronics. All Rights Reserved.
* This file is part of the latest release of the Multicom4 project. This release
* is fully functional and provides all of the original MME functionality.This
* release is now considered stable and ready for integration with other software
* components.
* Multicom4 is a 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.
* Multicom4 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 Multicom4;
* see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place -
* Suite 330, Boston, MA 02111-1307, USA.
* Written by Multicom team at STMicroelectronics in November 2010.
* Contact multicom.support@st.com.
**************************************************************/
/*
*
*/
/*
* sti7200 ST231 Video1
*/
#include <bsp/_bsp.h>
const char *bsp_cpu_name = "video1";
/*
* Local Variables:
* tab-width: 8
* c-indent-level: 2
* c-basic-offset: 2
* End:
*/
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef FLOWLAYOUT_H
#define FLOWLAYOUT_H
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
//! [0]
class FlowLayout : public QLayout
{
public:
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
void addItem(QLayoutItem *item);
int horizontalSpacing() const;
int verticalSpacing() const;
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
int count() const;
QLayoutItem *itemAt(int index) const;
QSize minimumSize() const;
void setGeometry(const QRect &rect);
QSize sizeHint() const;
QLayoutItem *takeAt(int index);
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
|
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
void bb_herror_msg(const char *s, ...)
{
va_list p;
va_start(p, s);
bb_vherror_msg(s, p);
va_end(p);
}
|
// RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s
// Test parameter 'a' is registered to LiveVariables analysis data although it
// is not referenced in the function body.
// Before processing 'return 1;', in RemoveDeadBindings(), we query the liveness
// of 'a', because we have a binding for it due to parameter passing.
int f1(int a) {
return 1;
}
void f2() {
int x;
x = f1(1);
}
|
/*
* psgp_settings.h
*
* Created on: 21 Jan 2012
* Author: barillrl
*/
#ifndef PSGP_SETTINGS_H_
#define PSGP_SETTINGS_H_
//-----------------------------------------------------------------------------
// CONSTANTS AND OTHER GENERAL PARAMETERS
//-----------------------------------------------------------------------------
// Max number of parameters for PSGP (this limit is set by the R code)
#define NUM_PSGP_PARAMETERS 16
// Maximum number of observations kept for param estimation
#define MAX_OBS 1000
// Maximum number of active points
#define MAX_ACTIVE_POINTS 400
// Likelihood to nugget ratio
#define LIKELIHOOD_NUGGET_RATIO 0.01
// Number of sweeps through data with changing/fixed active set
#define NUM_SWEEPS_CHANGING 1
#define NUM_SWEEPS_FIXED 1
// Whether to use a GP instead of PSGP for parameter estimation
#define PARAMETER_ESTIMATION_USING_GP false
// Outer loops in parameter estimation for PSGP
#define PSGP_PARAM_ITERATIONS 3
// Inner loop (i.e. SCG iterations in each outer loop) for PSGP
#define PSGP_SCG_ITERATIONS 5
// Define whether to use full prediction (all data at once) or
// split prediction (by chunks of data)
#define USING_CHUNK_PREDICTION true
// Size of prediction chunk (in number of observations)
#define CHUNK_SIZE 1000
#endif /* PSGP_SETTINGS_H_ */
|
/*
This is a File System Recognizer for IRIG 106 Ch10 Filesystem
Copyright (C) 2014 Arthur Walton.
Heavily derived from the File System Recognizer for RomFs
Copyright (C) 2001 Bo Brantén.
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 _ROM_FS_
#define _ROM_FS_
#define SECTOR_SIZE 512
#define CH10_MAGIC "FORTYtwo"
#define CH10_MAGIC_OFFSET 512
//
// Types used by Linux
//
#include "ltypes.h"
//
// Use 1 byte packing of on-disk structures
//
#include <pshpack1.h>
//
// The following is a subset of linux/include/linux/ch10fs_fs.h from
// version 2.2.14
//
/* The basic structures of the ch10fs filesystem */
#define CH10_BLOCK_SIZE 512
#define CH10_MAXFN 48
#define MAX_FILES_PER_DIR 4
#define CH10_MAX_DIR_BLOCKS 64
/*
* Ch10 Directory Entry
*/
struct ch10_dir_entry {
__u8 name[56]; // name of the directory entry
__u64 blockNum; // block number that the entry starts at
__u64 numBlocks; // length of the entry in blocks
__u64 size; // length of the entry in bytes
__u8 createDate[8]; // date entry was created
__u8 createTime[8]; // time entry was created
__u8 timeType; // time system the previous date and time were stored in
__u8 reserved[7]; // currently unused, reserved for future use
__u8 closeTime[8]; // time this entry was finished being written
};
/*
* Ch10 Directory Block
*/
struct ch10_dir_block {
__u8 magicNumAscii[8]; // Identifies this as being a directory block, always set to FORTYtwo
__u8 revNum; // revision number of the data recording standard in use
__u8 shutdown; // flag to indicate filesystem was not properly shutdown while writing to this directory
__u16 numEntries; // number of directory entries/files that are in this block
__u32 bytesPerBlock; // number of bytes per block
__u8 volName[32]; // name of this directory block
__u64 forwardLink:64; // block address of next directory block
__u64 reverseLink:64; // block address of previous directory block
struct ch10_dir_entry dirEntries[MAX_FILES_PER_DIR]; // all entries/files in the block
};
#include <poppack.h>
#endif
|
#include <linux/module.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_NFLOG.h>
#include <net/netfilter/nf_log.h>
#include <net/netfilter/nfnetlink_log.h>
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_DESCRIPTION("Xtables: packet logging to netlink using NFLOG");
MODULE_LICENSE("GPL");
MODULE_ALIAS("ipt_NFLOG");
MODULE_ALIAS("ip6t_NFLOG");
static unsigned int
nflog_tg(struct sk_buff *skb, const struct xt_target_param *par)
{
const struct xt_nflog_info *info = par->targinfo;
struct nf_loginfo li;
li.type = NF_LOG_TYPE_ULOG;
li.u.ulog.copy_len = info->len;
li.u.ulog.group = info->group;
li.u.ulog.qthreshold = info->threshold;
nfulnl_log_packet(par->family, par->hooknum, skb, par->in,
par->out, &li, info->prefix);
return XT_CONTINUE;
}
static bool nflog_tg_check(const struct xt_tgchk_param *par)
{
const struct xt_nflog_info *info = par->targinfo;
if (info->flags & ~XT_NFLOG_MASK)
return false;
if (info->prefix[sizeof(info->prefix) - 1] != '\0')
return false;
return true;
}
static struct xt_target nflog_tg_reg __read_mostly = {
.name = "NFLOG",
.revision = 0,
.family = NFPROTO_UNSPEC,
.checkentry = nflog_tg_check,
.target = nflog_tg,
.targetsize = sizeof(struct xt_nflog_info),
.me = THIS_MODULE,
};
static int __init nflog_tg_init(void)
{
return xt_register_target(&nflog_tg_reg);
}
static void __exit nflog_tg_exit(void)
{
xt_unregister_target(&nflog_tg_reg);
}
module_init(nflog_tg_init);
module_exit(nflog_tg_exit);
|
#ifndef LAC_DIFFERENCE_NEIGHBOR_SET_H
#define LAC_DIFFERENCE_NEIGHBOR_SET_H 1
#include <utility>
#include <list>
#include <algorithm>
namespace LAC {
namespace Difference {
template<typename T>
struct NeighborSet {
typedef T data_t;
typedef std::list<T> queue_t;
typedef typename queue_t::iterator it_t;
typedef typename queue_t::const_iterator const_it_t;
NeighborSet(size_t count) : m_count(std::max((size_t)1,count)) {}
~NeighborSet(){}
void Append(const T& d){
it_t it = std::lower_bound(m_queue.begin(),
m_queue.end(),
d);
m_queue.insert(it, d);
if(m_queue.size() > m_count)
m_queue.pop_back();
}
const_it_t Begin() const { return m_queue.begin(); }
const_it_t End() const { return m_queue.end(); }
size_t m_count;
queue_t m_queue;
};
}
}
#endif
|
/* Hey EMACS -*- linux-c -*- */
/* $Id: toolbar.h 4392 2011-08-01 09:24:05Z debrouxl $ */
/* TiLP - Tilp Is a Linking Program
* Copyright (C) 1999-2006 Romain Lievin
*
* 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 GTOOLBAR_H
#define GTOOLBAR_H
void toolbar_refresh_buttons(void);
void toolbar_set_button(int sr);
#endif
|
#pragma once
#include <string>
class GameSettings
{
private:
int m_nFPS = 60;
std::string m_strPath = "../Settings.ini";
private:
GameSettings();
void Load();
void Save();
static GameSettings& GetInstance();
public:
static int FPS();
};
|
/*
* Copyright (C) 2007 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LVM_UTIL_H
#define _LVM_UTIL_H
#define min(a, b) ({ typeof(a) _a = (a); \
typeof(b) _b = (b); \
(void) (&_a == &_b); \
_a < _b ? _a : _b; })
#define max(a, b) ({ typeof(a) _a = (a); \
typeof(b) _b = (b); \
(void) (&_a == &_b); \
_a > _b ? _a : _b; })
#define uninitialized_var(x) x = x
#define KERNEL_VERSION(major, minor, release) (((major) << 16) + ((minor) << 8) + (release))
#endif
|
/*
Linux PINMUX.C
*/
#include <asm/arch/am_regs.h>
#include <asm/arch/am_eth_reg.h>
#include <asm/arch/pinmux.h>
int clear_mio_mux(unsigned mux_index, unsigned mux_mask)
{
unsigned mux_reg[] = {PERIPHS_PIN_MUX_0, PERIPHS_PIN_MUX_1, PERIPHS_PIN_MUX_2,PERIPHS_PIN_MUX_3,
PERIPHS_PIN_MUX_4,PERIPHS_PIN_MUX_5,PERIPHS_PIN_MUX_6,PERIPHS_PIN_MUX_7,PERIPHS_PIN_MUX_8,
PERIPHS_PIN_MUX_9,PERIPHS_PIN_MUX_10,PERIPHS_PIN_MUX_11,PERIPHS_PIN_MUX_12};
if (mux_index < 13) {
CLEAR_CBUS_REG_MASK(mux_reg[mux_index], mux_mask);
return 0;
}
return -1;
}
int set_mio_mux(unsigned mux_index, unsigned mux_mask)
{
unsigned mux_reg[] = {PERIPHS_PIN_MUX_0, PERIPHS_PIN_MUX_1, PERIPHS_PIN_MUX_2,PERIPHS_PIN_MUX_3,
PERIPHS_PIN_MUX_4,PERIPHS_PIN_MUX_5,PERIPHS_PIN_MUX_6,PERIPHS_PIN_MUX_7,PERIPHS_PIN_MUX_8,
PERIPHS_PIN_MUX_9,PERIPHS_PIN_MUX_10,PERIPHS_PIN_MUX_11,PERIPHS_PIN_MUX_12};
if (mux_index < 13) {
SET_CBUS_REG_MASK(mux_reg[mux_index], mux_mask);
return 0;
}
return -1;
}
/*
call it before pinmux init;
call it before soft reset;
*/
void clearall_pinmux(void)
{
int i;
for(i=0;i<13;i++)
clear_mio_mux(i,0xffffffff);
return;
}
/*ETH PINMUX SETTING
More details can get from am_eth_pinmux.h
*/
int eth_set_pinmux(int bank_id,int clk_in_out_id,unsigned long ext_msk)
{
int ret=0;
switch(bank_id)
{
case ETH_BANK0_GPIOX46_X54:
if(ext_msk>0)
set_mio_mux(ETH_BANK0_REG1,ext_msk);
else
set_mio_mux(ETH_BANK0_REG1,ETH_BANK0_REG1_VAL);
break;
case ETH_BANK1_GPIOX59_X67:
if(ext_msk>0)
set_mio_mux(ETH_BANK1_REG1,ext_msk);
else
set_mio_mux(ETH_BANK1_REG1,ETH_BANK1_REG1_VAL);
break;
default:
printf("UNknow pinmux setting of ethernet!error bankid=%d,must be 0-2\n",bank_id);
ret=-1;
}
switch(clk_in_out_id)
{
case ETH_CLK_IN_GPIOX45_REG3_11:
set_mio_mux(3,1<<11);
break;
case ETH_CLK_IN_GPIOX55_REG3_0:
set_mio_mux(3,1);
break;
case ETH_CLK_IN_GPIOX58_REG3_24:
set_mio_mux(3,1<<24);
break;
case ETH_CLK_IN_GPIOX68_REG3_13:
set_mio_mux(3,1<<13);
break;
case ETH_CLK_OUT_GPIOX45_REG3_12:
set_mio_mux(3,1<<12);
break;
case ETH_CLK_OUT_GPIOX55_REG3_1:
set_mio_mux(3,1<<1);
break;
case ETH_CLK_OUT_GPIOX58_REG3_25:
set_mio_mux(3,1<<25);
break;
case ETH_CLK_OUT_GPIOX68_REG3_14:
set_mio_mux(3,1<<14);
break;
default:
printf("UNknow clk_in_out_id setting of ethernet!error clk_in_out_id=%d,must be 0-7\n",clk_in_out_id);
ret=-1;
}
return ret;
}
|
/*
* EffecTV for Android
* Copyright (C) 2013 Morihiro Soft
*
* MatrixTV.h :
*
* 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.
*/
/*
* EffecTV - Realtime Digital Video Effector
* Copyright (C) 2001-2006 FUKUCHI Kentaro
*
* matrixTV - A Matrix Like effect.
* This plugin for EffectTV is under GNU General Public License
* See the "COPYING" that should be shiped with this source code
* Copyright (C) 2001-2003 Monniez Christophe
* d-fence@swing.be
*
* 2003/12/24 Kentaro Fukuchi
* - Completely rewrote but based on Monniez's idea.
* - Uses edge detection, not only G value of each pixel.
* - Added 4x4 font includes number, alphabet and Japanese Katakana characters.
*/
#ifndef __MATRIXTV__
#define __MATRIXTV__
#include "BaseEffecTV.h"
class MatrixTV : public BaseEffecTV {
typedef BaseEffecTV super;
protected:
struct Blip {
int mode;
int y;
int timer;
int speed;
};
int show_info;
int mode;
int pause;
int mapW;
int mapH;
unsigned char* cmap;
unsigned char* vmap;
unsigned char* img;
unsigned char* font;
RGB32* palette;
Blip* blips;
virtual void intialize(bool reset);
virtual int readConfig();
virtual int writeConfig();
public:
MatrixTV(void);
virtual ~MatrixTV(void);
virtual const char* name(void);
virtual const char* title(void);
virtual const char** funcs(void);
virtual int start(Utils* utils, int width, int height);
virtual int stop(void);
virtual int draw(YUV* src_yuv, RGB32* dst_rgb, char* dst_msg);
virtual const char* event(int key_code);
virtual const char* touch(int action, int x, int y);
protected:
RGB32 green(unsigned int v);
int setPalette(void);
int setPattern(void);
void drawChar(RGB32* dst, unsigned char c, unsigned char v);
void createImg(RGB32* src);
void updateCharMap(void);
void darkenColumn(int);
void blipNone(int x);
void blipFall(int x);
void blipStop(int x);
void blipSlide(int x);
};
#endif // __MATRIXTV__
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_mouse.h"
#include "../../events/SDL_events_c.h"
#include "SDL_vglvideo.h"
#include "SDL_vglmouse_c.h"
struct WMcursor {
int unused;
};
void VGL_FreeWMCursor(_THIS, WMcursor *cursor)
{
return;
}
WMcursor *VGL_CreateWMCursor(_THIS,
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
{
return(NULL);
}
int VGL_ShowWMCursor(_THIS, WMcursor *cursor)
{
return(0);
}
void VGL_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
SDL_PrivateMouseMotion(0, 0, x, y);
}
|
/*
* mpc8610-pcm.h - ALSA PCM interface for the Freescale MPC8610 SoC
*
* 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 _MPC8610_PCM_H
#define _MPC8610_PCM_H
struct ccsr_dma {
u8 res0[0x100];
struct ccsr_dma_channel {
__be32 mr; /* Mode register */
__be32 sr; /* Status register */
__be32 eclndar; /* Current link descriptor extended addr reg */
__be32 clndar; /* Current link descriptor address register */
__be32 satr; /* Source attributes register */
__be32 sar; /* Source address register */
__be32 datr; /* Destination attributes register */
__be32 dar; /* Destination address register */
__be32 bcr; /* Byte count register */
__be32 enlndar; /* Next link descriptor extended address reg */
__be32 nlndar; /* Next link descriptor address register */
u8 res1[4];
__be32 eclsdar; /* Current list descriptor extended addr reg */
__be32 clsdar; /* Current list descriptor address register */
__be32 enlsdar; /* Next list descriptor extended address reg */
__be32 nlsdar; /* Next list descriptor address register */
__be32 ssr; /* Source stride register */
__be32 dsr; /* Destination stride register */
u8 res2[0x38];
} channel[4];
__be32 dgsr;
};
#define CCSR_DMA_MR_BWC_DISABLED 0x0F000000
#define CCSR_DMA_MR_BWC_SHIFT 24
#define CCSR_DMA_MR_BWC_MASK 0x0F000000
#define CCSR_DMA_MR_BWC(x) \
((ilog2(x) << CCSR_DMA_MR_BWC_SHIFT) & CCSR_DMA_MR_BWC_MASK)
#define CCSR_DMA_MR_EMP_EN 0x00200000
#define CCSR_DMA_MR_EMS_EN 0x00040000
#define CCSR_DMA_MR_DAHTS_MASK 0x00030000
#define CCSR_DMA_MR_DAHTS_1 0x00000000
#define CCSR_DMA_MR_DAHTS_2 0x00010000
#define CCSR_DMA_MR_DAHTS_4 0x00020000
#define CCSR_DMA_MR_DAHTS_8 0x00030000
#define CCSR_DMA_MR_SAHTS_MASK 0x0000C000
#define CCSR_DMA_MR_SAHTS_1 0x00000000
#define CCSR_DMA_MR_SAHTS_2 0x00004000
#define CCSR_DMA_MR_SAHTS_4 0x00008000
#define CCSR_DMA_MR_SAHTS_8 0x0000C000
#define CCSR_DMA_MR_DAHE 0x00002000
#define CCSR_DMA_MR_SAHE 0x00001000
#define CCSR_DMA_MR_SRW 0x00000400
#define CCSR_DMA_MR_EOSIE 0x00000200
#define CCSR_DMA_MR_EOLNIE 0x00000100
#define CCSR_DMA_MR_EOLSIE 0x00000080
#define CCSR_DMA_MR_EIE 0x00000040
#define CCSR_DMA_MR_XFE 0x00000020
#define CCSR_DMA_MR_CDSM_SWSM 0x00000010
#define CCSR_DMA_MR_CA 0x00000008
#define CCSR_DMA_MR_CTM 0x00000004
#define CCSR_DMA_MR_CC 0x00000002
#define CCSR_DMA_MR_CS 0x00000001
#define CCSR_DMA_SR_TE 0x00000080
#define CCSR_DMA_SR_CH 0x00000020
#define CCSR_DMA_SR_PE 0x00000010
#define CCSR_DMA_SR_EOLNI 0x00000008
#define CCSR_DMA_SR_CB 0x00000004
#define CCSR_DMA_SR_EOSI 0x00000002
#define CCSR_DMA_SR_EOLSI 0x00000001
/* ECLNDAR takes bits 32-36 of the CLNDAR register */
static inline u32 CCSR_DMA_ECLNDAR_ADDR(u64 x)
{
return (x >> 32) & 0xf;
}
#define CCSR_DMA_CLNDAR_ADDR(x) ((x) & 0xFFFFFFFE)
#define CCSR_DMA_CLNDAR_EOSIE 0x00000008
/* SATR and DATR, combined */
#define CCSR_DMA_ATR_PBATMU 0x20000000
#define CCSR_DMA_ATR_TFLOWLVL_0 0x00000000
#define CCSR_DMA_ATR_TFLOWLVL_1 0x06000000
#define CCSR_DMA_ATR_TFLOWLVL_2 0x08000000
#define CCSR_DMA_ATR_TFLOWLVL_3 0x0C000000
#define CCSR_DMA_ATR_PCIORDER 0x02000000
#define CCSR_DMA_ATR_SME 0x01000000
#define CCSR_DMA_ATR_NOSNOOP 0x00040000
#define CCSR_DMA_ATR_SNOOP 0x00050000
#define CCSR_DMA_ATR_ESAD_MASK 0x0000000F
/**
* List Descriptor for extended chaining mode DMA operations.
*
* The CLSDAR register points to the first (in a linked-list) List
* Descriptor. Each object must be aligned on a 32-byte boundary. Each
* list descriptor points to a linked-list of link Descriptors.
*/
struct fsl_dma_list_descriptor {
__be64 next; /* Address of next list descriptor */
__be64 first_link; /* Address of first link descriptor */
__be32 source; /* Source stride */
__be32 dest; /* Destination stride */
u8 res[8]; /* Reserved */
} __attribute__ ((aligned(32), packed));
/**
* Link Descriptor for basic and extended chaining mode DMA operations.
*
* A Link Descriptor points to a single DMA buffer. Each link descriptor
* must be aligned on a 32-byte boundary.
*/
struct fsl_dma_link_descriptor {
__be32 source_attr; /* Programmed into SATR register */
__be32 source_addr; /* Programmed into SAR register */
__be32 dest_attr; /* Programmed into DATR register */
__be32 dest_addr; /* Programmed into DAR register */
__be64 next; /* Address of next link descriptor */
__be32 count; /* Byte count */
u8 res[4]; /* Reserved */
} __attribute__ ((aligned(32), packed));
<<<<<<< HEAD
=======
/* DMA information needed to create a snd_soc_dai object
*
* ssi_stx_phys: bus address of SSI STX register to use
* ssi_srx_phys: bus address of SSI SRX register to use
* dma[0]: points to the DMA channel to use for playback
* dma[1]: points to the DMA channel to use for capture
* dma_irq[0]: IRQ of the DMA channel to use for playback
* dma_irq[1]: IRQ of the DMA channel to use for capture
*/
struct fsl_dma_info {
dma_addr_t ssi_stx_phys;
dma_addr_t ssi_srx_phys;
struct ccsr_dma_channel __iomem *dma_channel[2];
unsigned int dma_irq[2];
};
extern struct snd_soc_platform fsl_soc_platform;
int fsl_dma_configure(struct fsl_dma_info *dma_info);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#endif
|
/*
* HT Editor
* syssdl.h
*
* Copyright (C) 2004 Stefan Weyergraf
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SYSSDL_H__
#define __SYSSDL_H__
#ifdef __MACH__
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif
#include "system/display.h"
#include "system/systhread.h"
extern SDL_Surface * gSDLScreen;
class SDLSystemDisplay: public SystemDisplay {
protected:
DisplayCharacteristics mSDLChar;
byte * mSDLFrameBuffer;
bool mChangingScreen;
SDL_Surface * mSDLClientScreen;
sys_mutex mRedrawMutex;
SDL_Cursor * mVisibleCursor;
SDL_Cursor * mInvisibleCursor;
uint bitsPerPixelToXBitmapPad(uint bitsPerPixel);
void dumpDisplayChar(const DisplayCharacteristics &chr);
public:
char * mTitle;
DisplayCharacteristics mSDLChartemp;
SDL_cond *mWaitcondition;
bool mChangeResRet;
uint32 mEventThreadID;
SDLSystemDisplay(const char *title, const DisplayCharacteristics &chr, int redraw_ms);
void finishMenu();
virtual void updateTitle();
virtual int toString(char *buf, int buflen) const;
void toggleFullScreen();
virtual void displayShow();
virtual void convertCharacteristicsToHost(DisplayCharacteristics &aHostChar, const DisplayCharacteristics &aClientChar);
virtual bool changeResolution(const DisplayCharacteristics &aCharacteristics);
virtual bool changeResolutionREAL(const DisplayCharacteristics &aCharacteristics);
virtual void getHostCharacteristics(Container &modes);
virtual void setMouseGrab(bool enable);
virtual void initCursor();
};
#endif
|
#include "exec/def-helper.h"
#ifdef CONFIG_TCG_PLUGIN
DEF_HELPER_FLAGS_4(tcg_plugin_pre_tb, 0, void, i64, i64, i64, i64)
#endif
DEF_HELPER_2(exception, noreturn, env, i32)
DEF_HELPER_3(exception_cause, noreturn, env, i32, i32)
DEF_HELPER_4(exception_cause_vaddr, noreturn, env, i32, i32, i32)
DEF_HELPER_3(debug_exception, noreturn, env, i32, i32)
DEF_HELPER_FLAGS_1(nsa, TCG_CALL_NO_RWG_SE, i32, i32)
DEF_HELPER_FLAGS_1(nsau, TCG_CALL_NO_RWG_SE, i32, i32)
DEF_HELPER_2(wsr_windowbase, void, env, i32)
DEF_HELPER_4(entry, void, env, i32, i32, i32)
DEF_HELPER_2(retw, i32, env, i32)
DEF_HELPER_2(rotw, void, env, i32)
DEF_HELPER_3(window_check, void, env, i32, i32)
DEF_HELPER_1(restore_owb, void, env)
DEF_HELPER_2(movsp, void, env, i32)
DEF_HELPER_2(wsr_lbeg, void, env, i32)
DEF_HELPER_2(wsr_lend, void, env, i32)
DEF_HELPER_1(simcall, void, env)
DEF_HELPER_1(dump_state, void, env)
DEF_HELPER_3(waiti, void, env, i32, i32)
DEF_HELPER_3(timer_irq, void, env, i32, i32)
DEF_HELPER_2(advance_ccount, void, env, i32)
DEF_HELPER_1(check_interrupts, void, env)
DEF_HELPER_3(check_atomctl, void, env, i32, i32)
DEF_HELPER_2(wsr_rasid, void, env, i32)
DEF_HELPER_FLAGS_3(rtlb0, TCG_CALL_NO_RWG_SE, i32, env, i32, i32)
DEF_HELPER_FLAGS_3(rtlb1, TCG_CALL_NO_RWG_SE, i32, env, i32, i32)
DEF_HELPER_3(itlb, void, env, i32, i32)
DEF_HELPER_3(ptlb, i32, env, i32, i32)
DEF_HELPER_4(wtlb, void, env, i32, i32, i32)
DEF_HELPER_2(wsr_ibreakenable, void, env, i32)
DEF_HELPER_3(wsr_ibreaka, void, env, i32, i32)
DEF_HELPER_3(wsr_dbreaka, void, env, i32, i32)
DEF_HELPER_3(wsr_dbreakc, void, env, i32, i32)
DEF_HELPER_2(wur_fcr, void, env, i32)
DEF_HELPER_FLAGS_1(abs_s, TCG_CALL_NO_RWG_SE, f32, f32)
DEF_HELPER_FLAGS_1(neg_s, TCG_CALL_NO_RWG_SE, f32, f32)
DEF_HELPER_3(add_s, f32, env, f32, f32)
DEF_HELPER_3(sub_s, f32, env, f32, f32)
DEF_HELPER_3(mul_s, f32, env, f32, f32)
DEF_HELPER_4(madd_s, f32, env, f32, f32, f32)
DEF_HELPER_4(msub_s, f32, env, f32, f32, f32)
DEF_HELPER_FLAGS_3(ftoi, TCG_CALL_NO_RWG_SE, i32, f32, i32, i32)
DEF_HELPER_FLAGS_3(ftoui, TCG_CALL_NO_RWG_SE, i32, f32, i32, i32)
DEF_HELPER_3(itof, f32, env, i32, i32)
DEF_HELPER_3(uitof, f32, env, i32, i32)
DEF_HELPER_4(un_s, void, env, i32, f32, f32)
DEF_HELPER_4(oeq_s, void, env, i32, f32, f32)
DEF_HELPER_4(ueq_s, void, env, i32, f32, f32)
DEF_HELPER_4(olt_s, void, env, i32, f32, f32)
DEF_HELPER_4(ult_s, void, env, i32, f32, f32)
DEF_HELPER_4(ole_s, void, env, i32, f32, f32)
DEF_HELPER_4(ule_s, void, env, i32, f32, f32)
#include "exec/def-helper.h"
|
/*
Copyright (C) 2004 Michael Liebscher
Copyright (C) 1997-2001 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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* renderer.h: Interface to graphics API.
*
* Author: Michael Liebscher <wolf3d.redux@gmail.com>
* Date: 2004
*
* Acknowledgement:
* This code was derived from Quake II, and was originally
* written by Id Software, Inc.
*
*/
/*
Notes:
This module communicates with the graphics API. The API can be any graphics
API, e.g OpenGL, DirectX, SDL, GDI, etc; as long as the functions listed in
this header are implemented.
*/
#ifndef __RENDERER_H__
#define __RENDERER_H__
#include "filesystem.h"
#include "platform.h"
#include "texture_manager.h"
#include "font_manager.h"
#ifdef _WIN32
#define OPENGL_DLL_NAME "opengl32.dll"
#elif __unix__
#define OPENGL_DLL_NAME "libGL.so.1"
#else
#error "Define OPENGL_DLL_NAME"
#endif
typedef enum
{
rserr_ok,
rserr_invalid_fullscreen,
rserr_invalid_mode,
rserr_unknown
} rserr_t;
int registration_sequence;
int R_Init( void *hinstance, void *hWnd );
void R_Shutdown( void );
void R_BeginRegistration( const char *model );
void R_EndRegistration( void );
void R_BeginFrame( void );
void R_EndFrame( void );
void R_AppActivate( _boolean active );
void R_SwapBuffers( int );
void R_SetPalette( const unsigned char *palette);
void R_DeleteTexture( unsigned int texnum );
_boolean R_UploadTexture( texture_t *tex, PW8 data );
void R_SetGL2D( void );
void R_Draw_Pic( int x, int y, const char *name );
void R_Draw_StretchPic( int x, int y, int w, int h, const char *name );
void R_Draw_Character( int x, int y, int num, font_t *myfont );
void R_Draw_Tile( int x, int y, int w, int h, const char *name );
void R_Draw_Fill( int x, int y, int w, int h, colour3_t c );
void R_Draw_Line( int nXStart, int nYStart, int nXEnd, int nYEnd, int width, colour3_t c );
#endif /* __RENDERER_H__ */
|
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2004-2006 Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Support for unit tests of CUnit framework
*
* 12-Aug-2004 Initial implementation. (JDS)
*
* 02-May-2006 Added internationalization hooks. (JDS)
*/
/** @file
* CUnit internal testingfunctions (implementation).
*/
/** @addtogroup Internal
@{
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../../Headers/CUnit.h"
#include "../../Headers/MyMem.h"
#include "../../Headers/Util.h"
#include "../../Headers/CUnit_intl.h"
#include "test_cunit.h"
static unsigned int f_nTests = 0;
static unsigned int f_nFailures = 0;
static unsigned int f_nTests_stored = 0;
static unsigned int f_nFails_stored = 0;
static clock_t f_start_time;
static void test_cunit_initialize(void);
static void test_cunit_report_results(void);
int main()
{
/* No line buffering. */
setbuf(stdout, NULL);
test_cunit_initialize();
fprintf(stdout, "\n%s", _("Testing CUnit internals..."));
/* individual module test functions go here */
test_cunit_CUError();
test_cunit_MyMem();
test_cunit_TestDB();
test_cunit_TestRun();
test_cunit_Util();
test_cunit_report_results();
CU_cleanup_registry();
return 0;
}
void test_cunit_start_tests(const char* strName)
{
fprintf(stdout, _("\n testing %s ... "), strName);
f_nTests_stored = f_nTests;
f_nFails_stored = f_nFailures;
}
void test_cunit_end_tests(void)
{
fprintf(stdout, _("%d assertions, %d failures"),
f_nTests - f_nTests_stored,
f_nFailures - f_nFails_stored);
}
void test_cunit_add_test(void)
{
++f_nTests;
}
void test_cunit_add_failure(void)
{
++f_nFailures;
}
unsigned int test_cunit_test_count(void)
{
return f_nTests;
}
unsigned int test_cunit_failure_count(void)
{
return f_nFailures;
}
void test_cunit_initialize(void)
{
f_nTests = 0;
f_nFailures = 0;
f_start_time = clock();
}
void test_cunit_report_results(void)
{
fprintf(stdout,
"\n\n---------------------------"
"\n%s"
"\n---------------------------"
"\n %s%d"
"\n %s%d"
"\n %s%d"
"\n\n%s%8.3f%s\n",
_("CUnit Internal Test Results"),
_("Total Number of Assertions: "),
f_nTests,
_("Successes: "),
f_nTests-f_nFailures,
_("Failures: "),
f_nFailures,
_("Total test time = "),
((double)clock() - (double)f_start_time)/(double)CLOCKS_PER_SEC,
_(" seconds."));
}
CU_BOOL test_cunit_assert_impl(CU_BOOL value,
const char* condition,
const char* file,
unsigned int line)
{
test_cunit_add_test();
if (CU_FALSE == value) {
test_cunit_add_failure();
printf(_("\nTEST FAILED: File '%s', Line %d, Condition '%s.'\n"),
file, line, condition);
}
return value;
}
|
/*
File: pdisksel.h
Copyright (C) 2014 Christophe GRENIER <grenier@cgsecurity.org>
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _PDISKSEL_H
#define _PDISKSEL_H
#ifdef __cplusplus
extern "C" {
#endif
/*@
@ requires valid_read_string(cmd_device);
@ requires \valid_read(list_disk);
@ requires valid_disk(list_disk->disk);
@ requires \valid(list_search_space);
@ requires \separated(cmd_device, list_disk, list_search_space);
@ ensures valid_disk(\result);
@*/
disk_t *photorec_disk_selection_cli(const char *cmd_device, const list_disk_t *list_disk, alloc_data_t *list_search_space);
#ifdef __cplusplus
} /* closing brace for extern "C" */
#endif
#endif
|
/****************************************************************************
**
** Jreen
**
** Copyright © 2011 Aleksey Sidorov <gorthauer87@yandex.ru>
**
*****************************************************************************
**
** $JREEN_BEGIN_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/.
** $JREEN_END_LICENSE$
**
****************************************************************************/
#ifndef BOOKMARK_H
#define BOOKMARK_H
#include "stanzaextension.h"
#include "jid.h"
namespace Jreen {
//XEP-0048
//http://xmpp.org/extensions/xep-0048.html
class BookmarkPrivate;
/*! For ease-of-use in a Jabber client, it is desirable to have a way to store shortcuts
* to various services and resources (such as conference rooms and web pages) as "bookmarks"
* that can be displayed in the user's client.
* Several Jabber clients have already agreed on and implemented a method to provide this service;
* that informal agreement is documented and expanded upon in this document
*/
class JREEN_EXPORT Bookmark : public Payload
{
Q_DECLARE_PRIVATE(Bookmark)
J_PAYLOAD(Jreen::Bookmark) //dummy
public:
class ConferencePrivate;
class JREEN_EXPORT Conference
{
public:
Conference();
Conference(const QString &name, const JID &jid, const QString &nick,
const QString &password = QString(), bool autojoin = false);
Conference(const Conference &o);
Conference &operator =(const Conference &o);
~Conference();
bool operator ==(const Conference &o);
bool operator !=(const Conference &o);
bool isValid() const;
void setJid(const JID &jid);
void setName(const QString &name);
/*! set the user's preferred roomnick for the chatroom
*/
void setNick(const QString &nick);
/*! set an unencrypted string for the password needed to enter a password-protected room.
* \note For security reasons, use of this element is NOT RECOMMENDED.
*/
void setPassword(const QString &password);
/*! set autojoin attribute
*/
void setAutojoin(bool set);
/*! returns friendly name of bookmark
*/
QString name() const;
/*! returns friendly name of bookmark
*/
QString nick() const;
/*! returns the user's preferred roomnick for the chatroom
*/
QString password() const;
/*! returns JabberID of the chat room.
*/
JID jid() const;
/*! returns autojoin attribute
*/
bool autojoin() const;
private:
QExplicitlySharedDataPointer<ConferencePrivate> d_ptr;
};
/*! Default constructor \param jid - The JabberID of the chat room
* \param name - A friendly name for the bookmark(optional)
* \param nick - The user's preferred roomnick for the chatroom(optional).
*/
Bookmark();
/*! set friendly name of bookmark
*/
~Bookmark();
QList<Conference> conferences() const;
void addConference(const Conference &conf);
void setConferences(const QList<Conference> &conferences);
private:
QScopedPointer<BookmarkPrivate> d_ptr;
};
} // namespace Jreen
#endif // BOOKMARK_H
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
Copyright (C) 2007-2015 Ingo Korb <ingo@akana.de>
Inspired by MMC2IEC by Lars Pontoppidan et al.
FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
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 only.
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
bus.h: Common IEC/IEEE bus definitions
*/
#ifndef BUS_H
#define BUS_H
extern uint8_t device_address;
void bus_interface_init(void);
void bus_init(void);
void __attribute__((noreturn)) bus_mainloop(void);
#endif
|
/* iCalByDayMask.h - this file is part of SOPE
*
* Copyright (C) 2010-2015 Inverse inc.
*
* This file 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 file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef ICALBYDAYMASK_H
#define ICALBYDAYMASK_H
#import <Foundation/NSObject.h>
#import "iCalRecurrenceRule.h"
typedef enum {
iCalWeekOccurrenceFirst = 0x001, // order
iCalWeekOccurrenceSecond = 0x002, // 2^(order - 1)
iCalWeekOccurrenceThird = 0x004,
iCalWeekOccurrenceFourth = 0x008,
iCalWeekOccurrenceFifth = 0x010,
iCalWeekOccurrenceAll = 0x3ff,
iCalWeekOccurrenceLast = 0x020, // 2^(order - 1) >> 5
iCalWeekOccurrenceSecondLast = 0x040,
iCalWeekOccurrenceThirdLast = 0x080,
iCalWeekOccurrenceFourthLast = 0x100,
iCalWeekOccurrenceFifthLast = 0x200,
} iCalWeekOccurrence;
typedef iCalWeekOccurrence iCalWeekOccurrences[7];
// extern NSString *iCalWeekOccurrenceString[];
@interface iCalByDayMask : NSObject
{
iCalWeekOccurrences days;
}
+ (id) byDayMaskWithDays: (iCalWeekOccurrences) theDays;
+ (id) byDayMaskWithWeekDays;
- (id) initWithDays: (iCalWeekOccurrences) theDays;
+ (id) byDayMaskWithRuleString: (NSString *) byDayRule;
- (id) initWithRuleString: (NSString *) byDayRule;
+ (id) byDayMaskWithDaysAndOccurrences: (NSArray *) values;
- (id) initWithDaysAndOccurrences: (NSArray *) values;
- (BOOL) occursOnDay: (iCalWeekDay) weekDay;
- (BOOL) occursOnDay: (iCalWeekDay) weekDay
withWeekOccurrence: (iCalWeekOccurrence) occurrence;
- (BOOL) occursOnDay: (iCalWeekDay) weekDay
withWeekNumber: (int) week;
- (BOOL) isWeekDays;
//- (iCalWeekOccurrences *) allDays;
- (iCalWeekDay) firstDay;
- (int) firstOccurrence;
- (iCalWeekOccurrences *) weekDayOccurrences;
- (NSString *) asRuleString;
- (NSString *) asRuleStringWithIntegers;
- (NSArray *) asRuleArray;
@end
#endif /* ICALBYDAYMASK_H */
|
/*
* Copyright (c) 2001-2006 TIBCO Software Inc.
* All rights reserved.
* For more information, please contact:
* TIBCO Software Inc., Palo Alto, California, USA
*
* $Id: emserr.h 23734 2006-11-21 20:02:10Z $
*
*/
#ifndef _INCLUDED_emserr_h
#define _INCLUDED_emserr_h
#include "types.h"
#include "status.h"
#if defined(__cplusplus)
extern "C" {
#endif
extern tibems_status
tibemsErrorContext_Create(
tibemsErrorContext* errorContext);
extern tibems_status
tibemsErrorContext_Close(
tibemsErrorContext errorContext);
extern tibems_status
tibemsErrorContext_GetLastErrorString(
tibemsErrorContext errorContext,
const char** string);
extern tibems_status
tibemsErrorContext_GetLastErrorStackTrace(
tibemsErrorContext errorContext,
const char** string);
#ifdef __cplusplus
}
#endif
#endif
|
/***************************************************************************
* Copyright (C) 2009 by Andrey Afletdinov <fheroes2@gmail.com> *
* *
* Part of the Free Heroes2 Engine: *
* http://sourceforge.net/projects/fheroes2 *
* *
* 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 MIDI_CHUNK_H
#define MIDI_CHUNK_H
#include <ostream>
#include <istream>
#include <vector>
#include "midi.h"
namespace MIDI
{
class Chunk
{
public:
char id[4];
u32 size;
u8* data;
Chunk();
Chunk(const char *i, const u32 s, const u8 *p = NULL);
Chunk(std::istream & i);
Chunk(const u8 *p);
Chunk(const Chunk & c);
~Chunk();
Chunk & operator= (const Chunk & c);
bool Write(std::ostream & o) const;
bool Write(u8 *p) const;
bool Read(std::istream & i);
bool Read(const u8 *p);
bool Read(const std::vector<u8> & b);
void Dump(void) const;
};
}
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <time.h>
int main(void)
{
int handle;
char msg[] = "This is a test";
char ch[50];
int n;
/* create a file */
handle = open("hello.txt", O_CREAT | O_RDWR, 0777);
/* write some data to the file */
write(handle, msg, strlen(msg));
/* seek to the beginning of the file */
lseek(handle, 0L, SEEK_SET);
/* reads chars from the file until we hit EOF */
/* do
{
read(handle, &ch, 1);
printf("%c", ch);
}while(ch != EOF);*/
while((n= read(handle, ch, 50)) > 0)
{
ch[n]='\0';
printf("%s\n", ch);
sleep(1);
}
close(handle);
return 0;
}
|
/*
* resolve.c - resolve names and tags into specific devices
*
* Copyright (C) 2001, 2003 Theodore Ts'o.
* Copyright (C) 2001 Andreas Dilger
*
* %Begin-Header%
* This file may be redistributed under the terms of the
* GNU Lesser General Public License.
* %End-Header%
*/
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "blkidP.h"
#include "probe.h"
/*
* Find a tagname (e.g. LABEL or UUID) on a specific device.
*/
char *blkid_get_tag_value(blkid_cache cache, const char *tagname,
const char *devname)
{
blkid_tag found;
blkid_dev dev;
blkid_cache c = cache;
char *ret = NULL;
DBG(DEBUG_RESOLVE, printf("looking for %s on %s\n", tagname, devname));
if (!devname)
return NULL;
if (!cache) {
if (blkid_get_cache(&c, NULL) < 0)
return NULL;
}
if ((dev = blkid_get_dev(c, devname, BLKID_DEV_NORMAL)) &&
(found = blkid_find_tag_dev(dev, tagname)))
ret = blkid_strdup(found->bit_val);
if (!cache)
blkid_put_cache(c);
return ret;
}
/*
* Locate a device name from a token (NAME=value string), or (name, value)
* pair. In the case of a token, value is ignored. If the "token" is not
* of the form "NAME=value" and there is no value given, then it is assumed
* to be the actual devname and a copy is returned.
*/
char *blkid_get_devname(blkid_cache cache, const char *token,
const char *value)
{
blkid_dev dev;
blkid_cache c = cache;
char *t = 0, *v = 0;
char *ret = NULL;
if (!token)
return NULL;
if (!cache) {
if (blkid_get_cache(&c, NULL) < 0)
return NULL;
}
DBG(DEBUG_RESOLVE,
printf("looking for %s%s%s %s\n", token, value ? "=" : "",
value ? value : "", cache ? "in cache" : "from disk"));
if (!value) {
if (!strchr(token, '='))
return blkid_strdup(token);
blkid_parse_tag_string(token, &t, &v);
if (!t || !v)
goto errout;
token = t;
value = v;
}
dev = blkid_find_dev_with_tag(c, token, value);
if (!dev)
goto errout;
ret = blkid_strdup(blkid_dev_devname(dev));
errout:
if (t)
free(t);
if (v)
free(v);
if (!cache) {
blkid_put_cache(c);
}
return (ret);
}
#ifdef TEST_PROGRAM
int main(int argc, char **argv)
{
char *value;
blkid_cache cache;
blkid_debug_mask = DEBUG_ALL;
if (argc != 2 && argc != 3) {
fprintf(stderr, "Usage:\t%s tagname=value\n"
"\t%s tagname devname\n"
"Find which device holds a given token or\n"
"Find what the value of a tag is in a device\n",
argv[0], argv[0]);
exit(1);
}
if (blkid_get_cache(&cache, bb_dev_null) < 0) {
fprintf(stderr, "Couldn't get blkid cache\n");
exit(1);
}
if (argv[2]) {
value = blkid_get_tag_value(cache, argv[1], argv[2]);
printf("%s has tag %s=%s\n", argv[2], argv[1],
value ? value : "<missing>");
} else {
value = blkid_get_devname(cache, argv[1], NULL);
printf("%s has tag %s\n", value ? value : "<none>", argv[1]);
}
blkid_put_cache(cache);
return value ? 0 : 1;
}
#endif
|
#ifndef __ASM_ARM_IRQ_H
#define __ASM_ARM_IRQ_H
#include <mach/irqs.h>
#ifndef irq_canonicalize
#define irq_canonicalize(i) (i)
#endif
#ifndef NR_IRQS
#define NR_IRQS 128
#endif
/*
* Use this value to indicate lack of interrupt
* capability
*/
#ifndef NO_IRQ
#define NO_IRQ ((unsigned int)(-1))
#endif
/*
* Migration helpers
*/
#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING
#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING
#define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW
#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH
#define IRQT_NOEDGE (0)
#define IRQT_RISING (__IRQT_RISEDGE)
#define IRQT_FALLING (__IRQT_FALEDGE)
#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
#define IRQT_LOW (__IRQT_LOWLVL)
#define IRQT_HIGH (__IRQT_HIGHLVL)
#define IRQT_PROBE IRQ_TYPE_PROBE
#ifndef __ASSEMBLY__
struct irqaction;
extern void migrate_irqs(void);
extern void asm_do_IRQ(unsigned int, struct pt_regs *);
void init_IRQ(void);
#endif
#endif
|
// Copyright (c) 2011 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 NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_
#define NET_HTTP_HTTP_AUTH_HANDLER_FACTORY_H_
#pragma once
#include <map>
#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/http/http_auth.h"
#include "net/http/url_security_manager.h"
class GURL;
namespace net {
class BoundNetLog;
class HostResolver;
class HttpAuthHandler;
class HttpAuthHandlerRegistryFactory;
class NET_EXPORT HttpAuthHandlerFactory {
public:
enum CreateReason {
CREATE_CHALLENGE,
CREATE_PREEMPTIVE,
};
HttpAuthHandlerFactory() : url_security_manager_(NULL) {}
virtual ~HttpAuthHandlerFactory() {}
void set_url_security_manager(URLSecurityManager* url_security_manager) {
url_security_manager_ = url_security_manager;
}
URLSecurityManager* url_security_manager() {
return url_security_manager_;
}
virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge,
HttpAuth::Target target,
const GURL& origin,
CreateReason create_reason,
int digest_nonce_count,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler) = 0;
int CreateAuthHandlerFromString(const std::string& challenge,
HttpAuth::Target target,
const GURL& origin,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler);
int CreatePreemptiveAuthHandlerFromString(
const std::string& challenge,
HttpAuth::Target target,
const GURL& origin,
int digest_nonce_count,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler);
static HttpAuthHandlerRegistryFactory* CreateDefault(HostResolver* resolver);
private:
URLSecurityManager* url_security_manager_;
DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerFactory);
};
class NET_EXPORT HttpAuthHandlerRegistryFactory
: public HttpAuthHandlerFactory {
public:
HttpAuthHandlerRegistryFactory();
virtual ~HttpAuthHandlerRegistryFactory();
void SetURLSecurityManager(const std::string& scheme,
URLSecurityManager* url_security_manager);
void RegisterSchemeFactory(const std::string& scheme,
HttpAuthHandlerFactory* factory);
HttpAuthHandlerFactory* GetSchemeFactory(const std::string& scheme) const;
static HttpAuthHandlerRegistryFactory* Create(
const std::vector<std::string>& supported_schemes,
URLSecurityManager* security_manager,
HostResolver* host_resolver,
const std::string& gssapi_library_name,
bool negotiate_disable_cname_lookup,
bool negotiate_enable_port);
virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge,
HttpAuth::Target target,
const GURL& origin,
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler);
private:
typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap;
FactoryMap factory_map_;
DISALLOW_COPY_AND_ASSIGN(HttpAuthHandlerRegistryFactory);
};
}
#endif
|
/*
* $Id: hppcl.h,v 1.5 2008-07-27 03:22:41 haley Exp $
*/
/************************************************************************
* *
* Copyright (C) 2000 *
* University Corporation for Atmospheric Research *
* All Rights Reserved *
* *
* The use of this Software is governed by a License Agreement. *
* *
************************************************************************/
#ifndef _hppcl_
#define _hppcl_
#define HPPCL_RESET "E"
#define HPPCL_PORTRAIT "&l0O"
#define HPPCL_LANDSCAPE "&l1O"
#define HPPCL_ENCODING ""
#define HPPCL_START "1A"
#define HPPCL_END "B"
#define HPPCL_EJECT "&l0H"
#define HPPCL_POSITION "%dx%dY"
#define HPPCL_TRANSFER "%dW"
#define HPPCL_RESOLUTION "%dR"
#ifdef DEAD
#define HPPCL_PAPER_WIDTH 8.5
#define HPPCL_PAPER_HEIGHT 11.0
#endif
#define HPPCL_PAPER_WIDTH 8.0
#define HPPCL_PAPER_HEIGHT 10.0
#define HPPCL_MAX_RES 300 /* default resolution 300dpi */
typedef struct HPPCL_Info {
int do_compress;
int orientation;
int dpi;
char *trans_data;
int row_size;
int image_size;
int start_x;
int start_y;
} HPPCL_Info;
#endif /* _hppcl_ */
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FORCE_H
#define LMP_FORCE_H
#include "pointers.h"
#include <map>
#include <string>
namespace LAMMPS_NS {
class Force : protected Pointers {
public:
double boltz; // Boltzmann constant (eng/degree-K)
double hplanck; // Planck's constant (energy-time)
double mvv2e; // conversion of mv^2 to energy
double ftm2v; // conversion of ft/m to velocity
double mv2d; // conversion of mass/volume to density
double nktv2p; // conversion of NkT/V to pressure
double qqr2e; // conversion of q^2/r to energy
double qe2f; // conversion of qE to force
double vxmu2f; // conversion of vx dynamic-visc to force
double xxt2kmu; // conversion of xx/t to kinematic-visc
double dielectric; // dielectric constant
double qqrd2e; // q^2/r to energy w/ dielectric constant
double e_mass; // electron mass
double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy
double mvh2r; // conversion of mv/hbar to distance
// hbar = h/(2*pi)
double angstrom; // 1 angstrom in native units
double femtosecond; // 1 femtosecond in native units
double qelectron; // 1 electron charge abs() in native units
int newton,newton_pair,newton_bond; // Newton's 3rd law settings
class Pair *pair;
char *pair_style;
typedef Pair *(*PairCreator)(LAMMPS *);
std::map<std::string,PairCreator> *pair_map;
class Bond *bond;
char *bond_style;
class Angle *angle;
char *angle_style;
class Dihedral *dihedral;
char *dihedral_style;
class Improper *improper;
char *improper_style;
class KSpace *kspace;
char *kspace_style;
// index [0] is not used in these arrays
double special_lj[4]; // 1-2, 1-3, 1-4 prefactors for LJ
double special_coul[4]; // 1-2, 1-3, 1-4 prefactors for Coulombics
int special_angle; // 0 if defined angles are ignored
// 1 if only weight 1,3 atoms if in an angle
int special_dihedral; // 0 if defined dihedrals are ignored
// 1 if only weight 1,4 atoms if in a dihedral
int special_extra; // extra space for added bonds
Force(class LAMMPS *);
~Force();
void init();
void create_pair(const char *, const char *suffix = NULL);
class Pair *new_pair(const char *, const char *, int &);
class Pair *pair_match(const char *, int);
void create_bond(const char *, const char *suffix = NULL);
class Bond *new_bond(const char *, const char *, int &);
class Bond *bond_match(const char *);
void create_angle(const char *, const char *suffix = NULL);
class Angle *new_angle(const char *, const char *, int &);
void create_dihedral(const char *, const char *suffix = NULL);
class Dihedral *new_dihedral(const char *, const char *, int &);
void create_improper(const char *, const char *suffix = NULL);
class Improper *new_improper(const char *, const char *, int &);
void create_kspace(int, char **, const char *suffix = NULL);
class KSpace *new_kspace(int, char **, const char *, int &);
class KSpace *kspace_match(const char *, int);
void set_special(int, char **);
void bounds(char *, int, int &, int &, int nmin=1);
void boundsbig(char *, bigint, bigint &, bigint &, bigint nmin=1);
double numeric(const char *, int, char *);
int inumeric(const char *, int, char *);
bigint bnumeric(const char *, int, char *);
bigint memory_usage();
private:
template <typename T> static Pair *pair_creator(LAMMPS *);
};
}
#endif
/* ERROR/WARNING messages:
E: Invalid pair style
The choice of pair style is unknown.
E: Invalid bond style
The choice of bond style is unknown.
E: Invalid angle style
The choice of angle style is unknown.
E: Invalid dihedral style
The choice of dihedral style is unknown.
E: Invalid improper style
The choice of improper style is unknown.
E: Invalid kspace style
The choice of kspace style is unknown.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Numeric index is out of bounds
A command with an argument that specifies an integer or range of
integers is using a value that is less than 1 or greater than the
maximum allowed limit.
*/
|
/*
* Copyright (c) 2002-2003, Intel Corporation. All rights reserved.
* Created by: rusty.lynch REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
Test case for assertion #4 of the sigaction system call that shows
that attempting to add SIGSTOP to the signal mask of SIGSEGV will
not result in sigaction returning -1
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#include "posixtest.h"
void handler(int signo)
{
}
int main()
{
struct sigaction act;
act.sa_handler = handler;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask, SIGSTOP);
if (sigaction(SIGSEGV, &act, 0) == -1) {
printf("Test FAILED\n");
return PTS_FAIL;
}
printf("Test PASSED\n");
return PTS_PASS;
}
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/iWorkImport.framework/iWorkImport
*/
#import <iWorkImport/GQDRStrokePattern.h>
#import <iWorkImport/XXUnknownSuperclass.h>
#import <iWorkImport/iWorkImport-Structs.h>
__attribute__((visibility("hidden")))
@interface GQDRStrokePattern : XXUnknownSuperclass {
@private
int mType; // 4 = 0x4
}
+ (id)solidPattern; // 0xde35
- (int)type; // 0xde05
@end
@interface GQDRStrokePattern (Private)
- (int)readAttributesFromReader:(xmlTextReader *)reader; // 0xde81
@end
|
#ifndef LINUX_HARDIRQ_H
#define LINUX_HARDIRQ_H
#include <linux/preempt.h>
#include <linux/lockdep.h>
#include <linux/ftrace_irq.h>
#include <asm/hardirq.h>
/*
* We put the hardirq and softirq counter into the preemption
* counter. The bitmask has the following meaning:
*
* - bits 0-7 are the preemption count (max preemption depth: 256)
* - bits 8-15 are the softirq count (max # of softirqs: 256)
*
* The hardirq count can in theory reach the same as NR_IRQS.
* In reality, the number of nested IRQS is limited to the stack
* size as well. For archs with over 1000 IRQS it is not practical
* to expect that they will all nest. We give a max of 10 bits for
* hardirq nesting. An arch may choose to give less than 10 bits.
* m68k expects it to be 8.
*
* - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
* - bit 26 is the NMI_MASK
* - bit 28 is the PREEMPT_ACTIVE flag
*
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
* HARDIRQ_MASK: 0x03ff0000
* NMI_MASK: 0x04000000
*/
#define PREEMPT_BITS 8
#define SOFTIRQ_BITS 8
#define NMI_BITS 1
#define MAX_HARDIRQ_BITS 10
#ifndef HARDIRQ_BITS
# define HARDIRQ_BITS MAX_HARDIRQ_BITS
#endif
#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
#error HARDIRQ_BITS too high!
#endif
#define PREEMPT_SHIFT 0
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
#define __IRQ_MASK(x) ((1UL << (x))-1)
#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
#define NMI_OFFSET (1UL << NMI_SHIFT)
#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
#ifndef PREEMPT_ACTIVE
#define PREEMPT_ACTIVE_BITS 1
#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
#endif
#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
#error PREEMPT_ACTIVE is too low!
#endif
#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
| NMI_MASK))
/*
* Are we doing bottom half or hardware interrupt processing?
* Are we in a softirq context? Interrupt context?
* in_softirq - Are we currently processing softirq or have bh disabled?
* in_serving_softirq - Are we currently processing softirq?
*/
#define in_irq() (hardirq_count())
#define in_softirq() (softirq_count())
#define in_interrupt() (irq_count())
#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
/*
* Are we in NMI context?
*/
#define in_nmi() (preempt_count() & NMI_MASK)
#if defined(CONFIG_PREEMPT_COUNT)
# define PREEMPT_CHECK_OFFSET 1
#else
# define PREEMPT_CHECK_OFFSET 0
#endif
/*
* Are we running in atomic context? WARNING: this macro cannot
* always detect atomic context; in particular, it cannot know about
* held spinlocks in non-preemptible kernels. Thus it should not be
* used in the general case to determine whether sleeping is possible.
* Do not use in_atomic() in driver code.
*/
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
/*
* Check whether we were atomic before we did preempt_disable():
* (used by the scheduler, *after* releasing the kernel lock)
*/
#define in_atomic_preempt_off() \
((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
#ifdef CONFIG_PREEMPT_COUNT
# define preemptible() (preempt_count() == 0 && !irqs_disabled())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else
# define preemptible() 0
# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
#endif
extern void synchronize_irq(unsigned int irq);
struct task_struct;
#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING)
static inline void account_system_vtime(struct task_struct *tsk)
{
}
#else
extern void account_system_vtime(struct task_struct *tsk);
#endif
#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
static inline void rcu_nmi_enter(void)
{
}
static inline void rcu_nmi_exit(void)
{
}
#else
extern void rcu_nmi_enter(void);
extern void rcu_nmi_exit(void);
#endif
/*
* It is safe to do non-atomic ops on ->hardirq_context,
* because NMI handlers may not preempt and the ops are
* always balanced, so the interrupted value of ->hardirq_context
* will always be restored.
*/
#define __irq_enter() \
do { \
account_system_vtime(current); \
add_preempt_count(HARDIRQ_OFFSET); \
trace_hardirq_enter(); \
} while (0)
/*
* Enter irq context (on NO_HZ, update jiffies):
*/
extern void irq_enter(void);
/*
* Exit irq context without processing softirqs:
*/
#define __irq_exit() \
do { \
trace_hardirq_exit(); \
account_system_vtime(current); \
sub_preempt_count(HARDIRQ_OFFSET); \
} while (0)
/*
* Exit irq context and process softirqs if needed:
*/
extern void irq_exit(void);
#define nmi_enter() \
do { \
ftrace_nmi_enter(); \
BUG_ON(in_nmi()); \
add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
lockdep_off(); \
rcu_nmi_enter(); \
trace_hardirq_enter(); \
} while (0)
#define nmi_exit() \
do { \
trace_hardirq_exit(); \
rcu_nmi_exit(); \
lockdep_on(); \
BUG_ON(!in_nmi()); \
sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
ftrace_nmi_exit(); \
} while (0)
#endif /* LINUX_HARDIRQ_H */
|
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/custombgwin.h
// Purpose: wxMSW implementation of wxCustomBackgroundWindow
// Author: Vadim Zeitlin
// Created: 2011-10-10
// RCS-ID: $Id: custombgwin.h 69378 2011-10-11 17:07:43Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_CUSTOMBGWIN_H_
#define _WX_MSW_CUSTOMBGWIN_H_
#include "wx/bitmap.h"
#include "wx/brush.h"
// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow
// ----------------------------------------------------------------------------
template <class W>
class wxCustomBackgroundWindow : public W,
public wxCustomBackgroundWindowBase
{
public:
typedef W BaseWindowClass;
wxCustomBackgroundWindow() { m_backgroundBrush = NULL; }
virtual ~wxCustomBackgroundWindow() { delete m_backgroundBrush; }
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp)
{
delete m_backgroundBrush;
m_backgroundBrush = bmp.IsOk() ? new wxBrush(bmp) : NULL;
// Our transparent children should use our background if we have it,
// otherwise try to restore m_inheritBgCol to some reasonable value: true
// if we also have non-default background colour or false otherwise.
BaseWindowClass::m_inheritBgCol = bmp.IsOk()
|| BaseWindowClass::UseBgCol();
}
virtual WXHBRUSH MSWGetCustomBgBrush()
{
if ( m_backgroundBrush )
return (WXHBRUSH)m_backgroundBrush->GetResourceHandle();
return BaseWindowClass::MSWGetCustomBgBrush();
}
wxBrush *m_backgroundBrush;
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCustomBackgroundWindow, W);
};
#endif // _WX_MSW_CUSTOMBGWIN_H_
|
#ifndef PLAYER_H
#define PLAYER_H
#include "Vector2d.h"
#include "Polygon.h"
#include "CollisionController.h"
#include <vector>
const float WALKING_ACCEL = 0.5;
const float MAX_WALKING_SPEED = 11.0;
const float FALLING_ACCEL = 1.2;
const float MAX_FALLING_SPEED = 20.0;
const float JUMPING_SPEED = -25.0;
class Player {
public:
Player(Vector2d, std::vector<Polygon*>*);
~Player();
void control();
void update();
void render();
bool verticalCollision(const Polygon&);
bool horizontalCollision(const Polygon&);
void setPosition(const Vector2d);
void setVelocity(const Vector2d);
void setAcceleration(const Vector2d);
Vector2d getPosition() const;
Vector2d getVelocity() const;
Vector2d getAcceleration() const;
private:
bool grounded;
bool groundedLatch;
bool jumping;
//Position and derivatives for movement.
Vector2d m_Position;
Vector2d m_Velocity;
Vector2d m_Acceleration;
//Polygon for rendering.
Polygon m_Polygon;
std::vector<Polygon*> *m_Platforms;
void enableGrounded();
};
#endif
|
//
// NXTableView.h
// GestureOnTableViewCell
//
// Created by CornerZhang on 14-9-15.
// Copyright (c) 2014年 NeXtreme.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NXTableView : UITableView <UITableViewDataSource, UITableViewDelegate>
@end
|
#ifndef VALUESCOPE_H_
#define VALUESCOPE_H_
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "ValueEntry.h"
#include "types/Type.h"
namespace semantic_analyzer {
class ValueScope {
public:
bool insertSymbol(std::string name, const type::Type& type, translation_unit::Context context);
void insertFunctionArgument(std::string name, const type::Type& type, translation_unit::Context context);
ValueEntry createTemporarySymbol(type::Type type);
bool isSymbolDefined(std::string symbolName) const;
ValueEntry lookup(std::string name) const;
std::map<std::string, ValueEntry> getSymbols() const;
std::vector<ValueEntry> getArguments() const;
private:
std::vector<ValueEntry> arguments;
std::map<std::string, ValueEntry> localSymbols;
};
} // namespace semantic_analyzer
#endif // VALUESCOPE_H_
|
/*
* drivers/power/process.c - Functions for starting/stopping processes on
* suspend transitions.
*
* Originally from swsusp.
*/
#undef DEBUG
#include <linux/interrupt.h>
#include <linux/oom.h>
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/kmod.h>
#include <linux/wakelock.h>
#include "power.h"
/*
* Timeout for stopping processes
*/
#define TIMEOUT (20 * HZ)
static int try_to_freeze_tasks(bool user_only)
{
struct task_struct *g, *p;
unsigned long end_time;
unsigned int todo;
bool wq_busy = false;
struct timeval start, end;
u64 elapsed_csecs64;
unsigned int elapsed_csecs;
bool wakeup = false;
do_gettimeofday(&start);
end_time = jiffies + TIMEOUT;
if (!user_only)
freeze_workqueues_begin();
while (true) {
todo = 0;
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p == current || !freeze_task(p))
continue;
/*
* Now that we've done set_freeze_flag, don't
* perturb a task in TASK_STOPPED or TASK_TRACED.
* It is "frozen enough". If the task does wake
* up, it will immediately call try_to_freeze.
*
* Because freeze_task() goes through p's scheduler lock, it's
* guaranteed that TASK_STOPPED/TRACED -> TASK_RUNNING
* transition can't race with task state testing here.
*/
if (!task_is_stopped_or_traced(p) &&
!freezer_should_skip(p))
todo++;
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
if (!user_only) {
wq_busy = freeze_workqueues_busy();
todo += wq_busy;
}
if (todo && has_wake_lock(WAKE_LOCK_SUSPEND)) {
wakeup = 1;
break;
}
if (!todo || time_after(jiffies, end_time))
break;
if (pm_wakeup_pending()) {
wakeup = true;
break;
}
/*
* We need to retry, but first give the freezing tasks some
* time to enter the regrigerator.
*/
msleep(10);
}
do_gettimeofday(&end);
elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
elapsed_csecs = elapsed_csecs64;
if (todo) {
/* This does not unfreeze processes that are already frozen
* (we have slightly ugly calling convention in that respect,
* and caller must call thaw_processes() if something fails),
* but it cleans up leftover PF_FREEZE requests.
*/
if(wakeup) {
printk("\n");
printk(KERN_ERR "Freezing of %s aborted\n",
user_only ? "user space " : "tasks ");
}
else {
printk("\n");
printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
"(%d tasks refusing to freeze, wq_busy=%d):\n",
wakeup ? "aborted" : "failed",
elapsed_csecs / 100, elapsed_csecs % 100,
todo - wq_busy, wq_busy);
}
if (!wakeup) {
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p != current && !freezer_should_skip(p)
&& freezing(p) && !frozen(p) &&
elapsed_csecs > 100)
sched_show_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
}
} else {
printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
elapsed_csecs % 100);
}
return todo ? -EBUSY : 0;
}
/**
* freeze_processes - Signal user space processes to enter the refrigerator.
*
* On success, returns 0. On failure, -errno and system is fully thawed.
*/
int freeze_processes(void)
{
int error;
error = suspend_sys_sync_wait();
if (error)
return error;
error = __usermodehelper_disable(UMH_FREEZING);
if (error)
return error;
if (!pm_freezing)
atomic_inc(&system_freezing_cnt);
printk("Freezing user space processes ... ");
pm_freezing = true;
error = try_to_freeze_tasks(true);
if (!error) {
printk("done.");
__usermodehelper_set_disable_depth(UMH_DISABLED);
oom_killer_disable();
}
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_processes();
return error;
}
/**
* freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
*
* On success, returns 0. On failure, -errno and only the kernel threads are
* thawed, so as to give a chance to the caller to do additional cleanups
* (if any) before thawing the userspace tasks. So, it is the responsibility
* of the caller to thaw the userspace tasks, when the time is right.
*/
int freeze_kernel_threads(void)
{
int error;
// error = suspend_sys_sync_wait();
// if (error)
// return error;
printk("Freezing remaining freezable tasks ... ");
pm_nosig_freezing = true;
error = try_to_freeze_tasks(false);
if (!error)
printk("done.");
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_kernel_threads();
return error;
}
void thaw_processes(void)
{
struct task_struct *g, *p;
if (pm_freezing)
atomic_dec(&system_freezing_cnt);
pm_freezing = false;
pm_nosig_freezing = false;
oom_killer_enable();
printk("Restarting tasks ... ");
__usermodehelper_set_disable_depth(UMH_FREEZING);
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
usermodehelper_enable();
schedule();
printk("done.\n");
}
void thaw_kernel_threads(void)
{
struct task_struct *g, *p;
pm_nosig_freezing = false;
printk("Restarting kernel threads ... ");
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
schedule();
printk("done.\n");
}
|
/*
mkvtoolnix - A set of programs for manipulating Matroska files
Distributed under the GPL
see the file COPYING for details
or visit http://www.gnu.org/copyleft/gpl.html
Cross platform compatibility definitions
Written by Moritz Bunkus <moritz@bunkus.org>.
*/
#ifndef MTX_COMMON_OS_H
#define MTX_COMMON_OS_H
#undef __STRICT_ANSI__
#include "config.h"
// For PRId64 and PRIu64:
#define __STDC_FORMAT_MACROS
#if defined(HAVE_COREC_H)
#include "corec.h"
#if defined(TARGET_WIN)
# define SYS_WINDOWS
#elif defined(TARGET_OSX)
# define SYS_APPLE
#elif defined(TARGET_LINUX)
# define SYS_UNIX
# if defined(__sun) && defined(__SVR4)
# define SYS_SOLARIS
# else
# define SYS_LINUX
# endif
#endif
#else // HAVE_COREC_H
#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
# define SYS_WINDOWS
#elif defined(__APPLE__)
# define SYS_APPLE
#else
# define COMP_GCC
# define SYS_UNIX
# if defined(__bsdi__) || defined(__FreeBSD__)
# define SYS_BSD
# elif defined(__sun) && defined(__SUNPRO_CC)
# undef COMP_GCC
# define COMP_SUNPRO
# define SYS_SOLARIS
# elif defined(__sun) && defined(__SVR4)
# define SYS_SOLARIS
# else
# define SYS_LINUX
# endif
#endif
#endif // HAVE_COREC_H
#if defined(SYS_WINDOWS)
# if defined __MINGW32__
# define COMP_MINGW
# elif defined __CYGWIN__
# define COMP_CYGWIN
# else
# define COMP_MSC
# define NOMINMAX
# endif
#endif
#if (defined(SYS_WINDOWS) && defined(_WIN64)) || (!defined(SYS_WINDOWS) && (defined(__x86_64__) || defined(__ppc64__)))
# define ARCH_64BIT
#else
# define ARCH_32BIT
#endif
#if defined(COMP_MSC)
#if !defined(HAVE_COREC_H)
# define strncasecmp _strnicmp
# define strcasecmp _stricmp
typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int8 uint8_t;
#endif // HAVE_COREC_H
# define nice(a)
#include <io.h>
typedef _fsize_t ssize_t;
#define PACKED_STRUCTURE
#else // COMP_MSC
#define PACKED_STRUCTURE __attribute__((__packed__))
#endif // COMP_MSC
#if defined(COMP_MINGW) || defined(COMP_MSC)
# if defined(COMP_MINGW)
// mingw is a special case. It does have inttypes.h declaring
// PRId64 to be I64d, but it warns about "int type format, different
// type argument" if %I64d is used with a int64_t. The mx* functions
// convert %lld to %I64d on mingw/msvc anyway.
# undef PRId64
# define PRId64 "lld"
# undef PRIu64
# define PRIu64 "llu"
# undef PRIx64
# define PRIx64 "llx"
# else
// MSVC doesn't have inttypes, nor the PRI?64 defines.
# define PRId64 "I64d"
# define PRIu64 "I64u"
# define PRIx64 "I64x"
# endif // defined(COMP_MINGW)
#endif // COMP_MINGW || COMP_MSC
#define LLD "%" PRId64
#define LLU "%" PRIu64
#if defined(HAVE_NO_INT64_T)
typedef INT64_TYPE int64_t;
#endif
#if defined(HAVE_NO_UINT64_T)
typedef UINT64_TYPE uint64_t;
#endif
#if defined(SYS_WINDOWS)
# define PATHSEP '\\'
#else
# define PATHSEP '/'
#endif
#if defined(WORDS_BIGENDIAN) && (WORDS_BIGENDIAN == 1)
# define ARCH_BIGENDIAN
#else
# define ARCH_LITTLEENDIAN
#endif
#endif
|
//
// XRLoginView.h
// XyralityTest
//
// Created by lava on 12/19/15.
//
//
#import <UIKit/UIKit.h>
@interface XRLoginView : UIView
@property (weak, nonatomic) IBOutlet UIView *credentialsView;
@property (weak, nonatomic) IBOutlet UILabel *loginLabel;
@property (weak, nonatomic) IBOutlet UITextField *loginTextField;
@property (weak, nonatomic) IBOutlet UILabel *passwordLabel;
@property (weak, nonatomic) IBOutlet UITextField *passworldTextField;
@property (weak, nonatomic) IBOutlet UIButton *showMyWorldsButton;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activtyIndicator;
- (void)startProgressAnimation;
- (void)stopProgressAnimation;
@end
|
/* $Id$ */
/** @file
* IPRT - User & Kernel Memory, Ring-0 Driver, Solaris.
*/
/*
* Copyright (C) 2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
# include <iprt/asm-amd64-x86.h>
#endif
#include <iprt/assert.h>
#include <iprt/err.h>
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb)
{
int rc;
RT_ASSERT_INTS_ON();
rc = ddi_copyin((const char *)R3PtrSrc, pvDst, cb, 0 /*flags*/);
if (RT_LIKELY(rc == 0))
return VINF_SUCCESS;
return VERR_ACCESS_DENIED;
}
RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb)
{
int rc;
RT_ASSERT_INTS_ON();
rc = ddi_copyout(pvSrc, (void *)R3PtrDst, cb, 0 /*flags*/);
if (RT_LIKELY(rc == 0))
return VINF_SUCCESS;
return VERR_ACCESS_DENIED;
}
RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr)
{
return R3Ptr < kernelbase;
}
RTR0DECL(bool) RTR0MemKernelIsValidAddr(void *pv)
{
return (uintptr_t)pv >= kernelbase;
}
RTR0DECL(bool) RTR0MemAreKrnlAndUsrDifferent(void)
{
return true;
}
|
/*
* This file is part of ePipe
* Copyright (C) 2019, Logical Clocks AB. All rights reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef TBLSTAILER_H
#define TBLSTAILER_H
#include "TableTailer.h"
#include "tables/hive/TBLSTable.h"
#include "tables/hive/SDSTable.h"
#include "tables/hive/TABCOLSTATSTable.h"
#include "tables/hive/TABLEPARAMSTable.h"
class TBLSTailer : public TableTailer<TBLSRow> {
public:
TBLSTailer(Ndb *ndb, const int poll_maxTimeToWait, const Barrier barrier)
: TableTailer(ndb, new TBLSTable(), poll_maxTimeToWait, barrier) {}
virtual ~TBLSTailer() {}
private:
SDSTable mSDSTable;
TABLEPARAMSTable mTABLEPARAMSTable;
TABCOLSTATSTable mTABCOLSTATSTable;
virtual void handleEvent(NdbDictionary::Event::TableEvent eventType, TBLSRow
pre, TBLSRow row) {
LOG_INFO("Delete TBLS event received. Primary Key value: " << pre.mTBLID);
mTABLEPARAMSTable.remove(mNdbConnection, pre.mTBLID);
mTABCOLSTATSTable.remove(mNdbConnection, pre.mTBLID);
mSDSTable.remove(mNdbConnection, pre.mSDID);
}
};
#endif /* TBLSTAILER_H */
|
/*
* Copyright 2015 AASHTO/ITE/NEMA.
* American Association of State Highway and Transportation Officials,
* Institute of Transportation Engineers and
* National Electrical Manufacturers Association.
*
* This file is part of the Advanced Transportation Controller (ATC)
* Application Programming Interface Validation Suite (APIVS).
*
* The APIVS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* The APIVS 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 the APIVS. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************
* \file emfio_setupCommands.h
*
* (c) Copyright 2010 ITE
* All rights reserved. Copying or other reproduction of this program
* except for archival purposes is prohibited without the prior written
* consent of ITE.
*
* \brief This file declares the functions that setup and teardown the command structures.
*
* \date 12/22/2010
*
* \author Steve Kapp
*
* \version 1.0
*****************************************************************************/
#ifndef emfio_setupCommands_h
#define emfio_setupCommands_h
//=============================================================================
/**
* Includes
*/
#include <stdint.h> // STD IEEE Type Definitions - int16_t, uint8_t, etc.
//=============================================================================
/**
* External Global Routines
*/
extern int16_t emfio_setupCommands();
extern int16_t emfio_teardownCommands();
extern int16_t emfio_setupResponses();
extern int16_t emfio_teardownResponses();
extern uint32_t emfio_getNextLoadCounter();
extern uint32_t emfio_getNextReceiveCounter();
#endif
|
/* $Id: mpnotification-r0drv-solaris.c $ */
/** @file
* IPRT - Multiprocessor Event Notifications, Ring-0 Driver, Solaris.
*/
/*
* Copyright (C) 2008-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/err.h>
#include <iprt/mp.h>
#include <iprt/cpuset.h>
#include <iprt/string.h>
#include <iprt/thread.h>
#include "r0drv/mp-r0drv.h"
/*********************************************************************************************************************************
* Global Variables *
*********************************************************************************************************************************/
/** Whether CPUs are being watched or not. */
static volatile bool g_fSolCpuWatch = false;
/** Set of online cpus that is maintained by the MP callback.
* This avoids locking issues querying the set from the kernel as well as
* eliminating any uncertainty regarding the online status during the
* callback. */
RTCPUSET g_rtMpSolCpuSet;
/**
* Internal solaris representation for watching CPUs.
*/
typedef struct RTMPSOLWATCHCPUS
{
/** Function pointer to Mp worker. */
PFNRTMPWORKER pfnWorker;
/** Argument to pass to the Mp worker. */
void *pvArg;
} RTMPSOLWATCHCPUS;
typedef RTMPSOLWATCHCPUS *PRTMPSOLWATCHCPUS;
/**
* Solaris callback function for Mp event notification.
*
* @returns Solaris error code.
* @param CpuState The current event/state of the CPU.
* @param iCpu Which CPU is this event for.
* @param pvArg Ignored.
*
* @remarks This function assumes index == RTCPUID.
* We may -not- be firing on the CPU going online/offline and called
* with preemption enabled.
*/
static int rtMpNotificationCpuEvent(cpu_setup_t CpuState, int iCpu, void *pvArg)
{
RTMPEVENT enmMpEvent;
/*
* Update our CPU set structures first regardless of whether we've been
* scheduled on the right CPU or not, this is just atomic accounting.
*/
if (CpuState == CPU_ON)
{
enmMpEvent = RTMPEVENT_ONLINE;
RTCpuSetAdd(&g_rtMpSolCpuSet, iCpu);
}
else if (CpuState == CPU_OFF)
{
enmMpEvent = RTMPEVENT_OFFLINE;
RTCpuSetDel(&g_rtMpSolCpuSet, iCpu);
}
else
return 0;
rtMpNotificationDoCallbacks(enmMpEvent, iCpu);
NOREF(pvArg);
return 0;
}
DECLHIDDEN(int) rtR0MpNotificationNativeInit(void)
{
if (ASMAtomicReadBool(&g_fSolCpuWatch) == true)
return VERR_WRONG_ORDER;
/*
* Register the callback building the online cpu set as we do so.
*/
RTCpuSetEmpty(&g_rtMpSolCpuSet);
mutex_enter(&cpu_lock);
register_cpu_setup_func(rtMpNotificationCpuEvent, NULL /* pvArg */);
for (int i = 0; i < (int)RTMpGetCount(); ++i)
if (cpu_is_online(cpu[i]))
rtMpNotificationCpuEvent(CPU_ON, i, NULL /* pvArg */);
ASMAtomicWriteBool(&g_fSolCpuWatch, true);
mutex_exit(&cpu_lock);
return VINF_SUCCESS;
}
DECLHIDDEN(void) rtR0MpNotificationNativeTerm(void)
{
if (ASMAtomicReadBool(&g_fSolCpuWatch) == true)
{
mutex_enter(&cpu_lock);
unregister_cpu_setup_func(rtMpNotificationCpuEvent, NULL /* pvArg */);
ASMAtomicWriteBool(&g_fSolCpuWatch, false);
mutex_exit(&cpu_lock);
}
}
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager Connection editor -- Connection editor for NetworkManager
*
* 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.
*
* Copyright 2012 Red Hat, Inc.
*/
#ifndef __PAGE_MASTER_H__
#define __PAGE_MASTER_H__
#include <nm-connection.h>
#include <glib.h>
#include <glib-object.h>
#include "ce-page.h"
#include "connection-helpers.h"
#define CE_TYPE_PAGE_MASTER (ce_page_master_get_type ())
#define CE_PAGE_MASTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CE_TYPE_PAGE_MASTER, CEPageMaster))
#define CE_PAGE_MASTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CE_TYPE_PAGE_MASTER, CEPageMasterClass))
#define CE_IS_PAGE_MASTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CE_TYPE_PAGE_MASTER))
#define CE_IS_PAGE_MASTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CE_TYPE_PAGE_MASTER))
#define CE_PAGE_MASTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CE_TYPE_PAGE_MASTER, CEPageMasterClass))
typedef struct {
CEPage parent;
gboolean aggregating;
} CEPageMaster;
typedef struct {
CEPageClass parent;
/* signals */
void (*create_connection) (CEPageMaster *self, NMConnection *connection);
void (*connection_added) (CEPageMaster *self, NMConnection *connection);
void (*connection_removed) (CEPageMaster *self, NMConnection *connection);
/* methods */
void (*add_slave) (CEPageMaster *self, NewConnectionResultFunc result_func);
} CEPageMasterClass;
GType ce_page_master_get_type (void);
gboolean ce_page_master_has_slaves (CEPageMaster *self);
#endif /* __PAGE_MASTER_H__ */
|
/*
** Zabbix
** Copyright (C) 2001-2018 Zabbix SIA
**
** 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 ZABBIX_HISTORY_H
#define ZABBIX_HISTORY_H
#define ZBX_HISTORY_IFACE_SQL 0
#define ZBX_HISTORY_IFACE_ELASTIC 1
typedef struct zbx_history_iface zbx_history_iface_t;
typedef void (*zbx_history_destroy_func_t)(struct zbx_history_iface *hist);
typedef int (*zbx_history_add_values_func_t)(struct zbx_history_iface *hist, const zbx_vector_ptr_t *history);
typedef int (*zbx_history_get_values_func_t)(struct zbx_history_iface *hist, zbx_uint64_t itemid, int start,
int count, int end, zbx_vector_history_record_t *values);
typedef void (*zbx_history_flush_func_t)(struct zbx_history_iface *hist);
struct zbx_history_iface
{
unsigned char value_type;
unsigned char requires_trends;
void *data;
zbx_history_destroy_func_t destroy;
zbx_history_add_values_func_t add_values;
zbx_history_get_values_func_t get_values;
zbx_history_flush_func_t flush;
};
/* SQL hist */
int zbx_history_sql_init(zbx_history_iface_t *hist, unsigned char value_type, char **error);
/* elastic hist */
int zbx_history_elastic_init(zbx_history_iface_t *hist, unsigned char value_type, char **error);
#endif
|
/* Copyright (C) 2001 artofcode LLC. All rights reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
/* $Id: gp_stdia.c,v 1.5 2002/02/21 22:24:52 giles Exp $ */
/* Read stdin on platforms that support unbuffered read. */
/* We want unbuffered for console input and pipes. */
#include "stdio_.h"
#include "time_.h"
#include "unistd_.h"
#include "gx.h"
#include "gp.h"
/* Read bytes from stdin, unbuffered if possible. */
int gp_stdin_read(char *buf, int len, int interactive, FILE *f)
{
return read(fileno(f), buf, len);
}
|
/*----------------------------------------------------------------------------
* U S B - K e r n e l
*----------------------------------------------------------------------------
* Name: usbreg_STM32F10x.h
* Purpose: USB Hardware Layer Definitions for ST STM32F10x
* Version: V1.20
*----------------------------------------------------------------------------
* This file is part of the uVision/ARM development tools.
* This software may only be used under the terms of a valid, current,
* end user licence from KEIL for a compatible version of KEIL software
* development tools. Nothing else gives you the right to use this software.
*
* This software is supplied "AS IS" without warranties of any kind.
*
* Copyright (c) 2009-2011 Keil - An ARM Company. All rights reserved.
*----------------------------------------------------------------------------*/
#ifndef __USBREG_STM32F10x_H
#define __USBREG_STM32F10x_H
#define REG(x) (*((volatile unsigned int *)(x)))
#define USB_BASE_ADDR 0x40005C00 /* USB Registers Base Address */
#define USB_PMA_ADDR 0x40006000 /* USB Packet Memory Area Address */
/* Common Registers */
#define CNTR REG(USB_BASE_ADDR + 0x40) /* Control Register */
#define ISTR REG(USB_BASE_ADDR + 0x44) /* Interrupt Status Register */
#define FNR REG(USB_BASE_ADDR + 0x48) /* Frame Number Register */
#define DADDR REG(USB_BASE_ADDR + 0x4C) /* Device Address Register */
#define BTABLE REG(USB_BASE_ADDR + 0x50) /* Buffer Table Address Register */
/* CNTR: Control Register Bit Definitions */
#define CNTR_CTRM 0x8000 /* Correct Transfer Interrupt Mask */
#define CNTR_PMAOVRM 0x4000 /* Packet Memory Aerea Over/underrun Interrupt Mask */
#define CNTR_ERRM 0x2000 /* Error Interrupt Mask */
#define CNTR_WKUPM 0x1000 /* Wake-up Interrupt Mask */
#define CNTR_SUSPM 0x0800 /* Suspend Mode Interrupt Mask */
#define CNTR_RESETM 0x0400 /* USB Reset Interrupt Mask */
#define CNTR_SOFM 0x0200 /* Start of Frame Interrupt Mask */
#define CNTR_ESOFM 0x0100 /* Expected Start of Frame Interrupt Mask */
#define CNTR_RESUME 0x0010 /* Resume Request */
#define CNTR_FSUSP 0x0008 /* Force Suspend */
#define CNTR_LPMODE 0x0004 /* Low-power Mode */
#define CNTR_PDWN 0x0002 /* Power Down */
#define CNTR_FRES 0x0001 /* Force USB Reset */
/* ISTR: Interrupt Status Register Bit Definitions */
#define ISTR_CTR 0x8000 /* Correct Transfer */
#define ISTR_PMAOVR 0x4000 /* Packet Memory Aerea Over/underrun */
#define ISTR_ERR 0x2000 /* Error */
#define ISTR_WKUP 0x1000 /* Wake-up */
#define ISTR_SUSP 0x0800 /* Suspend Mode */
#define ISTR_RESET 0x0400 /* USB Reset */
#define ISTR_SOF 0x0200 /* Start of Frame */
#define ISTR_ESOF 0x0100 /* Expected Start of Frame */
#define ISTR_DIR 0x0010 /* Direction of Transaction */
#define ISTR_EP_ID 0x000F /* EndPoint Identifier */
/* FNR: Frame Number Register Bit Definitions */
#define FNR_RXDP 0x8000 /* D+ Data Line Status */
#define FNR_RXDM 0x4000 /* D- Data Line Status */
#define FNR_LCK 0x2000 /* Locked */
#define FNR_LSOF 0x1800 /* Lost SOF */
#define FNR_FN 0x07FF /* Frame Number */
/* DADDR: Device Address Register Bit Definitions */
#define DADDR_EF 0x0080 /* Enable Function */
#define DADDR_ADD 0x007F /* Device Address */
/* EndPoint Registers */
#define EPxREG(x) REG(USB_BASE_ADDR + 4*(x))
/* EPxREG: EndPoint Registers Bit Definitions */
#define EP_CTR_RX 0x8000 /* Correct RX Transfer */
#define EP_DTOG_RX 0x4000 /* RX Data Toggle */
#define EP_STAT_RX 0x3000 /* RX Status */
#define EP_SETUP 0x0800 /* EndPoint Setup */
#define EP_TYPE 0x0600 /* EndPoint Type */
#define EP_KIND 0x0100 /* EndPoint Kind */
#define EP_CTR_TX 0x0080 /* Correct TX Transfer */
#define EP_DTOG_TX 0x0040 /* TX Data Toggle */
#define EP_STAT_TX 0x0030 /* TX Status */
#define EP_EA 0x000F /* EndPoint Address */
/* EndPoint Register Mask (No Toggle Fields) */
#define EP_MASK (EP_CTR_RX|EP_SETUP|EP_TYPE|EP_KIND|EP_CTR_TX|EP_EA)
/* EP_TYPE: EndPoint Types */
#define EP_BULK 0x0000 /* BULK EndPoint */
#define EP_CONTROL 0x0200 /* CONTROL EndPoint */
#define EP_ISOCHRONOUS 0x0400 /* ISOCHRONOUS EndPoint */
#define EP_INTERRUPT 0x0600 /* INTERRUPT EndPoint */
/* EP_KIND: EndPoint Kind */
#define EP_DBL_BUF EP_KIND /* Double Buffer for Bulk Endpoint */
#define EP_STATUS_OUT EP_KIND /* Status Out for Control Endpoint */
/* EP_STAT_TX: TX Status */
#define EP_TX_DIS 0x0000 /* Disabled */
#define EP_TX_STALL 0x0010 /* Stalled */
#define EP_TX_NAK 0x0020 /* NAKed */
#define EP_TX_VALID 0x0030 /* Valid */
/* EP_STAT_RX: RX Status */
#define EP_RX_DIS 0x0000 /* Disabled */
#define EP_RX_STALL 0x1000 /* Stalled */
#define EP_RX_NAK 0x2000 /* NAKed */
#define EP_RX_VALID 0x3000 /* Valid */
/* Endpoint Buffer Descriptor */
typedef struct _EP_BUF_DSCR {
U32 ADDR_TX;
U32 COUNT_TX;
U32 ADDR_RX;
U32 COUNT_RX;
} EP_BUF_DSCR;
#define EP_ADDR_MASK 0xFFFE /* Address Mask */
#define EP_COUNT_MASK 0x03FF /* Count Mask */
#endif /* __USBREG_STM32F10x_H */
|
//
// iTermBoxDrawingBezierCurveFactory.h
// iTerm2
//
// Created by George Nachman on 7/15/16.
//
//
#import <Cocoa/Cocoa.h>
@interface iTermBoxDrawingBezierCurveFactory : NSObject
+ (NSCharacterSet *)boxDrawingCharactersWithBezierPaths;
+ (NSArray<NSBezierPath *> *)bezierPathsForBoxDrawingCode:(unichar)code
cellSize:(NSSize)cellSize
scale:(CGFloat)scale;
@end
|
#ifndef _LINUX_PRIO_HEAP_H
#define _LINUX_PRIO_HEAP_H
#include <linux/gfp.h>
struct ptr_heap {
void **ptrs;
int max;
int size;
int (*gt)(void *, void *);
};
extern int heap_init(struct ptr_heap *heap, size_t size, gfp_t gfp_mask,
int (*gt)(void *, void *));
void heap_free(struct ptr_heap *heap);
extern void *heap_insert(struct ptr_heap *heap, void *p);
#endif
|
/*****************************************************************************
* Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License version 2 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* 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 KEDIT_TAGS_DIALOG_H
#define KEDIT_TAGS_DIALOG_H
#include <kdialog.h>
#include <Nepomuk2/Tag>
class KLineEdit;
class QListWidget;
class QListWidgetItem;
class QPushButton;
class QTimer;
/**
* @brief Dialog to edit a list of Nepomuk tags.
*
* It is possible for the user to add existing tags,
* create new tags or to remove tags.
*
* @see KMetaDataConfigurationDialog
*/
class KEditTagsDialog : public KDialog
{
Q_OBJECT
public:
KEditTagsDialog(const QList<Nepomuk2::Tag>& tags,
QWidget* parent = 0,
Qt::WFlags flags = 0);
virtual ~KEditTagsDialog();
QList<Nepomuk2::Tag> tags() const;
virtual bool eventFilter(QObject* watched, QEvent* event);
protected slots:
virtual void slotButtonClicked(int button);
private slots:
void slotTextEdited(const QString& text);
void slotItemEntered(QListWidgetItem* item);
void showDeleteButton();
void deleteTag();
private:
void loadTags();
void removeNewTagItem();
private:
QList<Nepomuk2::Tag> m_tags;
QListWidget* m_tagsList;
QListWidgetItem* m_newTagItem;
QListWidgetItem* m_autoCheckedItem;
QListWidgetItem* m_deleteCandidate;
KLineEdit* m_newTagEdit;
QPushButton* m_deleteButton;
QTimer* m_deleteButtonTimer;
};
#endif
|
/*
* Open Firm Accounting
* A double-entry accounting application for professional services.
*
* Copyright (C) 2014-2020 Pierre Wieser (see AUTHORS)
*
* Open Firm Accounting 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.
*
* Open Firm Accounting 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 Open Firm Accounting; see the file COPYING. If not,
* see <http://www.gnu.org/licenses/>.
*
* Authors:
* Pierre Wieser <pwieser@trychlos.org>
*/
#ifndef __OPENBOOK_API_OFO_BASE_H__
#define __OPENBOOK_API_OFO_BASE_H__
/**
* SECTION: ofobase
* @title: ofoBase
* @short_description: #ofoBase class definition.
* @include: openbook/ofo-base.h
*
* The ofoBase class is the class base for application objects.
*
* Properties:
* - ofo-base-getter:
* a #ofaIGetter instance;
* no default, will be %NULL if has not been previously set.
*/
#include "api/ofa-box.h"
#include "api/ofa-idbconnect-def.h"
#include "api/ofa-igetter-def.h"
#include "api/ofo-base-def.h"
G_BEGIN_DECLS
#define OFO_TYPE_BASE ( ofo_base_get_type())
#define OFO_BASE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, OFO_TYPE_BASE, ofoBase ))
#define OFO_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, OFO_TYPE_BASE, ofoBaseClass ))
#define OFO_IS_BASE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, OFO_TYPE_BASE ))
#define OFO_IS_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), OFO_TYPE_BASE ))
#define OFO_BASE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), OFO_TYPE_BASE, ofoBaseClass ))
#if 0
typedef struct _ofoBaseProtected ofoBaseProtected;
typedef struct {
/*< public members >*/
GObject parent;
/*< protected members >*/
ofoBaseProtected *prot;
}
ofoBase;
typedef struct {
/*< public members >*/
GObjectClass parent;
}
ofoBaseClass;
#endif
/**
* ofo_base_getter:
* @C: the class radical (e.g. 'ACCOUNT')
* @V: the variable name (e.g. 'account')
* @T: the type of required data (e.g. 'amount')
* @R: the returned data if %NULL or an error occured (e.g. '0')
* @I: the identifier of the required field (e.g. 'ACC_DEB_AMOUNT')
*
* A convenience macro to get the value of an identified field from an
* #ofoBase object.
*/
#define ofo_base_getter(C,V,T,R,I) \
g_return_val_if_fail((V) && OFO_IS_ ## C(V),(R)); \
g_return_val_if_fail( !OFO_BASE(V)->prot->dispose_has_run, (R)); \
if( !ofa_box_is_set( OFO_BASE(V)->prot->fields,(I))) return(R); \
return(ofa_box_get_ ## T(OFO_BASE(V)->prot->fields,(I)))
/**
* ofo_base_setter:
* @C: the class mnemonic (e.g. 'ACCOUNT')
* @V: the variable name (e.g. 'account')
* @T: the type of required data (e.g. 'amount')
* @I: the identifier of the required field (e.g. 'ACC_DEB_AMOUNT')
* @D: the data value to be set
*
* A convenience macro to set the value of an identified field from an
* #ofoBase object.
*/
#define ofo_base_setter(C,V,T,I,D) \
g_return_if_fail((V) && OFO_IS_ ## C(V)); \
g_return_if_fail( !OFO_BASE(V)->prot->dispose_has_run ); \
ofa_box_set_ ## T(OFO_BASE(V)->prot->fields,(I),(D))
/**
* Identifier unset value
*/
#define OFO_BASE_UNSET_ID -1
GType ofo_base_get_type ( void ) G_GNUC_CONST;
GList *ofo_base_init_fields_list( const ofsBoxDef *defs );
GList *ofo_base_load_dataset ( const ofsBoxDef *defs,
const gchar *from,
GType type,
ofaIGetter *getter );
GList *ofo_base_load_rows ( const ofsBoxDef *defs,
const ofaIDBConnect *connect,
const gchar *from );
ofaIGetter *ofo_base_get_getter ( ofoBase *base );
G_END_DECLS
#endif /* __OPENBOOK_API_OFO_BASE_H__ */
|
/*
* (C) 2007-2010 Taobao Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*
* Version: $Id$
*
* Authors:
* duolong <duolong@taobao.com>
*
*/
#ifndef TBNET_SERVERSOCKET_H_
#define TBNET_SERVERSOCKET_H_
namespace tbnet {
class ServerSocket : public Socket {
public:
/*
* ¹¹Ô캯Êý
*/
ServerSocket();
/*
* acceptÒ»¸öеÄÁ¬½Ó
*
* @return Ò»¸öSocket
*/
Socket* accept();
/*
* ´ò¿ª¼àÌý
*
* @return ÊÇ·ñ³É¹¦
*/
bool listen();
private:
int _backLog; // backlog
};
}
#endif /*SERVERSOCKET_H_*/
|
#ifndef SCSI_TRANSPORT_SRP_H
#define SCSI_TRANSPORT_SRP_H
#include <linux/transport_class.h>
#include <linux/types.h>
#include <linux/mutex.h>
#define SRP_RPORT_ROLE_INITIATOR 0
#define SRP_RPORT_ROLE_TARGET 1
struct srp_rport_identifiers {
u8 port_id[16];
u8 roles;
};
struct srp_rport {
struct device dev;
u8 port_id[16];
u8 roles;
};
struct srp_function_template {
/* for target drivers */
int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
int (* it_nexus_response)(struct Scsi_Host *, u64, int);
};
extern struct scsi_transport_template *
srp_attach_transport(struct srp_function_template *);
extern void srp_release_transport(struct scsi_transport_template *);
extern struct srp_rport *srp_rport_add(struct Scsi_Host *,
struct srp_rport_identifiers *);
extern void srp_rport_del(struct srp_rport *);
extern void srp_remove_host(struct Scsi_Host *);
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2008 VIA Technologies, Inc.
* (Written by Aaron Lwe <aaron.lwe@gmail.com> for VIA)
*
* 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 <stdint.h>
#include <device/pci_def.h>
#include <device/pci_ids.h>
#include <arch/io.h>
#include <device/pnp_def.h>
#include <console/console.h>
#include <lib.h>
#include <northbridge/via/cn700/raminit.h>
#include <cpu/x86/bist.h>
#include <delay.h>
#include "southbridge/via/vt8237r/early_smbus.c"
#include "southbridge/via/vt8237r/early_serial.c"
#include <spd.h>
static inline int spd_read_byte(unsigned device, unsigned address)
{
return smbus_read_byte(device, address);
}
#include "northbridge/via/cn700/raminit.c"
static void enable_mainboard_devices(void)
{
device_t dev;
dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VT8237R_LPC), 0);
if (dev == PCI_DEV_INVALID)
die("Southbridge not found!!!\n");
/* bit=0 means enable function (per CX700 datasheet)
* 5 16.1 USB 2
* 4 16.0 USB 1
* 3 15.0 SATA and PATA
* 2 16.2 USB 3
* 1 16.4 USB EHCI
*/
pci_write_config8(dev, 0x50, 0x80);
/* bit=1 means enable internal function (per CX700 datasheet)
* 3 Internal RTC
* 2 Internal PS2 Mouse
* 1 Internal KBC Configuration
* 0 Internal Keyboard Controller
*/
pci_write_config8(dev, 0x51, 0x1d);
}
static const struct mem_controller ctrl = {
.d0f0 = 0x0000,
.d0f2 = 0x2000,
.d0f3 = 0x3000,
.d0f4 = 0x4000,
.d0f7 = 0x7000,
.d1f0 = 0x8000,
.channel0 = { DIMM0 },
};
#include <cpu/intel/romstage.h>
void main(unsigned long bist)
{
/* Enable multifunction for northbridge. */
pci_write_config8(ctrl.d0f0, 0x4f, 0x01);
enable_vt8237r_serial();
console_init();
enable_smbus();
smbus_fixup(&ctrl);
report_bist_failure(bist);
enable_mainboard_devices();
ddr_ram_setup(&ctrl);
}
|
/*
* This file Copyright (C) Mnemosyne LLC
*
* This file is licensed by the GPL version 2. Works owned by the
* Transmission project are granted a special exemption to clause 2 (b)
* so that the bulk of its code can remain under the MIT license.
* This exemption does not extend to derived works not owned by
* the Transmission project.
*
* $Id$
*/
#ifndef GTR_UTIL_H
#define GTR_UTIL_H
#include <sys/types.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libtransmission/transmission.h>
extern const int mem_K;
extern const char * mem_K_str;
extern const char * mem_M_str;
extern const char * mem_G_str;
extern const char * mem_T_str;
extern const int disk_K;
extern const char * disk_K_str;
extern const char * disk_M_str;
extern const char * disk_G_str;
extern const char * disk_T_str;
extern const int speed_K;
extern const char * speed_K_str;
extern const char * speed_M_str;
extern const char * speed_G_str;
extern const char * speed_T_str;
/* macro to shut up "unused parameter" warnings */
#ifndef UNUSED
#define UNUSED G_GNUC_UNUSED
#endif
enum
{
GTR_UNICODE_UP,
GTR_UNICODE_DOWN,
GTR_UNICODE_INF,
GTR_UNICODE_BULLET
};
const char * gtr_get_unicode_string (int);
/* return a percent formatted string of either x.xx, xx.x or xxx */
char* tr_strlpercent (char * buf, double x, size_t buflen);
/* return a human-readable string for the size given in bytes. */
char* tr_strlsize (char * buf, guint64 size, size_t buflen);
/* return a human-readable string for the given ratio. */
char* tr_strlratio (char * buf, double ratio, size_t buflen);
/* return a human-readable string for the time given in seconds. */
char* tr_strltime (char * buf, int secs, size_t buflen);
/***
****
***/
/* http://www.legaltorrents.com/some/announce/url --> legaltorrents.com */
void gtr_get_host_from_url (char * buf, size_t buflen, const char * url);
gboolean gtr_is_magnet_link (const char * str);
gboolean gtr_is_hex_hashcode (const char * str);
/***
****
***/
void gtr_open_uri (const char * uri);
void gtr_open_file (const char * path);
const char* gtr_get_help_uri (void);
/***
****
***/
/* backwards-compatible wrapper around gtk_widget_set_visible () */
void gtr_widget_set_visible (GtkWidget *, gboolean);
void gtr_dialog_set_content (GtkDialog * dialog, GtkWidget * content);
/***
****
***/
GtkWidget * gtr_priority_combo_new (void);
#define gtr_priority_combo_get_value(w) gtr_combo_box_get_active_enum (w)
#define gtr_priority_combo_set_value(w,val) gtr_combo_box_set_active_enum (w,val)
GtkWidget * gtr_combo_box_new_enum (const char * text_1, ...);
int gtr_combo_box_get_active_enum (GtkComboBox *);
void gtr_combo_box_set_active_enum (GtkComboBox *, int value);
/***
****
***/
void gtr_unrecognized_url_dialog (GtkWidget * parent, const char * url);
void gtr_http_failure_dialog (GtkWidget * parent, const char * url, long response_code);
void gtr_add_torrent_error_dialog (GtkWidget * window_or_child,
int err,
const char * filename);
/* pop up the context menu if a user right-clicks.
if the row they right-click on isn't selected, select it. */
gboolean on_tree_view_button_pressed (GtkWidget * view,
GdkEventButton * event,
gpointer unused);
/* if the click didn't specify a row, clear the selection */
gboolean on_tree_view_button_released (GtkWidget * view,
GdkEventButton * event,
gpointer unused);
/* move a file to the trashcan if GIO is available; otherwise, delete it */
int gtr_file_trash_or_remove (const char * filename);
void gtr_paste_clipboard_url_into_entry (GtkWidget * entry);
/* Only call gtk_label_set_text () if the new text differs from the old.
* This prevents the label from having to recalculate its size
* and prevents selected text in the label from being deselected */
void gtr_label_set_text (GtkLabel * lb, const char * text);
#endif /* GTR_UTIL_H */
|
/* $Id: capi.h,v 1.1.1.1 2010/03/11 21:10:39 kris Exp $
*
* CAPI 2.0 Interface for Linux
*
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#ifndef __LINUX_CAPI_H__
#define __LINUX_CAPI_H__
#include <asm/types.h>
#include <linux/ioctl.h>
#ifndef __KERNEL__
#include <linux/kernelcapi.h>
#endif
/*
* CAPI_REGISTER
*/
typedef struct capi_register_params { /* CAPI_REGISTER */
__u32 level3cnt; /* No. of simulatneous user data connections */
__u32 datablkcnt; /* No. of buffered data messages */
__u32 datablklen; /* Size of buffered data messages */
} capi_register_params;
#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
/*
* CAPI_GET_MANUFACTURER
*/
#define CAPI_MANUFACTURER_LEN 64
#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
/*
* CAPI_GET_VERSION
*/
typedef struct capi_version {
__u32 majorversion;
__u32 minorversion;
__u32 majormanuversion;
__u32 minormanuversion;
} capi_version;
#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
/*
* CAPI_GET_SERIAL
*/
#define CAPI_SERIAL_LEN 8
#define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
/*
* CAPI_GET_PROFILE
*/
typedef struct capi_profile {
__u16 ncontroller; /* number of installed controller */
__u16 nbchannel; /* number of B-Channels */
__u32 goptions; /* global options */
__u32 support1; /* B1 protocols support */
__u32 support2; /* B2 protocols support */
__u32 support3; /* B3 protocols support */
__u32 reserved[6]; /* reserved */
__u32 manu[5]; /* manufacturer specific information */
} capi_profile;
#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
typedef struct capi_manufacturer_cmd {
unsigned long cmd;
void __user *data;
} capi_manufacturer_cmd;
/*
* CAPI_MANUFACTURER_CMD
*/
#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
/*
* CAPI_GET_ERRCODE
* capi errcode is set, * if read, write, or ioctl returns EIO,
* ioctl returns errcode directly, and in arg, if != 0
*/
#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
/*
* CAPI_INSTALLED
*/
#define CAPI_INSTALLED _IOR('C',0x22, __u16)
/*
* member contr is input for
* CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
* and CAPI_GET_PROFILE
*/
typedef union capi_ioctl_struct {
__u32 contr;
capi_register_params rparams;
__u8 manufacturer[CAPI_MANUFACTURER_LEN];
capi_version version;
__u8 serial[CAPI_SERIAL_LEN];
capi_profile profile;
capi_manufacturer_cmd cmd;
__u16 errcode;
} capi_ioctl_struct;
/*
* Middleware extension
*/
#define CAPIFLAG_HIGHJACKING 0x0001
#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
#endif /* __LINUX_CAPI_H__ */
|
/***********************************************************************************
* *
* Voreen - The Volume Rendering Engine *
* *
* Copyright (C) 2005-2012 University of Muenster, Germany. *
* Visualization and Computer Graphics Group <http://viscg.uni-muenster.de> *
* For a list of authors please refer to the file "CREDITS.txt". *
* *
* This file is part of the Voreen software package. Voreen 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. *
* *
* Voreen 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 in the file *
* "LICENSE.txt" along with this file. If not, see <http://www.gnu.org/licenses/>. *
* *
* For non-commercial academic use see the license exception specified in the file *
* "LICENSE-academic.txt". To get information about commercial licensing please *
* contact the authors. *
* *
***********************************************************************************/
#ifndef VRN_CLOSINGBYRECONSTRUCTIONIMAGEFILTER_H
#define VRN_CLOSINGBYRECONSTRUCTIONIMAGEFILTER_H
#include "modules/itk/processors/itkprocessor.h"
#include "voreen/core/processors/volumeprocessor.h"
#include "voreen/core/ports/allports.h"
#include <string>
#include "voreen/core/properties/boolproperty.h"
#include "voreen/core/properties/optionproperty.h"
#include "voreen/core/properties/vectorproperty.h"
namespace voreen {
class VolumeBase;
class ClosingByReconstructionImageFilterITK : public ITKProcessor {
public:
ClosingByReconstructionImageFilterITK();
virtual Processor* create() const;
virtual std::string getCategory() const { return "Volume Processing/Filtering/MathematicalMorphology"; }
virtual std::string getClassName() const { return "ClosingByReconstructionImageFilterITK"; }
virtual CodeState getCodeState() const { return CODE_STATE_STABLE; }
protected:
virtual void setDescriptions() {
setDescription("<a href=\"http://www.itk.org/Doxygen/html/classitk_1_1ClosingByReconstructionImageFilter.html\">Go to ITK-Doxygen-Description</a>");
}
template<class T>
void closingByReconstructionImageFilterITK();
virtual void process();
private:
VolumePort inport1_;
VolumePort outport1_;
BoolProperty enableProcessing_;
StringOptionProperty structuringElement_;
StringOptionProperty shape_;
IntVec3Property radius_;
BoolProperty fullyConnected_;
BoolProperty preserveIntensities_;
static const std::string loggerCat_;
};
}
#endif
|
/*
Copyright (C) 2014, 2015 by Yu Gong
*/
#ifndef JULIA_R_H
#define JULIA_R_H
#ifdef __cplusplus
extern "C" {
#endif
#include <R.h>
#include <julia.h>
//Convert R Type To Julia,which not contain NA
SEXP R_Julia(SEXP Var, SEXP VarNam);
//Convert R Type To Julia,which contain NA
SEXP R_Julia_NA(SEXP Var, SEXP VarNam);
//Convert R Type To Julia,which contain NA
SEXP R_Julia_NA_Factor(SEXP Var, SEXP VarNam);
//Convert R data frame To Julia
SEXP R_Julia_NA_DataFrame(SEXP Var, SEXP VarNam);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007-2008 coresystems GmbH
* 2012 secunet Security Networks AG
*
* 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
*/
#ifndef NORTHBRIDGE_INTEL_I965_CHIP_H
#define NORTHBRIDGE_INTEL_I965_CHIP_H
struct northbridge_intel_i965_config {
int gpu_use_spread_spectrum_clock;
int gpu_lvds_dual_channel;
int gpu_link_frequency_270_mhz;
int gpu_lvds_num_lanes;
};
#endif /* NORTHBRIDGE_INTEL_I965_CHIP_H */
|
#ifndef __EDIV_QGRAPHICS_H_
#define __EDIV_QGRAPHICS_H_
#include "export.h"
/* Flags de modos de video */
#define _FULLSCREEN 0x01
typedef struct {
byte* buffer; // invisible buffer
byte* colormap; // 256 * VID_GRADES size
byte* alphamap; // 256 * 256 translucency map
int width;
int height;
int bpp;
int flags;
} viddef_t;
viddef_t vid;
#endif /* __EDIV_QGRAPHICS_H_ */
|
/**
* @file mqueue.h
*
* This file contains the definitions related to POSIX Message Queues.
*/
/*
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifndef _MQUEUE_H
#define _MQUEUE_H
#include <unistd.h>
#if defined(_POSIX_MESSAGE_PASSING)
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* 15.1.1 Data Structures, P1003.1b-1993, p. 271
*/
/**
* Message queue id type.
*
* @note Use uint32_t since all POSIX Ids are 32-bit currently.
*/
typedef uint32_t mqd_t;
/**
* This is the message queue attributes structure.
*/
struct mq_attr {
/** This is the message queue flags */
long mq_flags;
/** This is the maximum number of messages */
long mq_maxmsg;
/** This is the maximum message size */
long mq_msgsize;
/** This is the mumber of messages currently queued */
long mq_curmsgs;
};
/**
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
*/
mqd_t mq_open(
const char *name,
int oflag,
...
);
/**
* 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
*/
int mq_close(
mqd_t mqdes
);
/**
* 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
*/
int mq_unlink(
const char *name
);
/**
* 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
*
* @note P1003.4b/D8, p. 45 adds mq_timedsend().
*/
int mq_send(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio
);
#if defined(_POSIX_TIMEOUTS)
#include <time.h>
int mq_timedsend(
mqd_t mqdes,
const char *msg_ptr,
size_t msg_len,
unsigned int msg_prio,
const struct timespec *abstime
);
#endif /* _POSIX_TIMEOUTS */
/*
* 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
*
* NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
*/
ssize_t mq_receive(
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio
);
#if defined(_POSIX_TIMEOUTS)
ssize_t mq_timedreceive(
mqd_t mqdes,
char *msg_ptr,
size_t msg_len,
unsigned int *msg_prio,
const struct timespec *abstime
);
#endif /* _POSIX_TIMEOUTS */
#if defined(_POSIX_REALTIME_SIGNALS)
/*
* 15.2.6 Notify Process that a Message is Available on a Queue,
* P1003.1b-1993, p. 280
*/
int mq_notify(
mqd_t mqdes,
const struct sigevent *notification
);
#endif /* _POSIX_REALTIME_SIGNALS */
/*
* 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
*/
int mq_setattr(
mqd_t mqdes,
const struct mq_attr *mqstat,
struct mq_attr *omqstat
);
/*
* 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
*/
int mq_getattr(
mqd_t mqdes,
struct mq_attr *mqstat
);
#ifdef __cplusplus
}
#endif
#endif /* _POSIX_MESSAGE_PASSING */
#endif
/* end of include file */
|
/*
Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Mark Aylett <mark.aylett@gmail.com>
This file is part of Aug written by Mark Aylett.
Aug is released under the GPL with the additional exemption that compiling,
linking, and/or using OpenSSL is allowed.
Aug 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.
Aug 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 AUGUTIL_PWD_H
#define AUGUTIL_PWD_H
/**
* @file augutil/pwd.h
*
* Password functions.
*/
#include "augutil/md5.h"
#define AUG_MAXPASSWORD 128
typedef char aug_pwd_t[AUG_MAXPASSWORD + 1];
AUGUTIL_API char*
aug_getpass(const char* prompt, char* buf, size_t len);
AUGUTIL_API char*
aug_digestpass(const char* username, const char* realm,
const char* password, aug_md5base64_t base64);
#endif /* AUGUTIL_PWD_H */
|
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "pcm_volume.h"
#include "pcm_utils.h"
#include "audio_format.h"
#include <glib.h>
#include <stdint.h>
#include <string.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "pcm_volume"
static void
pcm_volume_change_8(int8_t *buffer, const int8_t *end, int volume)
{
while (buffer < end) {
int32_t sample = *buffer;
sample = (sample * volume + pcm_volume_dither() +
PCM_VOLUME_1 / 2)
/ PCM_VOLUME_1;
*buffer++ = pcm_range(sample, 8);
}
}
static void
pcm_volume_change_16(int16_t *buffer, const int16_t *end, int volume)
{
while (buffer < end) {
int32_t sample = *buffer;
sample = (sample * volume + pcm_volume_dither() +
PCM_VOLUME_1 / 2)
/ PCM_VOLUME_1;
*buffer++ = pcm_range(sample, 16);
}
}
#ifdef __i386__
/**
* Optimized volume function for i386. Use the EDX:EAX 2*32 bit
* multiplication result instead of emulating 64 bit multiplication.
*/
static inline int32_t
pcm_volume_sample_24(int32_t sample, int32_t volume, G_GNUC_UNUSED int32_t dither)
{
int32_t result;
asm(/* edx:eax = sample * volume */
"imul %2\n"
/* "add %3, %1\n" dithering disabled for now, because we
have no overflow check - is dithering really important
here? */
/* eax = edx:eax / PCM_VOLUME_1 */
"sal $22, %%edx\n"
"shr $10, %1\n"
"or %%edx, %1\n"
: "=a"(result)
: "0"(sample), "r"(volume) /* , "r"(dither) */
: "edx"
);
return result;
}
#endif
static void
pcm_volume_change_24(int32_t *buffer, const int32_t *end, int volume)
{
while (buffer < end) {
#ifdef __i386__
/* assembly version for i386 */
int32_t sample = *buffer;
sample = pcm_volume_sample_24(sample, volume,
pcm_volume_dither());
#else
/* portable version */
int64_t sample = *buffer;
sample = (sample * volume + pcm_volume_dither() +
PCM_VOLUME_1 / 2)
/ PCM_VOLUME_1;
#endif
*buffer++ = pcm_range(sample, 24);
}
}
static void
pcm_volume_change_32(int32_t *buffer, const int32_t *end, int volume)
{
while (buffer < end) {
#ifdef __i386__
/* assembly version for i386 */
int32_t sample = *buffer;
*buffer++ = pcm_volume_sample_24(sample, volume, 0);
#else
/* portable version */
int64_t sample = *buffer;
sample = (sample * volume + pcm_volume_dither() +
PCM_VOLUME_1 / 2)
/ PCM_VOLUME_1;
*buffer++ = pcm_range_64(sample, 32);
#endif
}
}
static void
pcm_volume_change_float(float *buffer, const float *end, float volume)
{
while (buffer < end) {
float sample = *buffer;
sample *= volume;
*buffer++ = sample;
}
}
bool
pcm_volume(void *buffer, size_t length,
enum sample_format format,
int volume)
{
if (volume == PCM_VOLUME_1)
return true;
if (volume <= 0) {
memset(buffer, 0, length);
return true;
}
const void *end = pcm_end_pointer(buffer, length);
switch (format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
/* not implemented */
return false;
case SAMPLE_FORMAT_S8:
pcm_volume_change_8(buffer, end, volume);
return true;
case SAMPLE_FORMAT_S16:
pcm_volume_change_16(buffer, end, volume);
return true;
case SAMPLE_FORMAT_S24_P32:
pcm_volume_change_24(buffer, end, volume);
return true;
case SAMPLE_FORMAT_S32:
pcm_volume_change_32(buffer, end, volume);
return true;
case SAMPLE_FORMAT_FLOAT:
pcm_volume_change_float(buffer, end,
pcm_volume_to_float(volume));
return true;
}
/* unreachable */
assert(false);
return false;
}
|
#include "capwap.h"
#include "capwap_element.h"
/********************************************************************
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Radio ID | MAC Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MAC Address | QoS Sub-Element... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved|8021p|RSV| DSCP Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type: 1043 for IEEE 802.11 Update Station QoS
Length: 14
********************************************************************/
/* */
static void capwap_80211_updatestationqos_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
int i;
struct capwap_80211_updatestationqos_element* element = (struct capwap_80211_updatestationqos_element*)data;
ASSERT(data != NULL);
func->write_u8(handle, element->radioid);
func->write_block(handle, element->address, MACADDRESS_EUI48_LENGTH);
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
func->write_u8(handle, element->qos[i].priority8021p & CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK);
func->write_u8(handle, element->qos[i].dscp & CAPWAP_UPDATE_STATION_QOS_DSCP_MASK);
}
}
/* */
static void* capwap_80211_updatestationqos_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
int i;
struct capwap_80211_updatestationqos_element* data;
ASSERT(handle != NULL);
ASSERT(func != NULL);
if (func->read_ready(handle) != 14) {
capwap_logging_debug("Invalid IEEE 802.11 Update Station QoS element");
return NULL;
}
/* */
data = (struct capwap_80211_updatestationqos_element*)capwap_alloc(sizeof(struct capwap_80211_updatestationqos_element));
memset(data, 0, sizeof(struct capwap_80211_updatestationqos_element));
/* Retrieve data */
func->read_u8(handle, &data->radioid);
func->read_block(handle, data->address, MACADDRESS_EUI48_LENGTH);
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
func->read_u8(handle, &data->qos[i].priority8021p);
data->qos[i].priority8021p &= CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK;
func->read_u8(handle, &data->qos[i].dscp);
data->qos[i].dscp &= CAPWAP_UPDATE_STATION_QOS_DSCP_MASK;
}
return data;
}
/* */
static void* capwap_80211_updatestationqos_element_clone(void* data) {
ASSERT(data != NULL);
return capwap_clone(data, sizeof(struct capwap_80211_updatestationqos_element));
}
/* */
static void capwap_80211_updatestationqos_element_free(void* data) {
ASSERT(data != NULL);
capwap_free(data);
}
/* */
struct capwap_message_elements_ops capwap_element_80211_updatestationqos_ops = {
.create_message_element = capwap_80211_updatestationqos_element_create,
.parsing_message_element = capwap_80211_updatestationqos_element_parsing,
.clone_message_element = capwap_80211_updatestationqos_element_clone,
.free_message_element = capwap_80211_updatestationqos_element_free
};
|
/*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* null audio source
*/
#include <inttypes.h>
#include <stdio.h>
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
#include "avfilter.h"
#include "internal.h"
static int request_frame(AVFilterLink *link)
{
return AVERROR_EOF;
}
static const AVFilterPad avfilter_asrc_anullsrc_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame,
},
{ NULL }
};
AVFilter avfilter_asrc_anullsrc = {
.name = "anullsrc",
.description = NULL_IF_CONFIG_SMALL("Null audio source, never return audio frames."),
.inputs = NULL,
.outputs = avfilter_asrc_anullsrc_outputs,
};
|
/* -*- c++ -*-
Kvalobs - Free Quality Control Software for Meteorological Observations
$Id: decodermgr.h,v 1.1.2.2 2007/09/27 09:02:27 paule Exp $
Copyright (C) 2007 met.no
Contact information:
Norwegian Meteorological Institute
Box 43 Blindern
0313 OSLO
NORWAY
email: kvalobs-dev@met.no
This file is part of KVALOBS
KVALOBS 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.
KVALOBS 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 KVALOBS; if not, write to the Free Software Foundation Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __dnmi_decoder_DecoderMgr_h__
#define __dnmi_decoder_DecoderMgr_h__
#include <list>
#include <string>
#include <kvdb/kvdb.h>
#include <fileutil/dso.h>
#include <decoderbase/decoder.h>
#include <kvalobs/kvTypes.h>
#include <boost/noncopyable.hpp>
#include <miconfparser/miconfparser.h>
/**
* \addtogroup kvdecoder
*
* @{
*/
extern "C" {
typedef kvalobs::decoder::DecoderBase*
(*decoderFactory)(dnmi::db::Connection &con_, const ParamList ¶ms,
const std::list<kvalobs::kvTypes> &typeList, int decoderId_,
const std::string &observationType_,
const std::string &observation_);
typedef void (*releaseDecoderFunc)(kvalobs::decoder::DecoderBase* decoder);
typedef std::list<std::string> (*getObsTypes)();
typedef std::list<std::string> (*getObsTypesExt)(
miutil::conf::ConfSection *theKvConf);
typedef void (*setKvConf)(kvalobs::decoder::DecoderBase* decoder,
miutil::conf::ConfSection *theKvConf);
}
namespace kvalobs {
namespace decoder {
/**
* \brief DecoderMgr is responsible for loading of decoders.
*/
class DecoderMgr {
struct DecoderItem : public boost::noncopyable {
decoderFactory factory;
releaseDecoderFunc releaseFunc;
setKvConf setConf;
dnmi::file::DSO *dso;
time_t modTime;
int decoderCount;
int decoderId;
std::list<std::string> obsTypes;
DecoderItem(decoderFactory factory_, releaseDecoderFunc releaseFunc_,
setKvConf setKvConf_, dnmi::file::DSO *dso_, time_t mTime)
: factory(factory_),
releaseFunc(releaseFunc_),
setConf(setKvConf_),
dso(dso_),
modTime(mTime),
decoderCount(0),
decoderId(-1) {
}
~DecoderItem() {
delete dso;
}
};
typedef std::list<DecoderItem*> DecoderList;
typedef std::list<DecoderItem*>::iterator IDecoderList;
typedef std::list<DecoderItem*>::const_iterator CIDecoderList;
DecoderList decoders;
std::string decoderPath;
std::string soVersion;
miutil::conf::ConfSection *theKvConf;
public:
DecoderMgr(const std::string &decoderPath_,
miutil::conf::ConfSection *theKvConf);
DecoderMgr()
: theKvConf(0) {
}
;
~DecoderMgr();
std::string fixDecoderName(const std::string &driver);
void setTheKvConf(miutil::conf::ConfSection *theKvConf);
void setDecoderPath(const std::string &decoderPath_);
/**
* returns true when all decoder has a decoderCount of 0.
*/
bool readyForUpdate();
void updateDecoders(miutil::conf::ConfSection *theKvConf);
void updateDecoders();
DecoderBase *findDecoder(dnmi::db::Connection &connection,
const ParamList ¶ms,
const std::list<kvalobs::kvTypes> &typeList,
const std::string &obsType, const std::string &obs,
std::string &errorMsg);
void releaseDecoder(DecoderBase *dec);
int numberOfDecoders() const {
return decoders.size();
}
void obsTypes(std::list<std::string> &list);
private:
void clearDecoders();
};
/** @} */
}
}
#endif
|
/**
* Copyright (C) 2008-2014, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/******************** (c) Marvell Semiconductor, Inc., 2001 *******************
*
* Purpose:
* This file contains the definitions of the fragment module
*
*****************************************************************************/
#ifndef __FRAGMENT_H__
#define __FRAGMENT_H__
#include "StaDb.h"
//=============================================================================
// INCLUDE FILES
//=============================================================================
//=============================================================================
// DEFINITIONS
//=============================================================================
//=============================================================================
// PUBLIC TYPE DEFINITIONS
//=============================================================================
//=============================================================================
// PUBLIC PROCEDURES (ANSI Prototypes)
//=============================================================================
extern struct sk_buff *DeFragPck(struct net_device *dev,struct sk_buff *skb, extStaDb_StaInfo_t **pStaInfo);
#endif/* __FRAGMENT_H__ */
|
/*
* Copyright (c) 1997 Enterprise Systems Management Corp.
*
* This file is part of UName*It.
*
* UName*It 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.
*
* UName*It 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 UName*It; see the file COPYING. If not, write to the Free
* Software Foundation, 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
/* $Id: transaction.h,v 1.13 1997/05/28 23:19:52 viktor Exp $ */
#ifndef _TRANSACTION_H
#define _TRANSACTION_H
#include <dbi.h>
#include <tcl.h>
typedef enum {NORESTORE, RESTOREDATA, RESTORESCHEMA} RestoreMode;
/*
* item_class NON-NULL iff template is for a 'unameit_item'
*/
extern DB_OBJECT *Udb_Finish_Object(
DB_OBJECT *item_class,
DB_OTMPL *template,
int item_deleted
);
extern RestoreMode Udb_Restore_Mode(RestoreMode *new);
extern Tcl_CmdProc Udb_Syscall;
extern Tcl_CmdProc Udb_Transaction;
extern Tcl_CmdProc Udb_Version;
extern Tcl_CmdProc Udb_Rollback;
extern Tcl_CmdProc Udb_Commit;
extern void Udb_OpenLog(const char *logPrefix);
extern void Udb_CloseLog(void);
extern void Udb_Force_Rollback(Tcl_Interp *interp);
extern int Udb_Do_Rollback(Tcl_Interp *interp);
extern int Udb_Do_Commit(Tcl_Interp *interp, const char *logEntry);
#endif
|
/////////////////////////////////////////////////////////////////////////////
// Name: imagpnm.h
// Purpose: wxImage PNM handler
// Author: Sylvain Bougnoux
// RCS-ID: $Id: imagpnm.h,v 1.1 1999/12/15 22:37:51 VS Exp $
// Copyright: (c) Sylvain Bougnoux
// Licence: wxWindows licence
// Modified by: Chris M. Christoudias
// read/write pnm image
/////////////////////////////////////////////////////////////////////////////
#ifndef _BG_IMAGPNM_H_
#define _BG_IMAGPNM_H_
#ifdef __GNUG__
#pragma interface "BgImagPNM.h"
#endif
#include <wx/image.h>
//-----------------------------------------------------------------------------
// bgPGMHandler
//-----------------------------------------------------------------------------
class bgPNMHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(bgPNMHandler)
public:
inline bgPNMHandler()
{
m_name = "PNM file";
m_extension = "pnm";
m_type = wxBITMAP_TYPE_PNM;
m_mime = "image/pnm";
};
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
void Skip_Comment(wxInputStream &stream);
};
#endif
|
/*
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
* s_misc.c: Yet another miscellaneous functions file.
*
* Copyright (C) 2002 by the past and present ircd coders, and others.
*
* 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: s_misc.c 33 2005-10-02 20:50:00Z knight $
*/
#include "stdinc.h"
#include "s_misc.h"
#include "client.h"
#include "common.h"
#include "irc_string.h"
#include "sprintf_irc.h"
#include "ircd.h"
#include "numeric.h"
#include "irc_res.h"
#include "fdlist.h"
#include "s_bsd.h"
#include "s_conf.h"
#include "s_serv.h"
#include "send.h"
#include "memory.h"
static const char *months[] =
{
"January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November","December"
};
static const char *weekdays[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
};
char *
date(time_t lclock)
{
static char buf[80], plus;
struct tm *lt, *gm;
struct tm gmbuf;
int minswest;
if (!lclock)
lclock = CurrentTime;
gm = gmtime(&lclock);
memcpy(&gmbuf, gm, sizeof(gmbuf));
gm = &gmbuf;
lt = localtime(&lclock);
/*
* There is unfortunately no clean portable way to extract time zone
* offset information, so do ugly things.
*/
minswest = (gm->tm_hour - lt->tm_hour) * 60 + (gm->tm_min - lt->tm_min);
if (lt->tm_yday != gm->tm_yday)
{
if ((lt->tm_yday > gm->tm_yday && lt->tm_year == gm->tm_year) ||
(lt->tm_yday < gm->tm_yday && lt->tm_year != gm->tm_year))
minswest -= 24 * 60;
else
minswest += 24 * 60;
}
plus = (minswest > 0) ? '-' : '+';
if (minswest < 0)
minswest = -minswest;
ircsprintf(buf, "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
plus, minswest/60, minswest%60);
return buf;
}
const char *
smalldate(time_t lclock)
{
static char buf[MAX_DATE_STRING];
struct tm *lt, *gm;
struct tm gmbuf;
if (!lclock)
lclock = CurrentTime;
gm = gmtime(&lclock);
memcpy(&gmbuf, gm, sizeof(gmbuf));
gm = &gmbuf;
lt = localtime(&lclock);
ircsprintf(buf, "%d/%d/%d %02d.%02d",
lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
lt->tm_hour, lt->tm_min);
return buf;
}
/* small_file_date()
* Make a small YYYYMMDD formatted string suitable for a
* dated file stamp.
*/
char *
small_file_date(time_t lclock)
{
static char timebuffer[MAX_DATE_STRING];
struct tm *tmptr;
if (!lclock)
time(&lclock);
tmptr = localtime(&lclock);
strftime(timebuffer, MAX_DATE_STRING, "%Y%m%d", tmptr);
return timebuffer;
}
#ifdef HAVE_LIBCRYPTO
char *
ssl_get_cipher(SSL *ssl)
{
static char buffer[128];
const char *name = NULL;
int bits;
switch (ssl->session->ssl_version)
{
case SSL2_VERSION:
name = "SSLv2";
break;
case SSL3_VERSION:
name = "SSLv3";
break;
case TLS1_VERSION:
name = "TLSv1";
break;
default:
name = "UNKNOWN";
}
SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits);
snprintf(buffer, sizeof(buffer), "%s %s-%d",
name, SSL_get_cipher(ssl), bits);
return buffer;
}
#endif
|
// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICEGRID_ADMINSESSIONI_H
#define ICEGRID_ADMINSESSIONI_H
#include <IceGrid/SessionI.h>
#include <IceGrid/Topics.h>
#include <IceGrid/ReapThread.h>
#include <IceGrid/Internal.h>
namespace IceGrid
{
class RegistryI;
typedef IceUtil::Handle<RegistryI> RegistryIPtr;
class FileIteratorI;
typedef IceUtil::Handle<FileIteratorI> FileIteratorIPtr;
class AdminSessionI : public BaseSessionI, public AdminSession
{
public:
AdminSessionI(const std::string&, const DatabasePtr&, int, const RegistryIPtr&);
virtual ~AdminSessionI();
Ice::ObjectPrx _register(const SessionServantManagerPtr&, const Ice::ConnectionPtr&);
virtual void keepAlive(const Ice::Current& current) { BaseSessionI::keepAlive(current); }
virtual AdminPrx getAdmin(const Ice::Current&) const;
virtual Ice::ObjectPrx getAdminCallbackTemplate(const Ice::Current&) const;
virtual void setObservers(const RegistryObserverPrx&, const NodeObserverPrx&, const ApplicationObserverPrx&,
const AdapterObserverPrx&, const ObjectObserverPrx&, const Ice::Current&);
virtual void setObserversByIdentity(const Ice::Identity&, const Ice::Identity&, const Ice::Identity&,
const Ice::Identity&, const Ice::Identity&, const Ice::Current&);
virtual int startUpdate(const Ice::Current&);
virtual void finishUpdate(const Ice::Current&);
virtual std::string getReplicaName(const Ice::Current&) const;
virtual FileIteratorPrx openServerLog(const std::string&, const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openServerStdOut(const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openServerStdErr(const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openNodeStdOut(const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openNodeStdErr(const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openRegistryStdOut(const std::string&, int, const Ice::Current&);
virtual FileIteratorPrx openRegistryStdErr(const std::string&, int, const Ice::Current&);
virtual void destroy(const Ice::Current&);
void removeFileIterator(const Ice::Identity&, const Ice::Current&);
private:
void setupObserverSubscription(TopicName, const Ice::ObjectPrx&, bool = false);
Ice::ObjectPrx addForwarder(const Ice::Identity&, const Ice::Current&);
Ice::ObjectPrx addForwarder(const Ice::ObjectPrx&);
FileIteratorPrx addFileIterator(const FileReaderPrx&, const std::string&, int, const Ice::Current&);
virtual void destroyImpl(bool);
const int _timeout;
const std::string _replicaName;
AdminPrx _admin;
std::map<TopicName, std::pair<Ice::ObjectPrx, bool> > _observers;
RegistryIPtr _registry;
Ice::ObjectPrx _adminCallbackTemplate;
};
typedef IceUtil::Handle<AdminSessionI> AdminSessionIPtr;
class AdminSessionFactory : public virtual IceUtil::Shared
{
public:
AdminSessionFactory(const SessionServantManagerPtr&, const DatabasePtr&, const ReapThreadPtr&, const RegistryIPtr&);
Glacier2::SessionPrx createGlacier2Session(const std::string&, const Glacier2::SessionControlPrx&);
AdminSessionIPtr createSessionServant(const std::string&);
const TraceLevelsPtr& getTraceLevels() const;
private:
const SessionServantManagerPtr _servantManager;
const DatabasePtr _database;
const int _timeout;
const ReapThreadPtr _reaper;
const RegistryIPtr _registry;
const bool _filters;
};
typedef IceUtil::Handle<AdminSessionFactory> AdminSessionFactoryPtr;
class AdminSessionManagerI : public virtual Glacier2::SessionManager
{
public:
AdminSessionManagerI(const AdminSessionFactoryPtr&);
virtual Glacier2::SessionPrx create(const std::string&, const Glacier2::SessionControlPrx&, const Ice::Current&);
private:
const AdminSessionFactoryPtr _factory;
};
class AdminSSLSessionManagerI : public virtual Glacier2::SSLSessionManager
{
public:
AdminSSLSessionManagerI(const AdminSessionFactoryPtr&);
virtual Glacier2::SessionPrx create(const Glacier2::SSLInfo&, const Glacier2::SessionControlPrx&,
const Ice::Current&);
private:
const AdminSessionFactoryPtr _factory;
};
class FileIteratorI : public FileIterator
{
public:
FileIteratorI(const AdminSessionIPtr&, const FileReaderPrx&, const std::string&, Ice::Long, int);
virtual bool read(int, Ice::StringSeq&, const Ice::Current&);
virtual void destroy(const Ice::Current&);
private:
const AdminSessionIPtr _session;
const FileReaderPrx _reader;
const std::string _filename;
Ice::Long _offset;
const int _messageSizeMax;
};
};
#endif
|
#ifndef __ANSI_H__
#define __ANSI_H__
#define STATE_ESC_SET 0x01
#define STATE_FONT_SET 0x02
#define STATE_NEW_LINE 0x04
#define STATE_QUOTE_LINE 0x08
#define STATE_NONE 0x00
#define STATE_UBB_START 0x10
#define STATE_UBB_MIDDLE 0x20
#define STATE_UBB_END 0x40
#define STATE_TEX_SET 0x80
enum UBBTYPE {UBB_TYPE_IMG,
UBB_TYPE_ITALICIZE,
UBB_TYPE_UNDERLINE,
UBB_TYPE_BOLD,
UBB_TYPE_FLY,
UBB_TYPE_RM,
UBB_TYPE_FLASH,
UBB_TYPE_CENTER,
UBB_TYPE_EMAIL,
UBB_TYPE_HTTPLINK,
UBB_TYPE_QUOTE,
UBB_TYPE_QUICKTIME,
UBB_TYPE_SHOCKWAVE,
UBB_TYPE_MOVE,
UBB_TYPE_GLOW,
UBB_TYPE_SHADOW,
UBB_TYPE_FACE,
UBB_TYPE_SOUND,
UBB_TYPE_ATTACH
};
enum ATTACHMENTTYPE {
ATTACH_IMG,
ATTACH_FLASH,
ATTACH_OTHERS
};
#define STATE_SET(s, b) ((s) |= (b))
#define STATE_CLR(s, b) ((s) &= ~(b))
#define STATE_ISSET(s, b) ((s) & (b))
#define STATE_ZERO(s) (s = 0)
#define STYLE_SET_FG(s, c) (s = (s & ~0x07) | (c & 0x07))
#define STYLE_SET_BG(s, c) (s = (s & ~0x70) | ((c & 0x07) << 4))
#define STYLE_GET_FG(s) (s & 0x0F)
#define STYLE_GET_BG(s) ((s & 0x70) >> 4)
#define STYLE_CLR_FG(s) (s &= ~0x0F)
#define STYLE_CLR_BG(s) (s &= ~0xF0)
#define STYLE_ZERO(s) (s = 0)
#define STYLE_SET(s, b) (s |= b)
#define STYLE_CLR(s, b) (s &= ~b)
#define STYLE_ISSET(s, b) (s & b)
#define FONT_STYLE_UL 0x0100
#define FONT_STYLE_BLINK 0x0200
#define FONT_STYLE_ITALIC 0x0400
#define FONT_FG_BOLD 0x08
#define FONT_COLOR_BLACK 0x00
#define FONT_COLOR_RED 0x01
#define FONT_COLOR_GREEN 0x02
#define FONT_COLOR_YELLOW 0x03
#define FONT_COLOR_BULE 0x04
#define FONT_COLOR_MAGENTA 0x05
#define FONT_COLOR_CYAN 0x06
#define FONT_COLOR_WHITE 0x07
//#define FONT_STYLE_QUOTE FONT_STYLE_ITALIC
#define FONT_STYLE_QUOTE 0x0000
#define FONT_COLOR_QUOTE FONT_COLOR_CYAN
#define FONT_BG_SET 0x80
#endif /* __ANSI_H__ */
|
/*
PHYML : a program that computes maximum likelihood phylogenies from
DNA or AA homologous sequences
Copyright (C) Stephane Guindon. Oct 2003 onward
All parts of the source except where indicated are distributed under
the GNU public licence. See http://www.opensource.org for details.
*/
#include <config.h>
#ifndef IO_H
#define IO_H
#include "utilities.h"
t_tree *Read_Tree(char **s_tree);
void R_rtree(char *s_tree_a,char *s_tree_d,t_node *a,t_tree *tree,int *n_int,int *n_ext);
void Read_Branch_Label(char *s_d,char *s_a,t_edge *b);
void Read_Branch_Length(char *s_d,char *s_a,t_tree *tree);
void Read_Node_Name(t_node *d,char *s_tree_d,t_tree *tree);
void Clean_Multifurcation(char **subtrees,int current_deg,int end_deg);
char **Sub_Trees(char *tree,int *degree);
int Next_Par(char *s,int pos);
void Print_Tree(FILE *fp,t_tree *tree);
char *Write_Tree(t_tree *tree,int custom);
void R_wtree(t_node *pere,t_node *fils,int *available,char **s_tree,t_tree *tree);
void R_wtree_Custom(t_node *pere,t_node *fils,int *available,char **s_tree,int *pos,t_tree *tree);
void Detect_Align_File_Format(option *io);
void Detect_Tree_File_Format(option *io);
align **Get_Seq(option *io);
void Get_Nexus_Data(FILE *fp,option *io);
int Get_Token(FILE *fp,char *token);
align **Get_Seq_Phylip(option *io);
void Read_Ntax_Len_Phylip(FILE *fp,int *n_otu,int *n_tax);
align **Read_Seq_Sequential(option *io);
align **Read_Seq_Interleaved(option *io);
int Read_One_Line_Seq(align ***data,int num_otu,FILE *in);
t_tree *Read_Tree_File(option *io);
char *Return_Tree_String_Phylip(FILE *fp_input_tree);
t_tree *Read_Tree_File_Phylip(FILE *fp_input_tree);
void Print_Site_Lk(t_tree *tree,FILE *fp);
void Print_Seq(FILE *fp, align **data, int n_otu);
void Print_CSeq(FILE *fp,int compressed,calign *cdata);
void Print_CSeq_Select(FILE *fp,int compressed,calign *cdata,t_tree *tree);
void Print_Dist(matrix *mat);
void Print_Node(t_node *a,t_node *d,t_tree *tree);
void Print_Model(t_mod *mod);
void Print_Mat(matrix *mat);
FILE *Openfile(char *filename,int mode);
void Print_Fp_Out(FILE *fp_out,time_t t_beg,time_t t_end,t_tree *tree,option *io,int n_data_set,int num_tree, int add_citation);
void Print_Fp_Out_Lines(FILE *fp_out,time_t t_beg,time_t t_end,t_tree *tree,option *io,int n_data_set);
void Print_Freq(t_tree *tree);
void Print_Settings(option *io);
void Print_Banner(FILE *fp);
void Print_Banner_Small(FILE *fp);
void Print_Data_Set_Number(option *io,FILE *fp);
void Print_Lk(t_tree *tree,char *string);
void Print_Pars(t_tree *tree);
void Print_Lk_And_Pars(t_tree *tree);
void Read_Qmat(phydbl *daa,phydbl *pi,FILE *fp);
void Print_Qmat_AA(phydbl *daa,phydbl *pi);
void Print_Square_Matrix_Generic(int n,phydbl *mat);
void Print_Diversity(FILE *fp,t_tree *tree);
void Print_Diversity_Pre(t_node *a,t_node *d,t_edge *b,FILE *fp,t_tree *tree);
t_tree *Read_User_Tree(calign *cdata,t_mod *mod,option *io);
void Print_Time_Info(time_t t_beg,time_t t_end);
void PhyML_Printf(char *format,...);
void PhyML_Fprintf(FILE *fp,char *format,...);
void Read_Clade_Priors(char *file_name,t_tree *tree);
option *Get_Input(int argc,char **argv);
void Print_Data_Structure(int final, FILE *fp, t_tree *root);
int Set_Whichmodel(int select);
void Print_Site(calign *cdata, int num, int n_otu, char *sep, int stepsize, FILE *fp);
option *PhyML_XML(char *xml_filename);
void Check_Taxa_Sets(t_tree *mixt_tree);
void Make_Ratematrice_From_XML_Node(xml_node *instance, option *io, t_mod *mod);
void Make_Efrq_From_XML_Node(xml_node *instance, option *io, t_mod *mod);
void Make_Topology_From_XML_Node(xml_node *instance, option *io, t_mod *mod);
void Make_RAS_From_XML_Node(xml_node *parent, t_mod *mod);
void Post_Process_Data(option *io);
int *Return_Int(int in);
void Print_All_Edge_PMats(t_tree* tree);
void Print_All_Edge_Likelihoods(t_tree* tree);
void Print_Edge_Likelihoods(t_tree* tree, t_edge* b, bool scientific);
void Print_Edge_PMats(t_tree* tree, t_edge* b);
void Print_Tip_Partials(t_tree* tree, t_node* d);
void Dump_Arr_D(phydbl* arr, int num);
void Dump_Arr_S(short int* arr, int num);
void Dump_Arr_I(int* arr, int num);
void Print_Tree_Structure(t_tree* tree);
void Print_Node_Brief(t_node *a, t_node *d, t_tree *tree, FILE *fp);
void Generic_Exit(const char *file, int line, const char *function);
#endif
|
/*
* Copyright (C) 2016, 2017 by Rafael Santiago
*
* This is a free software. You can redistribute it and/or modify under
* the terms of the GNU General Public License version 2.
*
*/
#include <cpu/itp/itp0.h>
#include <ctx/ctx.h>
#include <vid/vid.h>
unsigned short itp0_gate(const unsigned short nnn, struct cp8_ctx *cp8) {
unsigned short next = 2;
switch (nnn) {
case 0x00e0:
// INFO(Rafael): CLS
cp8_vidcls();
break;
case 0x00ee:
// INFO(Rafael): RET
cp8->pc = cp8_pop(cp8);
break;
default:
// INFO(Rafael): SYS addr is a pretty old stuff and should be ignored.
break;
}
return (cp8->pc + next);
}
|
/**
* \file ApplyMaskImageFilterParallel.h
* \brief Definition of the thelib::ApplyMaskImageFilterParallel class.
*/
#ifndef THELIB_APPLYMASKIMAGEFILTERPARALLEL_H
#define THELIB_APPLYMASKIMAGEFILTERPARALLEL_H
// ITK
#include <itkImageToImageFilter.h>
// namespace
namespace thelib
{
/**
* \brief Mask an input image (input 0) using a mask image (input 1) (parrallel).
* \ingroup TheLib
*/
template< class T >
class ApplyMaskImageFilterParallel : public itk::ImageToImageFilter<T,T>
{
public:
//! Standard class typedefs.
typedef ApplyMaskImageFilterParallel Self;
typedef itk::ImageToImageFilter<T,T> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
//! Method for creation through the object factory.
itkNewMacro(Self);
//! Run-time type information (and related methods).
itkTypeMacro(ApplyMaskImageFilter, ImageToImageFilter);
//! Set the invert flag.
itkSetMacro(InvertMask, bool);
//! Get the invert flag.
itkGetConstMacro(InvertMask, bool);
/**
* Print information about this class.
* \param os The stream to output to.
* \param indent The indent to apply to the output.
*/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
protected:
//! Constructor: protect from instantiation.
ApplyMaskImageFilterParallel();
//! Destructor: protect from instantiation.
~ApplyMaskImageFilterParallel();
/**
* Main method.
* \param outputRegionForThread Image region to apply the filter to.
* \param threadId The thread identifier.
*/
void ThreadedGenerateData(
const typename itk::ImageSource<T>::OutputImageRegionType& outputRegionForThread,
itk::ThreadIdType threadId);
private:
//! Copy constructor: purposely not implemented.
ApplyMaskImageFilterParallel( const Self& filter);
//! Assignement operator: purposely not implemented.
void operator=( const Self& filter);
//! Flag to invert the mask or not
bool m_InvertMask;
}; // class ApplyMaskImageFilterParallel
} // namespace thelib
#endif //THELIB_APPLYMASKIMAGEFILTERPARALLEL_H
|
#include<stdio.h>
int main()
{
int *p,i;
int a[10]={12,23,56,1,65,67,87,34,6,23};
p=a;
for(i=0;i<10;i++)
{
printf("%d ",(p+i));
}
return 0;
}
|
#ifndef TPPROTO_COMMANDPARAMETER_H
#define TPPROTO_COMMANDPARAMETER_H
/* CommandParameter Classes
*
* Copyright (C) 2008 Aaron Mavrinac and the Thousand Parsec Project
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*! \file
\brief Declares CommandParameter classes and the CommandParamType enum.
*/
#include <string>
#include <stdint.h>
namespace TPProto{
enum CommandParamType{
cpT_Invalid = -1,
cpT_String = 0,
cpT_Integer = 1,
cpT_Max
};
class Buffer;
/*! \brief Baseclass for holding a parameter for a Command.
*/
class CommandParameter{
public:
CommandParameter();
CommandParameter(const CommandParameter &rhs);
virtual ~CommandParameter();
virtual void packBuffer(Buffer* buf) = 0;
virtual bool unpackBuffer(Buffer* buf) = 0;
virtual CommandParameter* clone() = 0;
virtual bool setValueFromString(const std::string &nval) = 0;
std::string getName();
std::string getDescription();
void setName(const std::string &nn);
void setDescription(const std::string &nd);
private:
std::string name;
std::string description;
};
/*! \brief Holds a string CommandParameter.
*/
class StringCommandParameter : public CommandParameter{
public:
StringCommandParameter();
StringCommandParameter(const StringCommandParameter &rhs);
~StringCommandParameter();
void packBuffer(Buffer* buf);
bool unpackBuffer(Buffer* buf);
CommandParameter* clone();
bool setValueFromString(const std::string &nval);
unsigned int getMaxLength();
std::string getString();
void setString(const std::string &nval);
private:
unsigned int maxlength;
std::string value;
};
/*! \brief A CommandParameter that holds an integer.
*/
class IntegerCommandParameter : public CommandParameter{
public:
IntegerCommandParameter();
IntegerCommandParameter(const IntegerCommandParameter &rhs);
~IntegerCommandParameter();
void packBuffer(Buffer* buf);
bool unpackBuffer(Buffer* buf);
CommandParameter* clone();
bool setValueFromString(const std::string &nval);
uint32_t getValue() const;
void setValue(uint32_t nval);
private:
uint32_t value;
};
}
#endif
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2.
*
* 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.
*
* Test that the file is open for read acces when the applications specify
* the value of O_RDWR.
*
* Step:
* 1. Create a file a shared memory object using shm_open().
* 2. Write in the file referenced by the file descriptor return by
* shm_open().
* 3. Reopen the file with shm_open() and O_RDWR set.
* 4. Read in the file.
* The test pass if it read what it was previously written.
*/
/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
avoid warning if the implementation does not program ftruncate as a base
interface */
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include "posixtest.h"
#define BUF_SIZE 8
#define SHM_NAME "posixtest_14-2"
int main() {
int fd;
char str[BUF_SIZE] = "qwerty";
char *buf;
fd = shm_open(SHM_NAME, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
if (fd == -1) {
perror("An error occurs when calling shm_open()");
return PTS_UNRESOLVED;
}
if (ftruncate(fd, BUF_SIZE) != 0) {
perror("An error occurs when calling ftruncate()");
return PTS_UNRESOLVED;
}
buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0);
if (buf == MAP_FAILED) {
perror("An error occurs when calling mmap()");
return PTS_UNRESOLVED;
}
strcpy(buf, str);
fd = shm_open(SHM_NAME, O_RDWR, S_IRUSR|S_IWUSR);
if (fd == -1) {
perror("An error occurs when calling shm_open()");
return PTS_UNRESOLVED;
}
buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
if (buf == MAP_FAILED) {
perror("An error occurs when calling mmap()");
return PTS_UNRESOLVED;
}
shm_unlink(SHM_NAME);
if (strcmp(buf, str) == 0) {
printf("Test PASSED\n");
return PTS_PASS;
}
printf("Test FAILED\n");
return PTS_FAIL;
}
|
/* OS134, Copyright (C) 2005, Benjamin Stein, Jaap Weel, Ting Liao --
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 */
/*
* Loader. loads an a.out into the memory.
*/
/* The starting address for the text (code) section - 64K of code. */
#define I_ADDRESS 0x600000
/* The starting address for the data section - 64K of data. */
#define D_ADDRESS 0x800000
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef struct {
uint16_t magic __PACKED__; /* Magic number. */
uint16_t version __PACKED__; /* Version number. */
uint32_t code_size __PACKED__; /* Text segment size. */
uint32_t data_size __PACKED__; /* Initialized data size. */
uint32_t bss_size __PACKED__; /* Uninitialized data size. */
uint32_t syms_size __PACKED__;
uint32_t entry __PACKED__;
uint32_t code_offset __PACKED__;
uint32_t data_offset __PACKED__;
} aout_head_t; /* 28 bytes */
/*
* Since the OS does not have File I/O code yet, we need an image
* pointer that points to the file I have not figured out a way to do
* that yet, one reason is that we have no file system in the OS yet.
*/
/*
* Entry is the entry point of the program.
*/
int load_aout(char *filename, unsigned char *image, unsigned *entry)
{
/*
* Load the a.out format file filename.
*
* Read the text segment from the file to I_ADDRESS.
*
* Read the data segment from the file to D_ADDRESS. Zero out the BSS segment.
*
* Create and map in a stack segment (usually separate from the data
* segment, since the data heap and stack grow separately.) Place
* arguments from the command line or calling program on the stack.
*
* Set registers appropriately and jump to the starting address.
*/
aout_head_t *aout;
/* Validate headers. */
aout = (aout_head_t *) image;
image += sizeof(aout_head_t); /* Move to the code section. */
/* Get entry point. */
(*entry) = aout->entry;
/* Load text to I_ADDRESS.
*
* Copy aout->code_size bytes of code starting at image +
* code_offset to I_ADDRESS. */
image += aout->code_size;
/* Load DATA to D_ADDRESS.
*
* Copy aout->data_size bytes of code starting at image +
* data_offset to D_ADDRESS. */
image += aout->data_size;
/* Set uninitialized data to 0. */
/* Copy bss_size bytes of 0 starting at D_ADDRESS + aout->data_size. */
}
|
//
// SLFSettingsViewController.h
// Selfy
//
// Created by MadArkitekt on 4/30/14.
// Copyright (c) 2014 Ed Salter. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SLFSettingsViewController : UIViewController
@end
|
/*
* Copyright (C) 2010 Xavier Claessens <xclaesse@gmail.com>
* Copyright (C) 2010 Collabora Ltd.
*
* 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
*/
#include "config.h"
#include <stdlib.h>
#include <gio/gio.h>
#include <telepathy-glib/telepathy-glib.h>
static GMainLoop *loop = NULL;
static GList *channel_list = NULL;
static void
channel_invalidated_cb (TpChannel *channel,
guint domain,
gint code,
gchar *message,
gpointer user_data)
{
channel_list = g_list_remove (channel_list, channel);
g_object_unref (channel);
if (channel_list == NULL)
g_main_loop_quit (loop);
}
static void
session_complete (TpChannel *channel, const GError *error)
{
if (error != NULL)
{
g_debug ("Error for channel %p: %s", channel,
error ? error->message : "No error message");
}
tp_channel_close_async (channel, NULL, NULL);
}
static void
splice_cb (GObject *source_object,
GAsyncResult *res,
gpointer channel)
{
GError *error = NULL;
g_io_stream_splice_finish (res, &error);
session_complete (channel, error);
g_clear_error (&error);
}
static void
accept_tube_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
TpChannel *channel = TP_CHANNEL (object);
TpStreamTubeConnection *stc;
GInetAddress *inet_address = NULL;
GSocketAddress *socket_address = NULL;
GSocket *socket = NULL;
GSocketConnection *tube_connection = NULL;
GSocketConnection *sshd_connection = NULL;
GError *error = NULL;
stc = tp_stream_tube_channel_accept_finish (TP_STREAM_TUBE_CHANNEL (channel),
res, &error);
if (stc == NULL)
goto OUT;
tube_connection = tp_stream_tube_connection_get_socket_connection (stc);
/* Connect to the sshd */
inet_address = g_inet_address_new_loopback (G_SOCKET_FAMILY_IPV4);
socket_address = g_inet_socket_address_new (inet_address, 22);
socket = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_STREAM,
G_SOCKET_PROTOCOL_DEFAULT, &error);
if (socket == NULL)
goto OUT;
if (!g_socket_connect (socket, socket_address, NULL, &error))
goto OUT;
sshd_connection = g_socket_connection_factory_create_connection (socket);
/* Splice tube and ssh connections */
g_io_stream_splice_async (G_IO_STREAM (tube_connection),
G_IO_STREAM (sshd_connection), G_IO_STREAM_SPLICE_NONE,
G_PRIORITY_DEFAULT, NULL, splice_cb, channel);
OUT:
if (error != NULL)
session_complete (channel, error);
tp_clear_object (&stc);
tp_clear_object (&inet_address);
tp_clear_object (&socket_address);
tp_clear_object (&socket);
tp_clear_object (&sshd_connection);
g_clear_error (&error);
}
static void
got_channel_cb (TpSimpleHandler *handler,
TpAccount *account,
TpConnection *connection,
GList *channels,
GList *requests_satisfied,
gint64 user_action_time,
TpHandleChannelsContext *context,
gpointer user_data)
{
GList *l;
for (l = channels; l != NULL; l = l->next)
{
if (TP_IS_STREAM_TUBE_CHANNEL (l->data))
{
TpStreamTubeChannel *channel = l->data;
channel_list = g_list_prepend (channel_list, g_object_ref (channel));
g_signal_connect (channel, "invalidated",
G_CALLBACK (channel_invalidated_cb), NULL);
tp_stream_tube_channel_accept_async (channel, accept_tube_cb, NULL);
}
}
tp_handle_channels_context_accept (context);
}
int
main (gint argc, gchar *argv[])
{
TpDBusDaemon *dbus = NULL;
TpSimpleClientFactory *factory = NULL;
TpBaseClient *client = NULL;
gboolean success = TRUE;
GError *error = NULL;
g_type_init ();
tp_debug_set_flags (g_getenv ("SSH_CONTACT_DEBUG"));
dbus = tp_dbus_daemon_dup (&error);
if (dbus == NULL)
goto OUT;
factory = (TpSimpleClientFactory *) tp_automatic_client_factory_new (dbus);
client = tp_simple_handler_new_with_factory (factory, FALSE, FALSE,
"SSHContact", FALSE, got_channel_cb, NULL, NULL);
tp_base_client_take_handler_filter (client, tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TP_IFACE_CHANNEL_TYPE_STREAM_TUBE,
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
TP_HANDLE_TYPE_CONTACT,
TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, G_TYPE_STRING,
TUBE_SERVICE,
TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN,
FALSE,
NULL));
if (!tp_base_client_register (client, &error))
goto OUT;
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
OUT:
if (error != NULL)
{
g_debug ("Error: %s", error->message);
success = FALSE;
}
tp_clear_pointer (&loop, g_main_loop_unref);
tp_clear_object (&dbus);
tp_clear_object (&factory);
tp_clear_object (&client);
g_clear_error (&error);
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
/*
This file is part of t8code.
t8code is a C library to manage a collection (a forest) of multiple
connected adaptive space-trees of general element classes in parallel.
Copyright (C) 2015 the developers
t8code 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.
t8code 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 t8code; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/** \file t8_cmesh_readmshfile.h
* We define function here that serve to open a mesh file generated by
* GMSH and consructing a cmesh from it.
*/
#ifndef T8_CMESH_READMSHFILE_H
#define T8_CMESH_READMSHFILE_H
#include <t8.h>
#include <t8_eclass.h>
#include <t8_cmesh.h>
/* The maximum supported .msh file version.
* Currently, we support gmsh's file version 2 in ASCII format.
*/
#define T8_CMESH_SUPPORTED_FILE_VERSION 2
/* put typedefs here */
T8_EXTERN_C_BEGIN ();
/* put declarations here */
/** Read a .msh file and create a cmesh from it.
* \param [in] fileprefix The prefix of the mesh file.
* The file fileprefix.msh is read.
* \param [in] partition If true the file is only opened on one process
* specified by the \a master argument and saved as
* a partitioned cmesh where each other process does not
* have any trees.
* \param [in] comm The MPI communicator with which the cmesh is to be committed.
* \param [in] dim The dimension to read from the .msh files. The .msh format
* can store several dimensions of the mesh and therefore the
* dimension to read has to be set manually.
* \param [in] master If partition is true, a valid MPI rank that will
* read the file and store all the trees alone.
* \return A committed cmesh holding the mesh of dimension \a dim in the
* specified .msh file.
*/
t8_cmesh_t
t8_cmesh_from_msh_file (const char *fileprefix, int partition,
sc_MPI_Comm comm, int dim, int master);
T8_EXTERN_C_END ();
#endif /* !T8_CMESH_READMSHFILE_H */
|
/*
* ecgen, tool for generating Elliptic curve domain parameters
* Copyright (C) 2017-2018 J08nY
*/
#include "hex.h"
#include "exhaustive/arg.h"
#include "field.h"
#include "util/bits.h"
#include "util/memory.h"
#include "util/str.h"
static char *hex_point(point_t *point) {
GEN fx = field_elementi(gel(point->point, 1));
GEN fy = field_elementi(gel(point->point, 2));
char *fxs = pari_sprintf("%P0#*x", cfg->hex_digits, fx);
char *fxy = pari_sprintf("%P0#*x", cfg->hex_digits, fy);
char *result = str_joinv(",", fxs, fxy, NULL);
pari_free(fxs);
pari_free(fxy);
return result;
}
static char *hex_points(point_t *points[], size_t len) {
char *p[len];
for (size_t i = 0; i < len; ++i) {
point_t *pt = points[i];
p[i] = hex_point(pt);
}
size_t total = 1;
for (size_t i = 0; i < len; ++i) {
total += strlen(p[i]);
}
char *result = try_calloc(total);
for (size_t i = 0; i < len; ++i) {
strcat(result, p[i]);
try_free(p[i]);
}
return result;
}
CHECK(hex_check_param) {
HAS_ARG(args);
char *search_hex = try_strdup(args->args);
char *p = search_hex;
for (; *p; ++p) *p = (char)tolower(*p);
char *params[OFFSET_END] = {NULL};
bool pari[OFFSET_END] = {false};
if (state >= OFFSET_SEED) {
if (curve->seed && curve->seed->seed) {
params[OFFSET_SEED] = bits_to_hex(curve->seed->seed);
}
}
if (state >= OFFSET_FIELD) {
if (cfg->field == FIELD_PRIME) {
params[OFFSET_FIELD] =
pari_sprintf("%P0#*x", cfg->hex_digits, curve->field);
pari[OFFSET_FIELD] = true;
} else if (cfg->field == FIELD_BINARY) {
}
}
if (state >= OFFSET_A) {
params[OFFSET_A] =
pari_sprintf("%P0#*x", cfg->hex_digits, field_elementi(curve->a));
pari[OFFSET_A] = true;
}
if (state >= OFFSET_B) {
params[OFFSET_B] =
pari_sprintf("%P0#*x", cfg->hex_digits, field_elementi(curve->b));
pari[OFFSET_B] = true;
}
if (state >= OFFSET_ORDER) {
params[OFFSET_ORDER] =
pari_sprintf("%P0#*x", cfg->hex_digits, curve->order);
pari[OFFSET_ORDER] = true;
}
if (state >= OFFSET_GENERATORS) {
char *subgroups[curve->ngens];
for (size_t i = 0; i < curve->ngens; ++i) {
subgroups[i] = hex_point(curve->generators[i]->generator);
}
params[OFFSET_GENERATORS] = str_join(",", subgroups, curve->ngens);
for (size_t i = 0; i < curve->ngens; ++i) {
try_free(subgroups[i]);
}
}
if (state >= OFFSET_POINTS) {
char *subgroups[curve->ngens];
for (size_t i = 0; i < curve->ngens; ++i) {
subgroups[i] = hex_points(curve->generators[i]->points,
curve->generators[i]->npoints);
}
params[OFFSET_POINTS] = str_join(",", subgroups, curve->ngens);
for (size_t i = 0; i < curve->ngens; ++i) {
try_free(subgroups[i]);
}
}
int result = OFFSET_FIELD - state;
for (offset_e i = OFFSET_SEED; i < OFFSET_END; ++i) {
if (params[i]) {
if (result != 1 && strstr(params[i], search_hex)) {
result = 1;
}
if (pari[i]) {
pari_free(params[i]);
} else {
try_free(params[i]);
}
}
}
try_free(search_hex);
return result;
}
|
#ifndef _UMLNCRELATION_H
#define _UMLNCRELATION_H
#include "UmlBaseNcRelation.h"
#include <qcstring.h>
//This class manages 'relations' between non class objects
//
// You can modify it as you want (except the constructor)
class UmlNcRelation : public UmlBaseNcRelation {
public:
UmlNcRelation(void * id, const QCString & n) : UmlBaseNcRelation(id, n) {};
virtual int orderWeight();
};
#endif
|
// This file is part of fityk program. Copyright 2001-2013 Marcin Wojdyr
// Licence: GNU General Public License ver. 2+
/// wrapper around MPFIT (cmpfit) library,
/// http://www.physics.wisc.edu/~craigm/idl/cmpfit.html
/// which is Levenberg-Marquardt implementation based on MINPACK-1
#ifndef FITYK_MPFIT_H_
#define FITYK_MPFIT_H_
#include "fit.h"
#include "cmpfit/mpfit.h"
namespace fityk {
/// Wrapper around CMPFIT
class MPfit : public Fit
{
public:
MPfit(Full* F, const char* fname) : Fit(F, fname) {}
virtual double run_method(std::vector<realt>* best_a);
// implementation (must be public to be called inside callback function)
int calculate(int m, int npar, double *par, double *deviates,
double **derivs);
int on_iteration();
virtual std::vector<double>
get_covariance_matrix(const std::vector<Data*>& datas);
virtual std::vector<double>
get_standard_errors(const std::vector<Data*>& datas);
private:
mp_config_struct mp_conf_;
mp_result result_;
int run_mpfit(const std::vector<Data*>& datas,
const std::vector<realt>& parameters,
const std::vector<bool>& param_usage,
double *final_a=NULL);
};
} // namespace fityk
#endif
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// prototypes declarations
char** split(char *str, char *delimitators);
int main(void)
{
char** result;
char str[] = "1-0:0.0.1(132412515)\n1-0:0.2.3.4(654236517)\n";
result = split(str, "()\n");
for(size_t index = 0; *(result + index); index++)
{
printf("%s\n",*(result + index));
}
free(result);
return 0;
}
char** split(char *str, char* delimitators)
{
int count = 0;
size_t index = 0;
char **parse;
char *tmp = str;
char *token;
char *last_delimitator;
while(*tmp)
{
/******************************************
si *tmp contiene uno de los deliitadores
strchr devolvera la direcccion de este sino
devolvera una direccion nula
*******************************************/
if(strchr(delimitators, *tmp) != NULL)
{
count++;
last_delimitator = tmp;
}
tmp++;
}
//Espacio para datos ubicados luego del ultimo delimitador
count += last_delimitator < (str + strlen(str) - 1);
//Espacio para el caracter nulo del arreglo de punteros
count++;
parse = malloc(sizeof(char*) * count);
token = strtok(str, delimitators);
while(token != NULL)
{
*(parse + index++) = token;
token = strtok(NULL, delimitators);
}
*(parse + index) = 0;
return parse;
}
|
/******************************************************************************\
CAMotics is an Open-Source simulation and CAM software.
Copyright (C) 2011-2019 Joseph Coffland <joseph@cauldrondevelopment.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
\******************************************************************************/
#pragma once
#include <cbang/SmartPointer.h>
#include <QDialog>
namespace Ui {class DonateDialog;}
namespace CAMotics {
class DonateDialog : public QDialog {
Q_OBJECT;
cb::SmartPointer<Ui::DonateDialog> ui;
public:
DonateDialog(QWidget *parent);
QString getVersion() const;
void onStartup();
// From QDialog
int exec();
// From QWidget
void showEvent(QShowEvent *event);
};
}
|
#include<stdio.h>
int main()
{
double r,pi=3.14159;
scanf("%lf",&r);
printf("A=%.4lf\n",pi*r*r);
return 0;
}
|
/*
Copyright (C) 2015 Panagiotis Roubatsis
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.
*/
/*
Created by Panagiotis Roubatsis
Description: Load and apply GLSL shaders
to irrlicht nodes.
*/
#ifndef GLSL_SHADER_H
#define GLSL_SHADER_H
#include "Shader.h"
#include <iostream>
#include <irrlicht.h>
class GlslShader : public Shader
{
private:
irr::video::E_MATERIAL_TYPE _materialType;
bool _isLoaded;
public:
GlslShader();
GlslShader(std::string fileName, irr::video::IGPUProgrammingServices* gpu, int type);
void load(std::string fileName, irr::video::IGPUProgrammingServices* gpu, int type);
void apply(irr::scene::ISceneNode* node);
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.