text
stringlengths 4
6.14k
|
|---|
/* -*- mode: c; c-file-style: "bsd"; -*- */
/*
Copyright (C) 2001-2003 Paul Davis
Copyright (C) 2005 Jussi Laako
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <string.h>
#include <sys/types.h>
#include <sys/mman.h>
#include "internal.h"
#include "engine.h"
#include <jack/jack.h>
#include <sysdeps/time.h>
#include <sysdeps/cycles.h>
#include "local.h"
const char*
jack_clock_source_name (jack_timer_type_t src)
{
switch (src) {
case JACK_TIMER_HPET:
return "hpet";
case JACK_TIMER_SYSTEM_CLOCK:
#ifdef HAVE_CLOCK_GETTIME
return "system clock via clock_gettime";
#else
return "system clock via gettimeofday";
#endif
}
/* what is wrong with gcc ? */
return "unknown";
}
#ifndef HAVE_CLOCK_GETTIME
jack_time_t
jack_get_microseconds_from_system (void) {
jack_time_t jackTime;
struct timeval tv;
gettimeofday (&tv, NULL);
jackTime = (jack_time_t) tv.tv_sec * 1000000 + (jack_time_t) tv.tv_usec;
return jackTime;
}
#else
jack_time_t
jack_get_microseconds_from_system (void) {
jack_time_t jackTime;
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
jackTime = (jack_time_t) time.tv_sec * 1e6 +
(jack_time_t) time.tv_nsec / 1e3;
return jackTime;
}
#endif /* HAVE_CLOCK_GETTIME */
/* everything below here should be system-dependent */
#include <sysdeps/time.c>
|
#ifndef INKSCAPE_MEDIA_H
#define INKSCAPE_MEDIA_H
class Media {
public:
bool print;
bool screen;
};
void media_clear_all(Media &);
void media_set_all(Media &);
#endif /* !INKSCAPE_MEDIA_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
|
/*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __IDIRECTFB_DISPATCHER_H__
#define __IDIRECTFB_DISPATCHER_H__
#include <directfb.h>
#define IDIRECTFB_METHOD_ID_AddRef 1
#define IDIRECTFB_METHOD_ID_Release 2
#define IDIRECTFB_METHOD_ID_SetCooperativeLevel 3
#define IDIRECTFB_METHOD_ID_GetDeviceDescription 4
#define IDIRECTFB_METHOD_ID_EnumVideoModes 5
#define IDIRECTFB_METHOD_ID_SetVideoMode 6
#define IDIRECTFB_METHOD_ID_CreateSurface 7
#define IDIRECTFB_METHOD_ID_CreatePalette 8
#define IDIRECTFB_METHOD_ID_EnumScreens 9
#define IDIRECTFB_METHOD_ID_GetScreen 10
#define IDIRECTFB_METHOD_ID_EnumDisplayLayers 11
#define IDIRECTFB_METHOD_ID_GetDisplayLayer 12
#define IDIRECTFB_METHOD_ID_EnumInputDevices 13
#define IDIRECTFB_METHOD_ID_GetInputDevice 14
#define IDIRECTFB_METHOD_ID_CreateEventBuffer 15
#define IDIRECTFB_METHOD_ID_CreateInputEventBuffer 16
#define IDIRECTFB_METHOD_ID_CreateImageProvider 17
#define IDIRECTFB_METHOD_ID_CreateVideoProvider 18
#define IDIRECTFB_METHOD_ID_CreateFont 19
#define IDIRECTFB_METHOD_ID_CreateDataBuffer 20
#define IDIRECTFB_METHOD_ID_SetClipboardData 21
#define IDIRECTFB_METHOD_ID_GetClipboardData 22
#define IDIRECTFB_METHOD_ID_GetClipboardTimeStamp 23
#define IDIRECTFB_METHOD_ID_Suspend 24
#define IDIRECTFB_METHOD_ID_Resume 25
#define IDIRECTFB_METHOD_ID_WaitIdle 26
#define IDIRECTFB_METHOD_ID_WaitForSync 27
#define IDIRECTFB_METHOD_ID_GetInterface 28
typedef struct {
int width;
int height;
int bpp;
} IDirectFB_Dispatcher_EnumVideoModes_Item;
typedef struct {
DFBScreenID screen_id;
DFBScreenDescription desc;
} IDirectFB_Dispatcher_EnumScreens_Item;
typedef struct {
DFBInputDeviceID device_id;
DFBInputDeviceDescription desc;
} IDirectFB_Dispatcher_EnumInputDevices_Item;
#if 0
#define VOODOO_PARSER_READ_DFBSurfaceDescription( p, desc ) \
do { \
VOODOO_PARSER_GET_INT( p, (desc).flags ); \
VOODOO_PARSER_GET_INT( p, (desc).caps ); \
VOODOO_PARSER_GET_INT( p, (desc).width ); \
VOODOO_PARSER_GET_INT( p, (desc).height ); \
VOODOO_PARSER_GET_INT( p, (desc).pixelformat ); \
VOODOO_PARSER_GET_UINT( p, (desc).resource_id ); \
VOODOO_PARSER_GET_INT( p, (desc).hints ); \
} while (0)
#define VMBT_DFBSurfaceDescription( desc ) \
VMBT_INT, (desc).flags, \
VMBT_INT, (desc).caps, \
VMBT_INT, (desc).width, \
VMBT_INT, (desc).height, \
VMBT_INT, (desc).pixelformat, \
VMBT_UINT, (desc).resource_id, \
VMBT_INT, (desc).hints
#else
#define VOODOO_PARSER_READ_DFBSurfaceDescription( p, desc ) \
do { \
VOODOO_PARSER_READ_DATA( p, &(desc), sizeof(DFBSurfaceDescription) ); \
} while (0)
#define VMBT_DFBSurfaceDescription( desc ) \
VMBT_DATA, sizeof(DFBSurfaceDescription), &(desc)
#endif
#endif
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef BASEFILEFILTER_H
#define BASEFILEFILTER_H
#include "ilocatorfilter.h"
#include <QSharedPointer>
#include <QStringList>
namespace Core {
namespace Internal { class BaseFileFilterPrivate; }
class CORE_EXPORT BaseFileFilter : public ILocatorFilter
{
Q_OBJECT
public:
class Iterator {
public:
virtual ~Iterator() { }
virtual void toFront() = 0;
virtual bool hasNext() const = 0;
virtual QString next() = 0;
virtual QString filePath() const = 0;
virtual QString fileName() const = 0;
};
class CORE_EXPORT ListIterator : public Iterator {
public:
ListIterator(const QStringList &filePaths);
ListIterator(const QStringList &filePaths, const QStringList &fileNames);
void toFront();
bool hasNext() const;
QString next();
QString filePath() const;
QString fileName() const;
private:
QStringList m_filePaths;
QStringList m_fileNames;
QStringList::const_iterator m_pathPosition;
QStringList::const_iterator m_namePosition;
};
BaseFileFilter();
~BaseFileFilter();
void prepareSearch(const QString &entry);
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
void accept(LocatorFilterEntry selection) const;
protected:
void setFileIterator(Iterator *iterator);
QSharedPointer<Iterator> fileIterator();
private slots:
void updatePreviousResultData();
private:
Internal::BaseFileFilterPrivate *d;
};
} // namespace Core
#endif // BASEFILEFILTER_H
|
/*
cryptplugfactory.h
This file is part of libkleopatra, the KDE keymanagement library
Copyright (c) 2004 Klarälvdalens Datakonsult AB
Libkleopatra 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.
Libkleopatra 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
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef __KLEO_CRYPTPLUGFACTORY_H__
#define __KLEO_CRYPTPLUGFACTORY_H__
#include "kleo/kleo_export.h"
#include "kleo/cryptobackendfactory.h"
#ifndef LIBKLEOPATRA_NO_COMPAT
namespace Kleo {
//typedef CryptoBackendFactory CryptPlugFactory KDE_DEPRECATED;
}
class CryptPlugWrapper;
class CryptPlugWrapperList;
namespace KMail {
class KLEO_EXPORT CryptPlugFactory : public Kleo::CryptoBackendFactory {
Q_OBJECT
protected:
CryptPlugFactory();
~CryptPlugFactory();
public:
static CryptPlugFactory * instance();
CryptPlugWrapper * active() const;
CryptPlugWrapper * smime() const;
CryptPlugWrapper * openpgp() const;
CryptPlugWrapperList & list() const { return *mCryptPlugWrapperList; }
CryptPlugWrapper * createForProtocol( const QString & proto ) const;
void scanForBackends( QStringList * reason );
private:
void updateCryptPlugWrapperList();
private:
CryptPlugFactory( const CryptPlugFactory & );
void operator=( const CryptPlugFactory & );
CryptPlugWrapperList * mCryptPlugWrapperList;
static CryptPlugFactory * mSelf;
};
}
#endif
#endif // __KLEO_CRYPTPLUGFACTORY_H__
|
#include <wchar.h>
#include <wctype.h>
#include <stdio.h>
#define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 }
#define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1)
static const struct {
unsigned short upper;
signed char lower;
unsigned char len;
} casemaps[] = {
CASEMAP('A','Z','a'),
CASEMAP(0xc0,0xde,0xe0),
CASELACE(0x0100,0x012e),
CASELACE(0x0132,0x0136),
CASELACE(0x0139,0x0147),
CASELACE(0x014a,0x0176),
CASELACE(0x0179,0x017d),
CASELACE(0x370,0x372),
CASEMAP(0x391,0x3a1,0x3b1),
CASEMAP(0x3a3,0x3ab,0x3c3),
CASEMAP(0x400,0x40f,0x450),
CASEMAP(0x410,0x42f,0x430),
CASELACE(0x460,0x480),
CASELACE(0x48a,0x4be),
CASELACE(0x4c1,0x4cd),
CASELACE(0x4d0,0x50e),
CASEMAP(0x531,0x556,0x561),
CASELACE(0x01a0,0x01a4),
CASELACE(0x01b3,0x01b5),
CASELACE(0x01cd,0x01db),
CASELACE(0x01de,0x01ee),
CASELACE(0x01f8,0x021e),
CASELACE(0x0222,0x0232),
CASELACE(0x03d8,0x03ee),
CASELACE(0x1e00,0x1e94),
CASELACE(0x1ea0,0x1efe),
CASEMAP(0x1f08,0x1f0f,0x1f00),
CASEMAP(0x1f18,0x1f1d,0x1f10),
CASEMAP(0x1f28,0x1f2f,0x1f20),
CASEMAP(0x1f38,0x1f3f,0x1f30),
CASEMAP(0x1f48,0x1f4d,0x1f40),
CASEMAP(0x1f68,0x1f6f,0x1f60),
CASEMAP(0x1f88,0x1f8f,0x1f80),
CASEMAP(0x1f98,0x1f9f,0x1f90),
CASEMAP(0x1fa8,0x1faf,0x1fa0),
CASEMAP(0x1fb8,0x1fb9,0x1fb0),
CASEMAP(0x1fba,0x1fbb,0x1f70),
CASEMAP(0x1fc8,0x1fcb,0x1f72),
CASEMAP(0x1fd8,0x1fd9,0x1fd0),
CASEMAP(0x1fda,0x1fdb,0x1f76),
CASEMAP(0x1fe8,0x1fe9,0x1fe0),
CASEMAP(0x1fea,0x1feb,0x1f7a),
CASEMAP(0x1ff8,0x1ff9,0x1f78),
CASEMAP(0x1ffa,0x1ffb,0x1f7c),
CASELACE(0x246,0x24e),
CASELACE(0x510,0x512),
CASEMAP(0x2160,0x216f,0x2170),
CASEMAP(0x2c00,0x2c2e,0x2c30),
CASELACE(0x2c67,0x2c6b),
CASELACE(0x2c80,0x2ce2),
CASELACE(0xa722,0xa72e),
CASELACE(0xa732,0xa76e),
CASELACE(0xa779,0xa77b),
CASELACE(0xa77e,0xa786),
CASEMAP(0xff21,0xff3a,0xff41),
{ 0,0,0 }
};
static const unsigned short pairs[][2] = {
{ 'I', 0x0131 },
{ 'S', 0x017f },
{ 0x0130, 'i' },
{ 0x0178, 0x00ff },
{ 0x0181, 0x0253 },
{ 0x0182, 0x0183 },
{ 0x0184, 0x0185 },
{ 0x0186, 0x0254 },
{ 0x0187, 0x0188 },
{ 0x0189, 0x0256 },
{ 0x018a, 0x0257 },
{ 0x018b, 0x018c },
{ 0x018e, 0x01dd },
{ 0x018f, 0x0259 },
{ 0x0190, 0x025b },
{ 0x0191, 0x0192 },
{ 0x0193, 0x0260 },
{ 0x0194, 0x0263 },
{ 0x0196, 0x0269 },
{ 0x0197, 0x0268 },
{ 0x0198, 0x0199 },
{ 0x019c, 0x026f },
{ 0x019d, 0x0272 },
{ 0x019f, 0x0275 },
{ 0x01a6, 0x0280 },
{ 0x01a7, 0x01a8 },
{ 0x01a9, 0x0283 },
{ 0x01ac, 0x01ad },
{ 0x01ae, 0x0288 },
{ 0x01af, 0x01b0 },
{ 0x01b1, 0x028a },
{ 0x01b2, 0x028b },
{ 0x01b7, 0x0292 },
{ 0x01b8, 0x01b9 },
{ 0x01bc, 0x01bd },
{ 0x01c4, 0x01c6 },
{ 0x01c4, 0x01c5 },
{ 0x01c5, 0x01c6 },
{ 0x01c7, 0x01c9 },
{ 0x01c7, 0x01c8 },
{ 0x01c8, 0x01c9 },
{ 0x01ca, 0x01cc },
{ 0x01ca, 0x01cb },
{ 0x01cb, 0x01cc },
{ 0x01f1, 0x01f3 },
{ 0x01f1, 0x01f2 },
{ 0x01f2, 0x01f3 },
{ 0x01f4, 0x01f5 },
{ 0x01f6, 0x0195 },
{ 0x01f7, 0x01bf },
{ 0x0220, 0x019e },
{ 0x0386, 0x03ac },
{ 0x0388, 0x03ad },
{ 0x0389, 0x03ae },
{ 0x038a, 0x03af },
{ 0x038c, 0x03cc },
{ 0x038e, 0x03cd },
{ 0x038f, 0x03ce },
{ 0x0399, 0x0345 },
{ 0x0399, 0x1fbe },
{ 0x03a3, 0x03c2 },
{ 0x03f7, 0x03f8 },
{ 0x03fa, 0x03fb },
{ 0x1e60, 0x1e9b },
{ 0x1f59, 0x1f51 },
{ 0x1f5b, 0x1f53 },
{ 0x1f5d, 0x1f55 },
{ 0x1f5f, 0x1f57 },
{ 0x1fbc, 0x1fb3 },
{ 0x1fcc, 0x1fc3 },
{ 0x1fec, 0x1fe5 },
{ 0x1ffc, 0x1ff3 },
{ 0x23a, 0x2c65 },
{ 0x23b, 0x23c },
{ 0x23d, 0x19a },
{ 0x23e, 0x2c66 },
{ 0x241, 0x242 },
{ 0x243, 0x180 },
{ 0x244, 0x289 },
{ 0x245, 0x28c },
{ 0x3f4, 0x3b8 },
{ 0x3f9, 0x3f2 },
{ 0x3fd, 0x37b },
{ 0x3fe, 0x37c },
{ 0x3ff, 0x37d },
{ 0x4c0, 0x4cf },
{ 0x2126, 0x3c9 },
{ 0x212a, 'k' },
{ 0x212b, 0xe5 },
{ 0x2132, 0x214e },
{ 0x2183, 0x2184 },
{ 0x2c60, 0x2c61 },
{ 0x2c62, 0x26b },
{ 0x2c63, 0x1d7d },
{ 0x2c64, 0x27d },
{ 0x2c6d, 0x251 },
{ 0x2c6e, 0x271 },
{ 0x2c6f, 0x250 },
{ 0x2c72, 0x2c73 },
{ 0x2c75, 0x2c76 },
{ 0xa77d, 0x1d79 },
/* bogus greek 'symbol' letters */
{ 0x376, 0x377 },
{ 0x39c, 0xb5 },
{ 0x392, 0x3d0 },
{ 0x398, 0x3d1 },
{ 0x3a6, 0x3d5 },
{ 0x3a0, 0x3d6 },
{ 0x39a, 0x3f0 },
{ 0x3a1, 0x3f1 },
{ 0x395, 0x3f5 },
{ 0x3cf, 0x3d7 },
{ 0,0 }
};
static wchar_t __towcase(wchar_t wc, int lower)
{
int i;
int lmul = 2*lower-1;
int lmask = lower-1;
if ((unsigned)wc - 0x10400 < 0x50)
return wc + lmul*0x28;
/* no letters with case in these large ranges */
if (!iswalpha(wc)
|| (unsigned)wc - 0x0600 <= 0x0fff-0x0600
|| (unsigned)wc - 0x2e00 <= 0xa6ff-0x2e00
|| (unsigned)wc - 0xa800 <= 0xfeff-0xa800)
return wc;
/* special case because the diff between upper/lower is too big */
if ((unsigned)wc - 0x10a0 < 0x26 || (unsigned)wc - 0x2d00 < 0x26)
return wc + lmul*(0x2d00-0x10a0);
for (i=0; casemaps[i].len; i++) {
int base = casemaps[i].upper + (lmask & casemaps[i].lower);
if ((unsigned)wc-base < casemaps[i].len) {
if (casemaps[i].lower == 1)
return wc + lower - ((wc-casemaps[i].upper)&1);
return wc + lmul*casemaps[i].lower;
}
}
for (i=0; pairs[i][1-lower]; i++) {
if (pairs[i][1-lower] == wc)
return pairs[i][lower];
}
if ((unsigned)wc - 0x10428 + (lower<<5) + (lower<<3) < 0x28)
return wc - 0x28 + (lower<<10) + (lower<<6);
return wc;
}
wint_t towupper(wint_t wc)
{
return __towcase(wc, 0);
}
wint_t towlower(wint_t wc)
{
return __towcase(wc, 1);
}
|
/*******************************************************************************
This file is part of FeCl.
Copyright (c) 2015, Etienne Pierre-Doray, INRS
Copyright (c) 2015, Leszek Szczecinski, INRS
All rights reserved.
FeCl is free software: you can redistribute it and/or modify
it under the terms of the Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FeCl 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 Lesser General Public License
along with FeCl. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef WRAP_TURBO_DECODER_OPTIONS
#define WRAP_TURBO_DECODER_OPTIONS
#include <memory>
#include <type_traits>
#include <mex.h>
#include "Turbo.h"
#include "../util/Conversion.h"
#include "../util/Scheduling.h"
template <>
class mxArrayTo<fec::Turbo::DecoderOptions> : private ExceptionThrower
{
public:
mxArrayTo(const std::string& msg = "") : ExceptionThrower(msg) {}
mxArrayTo& operator() (const std::string& msg) {ExceptionThrower::operator() (msg); return *this;}
fec::Turbo::DecoderOptions operator() (const mxArray* in) const {
fec::Turbo::DecoderOptions decoderOptions;
decoderOptions.iterations( mxArrayTo<size_t>{msg()}("iterations")(mxGetField(in, 0, "iterations")) );
decoderOptions.scheduling( mxArrayTo<fec::Turbo::Scheduling>{msg()}("scheduling")(mxGetField(in, 0, "scheduling")) );
decoderOptions.scheduling( mxArrayTo<fec::SchedulingType>{msg()}("scheduling type")(mxGetField(in, 0, "schedulingType")) );
decoderOptions.algorithm( mxArrayTo<fec::DecoderAlgorithm>{msg()}("algorithm")(mxGetField(in, 0, "algorithm")) );
decoderOptions.scalingFactor( mxArrayTo<std::vector<std::vector<double>>>{msg()}("scaling factor")(mxGetField(in, 0, "scalingFactor")) );
return decoderOptions;
}
};
inline mxArray* toMxArray(fec::Turbo::DecoderOptions decoder)
{
const char* fieldnames[] = {"iterations", "schedulingType", "scheduling", "algorithm", "scalingFactor"};
mxArray* out = mxCreateStructMatrix(1,1, 5, fieldnames);
mxSetField(out, 0, fieldnames[0], toMxArray(decoder.iterations()));
mxSetField(out, 0, fieldnames[1], toMxArray(decoder.schedulingType()));
mxSetField(out, 0, fieldnames[1], toMxArray(decoder.scheduling()));
mxSetField(out, 0, fieldnames[2], toMxArray(decoder.algorithm()));
mxSetField(out, 0, fieldnames[3], toMxArray(decoder.scalingFactor()));
return out;
}
#endif
|
/* radare - LGPL - Copyright 2010-2016 - nibble, pancake */
#include <stdio.h>
#include <string.h>
#include <r_anal.h>
#include <r_list.h>
#include <r_util.h>
#include <r_core.h>
R_API int r_core_gdiff_fcn(RCore *c, ut64 addr, ut64 addr2) {
RList *la, *lb;
RAnalFunction *fa = r_anal_get_fcn_at (c->anal, addr, 0);
RAnalFunction *fb = r_anal_get_fcn_at (c->anal, addr2, 0);
la = r_list_new ();
r_list_append (la, fa);
lb = r_list_new ();
r_list_append (lb, fb);
r_anal_diff_fcn (c->anal, la, lb);
r_list_free (la);
r_list_free (lb);
return false;
}
/* Fingerprint functions and blocks, then diff. */
R_API int r_core_gdiff(RCore *c, RCore *c2) {
RCore *cores[2] = {c, c2};
RAnalFunction *fcn;
RAnalBlock *bb;
RListIter *iter, *iter2;
int i;
if (!c || !c2) {
return false;
}
for (i = 0; i < 2; i++) {
/* remove strings */
r_list_foreach_safe (cores[i]->anal->fcns, iter, iter2, fcn) {
if (!strncmp (fcn->name, "str.", 4)) {
r_anal_fcn_tree_delete (&cores[i]->anal->fcn_tree, fcn);
r_list_delete (cores[i]->anal->fcns, iter);
}
}
/* Fingerprint fcn bbs (functions basic-blocks) */
r_list_foreach (cores[i]->anal->fcns, iter, fcn) {
r_list_foreach (fcn->bbs, iter2, bb) {
r_anal_diff_fingerprint_bb (cores[i]->anal, bb);
}
}
/* Fingerprint fcn */
r_list_foreach (cores[i]->anal->fcns, iter, fcn) {
int newsize = r_anal_diff_fingerprint_fcn (cores[i]->anal, fcn);
r_anal_fcn_set_size (fcn, newsize);
}
}
/* Diff functions */
r_anal_diff_fcn (cores[0]->anal, cores[0]->anal->fcns, cores[1]->anal->fcns);
return true;
}
/* copypasta from radiff2 */
static void diffrow(ut64 addr, const char *name, ut32 size, int maxnamelen,
int digits, ut64 addr2, const char *name2, ut32 size2,
const char *match, double dist, int bare) {
if (bare) {
if (addr2 == UT64_MAX || !name2) {
printf ("0x%016"PFMT64x" |%8s (%f)\n", addr, match, dist);
} else {
printf ("0x%016"PFMT64x" |%8s (%f) | 0x%016"PFMT64x"\n", addr, match, dist, addr2);
}
} else {
if (addr2 == UT64_MAX || !name2) {
printf ("%*s %*d 0x%"PFMT64x" |%8s (%f)\n",
maxnamelen, name, digits, size, addr, match, dist);
} else {
printf ("%*s %*d 0x%"PFMT64x" |%8s (%f) | 0x%"PFMT64x" %*d %s\n",
maxnamelen, name, digits, size, addr, match, dist, addr2,
digits, size2, name2);
}
}
}
R_API void r_core_diff_show(RCore *c, RCore *c2) {
bool bare = r_config_get_i (c->config, "diff.bare") || r_config_get_i (c2->config, "diff.bare");
RList *fcns = r_anal_get_fcns (c->anal);
const char *match;
RListIter *iter;
RAnalFunction *f;
int maxnamelen = 0;
int maxsize = 0;
int digits = 1;
int len;
r_list_foreach (fcns, iter, f) {
if (f->name && (len = strlen (f->name)) > maxnamelen) {
maxnamelen = len;
}
if (r_anal_fcn_size (f) > maxsize) {
maxsize = r_anal_fcn_size (f);
}
}
fcns = r_anal_get_fcns (c2->anal);
r_list_foreach (fcns, iter, f) {
if (f->name && (len = strlen (f->name)) > maxnamelen) {
maxnamelen = len;
}
if (r_anal_fcn_size (f) > maxsize) {
maxsize = r_anal_fcn_size (f);
}
}
while (maxsize > 9) {
maxsize /= 10;
digits++;
}
fcns = r_anal_get_fcns (c->anal);
if (r_list_empty (fcns)) {
eprintf ("No functions found, try running with -A or load a project\n");
return;
}
r_list_sort (fcns, c->anal->columnSort);
r_list_foreach (fcns, iter, f) {
switch (f->type) {
case R_ANAL_FCN_TYPE_FCN:
case R_ANAL_FCN_TYPE_SYM:
switch (f->diff->type) {
case R_ANAL_DIFF_TYPE_MATCH:
match = "MATCH";
break;
case R_ANAL_DIFF_TYPE_UNMATCH:
match = "UNMATCH";
break;
default:
match = "NEW";
f->diff->dist = 0;
}
diffrow (f->addr, f->name, r_anal_fcn_size (f), maxnamelen, digits,
f->diff->addr, f->diff->name, f->diff->size,
match, f->diff->dist, bare);
break;
}
}
fcns = r_anal_get_fcns (c2->anal);
r_list_sort (fcns, c2->anal->columnSort);
r_list_foreach (fcns, iter, f) {
switch (f->type) {
case R_ANAL_FCN_TYPE_FCN:
case R_ANAL_FCN_TYPE_SYM:
if (f->diff->type == R_ANAL_DIFF_TYPE_NULL) {
diffrow (f->addr, f->name, r_anal_fcn_size (f), maxnamelen,
digits, f->diff->addr, f->diff->name, f->diff->size,
"NEW", 0, bare); //f->diff->dist, bare);
}
break;
}
}
}
|
/* =========================================================================
* This file is part of cphd-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* cphd-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __CPHD_METADATA_H__
#define __CPHD_METADATA_H__
#include <ostream>
#include <cphd/Types.h>
#include <cphd/Data.h>
#include <cphd/Global.h>
#include <cphd/Channel.h>
#include <cphd/SRP.h>
#include <cphd/Antenna.h>
#include <cphd/VectorParameters.h>
namespace cphd
{
/*!
* \class Metadata
*
* This class extends the Data object providing the CPHD
* layer and utilities for access. In order to write a CPHD,
* you must have a CPHDData object that is populated with
* the mandatory parameters, and you must add it to the Container
* object first.
*
* This object contains all of the sub-blocks for CPHD.
*
*
*/
struct Metadata
{
Metadata()
{
}
void setSampleType(SampleType sampleType)
{
data.sampleType = sampleType;
}
SampleType getSampleType() const
{
return data.sampleType;
}
size_t getNumChannels() const;
size_t getNumVectors(size_t channel) const; // 0-based channel number
size_t getNumSamples(size_t channel) const; // 0-based channel number
size_t getNumBytesPerSample() const; // 2, 4, or 8 bytes/complex sample
bool isFX() const
{
return (getDomainType() == DomainType::FX);
}
bool isTOA() const
{
return (getDomainType() == DomainType::TOA);
}
// returns "FX", "TOA", or "NOT_SET"
std::string getDomainTypeString() const;
// returns enum for FX, TOA, or NOT_SET
cphd::DomainType getDomainType() const;
//! CollectionInfo block. Contains the general collection information
//! CPHD can use the SICD Collection Information block directly
CollectionInformation collectionInformation;
//! Data block. Very unfortunate name, but matches the CPHD spec.
//! Contains the information
cphd::Data data;
//! Global block. Contains the information
Global global;
//! Channel block. Contains the information
Channel channel;
//! SRP block. Contains the information
SRP srp;
//! Optional Antenna block. Contains the information
//! This is similar to, but not identical to, the SICD Antenna
mem::ScopedCopyablePtr<Antenna> antenna;
//! VectorParameters block. Contains the information
VectorParameters vectorParameters;
bool operator==(const Metadata& other) const;
bool operator!=(const Metadata& other) const
{
return !((*this) == other);
}
};
std::ostream& operator<< (std::ostream& os, const Metadata& d);
}
#endif
|
/*
* =============================================================
* SOD.c
* input: x,a,b
* x : matrix DxN
* a : vector 1xnn
* b : vector 1xnn
*
* output: for i=1:nn; res=res+(x(:,a(i))-x(:,b(i)))*(x(:,a(i))-x(:,b(i)))';end;
*
* =============================================================
*/
/* $Revision: 1.2 $ */
#include "mex.h"
#include <string.h>
/* If you are using a compiler that equates NaN to zero, you must
* compile this example using the flag -DNAN_EQUALS_ZERO. For
* example:
*
* mex -DNAN_EQUALS_ZERO findnz.c
*
* This will correctly define the IsNonZero macro for your
compiler. */
#if NAN_EQUALS_ZERO
#define IsNonZero(d) ((d) != 0.0 || mxIsNaN(d))
#else
#define IsNonZero(d) ((d) != 0.0)
#endif
double square(double x) { return(x*x);}
void mexFunction(int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
/* Declare variables. */
double *X, *dummy, *v1,*v2, *C;
double *av,*bv;
int m,p,n,inds;
int j,i,r,c;
int ione=1;
char *chu="U";
char *chl="L";
char *chn2="T";
char *chn="N";
double minusone=-1.0,one=1.0, zero=0.0;
/* Check for proper number of input and output arguments. */
if (nrhs != 3) {
mexErrMsgTxt("Exactly three input arguments required.");
}
if (nlhs > 1) {
mexErrMsgTxt("Too many output arguments.");
}
/* Check data type of input argument. */
if (!(mxIsDouble(prhs[0]))) {
mexErrMsgTxt("Input array must be of type double.");
}
/* Check data type of input argument. */
/* if ((mxIsDouble(prhs[1]))) {
mexErrMsgTxt("Input array must be of type double.");
}
if ((mxIsDouble(prhs[2]))) {
mexErrMsgTxt("Input array must be of type double.");
}*/
/* Get the number of elements in the input argument. */
inds = mxGetNumberOfElements(prhs[1]);
if(inds != mxGetNumberOfElements(prhs[2]))
mexErrMsgTxt("Hey Bongo! Both index vectors must have same length!\n");
n = mxGetN(prhs[0]);
m = mxGetM(prhs[0]);
/* Get the data. */
X = mxGetPr(prhs[0]);
av = mxGetPr(prhs[1]);
bv = mxGetPr(prhs[2]);
/* Create output matrix */
plhs[0]=mxCreateDoubleMatrix(m,m,mxREAL);
C=mxGetPr(plhs[0]);
memset(C,0,sizeof(double)*m*m);
/* dummy=new double[m];*/
dummy=malloc(m*sizeof(double));
/* compute outer products and sum them up */
for(i=0;i<inds;i++){
/* Assign cols addresses */
v1=&X[(int) (av[i]-1)*m];
v2=&X[(int) (bv[i]-1)*m];
for(j=0;j<m;j++) dummy[j]=v1[j]-v2[j];
j=0;
for(r=0;r<m;r++){
for(c=0;c<=r;c++) {C[j]+=dummy[r]*dummy[c];j++;};
j+=m-r-1;
}
}
/* fill in lower triangular part of C */
if(inds>0)
for(r=0;r<m;r++)
for(c=r+1;c<m;c++) C[c+r*m]=C[r+c*m];
free(dummy);
}
|
//
// SWToast.h
// LoginTest
//
// Created by Stephen Walsh on 30/03/2015.
// Copyright (c) 2015 Stephen Walsh. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol SWPlainToastDelegate <NSObject>
- (void)actionButtonTapped;
@end
@protocol SWLoginToastDelegate <NSObject>
- (void)loginButtonTappedWithUsername:(NSString*)username
andPassword:(NSString*)password;
@end
typedef NS_ENUM(NSInteger, SWBufferedToastType) {
SWBufferedToastTypePlain,
SWBufferedToastTypeLogin,
SWBufferedToastTypeNotice
};
@interface SWToast : UIView <UITextFieldDelegate>
@property (nonatomic, assign) SWBufferedToastType toastType;
@property (nonatomic, assign) BOOL isLoading;
@property (nonatomic, readonly) BOOL loadingBlocksDismiss;
@property (nonatomic, weak) id <SWPlainToastDelegate> plainToastDelegate;
@property (nonatomic, weak) id <SWLoginToastDelegate> loginToastDelegate;
- (instancetype)initPlainToastWithColour:(UIColor*)color
title:(NSString*)title
subtitle:(NSString*)subtitle
actionTitle:(NSString*)actionTitle
animationImageNames:(NSArray*)animationImageNames
plainDelegate:(id)delegate
andParent:(UIView*)parentView;
- (instancetype)initLoginToastWithColour:(UIColor*)color
title:(NSString*)title
usernameTitle:(NSString*)usernameTitle
passwordTitle:(NSString*)passwordTitle
doneTitle:(NSString*)doneTitle
animationImageNames:(NSArray*)animationImageNames
loginDelegate:(id)loginDelegate
andParent:(UIView*)parentView;
- (instancetype)initNoticeToastWithColour:(UIColor*)color
title:(NSString*)title
subtitle:(NSString*)subtitle
animationImageNames:(NSArray*)animationImageNames
andParent:(UIView*)parentView;
- (void)appear;
- (void)disappear;
- (void)showBuffer;
- (void)hideBuffer;
@end
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* ******** *** SparseLib++ */
/* ******* ** *** *** *** */
/* ***** *** ******** ******** */
/* ***** *** ******** ******** R. Pozo */
/* ** ******* *** ** *** *** K. Remington */
/* ******** ******** A. Lumsdaine */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* */
/* */
/* SparseLib++ : Sparse Matrix Library */
/* */
/* National Institute of Standards and Technology */
/* University of Notre Dame */
/* Authors: R. Pozo, K. Remington, A. Lumsdaine */
/* */
/* NOTICE */
/* */
/* Permission to use, copy, modify, and distribute this software and */
/* its documentation for any purpose and without fee is hereby granted */
/* provided that the above notice appear in all copies and supporting */
/* documentation. */
/* */
/* Neither the Institutions (National Institute of Standards and Technology, */
/* University of Notre Dame) nor the Authors make any representations about */
/* the suitability of this software for any purpose. This software is */
/* provided ``as is'' without expressed or implied warranty. */
/* */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* Read a Harwell-Boeing file into a compressed Column matrix */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "iohb.h"
CompCol_Mat_double & readHB_mat(const char *filename, CompCol_Mat_double *A);
CompRow_Mat_double & readHB_mat(const char *filename, CompRow_Mat_double *A);
Coord_Mat_double & readHB_mat(const char *filename, Coord_Mat_double *A);
const CompCol_Mat_double & writeHB_mat(const char *filename, const CompCol_Mat_double & A, int nrhs = 0,
const double *rhs = 0, const char *title = 0,
const char *key = 0);
const CompRow_Mat_double & writeHB_mat(const char *filename, const CompRow_Mat_double & A, int nrhs = 0,
const double* rhs = 0, const char *title = 0,
const char *key = 0);
const Coord_Mat_double & writeHB_mat(const char *filename, const Coord_Mat_double & A, int nrhs = 0,
const double* rhs = 0, const char *title = 0,
const char *key = 0);
VECTOR_double & readHB_rhs(const char *filename, VECTOR_double *b, int j = 0);
|
/* main.c - Application main entry point */
/*
* Copyright (c) 2015-2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <misc/printk.h>
#include <misc/byteorder.h>
#include <zephyr.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/conn.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#include <gatt/hrs.h>
#include <gatt/dis.h>
#include <gatt/bas.h>
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
struct bt_conn *default_conn;
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0x0d, 0x18, 0x0f, 0x18, 0x05, 0x18),
};
static const struct bt_data sd[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
};
static void connected(struct bt_conn *conn, u8_t err)
{
if (err) {
printk("Connection failed (err %u)\n", err);
} else {
default_conn = bt_conn_ref(conn);
printk("Connected\n");
}
}
static void disconnected(struct bt_conn *conn, u8_t reason)
{
printk("Disconnected (reason %u)\n", reason);
if (default_conn) {
bt_conn_unref(default_conn);
default_conn = NULL;
}
}
static struct bt_conn_cb conn_callbacks = {
.connected = connected,
.disconnected = disconnected,
};
static void bt_ready(int err)
{
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
printk("Bluetooth initialized\n");
hrs_init(0x01);
bas_init();
dis_init(CONFIG_SOC, "Manufacturer");
err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad),
sd, ARRAY_SIZE(sd));
if (err) {
printk("Advertising failed to start (err %d)\n", err);
return;
}
printk("Advertising successfully started\n");
}
static void auth_cancel(struct bt_conn *conn)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
printk("Pairing cancelled: %s\n", addr);
}
static struct bt_conn_auth_cb auth_cb_display = {
.cancel = auth_cancel,
};
void main(void)
{
int err;
err = bt_enable(bt_ready);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
bt_conn_cb_register(&conn_callbacks);
bt_conn_auth_cb_register(&auth_cb_display);
/* Implement notification. At the moment there is no suitable way
* of starting delayed work so we do it here
*/
while (1) {
k_sleep(MSEC_PER_SEC);
/* Heartrate measurements simulation */
hrs_notify();
/* Battery level simulation */
bas_notify();
}
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/glue/Glue_EXPORTS.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Glue
{
namespace Model
{
class AWS_GLUE_API StopCrawlerScheduleResult
{
public:
StopCrawlerScheduleResult();
StopCrawlerScheduleResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
StopCrawlerScheduleResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
};
} // namespace Model
} // namespace Glue
} // namespace Aws
|
/*
* Copyright 2004-2015 Cray Inc.
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _AST_DUMP_TO_NODE_H_
#define _AST_DUMP_TO_NODE_H_
#include "AstLogger.h"
#include <cstdio>
class BaseAST;
class Expr;
class ModuleSymbol;
class Symbol;
class Type;
class AstDumpToNode : public AstLogger
{
//
// Static interface
//
public:
//
// This is the User interface to the logger.
//
// This will dump a view of the AST nodes in Module to a file.
// There are command line options to control where the log files
// are written. The name of each file includes the name of the
// Module, the number for the pass, and the name for the pass.
//
static void view(const char* passName,
int passNum);
static void view(const char* passName,
int passNum,
ModuleSymbol* module);
// These adjust the printing format. Could be per-instance.
static bool compact;
static const char* delimitEnter;
static const char* delimitExit;
static bool showNodeIDs;
//
// Instance interface
//
public:
AstDumpToNode(FILE* fp, int offset = 0);
virtual ~AstDumpToNode();
void offsetSet(int offset);
//
// These functions are the "implementation" interface for the
// Visitor pattern.
//
// They are logically "internal" to the pattern but must be
// declared public so that they can be invoked by the AST nodes
// themselves
//
virtual bool enterAggrType (AggregateType* node);
virtual void exitAggrType (AggregateType* node);
virtual bool enterEnumType (EnumType* node);
virtual void exitEnumType (EnumType* node);
virtual void visitPrimType (PrimitiveType* node);
virtual bool enterArgSym (ArgSymbol* node);
virtual void visitEnumSym (EnumSymbol* node);
virtual bool enterFnSym (FnSymbol* node);
virtual void visitLabelSym (LabelSymbol* node);
virtual bool enterModSym (ModuleSymbol* node);
virtual void exitModSym (ModuleSymbol* node);
virtual bool enterTypeSym (TypeSymbol* node);
virtual void visitVarSym (VarSymbol* node);
virtual bool enterCallExpr (CallExpr* node);
virtual bool enterDefExpr (DefExpr* node);
virtual bool enterNamedExpr (NamedExpr* node);
virtual void exitNamedExpr (NamedExpr* node);
virtual void visitSymExpr (SymExpr* node);
virtual void visitUsymExpr (UnresolvedSymExpr* node);
virtual bool enterBlockStmt (BlockStmt* node);
virtual bool enterWhileDoStmt (WhileDoStmt* node);
virtual bool enterDoWhileStmt (DoWhileStmt* node);
virtual bool enterCForLoop (CForLoop* node);
virtual bool enterForLoop (ForLoop* node);
virtual bool enterParamForLoop(ParamForLoop* node);
virtual bool enterCondStmt (CondStmt* node);
virtual void visitEblockStmt (ExternBlockStmt* node);
virtual bool enterGotoStmt (GotoStmt* node);
virtual void exitGotoStmt (GotoStmt* node);
private:
AstDumpToNode();
bool open(ModuleSymbol* mod, const char* passName, int passNum);
bool close();
void ast_symbol(const char* tag, Symbol* sym, bool def);
void ast_symbol(Symbol* sym, bool def);
void writeSymbol(Symbol* sym) const;
void writeSymbolCompact(Symbol* sym) const;
int writeType(Type* type, bool announce = true) const;
void write(const char* text);
void write(bool spaceBefore, const char* text, bool spaceAfter);
void newline();
void logEnter(BaseAST* node);
void logEnter(BaseAST* node, const char* fmt, ...);
void logEnter(const char* fmt, ...);
void logExit (BaseAST* node);
void logExit (const char* fmt, ...);
void logVisit(BaseAST* node);
void logVisit(const char* fmt, ...);
void logWrite(const char* fmt, ...);
// enable compact mode
void enterNode(BaseAST* node) const;
void enterNodeSym(Symbol* node, const char* name = 0) const;
void exitNode(BaseAST* node, bool addNewline = false) const;
void writeField(const char* msg, int offset, BaseAST* field);
void writeLongString(const char* msg, const char* arg) const;
void writeNodeID(BaseAST* node,
bool spaceBefore,
bool spaceAfter) const;
const char* mPath;
FILE* mFP;
int mOffset;
bool mNeedSpace;
ModuleSymbol* mModule;
};
#endif
|
/*
* Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/portability/Sockets.h>
#include <sys/types.h>
#if !defined(FOLLY_ALLOW_TFO)
#if defined(__linux__) || defined(__APPLE__)
// only allow for linux right now
#define FOLLY_ALLOW_TFO 1
#endif
#endif
namespace folly {
namespace detail {
/**
* tfo_sendto has the same semantics as sendmsg, but is used to
* send with TFO data.
*/
ssize_t tfo_sendmsg(int sockfd, const struct msghdr* msg, int flags);
/**
* Enable TFO on a listening socket.
*/
int tfo_enable(int sockfd, size_t max_queue_size);
/**
* Check if TFO succeeded in being used.
*/
bool tfo_succeeded(int sockfd);
}
}
|
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * 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 Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/lib/iomgr/resolve_address.h"
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/lib/iomgr/executor.h"
#include "test/core/util/test_config.h"
static gpr_timespec test_deadline(void) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100);
}
static void must_succeed(grpc_exec_ctx *exec_ctx, void *evp,
grpc_resolved_addresses *p) {
GPR_ASSERT(p);
GPR_ASSERT(p->naddrs >= 1);
grpc_resolved_addresses_destroy(p);
gpr_event_set(evp, (void *)1);
}
static void must_fail(grpc_exec_ctx *exec_ctx, void *evp,
grpc_resolved_addresses *p) {
GPR_ASSERT(!p);
gpr_event_set(evp, (void *)1);
}
static void test_localhost(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, "localhost:1", NULL, must_succeed, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, "localhost", "1", must_succeed, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_missing_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, "localhost", NULL, must_fail, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_ipv6_with_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, must_succeed, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_ipv6_without_port(void) {
const char *const kCases[] = {
"2001:db8::1", "2001:db8::1.2.3.4", "[2001:db8::1]",
};
unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, kCases[i], "80", must_succeed, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}
static void test_invalid_ip_addresses(void) {
const char *const kCases[] = {
"293.283.1238.3:1", "[2001:db8::11111]:1",
};
unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, kCases[i], NULL, must_fail, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}
static void test_unparseable_hostports(void) {
const char *const kCases[] = {
"[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1",
};
unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, kCases[i], "1", must_fail, &ev);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_executor_init();
grpc_iomgr_init();
test_localhost();
test_default_port();
test_missing_default_port();
test_ipv6_with_port();
test_ipv6_without_port();
test_invalid_ip_addresses();
test_unparseable_hostports();
grpc_iomgr_shutdown();
grpc_executor_shutdown();
return 0;
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ssm/SSM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace SSM
{
namespace Model
{
enum class CommandInvocationStatus
{
NOT_SET,
Pending,
InProgress,
Delayed,
Success,
Cancelled,
TimedOut,
Failed,
Cancelling
};
namespace CommandInvocationStatusMapper
{
AWS_SSM_API CommandInvocationStatus GetCommandInvocationStatusForName(const Aws::String& name);
AWS_SSM_API Aws::String GetNameForCommandInvocationStatus(CommandInvocationStatus value);
} // namespace CommandInvocationStatusMapper
} // namespace Model
} // namespace SSM
} // namespace Aws
|
/*
* Copyright (c) 2016 Spotify AB.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#import "SPTPersistentCacheRecord.h"
@interface SPTPersistentCacheRecord (Private)
- (instancetype)initWithData:(NSData *)data
key:(NSString *)key
refCount:(NSUInteger)refCount
ttl:(NSUInteger)ttl;
@end
|
// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_CORE_LIB_PROMISE_SEQ_H
#define GRPC_CORE_LIB_PROMISE_SEQ_H
#include <grpc/support/port_platform.h>
#include <utility>
#include "absl/types/variant.h"
#include "src/core/lib/promise/detail/basic_seq.h"
#include "src/core/lib/promise/poll.h"
namespace grpc_core {
namespace promise_detail {
template <typename T>
struct SeqTraits {
using UnwrappedType = T;
using WrappedType = T;
template <typename Next>
static auto CallFactory(Next* next, T&& value)
-> decltype(next->Once(std::forward<T>(value))) {
return next->Once(std::forward<T>(value));
}
template <typename Result, typename PriorResult, typename RunNext>
static Poll<Result> CheckResultAndRunNext(PriorResult prior,
RunNext run_next) {
return run_next(std::move(prior));
}
};
template <typename... Fs>
using Seq = BasicSeq<SeqTraits, Fs...>;
} // namespace promise_detail
// Sequencing combinator.
// Run the first promise.
// Pass its result to the second, and run the returned promise.
// Pass its result to the third, and run the returned promise.
// etc
// Return the final value.
template <typename... Functors>
promise_detail::Seq<Functors...> Seq(Functors... functors) {
return promise_detail::Seq<Functors...>(std::move(functors)...);
}
template <typename F>
F Seq(F functor) {
return functor;
}
} // namespace grpc_core
#endif // GRPC_CORE_LIB_PROMISE_SEQ_H
|
#ifndef INCLUDED_tlsf
#define INCLUDED_tlsf
/*
** Two Level Segregated Fit memory allocator, version 3.0.
** Written by Matthew Conte, and placed in the Public Domain.
** http://tlsf.baisoku.org
**
** Based on the original documentation by Miguel Masmano:
** http://rtportal.upv.es/rtmalloc/allocators/tlsf/index.shtml
**
** Please see the accompanying Readme.txt for implementation
** notes and caveats.
**
** This implementation was written to the specification
** of the document, therefore no GPL restrictions apply.
*/
#include <stddef.h>
#if defined(__cplusplus)
extern "C" {
#endif
/* tlsf_t: a TLSF structure. Can contain 1 to N pools. */
/* pool_t: a block of memory that TLSF can manage. */
typedef void* tlsf_t;
typedef void* pool_t;
/* Create/destroy a memory pool. */
tlsf_t tlsf_create(void* mem);
tlsf_t tlsf_create_with_pool(void* mem, size_t bytes);
void tlsf_destroy(tlsf_t tlsf);
pool_t tlsf_get_pool(tlsf_t tlsf);
/* Add/remove memory pools. */
pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes);
void tlsf_remove_pool(tlsf_t tlsf, pool_t pool);
/* malloc/memalign/realloc/free replacements. */
void* tlsf_malloc(tlsf_t tlsf, size_t bytes);
void* tlsf_memalign(tlsf_t tlsf, size_t align, size_t bytes);
void* tlsf_realloc(tlsf_t tlsf, void* ptr, size_t size);
void tlsf_free(tlsf_t tlsf, void* ptr);
/* Returns internal block size, not original request size */
size_t tlsf_block_size(void* ptr);
/* Overheads/limits of internal structures. */
size_t tlsf_size();
size_t tlsf_align_size();
size_t tlsf_block_size_min();
size_t tlsf_block_size_max();
size_t tlsf_pool_overhead();
size_t tlsf_alloc_overhead();
/* Debugging. */
typedef void (*tlsf_walker)(void* ptr, size_t size, int used, void* user);
void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user);
/* Returns nonzero if any internal consistency check fails. */
int tlsf_check(tlsf_t tlsf);
int tlsf_check_pool(pool_t pool);
#if defined(__cplusplus)
};
#endif
#endif
|
/*===============================================================================
Copyright (c) 2012-2014 Qualcomm Connected Experiences, Inc. All Rights Reserved.
Vuforia is a trademark of QUALCOMM Incorporated, registered in the United States
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
@file
ImageTargetResult.h
@brief
Header file for ImageTargetResult class.
===============================================================================*/
#ifndef _QCAR_IMAGETARGETRESULT_H_
#define _QCAR_IMAGETARGETRESULT_H_
// Include files
#include <QCAR/TrackableResult.h>
#include <QCAR/ImageTarget.h>
namespace QCAR
{
// Forward declarations:
class VirtualButtonResult;
/// Result for an ImageTarget.
class QCAR_API ImageTargetResult : public TrackableResult
{
public:
/// Returns the TrackableResult class' type
static Type getClassType();
/// Returns the corresponding Trackable that this result represents
virtual const ImageTarget& getTrackable() const = 0;
/// Returns the number of VirtualButtons defined for this ImageTarget
virtual int getNumVirtualButtons() const = 0;
/// Returns the VirtualButtonResult for a specific VirtualButton
virtual const VirtualButtonResult* getVirtualButtonResult(int idx) const = 0;
/// Returns the VirtualButtonResult for a specific VirtualButton
virtual const VirtualButtonResult* getVirtualButtonResult(const char* name) const = 0;
};
} // namespace QCAR
#endif //_QCAR_IMAGETARGETRESULT_H_
|
// Copyright 2014 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 CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_
#define CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/common/content_export.h"
#include "gpu/ipc/common/android/surface_texture_manager.h"
namespace content {
class CONTENT_EXPORT BrowserSurfaceTextureManager
: public gpu::SurfaceTextureManager {
public:
static BrowserSurfaceTextureManager* GetInstance();
// Overridden from SurfaceTextureManager:
void RegisterSurfaceTexture(int surface_texture_id,
int client_id,
gfx::SurfaceTexture* surface_texture) override;
void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override;
gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture(
int surface_texture_id) override;
private:
friend struct base::DefaultSingletonTraits<BrowserSurfaceTextureManager>;
BrowserSurfaceTextureManager();
~BrowserSurfaceTextureManager() override;
DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceTextureManager);
};
} // namespace content
#endif // CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_
|
// Copyright 2013 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 MOJO_PUBLIC_BINDINGS_ARRAY_H_
#define MOJO_PUBLIC_BINDINGS_ARRAY_H_
#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
#include "mojo/public/bindings/lib/array_internal.h"
#include "mojo/public/bindings/type_converter.h"
namespace mojo {
// Provides read-only access to array data.
template <typename T>
class Array {
public:
typedef internal::ArrayTraits<T, internal::TypeTraits<T>::kIsObject> Traits_;
typedef typename Traits_::DataType Data;
typedef typename Traits_::ConstRef ConstRef;
Array() : data_(NULL) {
}
template <typename U>
Array(const U& u, Buffer* buf = Buffer::current()) {
*this = TypeConverter<Array<T>,U>::ConvertFrom(u, buf);
}
template <typename U>
Array& operator=(const U& u) {
*this = TypeConverter<Array<T>,U>::ConvertFrom(u, Buffer::current());
return *this;
}
template <typename U>
operator U() const {
return To<U>();
}
template <typename U>
U To() const {
return TypeConverter<Array<T>,U>::ConvertTo(*this);
}
bool is_null() const { return !data_; }
size_t size() const { return data_->size(); }
ConstRef at(size_t offset) const {
return Traits_::ToConstRef(data_->at(offset));
}
ConstRef operator[](size_t offset) const { return at(offset); }
// Provides a way to initialize an array element-by-element.
class Builder {
public:
typedef typename Array<T>::Data Data;
typedef typename Array<T>::Traits_ Traits_;
typedef typename Traits_::Ref Ref;
explicit Builder(size_t num_elements, Buffer* buf = mojo::Buffer::current())
: data_(Data::New(num_elements, buf)) {
}
size_t size() const { return data_->size(); }
Ref at(size_t offset) {
return Traits_::ToRef(data_->at(offset));
}
Ref operator[](size_t offset) { return at(offset); }
Array<T> Finish() {
Data* data = NULL;
std::swap(data, data_);
return internal::Wrap(data);
}
private:
Data* data_;
MOJO_DISALLOW_COPY_AND_ASSIGN(Builder);
};
protected:
friend class internal::WrapperHelper<Array<T> >;
struct Wrap {};
Array(Wrap, const Data* data) : data_(data) {}
const Data* data_;
};
// UTF-8 encoded
typedef Array<char> String;
template <>
class TypeConverter<String, std::string> {
public:
static String ConvertFrom(const std::string& input, Buffer* buf);
static std::string ConvertTo(const String& input);
};
template <size_t N>
class TypeConverter<String, char[N]> {
public:
static String ConvertFrom(const char input[N], Buffer* buf) {
String::Builder result(N - 1, buf);
memcpy(&result[0], input, N - 1);
return result.Finish();
}
};
// Appease MSVC.
template <size_t N>
class TypeConverter<String, const char[N]> {
public:
static String ConvertFrom(const char input[N], Buffer* buf) {
return TypeConverter<String, char[N]>::ConvertFrom(input, buf);
}
};
template <>
class TypeConverter<String, const char*> {
public:
static String ConvertFrom(const char* input, Buffer* buf);
// NOTE: |ConvertTo| explicitly not implemented since String is not null
// terminated (and may have embedded null bytes).
};
template <typename T, typename E>
class TypeConverter<Array<T>, std::vector<E> > {
public:
static Array<T> ConvertFrom(const std::vector<E>& input, Buffer* buf) {
typename Array<T>::Builder result(input.size(), buf);
for (size_t i = 0; i < input.size(); ++i)
result[i] = TypeConverter<T, E>::ConvertFrom(input[i], buf);
return result.Finish();
}
static std::vector<E> ConvertTo(const Array<T>& input) {
std::vector<E> result;
if (!input.is_null()) {
result.resize(input.size());
for (size_t i = 0; i < input.size(); ++i)
result[i] = TypeConverter<T, E>::ConvertTo(input[i]);
}
return result;
}
};
} // namespace mojo
#endif // MOJO_PUBLIC_BINDINGS_ARRAY_H_
|
/* This file is te-macos.h. */
#define TE_POWERMAC 1
/* Added these, because if we don't know what we're targeting we may
need an assembler version of libgcc, and that will use local
labels. */
#define LOCAL_LABELS_DOLLAR 1
#define LOCAL_LABELS_FB 1
#include "obj-format.h"
|
// Copyright 2013 The Flutter 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 SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
#include "flutter/common/settings.h"
#include "flutter/runtime/platform_data.h"
#include "flutter/shell/common/engine.h"
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h"
NS_ASSUME_NONNULL_BEGIN
flutter::Settings FLTDefaultSettingsForBundle(NSBundle* bundle = nil);
@interface FlutterDartProject ()
/**
* This is currently used for *only for tests* to override settings.
*/
- (instancetype)initWithSettings:(const flutter::Settings&)settings;
- (const flutter::Settings&)settings;
- (const flutter::PlatformData)defaultPlatformData;
- (flutter::RunConfiguration)runConfiguration;
- (flutter::RunConfiguration)runConfigurationForEntrypoint:(nullable NSString*)entrypointOrNil;
- (flutter::RunConfiguration)runConfigurationForEntrypoint:(nullable NSString*)entrypointOrNil
libraryOrNil:(nullable NSString*)dartLibraryOrNil;
- (flutter::RunConfiguration)runConfigurationForEntrypoint:(nullable NSString*)entrypointOrNil
libraryOrNil:(nullable NSString*)dartLibraryOrNil
entrypointArgs:
(nullable NSArray<NSString*>*)entrypointArgs;
+ (NSString*)flutterAssetsName:(NSBundle*)bundle;
+ (NSString*)domainNetworkPolicy:(NSDictionary*)appTransportSecurity;
+ (bool)allowsArbitraryLoads:(NSDictionary*)appTransportSecurity;
@end
NS_ASSUME_NONNULL_END
#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
|
/*++
Copyright (c) 2005, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
libstatusbar.h
Abstract:
Definition for the Status Bar -
the display for the status of the editor
--*/
#ifndef _LIB_STATUS_BAR_H_
#define _LIB_STATUS_BAR_H_
#include "heditortype.h"
EFI_STATUS
HMainStatusBarInit (
VOID
);
EFI_STATUS
HMainStatusBarCleanup (
VOID
);
EFI_STATUS
HMainStatusBarRefresh (
VOID
);
EFI_STATUS
HMainStatusBarHide (
VOID
);
EFI_STATUS
HMainStatusBarSetStatusString (
CHAR16 *
);
EFI_STATUS
HMainStatusBarSetMode (
BOOLEAN
);
EFI_STATUS
HMainStatusBarBackup (
VOID
);
#endif
|
// Scintilla source code edit control
/** @file LineMarker.h
** Defines the look of a line marker in the margin .
**/
// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef LINEMARKER_H
#define LINEMARKER_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
/**
*/
class LineMarker {
public:
enum typeOfFold { undefined, head, body, tail, headWithTail };
int markType;
ColourDesired fore;
ColourDesired back;
ColourDesired backSelected;
int alpha;
std::unique_ptr<XPM> pxpm;
std::unique_ptr<RGBAImage> image;
/** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
* Draw function for drawing line markers. Allow those platforms to override
* it instead of creating a new method(s) in the Surface class that existing
* platforms must implement as empty. */
DrawLineMarkerFn customDraw;
LineMarker() {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
customDraw = nullptr;
}
LineMarker(const LineMarker &) {
// Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
pxpm.reset();
image.reset();
customDraw = nullptr;
}
~LineMarker() {
}
LineMarker &operator=(const LineMarker &other) {
// Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
if (this != &other) {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
pxpm.reset();
image.reset();
customDraw = nullptr;
}
return *this;
}
void SetXPM(const char *textForm);
void SetXPM(const char *const *linesForm);
void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
};
#ifdef SCI_NAMESPACE
}
#endif
#endif
|
/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSGMaskEffect_DEFINED
#define SkSGMaskEffect_DEFINED
#include "modules/sksg/include/SkSGEffectNode.h"
namespace sksg {
/**
* Concrete Effect node, applying a mask to its descendants.
*
*/
class MaskEffect final : public EffectNode {
public:
enum class Mode : uint32_t {
kAlphaNormal,
kAlphaInvert,
kLumaNormal,
kLumaInvert,
};
static sk_sp<MaskEffect> Make(sk_sp<RenderNode> child, sk_sp<RenderNode> mask,
Mode mode = Mode::kAlphaNormal) {
return (child && mask)
? sk_sp<MaskEffect>(new MaskEffect(std::move(child), std::move(mask), mode))
: nullptr;
}
~MaskEffect() override;
protected:
MaskEffect(sk_sp<RenderNode>, sk_sp<RenderNode> mask, Mode);
void onRender(SkCanvas*, const RenderContext*) const override;
const RenderNode* onNodeAt(const SkPoint&) const override;
SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
private:
const sk_sp<RenderNode> fMaskNode;
const Mode fMaskMode;
typedef EffectNode INHERITED;
};
} // namespace sksg
#endif // SkSGMaskEffect_DEFINED
|
#ifndef __HTTP_NTLM_H
#define __HTTP_NTLM_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* $Id: http_ntlm.h,v 1.2 2007-03-15 19:22:13 andy Exp $
***************************************************************************/
typedef enum {
CURLNTLM_NONE, /* not a ntlm */
CURLNTLM_BAD, /* an ntlm, but one we don't like */
CURLNTLM_FIRST, /* the first 401-reply we got with NTLM */
CURLNTLM_FINE, /* an ntlm we act on */
CURLNTLM_LAST /* last entry in this enum, don't use */
} CURLntlm;
/* this is for ntlm header input */
CURLntlm Curl_input_ntlm(struct connectdata *conn, bool proxy, char *header);
/* this is for creating ntlm header output */
CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy);
void Curl_ntlm_cleanup(struct connectdata *conn);
#ifndef USE_NTLM
#define Curl_ntlm_cleanup(x)
#endif
/* Flag bits definitions based on http://davenport.sourceforge.net/ntlm.html */
#define NTLMFLAG_NEGOTIATE_UNICODE (1<<0)
/* Indicates that Unicode strings are supported for use in security buffer
data. */
#define NTLMFLAG_NEGOTIATE_OEM (1<<1)
/* Indicates that OEM strings are supported for use in security buffer data. */
#define NTLMFLAG_REQUEST_TARGET (1<<2)
/* Requests that the server's authentication realm be included in the Type 2
message. */
/* unknown (1<<3) */
#define NTLMFLAG_NEGOTIATE_SIGN (1<<4)
/* Specifies that authenticated communication between the client and server
should carry a digital signature (message integrity). */
#define NTLMFLAG_NEGOTIATE_SEAL (1<<5)
/* Specifies that authenticated communication between the client and server
should be encrypted (message confidentiality). */
#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6)
/* unknown purpose */
#define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7)
/* Indicates that the LAN Manager session key should be used for signing and
sealing authenticated communications. */
#define NTLMFLAG_NEGOTIATE_NETWARE (1<<8)
/* unknown purpose */
#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9)
/* Indicates that NTLM authentication is being used. */
/* unknown (1<<10) */
/* unknown (1<<11) */
#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12)
/* Sent by the client in the Type 1 message to indicate that a desired
authentication realm is included in the message. */
#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13)
/* Sent by the client in the Type 1 message to indicate that the client
workstation's name is included in the message. */
#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14)
/* Sent by the server to indicate that the server and client are on the same
machine. Implies that the client may use a pre-established local security
context rather than responding to the challenge. */
#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15)
/* Indicates that authenticated communication between the client and server
should be signed with a "dummy" signature. */
#define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a domain. */
#define NTLMFLAG_TARGET_TYPE_SERVER (1<<17)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a server. */
#define NTLMFLAG_TARGET_TYPE_SHARE (1<<18)
/* Sent by the server in the Type 2 message to indicate that the target
authentication realm is a share. Presumably, this is for share-level
authentication. Usage is unclear. */
#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19)
/* Indicates that the NTLM2 signing and sealing scheme should be used for
protecting authenticated communications. */
#define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20)
/* unknown purpose */
#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21)
/* unknown purpose */
#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22)
/* unknown purpose */
#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23)
/* Sent by the server in the Type 2 message to indicate that it is including a
Target Information block in the message. */
/* unknown (1<24) */
/* unknown (1<25) */
/* unknown (1<26) */
/* unknown (1<27) */
/* unknown (1<28) */
#define NTLMFLAG_NEGOTIATE_128 (1<<29)
/* Indicates that 128-bit encryption is supported. */
#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30)
/* unknown purpose */
#define NTLMFLAG_NEGOTIATE_56 (1<<31)
/* Indicates that 56-bit encryption is supported. */
#endif
|
/*=========================================================================
medInria
Copyright (c) INRIA 2013 - 2014. All rights reserved.
See LICENSE.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#pragma once
#include <medAnnotationInteractor.h>
#include <map>
#include <vtkSmartPointer.h>
class medSeedPointAnnotationData;
class medAnnotationInteractor;
class medAnnIntSeedPointHelperPrivate;
class vtkSeedWidget;
class vtkAbstractWidget;
class medAnnIntSeedPointHelper : public msegAnnIntHelper {
public:
medAnnIntSeedPointHelper(medAnnotationInteractor * annInt);
virtual ~medAnnIntSeedPointHelper();
bool addAnnotation( medAnnotationData* annData );
void removeAnnotation( medAnnotationData * annData );
void annotationModified( medAnnotationData* annData );
void refreshFromWidget(vtkSeedWidget * spW);
private:
friend class medAnnIntSeedPointHelperPrivate;
typedef vtkSmartPointer <vtkAbstractWidget> WidgetSmartPointer;
struct ActorInfo {
WidgetSmartPointer actor2d;
WidgetSmartPointer actor3d;
};
typedef std::map<medSeedPointAnnotationData*, ActorInfo> ActorMap;
ActorMap & getActorMap();
bool findActorMapForWidget(vtkAbstractWidget * w, ActorMap::iterator & it);
medAnnIntSeedPointHelperPrivate * d;
};
|
#ifndef TH_CUDA_TENSOR_TOPK_INC
#define TH_CUDA_TENSOR_TOPK_INC
#include "THCTensor.h"
/* Returns the set of all kth smallest (or largest) elements, depending */
/* on `dir` */
THC_API void THCudaTensor_topk(THCState* state,
THCudaTensor* topK,
THCudaTensor* indices,
THCudaTensor* input,
long k, int dim, int dir, int sorted);
#endif
|
//
// CoreData.h
// RestKit
//
// Created by Blake Watters on 9/30/10.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <CoreData/CoreData.h>
#import "ObjectMapping.h"
#import "NSManagedObject+ActiveRecord.h"
#import "RKManagedObjectStore.h"
#import "RKManagedObjectSeeder.h"
#import "RKManagedObjectMapping.h"
#import "RKManagedObjectMappingOperation.h"
#import "RKManagedObjectCaching.h"
#import "RKInMemoryManagedObjectCache.h"
#import "RKFetchRequestManagedObjectCache.h"
#import "RKSearchableManagedObject.h"
#import "RKSearchWord.h"
#import "RKObjectPropertyInspector+CoreData.h"
#import "RKObjectMappingProvider+CoreData.h"
#import "NSManagedObjectContext+RKAdditions.h"
#import "NSManagedObject+RKAdditions.h"
#import "NSEntityDescription+RKAdditions.h"
|
#include "../Tests.h"
#include <ostream>
// Tests for C++ types
struct DLL_API Types
{
// AttributedType
#ifdef __clang__
#define ATTR __attribute__((stdcall))
#else
#define ATTR
#endif
// Note: This fails with C# currently due to mangling bugs.
// Move it back once it's fixed upstream.
typedef int AttributedFuncType(int, int) ATTR;
AttributedFuncType AttributedSum;
};
// Tests code generator to not generate a destructor/finalizer pair
// if the destructor of the C++ class is not public.
class DLL_API TestProtectedDestructors
{
~TestProtectedDestructors();
};
TestProtectedDestructors::~TestProtectedDestructors() {}
// Tests the insertion operator (<<) to ToString method pass
class DLL_API Date
{
public:
Date(int m, int d, int y)
{
mo = m; da = d; yr = y;
}
// Not picked up by parser yet
//friend std::ostream& operator<<(std::ostream& os, const Date& dt);
int mo, da, yr;
std::string testStdString(std::string s);
};
std::ostream& operator<<(std::ostream& os, const Date& dt)
{
os << dt.mo << '/' << dt.da << '/' << dt.yr;
return os;
}
|
//
// MLNavigationController.h
// ViewControllers
//
// Created by Joachim Kret on 22.11.2014.
// Copyright (c) 2014 Joachim Kret. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MLAutorotation.h"
@interface MLNavigationController : UINavigationController <MLAutorotation>
@property (nonatomic, readonly, assign) BOOL appearsFirstTime;
@property (nonatomic, readonly, assign, getter = isViewVisible) BOOL viewVisible;
@property (nonatomic, readwrite, assign) MLAutorotationMode autorotationMode;
@end
@interface MLNavigationController (MLSubclassOnly)
- (void)finishInitialize NS_REQUIRES_SUPER;
@end
|
/* stbiw-0.92 - public domain - http://nothings.org/stb/stb_image_write.h
writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010
no warranty implied; use at your own risk
Before including,
#define STB_IMAGE_WRITE_IMPLEMENTATION
in the file that you want to have the implementation.
ABOUT:
This header file is a library for writing images to C stdio. It could be
adapted to write to memory or a general streaming interface; let me know.
The PNG output is not optimal; it is 20-50% larger than the file
written by a decent optimizing implementation. This library is designed
for source code compactness and simplicitly, not optimal image file size
or run-time performance.
USAGE:
There are three functions, one for each image file format:
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
Each function returns 0 on failure and non-0 on success.
The functions create an image file defined by the parameters. The image
is a rectangle of pixels stored from left-to-right, top-to-bottom.
Each pixel contains 'comp' channels of data stored interleaved with 8-bits
per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is
monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall.
The *data pointer points to the first byte of the top-left-most pixel.
For PNG, "stride_in_bytes" is the distance in bytes from the first byte of
a row of pixels to the first byte of the next row of pixels.
PNG creates output files with the same number of components as the input.
The BMP and TGA formats expand Y to RGB in the file format. BMP does not
output alpha.
PNG supports writing rectangles of data even when the bytes storing rows of
data are not consecutive in memory (e.g. sub-rectangles of a larger image),
by supplying the stride between the beginning of adjacent rows. The other
formats do not. (Thus you cannot write a native-format BMP through the BMP
writer, both because it is in BGR order and because it may have padding
at the end of the line.)
*/
#ifndef INCLUDE_STB_IMAGE_WRITE_H
#define INCLUDE_STB_IMAGE_WRITE_H
#ifdef __cplusplus
extern "C" {
#endif
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
#ifdef __cplusplus
}
#endif
#endif//INCLUDE_STB_IMAGE_WRITE_H
|
//
// XBTagTitleCell.h
// XBScrollPageController
//
// Created by Scarecrow on 15/9/6.
// Copyright (c) 2015年 xiu8. All rights reserved.
//
#import <UIKit/UIKit.h>
@class XBTagTitleModel;
@interface XBTagTitleCell : UICollectionViewCell
@property (nonatomic,strong) XBTagTitleModel *tagTitleModel;
@end
|
//
// ____ _ __ _ _____
// / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \
// \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/
// /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_
// \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/
//
// Copyright Samurai development team and other contributors
//
// http://www.samurai-framework.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "Samurai_Core.h"
#import "Samurai_Event.h"
#import "Samurai_UIConfig.h"
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#pragma mark -
@class SamuraiViewWorkflow;
@interface SamuraiViewWorklet : NSObject
+ (instancetype)worklet;
- (BOOL)processWithContext:(id)context; // override point
@end
#pragma mark -
@interface SamuraiViewWorkflow : NSObject
@prop_unsafe( NSObject *, context );
@prop_strong( NSMutableArray *, worklets );
+ (instancetype)workflow;
+ (instancetype)workflowWithContext:(NSObject *)context;
- (BOOL)process;
@end
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
/* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned char input[1] , unsigned char output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
int main(int argc , char *argv[] )
{
unsigned char input[1] ;
unsigned char output[1] ;
int randomFuns_i5 ;
unsigned char randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned char )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == 119) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
void RandomFunc(unsigned char input[1] , unsigned char output[1] )
{
unsigned char state[1] ;
{
state[0UL] = (input[0UL] + 914778474UL) - (unsigned char)183;
if (state[0UL] & (unsigned char)1) {
if (state[0UL] & (unsigned char)1) {
if (state[0UL] & (unsigned char)1) {
state[0UL] += state[0UL];
state[0UL] += state[0UL];
} else {
state[0UL] += state[0UL];
state[0UL] += state[0UL];
}
} else {
state[0UL] += state[0UL];
state[0UL] += state[0UL];
}
} else {
state[0UL] += state[0UL];
state[0UL] += state[0UL];
}
output[0UL] = state[0UL] + (unsigned char)199;
}
}
void megaInit(void)
{
{
}
}
|
// CppNumericalSolver
#ifndef META_H
#define META_H
#include <iostream>
#include <Eigen/Core>
namespace cppoptlib {
/*template <typename T>
using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
template <typename T>
using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
*/
enum class DebugLevel { None = 0, Low, High };
enum class Status {
NotStarted = -1,
Continue = 0,
IterationLimit,
XDeltaTolerance,
FDeltaTolerance,
GradNormTolerance,
Condition
};
template<typename T>
class Criteria {
public:
size_t iterations; //!< Maximum number of iterations
T xDelta; //!< Minimum change in parameter vector
T fDelta; //!< Minimum change in cost function
T gradNorm; //!< Minimum norm of gradient vector
T condition; //!< Maximum condition number of Hessian
Criteria() {
reset();
}
static Criteria defaults() {
Criteria d;
d.iterations = 10000;
d.xDelta = 0;
d.fDelta = 0;
d.gradNorm = 1e-4;
d.condition = 0;
return d;
}
void reset() {
iterations = 0;
xDelta = 0;
fDelta = 0;
gradNorm = 0;
condition = 0;
}
void print(std::ostream &os) const {
os << "Iterations: " << iterations << std::endl;
os << "xDelta: " << xDelta << std::endl;
os << "fDelta: " << fDelta << std::endl;
os << "GradNorm: " << gradNorm << std::endl;
os << "Condition: " << condition << std::endl;
}
};
template<typename T>
Status checkConvergence(const Criteria<T> &stop, const Criteria<T> ¤t) {
if ((stop.iterations > 0) && (current.iterations > stop.iterations)) {
return Status::IterationLimit;
}
if ((stop.xDelta > 0) && (current.xDelta < stop.xDelta)) {
return Status::XDeltaTolerance;
}
if ((stop.fDelta > 0) && (current.fDelta < stop.fDelta)) {
return Status::FDeltaTolerance;
}
if ((stop.gradNorm > 0) && (current.gradNorm < stop.gradNorm)) {
return Status::GradNormTolerance;
}
if ((stop.condition > 0) && (current.condition > stop.condition)) {
return Status::Condition;
}
return Status::Continue;
}
inline std::ostream &operator<<(std::ostream &os, const Status &s) {
switch (s) {
case Status::NotStarted: os << "Solver not started."; break;
case Status::Continue: os << "Convergence criteria not reached."; break;
case Status::IterationLimit: os << "Iteration limit reached."; break;
case Status::XDeltaTolerance: os << "Change in parameter vector too small."; break;
case Status::FDeltaTolerance: os << "Change in cost function value too small."; break;
case Status::GradNormTolerance: os << "Gradient vector norm too small."; break;
case Status::Condition: os << "Condition of Hessian/Covariance matrix too large."; break;
}
return os;
}
template<typename T>
std::ostream &operator<<(std::ostream &os, const Criteria<T> &c) {
c.print(os);
return os;
}
} // End namespace cppoptlib
#endif /* META_H */
|
// This file is generated by FBC.
#ifndef GEN_H_
#define GEN_H_
#include "fbtypes.h"
typedef union {
struct {
UDINT CountChanged ; //
} event;
} GenOEvents;
typedef struct {
UINT _state;
BOOL _entered;
GenOEvents _output;
LINT Count; //
LINT _Count;
} Gen;
/* Function block initialization function */
void Geninit(Gen* me);
/* Function block execution function */
void Genrun(Gen* me);
/* ECC algorithms */
void Gen_IncCountService(Gen* me);
#endif // GEN_H_
|
/**
* @file Sprite.h
*/
#pragma once
#include "Animation.h"
#include "Action.h"
#include <d3d12.h>
#include <DirectXMath.h>
#include <wrl/client.h>
#include <vector>
#include <memory>
namespace Resource {
struct Texture;
class ResourceLoader;
}
struct PSO;
namespace Sprite {
/**
* Zf[^^.
*/
struct Cell {
DirectX::XMFLOAT2 uv; ///< eNX`ã̶ãÀW.
DirectX::XMFLOAT2 tsize; ///< eNX`ãÌc¡TCY.
DirectX::XMFLOAT2 ssize; ///< XN[ÀWãÌc¡TCY.
};
/**
* XvCg.
*/
struct Sprite
{
Sprite() = delete;
Sprite(const AnimationList& al, DirectX::XMFLOAT3 p, float rot = 0, DirectX::XMFLOAT2 s = DirectX::XMFLOAT2(1, 1), DirectX::XMFLOAT4 col = DirectX::XMFLOAT4(1, 1, 1, 1));
void SetSeqIndex(uint32_t no) { animeController.SetSeqIndex(no); }
void SetActionList(const Action::List* al) { actController.SetList(al); }
void SetAction(uint32_t no) { actController.SetSeqIndex(no); }
void SetCollisionId(int32_t id) { collisionId = id; }
int32_t GetCollisionId() const { return collisionId; }
void Update(double delta) {
animeController.Update(delta);
actController.Update(static_cast<float>(delta), this);
}
uint32_t GetCellIndex() const { return animeController.GetData().cellIndex; }
size_t GetSeqCount() const { return animeController.GetSeqCount(); }
AnimationController animeController;
Action::Controller actController;
int32_t hp;
int32_t collisionId;
DirectX::XMFLOAT3 pos; ///< XN[ÀWãÌXvCgÌÊu.
float rotation; ///< æÌñ]p(WA).
DirectX::XMFLOAT2 scale; ///< æÌgå¦.
DirectX::XMFLOAT4 color; ///< æÌF.
};
/**
* XvCg`æîñ.
*/
struct RenderingInfo
{
D3D12_CPU_DESCRIPTOR_HANDLE rtvHandle; ///< `ææ_[^[Qbg.
D3D12_CPU_DESCRIPTOR_HANDLE dsvHandle; ///< `ææ[xobt@.
D3D12_VIEWPORT viewport; ///< `æpr
[|[g.
D3D12_RECT scissorRect; ///< `æpVUOé`.
ID3D12DescriptorHeap* texDescHeap; ///< eNX`pÌfXNv^q[v.
DirectX::XMFLOAT4X4 matViewProjection; ///< `æÉgp·éÀWÏ·sñ.
};
/**
* ohID.
*/
typedef std::shared_ptr<size_t> BundleId;
/**
* XvCg`æNX.
*/
class Renderer
{
public:
Renderer();
~Renderer() = default;
bool Init(Microsoft::WRL::ComPtr<ID3D12Device> device, int numFrameBuffer, int maxSprite, Resource::ResourceLoader& resourceLoader);
BundleId CreateBundle(const PSO& pso, ID3D12DescriptorHeap* texDescHeap, const Resource::Texture& texture);
bool Begin(int frameIndex);
bool Draw(const std::vector<Sprite>& spriteList, const Cell* cellList, const BundleId& bundleId, RenderingInfo& info);
bool Draw(const Sprite* first, const Sprite* last, const Cell* cellList, const BundleId& bundleId, RenderingInfo& info);
bool End();
ID3D12GraphicsCommandList* GetCommandList();
private:
void DestroyBundle(size_t bundleId);
size_t maxSpriteCount;
int frameBufferCount;
struct FrameResource
{
Microsoft::WRL::ComPtr<ID3D12CommandAllocator> commandAllocator;
Microsoft::WRL::ComPtr<ID3D12Resource> vertexBuffer;
D3D12_VERTEX_BUFFER_VIEW vertexBufferView;
void* vertexBufferGPUAddress;
};
std::vector<FrameResource> frameResourceList;
int currentFrameIndex;
int spriteCount;
Microsoft::WRL::ComPtr<ID3D12GraphicsCommandList> commandList;
Microsoft::WRL::ComPtr<ID3D12Resource> indexBuffer;
D3D12_INDEX_BUFFER_VIEW indexBufferView;
Microsoft::WRL::ComPtr<ID3D12CommandAllocator> bundleAllocator;
std::vector<Microsoft::WRL::ComPtr<ID3D12GraphicsCommandList>> bundleList;
};
/**
* Zf[^Ìzñ.
*/
struct CellList
{
std::string name; ///< Xg¼.
std::vector<Cell> list; ///< Zf[^Ìzñ.
};
/**
* ¡ÌCellListðÜÆß½IuWFNgðì·é½ßÌC^[tFCXNX.
*
* LoadFromJsonFile()ÖðgÁÄC^[tFCXÉε½IuWFNgðæ¾µAGet()Å
* ÂXÌCellListANZX·é.
*/
class File
{
public:
File() = default;
File(const File&) = delete;
File& operator=(const File&) = delete;
virtual ~File() {}
virtual const CellList* Get(uint32_t no) const = 0;
virtual size_t Size() const = 0;
};
typedef std::shared_ptr<File> FilePtr;
FilePtr LoadFromJsonFile(const wchar_t*);
} // namespace Sprite
|
/* On macOS, compile with...
clang 500openGL20b.c -lglfw -framework OpenGL
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdarg.h>
#include <GLFW/glfw3.h>
void handleError(int error, const char *description) {
fprintf(stderr, "handleError: %d\n%s\n", error, description);
}
void handleResize(GLFWwindow *window, int width, int height) {
glViewport(0, 0, width, height);
}
#define triNum 8
#define vertNum 6
#define attrDim 6
GLdouble alpha = 0.0;
GLuint buffers[2];
void initializeMesh(void) {
GLdouble attributes[vertNum * attrDim] = {
1.0, 0.0, 0.0, 1.0, 0.0, 0.0,
-1.0, 0.0, 0.0, 1.0, 1.0, 0.0,
0.0, 1.0, 0.0, 0.0, 1.0, 0.0,
0.0, -1.0, 0.0, 0.0, 1.0, 1.0,
0.0, 0.0, 1.0, 0.0, 0.0, 1.0,
0.0, 0.0, -1.0, 1.0, 0.0, 1.0};
GLuint triangles[triNum * 3] = {
0, 2, 4,
2, 1, 4,
1, 3, 4,
3, 0, 4,
2, 0, 5,
1, 2, 5,
3, 1, 5,
0, 3, 5};
glGenBuffers(2, buffers);
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
glBufferData(GL_ARRAY_BUFFER, vertNum * attrDim * sizeof(GLdouble),
(GLvoid *)attributes, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, triNum * 3 * sizeof(GLuint),
(GLvoid *)triangles, GL_STATIC_DRAW);
}
#include "500shader.c"
GLuint program;
GLint positionLoc, colorLoc;
/* Instead of using OpenGL's modelview and projection matrices, we're going to
use our own transformation matrices, just as in our software graphics engine.
So we need to record their locations. */
GLint viewingLoc, modelingLoc;
/* Returns 0 on success, non-zero on failure. */
int initializeShaderProgram(void) {
/* The two matrices will be sent to the shaders as uniforms. */
GLchar vertexCode[] = "\
uniform mat4 viewing;\
uniform mat4 modeling;\
attribute vec3 position;\
attribute vec3 color;\
varying vec4 rgba;\
void main() {\
gl_Position = viewing * modeling * vec4(position, 1.0);\
rgba = vec4(color, 1.0);\
}";
GLchar fragmentCode[] = "\
varying vec4 rgba;\
void main() {\
gl_FragColor = rgba;\
}";
program = makeProgram(vertexCode, fragmentCode);
if (program != 0) {
glUseProgram(program);
positionLoc = glGetAttribLocation(program, "position");
colorLoc = glGetAttribLocation(program, "color");
/* Record the uniform locations. */
viewingLoc = glGetUniformLocation(program, "viewing");
modelingLoc = glGetUniformLocation(program, "modeling");
}
return (program == 0);
}
#define BUFFER_OFFSET(bytes) ((GLubyte*) NULL + (bytes))
/* Back from the dead. */
#include "510vector.c"
#include "520matrix.c"
// /* We want to pass matrices into OpenGL, but there are two obstacles. First,
// our matrix library uses double matrices, but OpenGL 2.x expects GLfloat
// matrices. Second, C matrices are implicitly stored one-row-after-another, while
// OpenGL expects matrices to be stored one-column-after-another. This function
// plows through both of those obstacles. */
// void mat44OpenGL(double m[4][4], GLfloat openGL[4][4]) {
// for (int i = 0; i < 4; i += 1)
// for (int j = 0; j < 4; j += 1)
// openGL[i][j] = m[j][i];
// }
void render(void) {
/* Clear, and prepare to send our own transformations to the shaders. */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glUseProgram(program);
/* Send our own modeling transformation M to the shaders. */
GLfloat modeling[4][4];
double trans[3] = {0.0, 0.0, 0.0}, axis[3] = {1.0, 1.0, 1.0};
double rot[3][3], model[4][4];
vecUnit(3, axis, axis);
alpha += 0.01;
mat33AngleAxisRotation(alpha, axis, rot);
mat44Isometry(rot, trans, model);
mat44OpenGL(model, modeling);
glUniformMatrix4fv(modelingLoc, 1, GL_FALSE, (GLfloat *)modeling);
/* Send our own viewing transformation P C^-1 to the shaders. */
GLfloat viewing[4][4];
double camInv[4][4], proj[4][4], projCamInv[4][4];
trans[2] = 4.0;
mat33AngleAxisRotation(0.0, axis, rot);
mat44InverseIsometry(rot, trans, camInv);
mat44Orthographic(-2.0, 2.0, -2.0, 2.0, -6.0, -2.0, proj);
mat444Multiply(proj, camInv, projCamInv);
mat44OpenGL(projCamInv, viewing);
glUniformMatrix4fv(viewingLoc, 1, GL_FALSE, (GLfloat *)viewing);
/* The rest of the process is just as in the preceding tutorial. */
glEnableVertexAttribArray(positionLoc);
glEnableVertexAttribArray(colorLoc);
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
glVertexAttribPointer(positionLoc, 3, GL_DOUBLE, GL_FALSE,
attrDim * sizeof(GLdouble), BUFFER_OFFSET(0));
glVertexAttribPointer(colorLoc, 3, GL_DOUBLE, GL_FALSE,
attrDim * sizeof(GLdouble), BUFFER_OFFSET(3 * sizeof(GLdouble)));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[1]);
glDrawElements(GL_TRIANGLES, triNum * 3, GL_UNSIGNED_INT, BUFFER_OFFSET(0));
glDisableVertexAttribArray(positionLoc);
glDisableVertexAttribArray(colorLoc);
}
int main(void) {
glfwSetErrorCallback(handleError);
if (glfwInit() == 0)
return 1;
GLFWwindow *window;
window = glfwCreateWindow(768, 512, "Learning OpenGL 2.0", NULL, NULL);
if (window == NULL) {
glfwTerminate();
return 2;
}
glfwSetWindowSizeCallback(window, handleResize);
glfwMakeContextCurrent(window);
fprintf(stderr, "main: OpenGL %s, GLSL %s.\n",
glGetString(GL_VERSION), glGetString(GL_SHADING_LANGUAGE_VERSION));
glEnable(GL_DEPTH_TEST);
/* OpenGL's depth convention is the opposite of what we've used in our
software engine. There are at least three ways to fix this. First, we could
negate the third row (row 2) of our projection matrices. Second, we could
tell glDepthFunc to use GL_GEQUAL instead of GL_LEQUAL. Third, we could
flip the final depth mapping, as follows. */
glDepthRange(1.0, 0.0);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
initializeMesh();
if (initializeShaderProgram() != 0)
return 3;
while (glfwWindowShouldClose(window) == 0) {
render();
glfwSwapBuffers(window);
glfwPollEvents();
}
glDeleteProgram(program);
glDeleteBuffers(2, buffers);
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}
|
/* Coldfire C Header File
* Copyright Freescale Semiconductor Inc
* All rights reserved.
*
* 2008/04/17 Revision: 0.2
*
* (c) Copyright UNIS, spol. s r.o. 1997-2008
* UNIS, spol. s r.o.
* Jundrovska 33
* 624 00 Brno
* Czech Republic
* http : www.processorexpert.com
* mail : info@processorexpert.com
*/
#ifndef __MCF52259_CLOCK_H__
#define __MCF52259_CLOCK_H__
/*********************************************************************
*
* Clock Module (CLOCK)
*
*********************************************************************/
/* Register read/write macros */
#define MCF_CLOCK_SYNCR (*(vuint16*)(0x40120000))
#define MCF_CLOCK_SYNSR (*(vuint8 *)(0x40120002))
#define MCF_CLOCK_ROCR (*(vuint16*)(0x40120004))
#define MCF_CLOCK_LPDR (*(vuint8 *)(0x40120007))
#define MCF_CLOCK_CCHR (*(vuint8 *)(0x40120008))
#define MCF_CLOCK_CCLR (*(vuint8 *)(0x40120009))
#define MCF_CLOCK_OCHR (*(vuint8 *)(0x4012000A))
#define MCF_CLOCK_OCLR (*(vuint8 *)(0x4012000B))
#define MCF_CLOCK_RTCCR (*(vuint8 *)(0x40120012))
#define MCF_CLOCK_BWCR (*(vuint8 *)(0x40120013))
/* Bit definitions and macros for MCF_CLOCK_SYNCR */
#define MCF_CLOCK_SYNCR_PLLEN (0x1)
#define MCF_CLOCK_SYNCR_PLLMODE (0x2)
#define MCF_CLOCK_SYNCR_CLKSRC (0x4)
#define MCF_CLOCK_SYNCR_FWKUP (0x20)
#define MCF_CLOCK_SYNCR_DISCLK (0x40)
#define MCF_CLOCK_SYNCR_LOCEN (0x80)
#define MCF_CLOCK_SYNCR_RFD(x) (((x)&0x7)<<0x8)
#define MCF_CLOCK_SYNCR_LOCRE (0x800)
#define MCF_CLOCK_SYNCR_MFD(x) (((x)&0x7)<<0xC)
#define MCF_CLOCK_SYNCR_LOLRE (0x8000)
/* Bit definitions and macros for MCF_CLOCK_SYNSR */
#define MCF_CLOCK_SYNSR_LOCS (0x4)
#define MCF_CLOCK_SYNSR_LOCK (0x8)
#define MCF_CLOCK_SYNSR_LOCKS (0x10)
#define MCF_CLOCK_SYNSR_CRYOSC (0x20)
#define MCF_CLOCK_SYNSR_OCOSC (0x40)
#define MCF_CLOCK_SYNSR_EXTOSC (0x80)
/* Bit definitions and macros for MCF_CLOCK_ROCR */
#define MCF_CLOCK_ROCR_TRIM(x) (((x)&0x3FF)<<0)
/* Bit definitions and macros for MCF_CLOCK_LPDR */
#define MCF_CLOCK_LPDR_LPD(x) (((x)&0xF)<<0)
/* Bit definitions and macros for MCF_CLOCK_CCHR */
#define MCF_CLOCK_CCHR_CCHR(x) (((x)&0x7)<<0)
/* Bit definitions and macros for MCF_CLOCK_CCLR */
#define MCF_CLOCK_CCLR_OSCSEL0 (0x1)
#define MCF_CLOCK_CCLR_OSCSEL1 (0x2)
/* Bit definitions and macros for MCF_CLOCK_OCHR */
#define MCF_CLOCK_OCHR_STBY (0x40)
#define MCF_CLOCK_OCHR_OCOEN (0x80)
/* Bit definitions and macros for MCF_CLOCK_OCLR */
#define MCF_CLOCK_OCLR_RANGE (0x10)
#define MCF_CLOCK_OCLR_LPEN (0x20)
#define MCF_CLOCK_OCLR_REFS (0x40)
#define MCF_CLOCK_OCLR_OSCEN (0x80)
/* Bit definitions and macros for MCF_CLOCK_RTCCR */
#define MCF_CLOCK_RTCCR_RTCSEL (0x1)
#define MCF_CLOCK_RTCCR_LPEN (0x2)
#define MCF_CLOCK_RTCCR_REFS (0x4)
#define MCF_CLOCK_RTCCR_KHZEN (0x8)
#define MCF_CLOCK_RTCCR_OSCEN (0x10)
#define MCF_CLOCK_RTCCR_EXTALEN (0x40)
/* Bit definitions and macros for MCF_CLOCK_BWCR */
#define MCF_CLOCK_BWCR_BWDSEL (0x1)
#define MCF_CLOCK_BWCR_BWDSTOP (0x2)
#endif /* __MCF52259_CLOCK_H__ */
|
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include "xsapi/game_server_platform.h"
#include "GameVariant_WinRT.h"
#include "GameVariantSchema_WinRT.h"
#include "GameServerImageSet_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_GAMESERVERPLATFORM_BEGIN
/// <summary>
/// Represents information on game server image sets and game variants.
/// </summary>
public ref class GameServerMetadataResult sealed
{
// Example:
//{
// "variants" :
// [
// {
// "gamevariantId":"041aae97-d359-4244-9b93-2d23ba27cd19",
// "name":"Example Variant",
// "rank":"100",
// "isPublisher":"False"
// "gameVariantSchemaId":"e96582b8-d78d-49e4-afe8-8b7ea3d10806",
// }
// ],
//
// "variantSchemas" :
// [
// {
// "variantSchemaId":"e96582b8-d78d-49e4-afe8-8b7ea3d10806",
// "schemaContent":"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\r\n <xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\r\n<xs:element name=\"testSchema\">\r\n </xs:element> \r\n </xs:schema> ",
// "name":"Example Variant"
// }
// ],
//
// "gsiSets" :
// [
// {
// "gsiSetId":"7efdf3a7-9ce4-4d28-b889-4aeea98727c1",
// "minRequiredPlayers":"2",
// "maxAllowedPlayers":"50",
// "selectionOrder":"1",
// "variantSchemaId":"e96582b8-d78d-49e4-afe8-8b7ea3d10806"
// }
// ]
//}
public:
/// <summary>
/// The collection of game variants.
/// </summary>
property Windows::Foundation::Collections::IVectorView<GameVariant^>^ GameVariants
{
Windows::Foundation::Collections::IVectorView<GameVariant^>^ get();
}
/// <summary>
/// The collection of game server image sets.
/// </summary>
property Windows::Foundation::Collections::IVectorView<GameServerImageSet^>^ GameServerImageSets
{
Windows::Foundation::Collections::IVectorView<GameServerImageSet^>^ get();
}
internal:
GameServerMetadataResult(
_In_ xbox::services::game_server_platform::game_server_metadata_result cppObj
);
private:
xbox::services::game_server_platform::game_server_metadata_result m_cppObj;
Windows::Foundation::Collections::IVector<GameVariant^>^ m_gameVariants;
Windows::Foundation::Collections::IVector<GameServerImageSet^>^ m_gameServerImageSets;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_GAMESERVERPLATFORM_END
|
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation https://xiph.org/ *
* *
********************************************************************
function: illustrate simple use of chained bitstream and vorbisfile.a
********************************************************************/
#include <stdlib.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
#include <io.h>
#include <fcntl.h>
#endif
int main(){
OggVorbis_File ov;
int i;
#ifdef _WIN32 /* We need to set stdin to binary mode. Damn windows. */
/* Beware the evil ifdef. We avoid these where we can, but this one we
cannot. Don't add any more, you'll probably go to hell if you do. */
_setmode( _fileno( stdin ), _O_BINARY );
#endif
/* open the file/pipe on stdin */
if(ov_open_callbacks(stdin,&ov,NULL,-1,OV_CALLBACKS_NOCLOSE)<0){
printf("Could not open input as an OggVorbis file.\n\n");
exit(1);
}
/* print details about each logical bitstream in the input */
if(ov_seekable(&ov)){
printf("Input bitstream contained %ld logical bitstream section(s).\n",
ov_streams(&ov));
printf("Total bitstream samples: %ld\n\n",
(long)ov_pcm_total(&ov,-1));
printf("Total bitstream playing time: %ld seconds\n\n",
(long)ov_time_total(&ov,-1));
}else{
printf("Standard input was not seekable.\n"
"First logical bitstream information:\n\n");
}
for(i=0;i<ov_streams(&ov);i++){
vorbis_info *vi=ov_info(&ov,i);
printf("\tlogical bitstream section %d information:\n",i+1);
printf("\t\t%ldHz %d channels bitrate %ldkbps serial number=%ld\n",
vi->rate,vi->channels,ov_bitrate(&ov,i)/1000,
ov_serialnumber(&ov,i));
printf("\t\theader length: %ld bytes\n",(long)
(ov.dataoffsets[i]-ov.offsets[i]));
printf("\t\tcompressed length: %ld bytes\n",(long)(ov_raw_total(&ov,i)));
printf("\t\tplay time: %lds\n",(long)ov_time_total(&ov,i));
}
ov_clear(&ov);
return 0;
}
|
//
// PopOverContentView.h
// ARIS
//
// Created by Phil Dougherty on 1/7/13.
//
//
#import <UIKit/UIKit.h>
@interface PopOverContentView : UIView
@end
|
#ifndef HCUBE_STL_H_INCLUDED
#define HCUBE_STL_H_INCLUDED
#include <vector>
#include <string>
#include <set>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <climits>
#include <sstream>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#endif // HCUBE_STL_H_INCLUDED
|
//
// MSWeakTimer.h
// MindSnacks
//
// Created by Javier Soto on 1/23/13.
//
//
#import <Foundation/Foundation.h>
/**
`MSWeakTimer` behaves similar to an `NSTimer` but doesn't retain the target.
This timer is implemented using GCD, so you can schedule and unschedule it on arbitrary queues (unlike regular NSTimers!)
*/
@interface MSWeakTimer : NSObject
/**
* Creates a timer with the specified parameters and waits for a call to `-schedule` to start ticking.
* @note It's safe to retain the returned timer by the object that is also the target.
* or the provided `dispatchQueue`.
* @param timeInterval how frequently `selector` will be invoked on `target`. If the timer doens't repeat, it will only be invoked once, approximately `timeInterval` seconds from the time you call this method.
* @param repeats if `YES`, `selector` will be invoked on `target` until the `MSWeakTimer` object is deallocated or until you call `invalidate`. If `NO`, it will only be invoked once.
* @param dispatchQueue the queue where the delegate method will be dispatched. It can be either a serial or concurrent queue.
* @see `invalidate`.
*/
- (id)initWithTimeInterval:(NSTimeInterval)timeInterval
target:(id)target
selector:(SEL)selector
userInfo:(id)userInfo
repeats:(BOOL)repeats
dispatchQueue:(dispatch_queue_t)dispatchQueue;
/**
* Creates an `MSWeakTimer` object and schedules it to start ticking inmediately.
*/
+ (instancetype)scheduledTimerWithTimeInterval:(NSTimeInterval)timeInterval
target:(id)target
selector:(SEL)selector
userInfo:(id)userInfo
repeats:(BOOL)repeats
dispatchQueue:(dispatch_queue_t)dispatchQueue;
/**
* Starts the timer if it hadn't been schedule yet.
* @warning calling this method on an already scheduled timer results in undefined behavior.
*/
- (void)schedule;
/**
* Sets the amount of time after the scheduled fire date that the timer may fire to the given interval.
* @discussion Setting a tolerance for a timer allows it to fire later than the scheduled fire date, improving the ability of the system to optimize for increased power savings and responsiveness. The timer may fire at any time between its scheduled fire date and the scheduled fire date plus the tolerance. The timer will not fire before the scheduled fire date. For repeating timers, the next fire date is calculated from the original fire date regardless of tolerance applied at individual fire times, to avoid drift. The default value is zero, which means no additional tolerance is applied. The system reserves the right to apply a small amount of tolerance to certain timers regardless of the value of this property.
As the user of the timer, you will have the best idea of what an appropriate tolerance for a timer may be. A general rule of thumb, though, is to set the tolerance to at least 10% of the interval, for a repeating timer. Even a small amount of tolerance will have a significant positive impact on the power usage of your application. The system may put a maximum value of the tolerance.
*/
@property (atomic, assign) NSTimeInterval tolerance;
/**
* Causes the timer to be fired synchronously manually on the queue from which you call this method.
* You can use this method to fire a repeating timer without interrupting its regular firing schedule.
* If the timer is non-repeating, it is automatically invalidated after firing, even if its scheduled fire date has not arrived.
*/
- (void)fire;
/**
* You can call this method on repeatable timers in order to stop it from running and trying
* to call the delegate method.
* @note `MSWeakTimer` won't invoke the `selector` on `target` again after calling this method.
* You can call this method from any queue, it doesn't have to be the queue from where you scheduled it.
* Since it doesn't retain the delegate, unlike a regular `NSTimer`, your `dealloc` method will actually be called
* and it's easier to place the `invalidate` call there, instead of figuring out a safe place to do it.
*/
- (void)invalidate;
- (id)userInfo;
@end
|
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: orderlist.h,v 1.9 2001/02/20 07:03:17 jgg Exp $
/* ######################################################################
Order List - Represents and Manipulates an ordered list of packages.
A list of packages can be ordered by a number of conflicting criteria
each given a specific priority. Each package also has a set of flags
indicating some useful things about it that are derived in the
course of sorting. The pkgPackageManager class uses this class for
all of it's installation ordering needs.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_ORDERLIST_H
#define PKGLIB_ORDERLIST_H
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/macros.h>
class pkgDepCache;
class pkgOrderList : protected pkgCache::Namespace
{
protected:
pkgDepCache &Cache;
typedef bool (pkgOrderList::*DepFunc)(DepIterator D);
// These are the currently selected ordering functions
DepFunc Primary;
DepFunc Secondary;
DepFunc RevDepends;
DepFunc Remove;
// State
Package **End;
Package **List;
Package **AfterEnd;
std::string *FileList;
DepIterator Loops[20];
int LoopCount;
int Depth;
unsigned short *Flags;
bool Debug;
// Main visit function
__deprecated bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
bool VisitNode(PkgIterator Pkg, char const* from);
bool VisitDeps(DepFunc F,PkgIterator Pkg);
bool VisitRDeps(DepFunc F,PkgIterator Pkg);
bool VisitRProvides(DepFunc F,VerIterator Ver);
bool VisitProvides(DepIterator Pkg,bool Critical);
// Dependency checking functions.
bool DepUnPackCrit(DepIterator D);
bool DepUnPackPreD(DepIterator D);
bool DepUnPackPre(DepIterator D);
bool DepUnPackDep(DepIterator D);
bool DepConfigure(DepIterator D);
bool DepRemove(DepIterator D);
// Analysis helpers
bool AddLoop(DepIterator D);
bool CheckDep(DepIterator D);
bool DoRun();
// For pre sorting
static pkgOrderList *Me;
static int OrderCompareA(const void *a, const void *b);
static int OrderCompareB(const void *a, const void *b);
int FileCmp(PkgIterator A,PkgIterator B);
public:
typedef Package **iterator;
/* State flags
The Loop flag can be set on a package that is currently being processed by either SmartConfigure or
SmartUnPack. This allows the package manager to tell when a loop has been formed as it will try to
SmartUnPack or SmartConfigure a package with the Loop flag set. It will then either stop (as it knows
that the operation is unnecessary as its already in process), or in the case of the conflicts resolution
in SmartUnPack, use EarlyRemove to resolve the situation. */
enum Flags {Added = (1 << 0), AddPending = (1 << 1),
Immediate = (1 << 2), Loop = (1 << 3),
UnPacked = (1 << 4), Configured = (1 << 5),
Removed = (1 << 6), // Early Remove
InList = (1 << 7),
After = (1 << 8),
States = (UnPacked | Configured | Removed)};
// Flag manipulators
inline bool IsFlag(PkgIterator Pkg,unsigned long F) {return (Flags[Pkg->ID] & F) == F;};
inline bool IsFlag(Package *Pkg,unsigned long F) {return (Flags[Pkg->ID] & F) == F;};
void Flag(PkgIterator Pkg,unsigned long State, unsigned long F) {Flags[Pkg->ID] = (Flags[Pkg->ID] & (~F)) | State;};
inline void Flag(PkgIterator Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
inline void Flag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
// RmFlag removes a flag from a package
inline void RmFlag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] &= ~F;};
// IsNow will return true if the Pkg has been not been either configured or unpacked
inline bool IsNow(PkgIterator Pkg) {return (Flags[Pkg->ID] & (States & (~Removed))) == 0;};
bool IsMissing(PkgIterator Pkg);
void WipeFlags(unsigned long F);
void SetFileList(std::string *FileList) {this->FileList = FileList;};
// Accessors
inline iterator begin() {return List;};
inline iterator end() {return End;};
inline void push_back(Package *Pkg) {*(End++) = Pkg;};
inline void push_back(PkgIterator Pkg) {*(End++) = Pkg;};
inline void pop_back() {End--;};
inline bool empty() {return End == List;};
inline unsigned int size() {return End - List;};
// Ordering modes
bool OrderCritical();
bool OrderUnpack(std::string *FileList = 0);
bool OrderConfigure();
int Score(PkgIterator Pkg);
pkgOrderList(pkgDepCache *Cache);
~pkgOrderList();
};
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2007 Imendio AB
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "giggle-git-config-read.h"
#include <string.h>
typedef struct GiggleGitConfigReadPriv GiggleGitConfigReadPriv;
struct GiggleGitConfigReadPriv {
GHashTable *hash_table;
};
static void git_config_read_finalize (GObject *object);
static void git_config_read_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
static void git_config_read_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec);
static gboolean git_config_read_get_command_line (GiggleJob *job,
gchar **command_line);
static void git_config_read_handle_output (GiggleJob *job,
const gchar *output_str,
gsize output_len);
G_DEFINE_TYPE (GiggleGitConfigRead, giggle_git_config_read, GIGGLE_TYPE_JOB)
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIGGLE_TYPE_GIT_CONFIG_READ, GiggleGitConfigReadPriv))
static void
giggle_git_config_read_class_init (GiggleGitConfigReadClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GiggleJobClass *job_class = GIGGLE_JOB_CLASS (class);
object_class->finalize = git_config_read_finalize;
object_class->get_property = git_config_read_get_property;
object_class->set_property = git_config_read_set_property;
job_class->get_command_line = git_config_read_get_command_line;
job_class->handle_output = git_config_read_handle_output;
g_type_class_add_private (object_class, sizeof (GiggleGitConfigReadPriv));
}
static void
giggle_git_config_read_init (GiggleGitConfigRead *read_config)
{
GiggleGitConfigReadPriv *priv;
priv = GET_PRIV (read_config);
priv->hash_table = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
g_free);
}
static void
git_config_read_finalize (GObject *object)
{
GiggleGitConfigReadPriv *priv;
priv = GET_PRIV (object);
g_hash_table_unref (priv->hash_table);
G_OBJECT_CLASS (giggle_git_config_read_parent_class)->finalize (object);
}
static void
git_config_read_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec)
{
GiggleGitConfigReadPriv *priv;
priv = GET_PRIV (object);
switch (param_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
git_config_read_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GiggleGitConfigReadPriv *priv;
priv = GET_PRIV (object);
switch (param_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static gboolean
git_config_read_get_command_line (GiggleJob *job,
gchar **command_line)
{
*command_line = g_strdup_printf (GIT_COMMAND " repo-config --list");
return TRUE;
}
static void
git_config_read_handle_output (GiggleJob *job,
const gchar *output_str,
gsize output_len)
{
GiggleGitConfigReadPriv *priv;
gchar **lines, **line;
gint i;
priv = GET_PRIV (job);
lines = g_strsplit (output_str, "\n", -1);
for (i = 0; lines[i] && *lines[i]; i++) {
line = g_strsplit (lines[i], "=", 2);
g_hash_table_insert (priv->hash_table, g_strdup (line[0]), g_strdup (line[1]));
g_strfreev (line);
}
g_strfreev (lines);
}
GiggleJob *
giggle_git_config_read_new (void)
{
return g_object_new (GIGGLE_TYPE_GIT_CONFIG_READ, NULL);
}
GHashTable *
giggle_git_config_read_get_config (GiggleGitConfigRead *config)
{
GiggleGitConfigReadPriv *priv;
g_return_val_if_fail (GIGGLE_IS_GIT_CONFIG_READ (config), NULL);
priv = GET_PRIV (config);
return priv->hash_table;
}
|
/*-----------------------------------------------------------------------------
//
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
// SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR
// XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION
// AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION
// OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS
// IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
// AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
// FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
// WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
// IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
// REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
// INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE.
//
// (c) Copyright 2006 Xilinx, Inc.
// All rights reserved.
//
// Revision History:
//
//---------------------------------------------------------------------------*/
/*
* close -- We don't need to do anything, but pretend we did.
*/
int close(int fd)
{
return (0);
}
|
/*
* COPYRIGHT (c) 1989-2012.
* 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.
*/
#if defined(USE_WAIT)
#define TEST_NUMBER "08"
#define TEST_CASE "pthread_cond_wait - blocking"
#elif defined(USE_TIMEDWAIT_WITH_VALUE)
#define TEST_NUMBER "09"
#define TEST_CASE "pthread_cond_timedwait - blocking"
#elif defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST)
#define TEST_NUMBER "10"
#define TEST_CASE "pthread_cond_timedwait - time in past error"
#else
#error "How am I being compiled?"
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <sched.h>
#include <timesys.h>
#include <tmacros.h>
#include <rtems/timerdrv.h>
#include "test_support.h"
#include <pthread.h>
/* forward declarations to avoid warnings */
void *POSIX_Init(void *argument);
void *Middle(void *argument);
void *Low(void *argument);
pthread_cond_t CondID;
pthread_mutex_t MutexID;
struct timespec sleepTime;
void *Low(
void *argument
)
{
long end_time;
end_time = benchmark_timer_read();
put_time(
TEST_CASE,
end_time,
OPERATION_COUNT,
0,
0
);
puts( "*** END OF POSIX TIME TEST PSXTMCOND" TEST_NUMBER " ***" );
rtems_test_exit( 0 );
return NULL;
}
void *Middle(
void *argument
)
{
int rc;
rc = pthread_mutex_lock(&MutexID);
rtems_test_assert( rc == 0 );
/* block and switch to another task here */
#if defined(USE_WAIT)
rc = pthread_cond_wait( &CondID, &MutexID );
rtems_test_assert( rc == 0 );
#elif defined(USE_TIMEDWAIT_WITH_VALUE)
rc = pthread_cond_timedwait( &CondID, &MutexID, &sleepTime );
rtems_test_assert( rc == 0 );
#elif defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST)
{
/* override sleepTime with something obviously in the past */
sleepTime.tv_sec = 0;
sleepTime.tv_nsec = 5;
/* this does all the work of timedwait but immediately returns */
rc = pthread_cond_timedwait( &CondID, &MutexID, &sleepTime );
rtems_test_assert(rc == ETIMEDOUT);
benchmark_timer_read();
}
#endif
pthread_mutex_unlock(&MutexID);
#if defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST)
/*
* In this case, unlock does not switch to another thread. so we need
* to explicitly yield. If we do not yield, then we will measure the
* time required to do an implicit pthread_exit() which is undesirable
* from a measurement viewpoint.
*/
sched_yield();
#endif
return NULL;
}
void *POSIX_Init(
void *argument
)
{
int i;
int status;
pthread_t threadId;
int rc;
struct timeval tp;
puts( "\n\n*** POSIX TIME TEST PSXTMCOND" TEST_NUMBER " ***" );
rc = gettimeofday(&tp, NULL);
rtems_test_assert( rc == 0 );
/* Convert from timeval to timespec */
sleepTime.tv_sec = tp.tv_sec;
sleepTime.tv_nsec = tp.tv_usec * 1000;
sleepTime.tv_nsec += 1;
rc = pthread_cond_init(&CondID, NULL);
rtems_test_assert( rc == 0 );
rc = pthread_mutex_init(&MutexID, NULL);
rtems_test_assert( rc == 0 );
rc = pthread_mutex_lock(&MutexID);
rtems_test_assert( rc == 0 );
for ( i=0 ; i < OPERATION_COUNT - 1 ; i++ ) {
status = pthread_create( &threadId, NULL, Middle, NULL );
rtems_test_assert( !status );
}
status = pthread_create( &threadId, NULL, Low, NULL );
rtems_test_assert( !status );
/* start the timer and switch through all the other tasks */
benchmark_timer_initialize();
rc = pthread_mutex_unlock(&MutexID);
rtems_test_assert( rc == 0 );
/* Should never return. */
return NULL;
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* end of file */
|
/*
* libxml-ext.h
*
* Created on: 2013-8-21
* Author: zhenfan
*/
#ifndef LIBXML_EXT_H_
#define LIBXML_EXT_H_
/**
* @author sohu-inc.com
* 该文件是实现对libxml中xml文件接口的封装,
* 主要实现的对外功能接口包括:
* 1. xml 文件节点的遍历
* 2. 通过某个属性获取某个节点
* 3. 修改某个节点的对应的元素的取值(通过属性或另一个元素值定位)
* 4. 保存修改之xml文件
*/
#include <stdio.h>
#include <stdlib.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xmlstring.h>
#include <glib.h>
#include "chassis-exports.h"
CHASSIS_API xmlDocPtr xml_get_file_ptr(const gchar *xmlFile);
CHASSIS_API xmlNodePtr xml_get_file_node_root(const xmlDocPtr docptr);
CHASSIS_API xmlXPathObjectPtr xml_xpath_get_nodeset(const xmlDocPtr docptr, const xmlChar *xpath);
CHASSIS_API gint xml_xpath_get_nodeset_count(const xmlDocPtr docptr, const xmlChar *xpath);
CHASSIS_API gboolean xml_xpath_onenodeset_addchild(const xmlDocPtr docptr, const xmlChar *xpath, xmlNodePtr childnode);
CHASSIS_API gboolean xml_xpath_onenodeset_delmyself(const xmlDocPtr docptr, const xmlChar *xpath);
CHASSIS_API gboolean xml_xpath_nodeset_delchild_matchtext(const xmlDocPtr docptr, const xmlChar *xpath, const xmlChar *text_content);
CHASSIS_API gboolean xml_xpath_nodeset_ischild_matchtext(const xmlDocPtr docptr, const xmlChar *xpath, const xmlChar *text_content);
CHASSIS_API gboolean xml_xpath_onenodeset_ischild_matchtext(const xmlDocPtr docptr, const xmlChar *xpath, const xmlChar *text_content);
CHASSIS_API xmlChar *xml_xpath_onenodeset_getchild_text(const xmlDocPtr docptr, const xmlChar *xpath);
CHASSIS_API gboolean xml_xpath_onenodeset_setchild_text(const xmlDocPtr docptr, const xmlChar *xpath, const xmlChar *content);
#endif /* LIBXML_EXT_H_ */
|
/* Prototypes of target machine for TILE-Gx.
Copyright (C) 2011-2014 Free Software Foundation, Inc.
Contributed by Walter Lee (walt@tilera.com)
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_TILEGX_PROTOS_H
#define GCC_TILEGX_PROTOS_H
extern void tilegx_init_expanders (void);
extern void tilegx_compute_pcrel_address (rtx, rtx);
extern void tilegx_compute_pcrel_plt_address (rtx, rtx);
extern bool tilegx_legitimate_pic_operand_p (rtx);
extern rtx tilegx_simd_int (rtx, machine_mode);
#ifdef RTX_CODE
extern bool tilegx_bitfield_operand_p (HOST_WIDE_INT, int *, int *);
extern void tilegx_expand_set_const64 (rtx, rtx);
extern bool tilegx_expand_mov (machine_mode, rtx *);
extern void tilegx_expand_unaligned_load (rtx, rtx, HOST_WIDE_INT,
HOST_WIDE_INT, bool);
extern void tilegx_expand_movmisalign (machine_mode, rtx *);
extern void tilegx_allocate_stack (rtx, rtx);
extern bool tilegx_expand_muldi (rtx, rtx, rtx);
extern void tilegx_expand_smuldi3_highpart (rtx, rtx, rtx);
extern void tilegx_expand_umuldi3_highpart (rtx, rtx, rtx);
extern bool tilegx_emit_setcc (rtx[], machine_mode);
extern void tilegx_emit_conditional_branch (rtx[], machine_mode);
extern rtx tilegx_emit_conditional_move (rtx);
extern const char *tilegx_output_cbranch_with_opcode (rtx_insn *, rtx *,
const char *,
const char *, int);
extern const char *tilegx_output_cbranch (rtx_insn *, rtx *, bool);
extern void tilegx_expand_tablejump (rtx, rtx);
extern void tilegx_expand_builtin_vector_binop (rtx (*)(rtx, rtx, rtx),
machine_mode, rtx,
machine_mode, rtx, rtx,
bool);
extern void tilegx_pre_atomic_barrier (enum memmodel);
extern void tilegx_post_atomic_barrier (enum memmodel);
#endif /* RTX_CODE */
extern bool tilegx_can_use_return_insn_p (void);
extern void tilegx_expand_prologue (void);
extern void tilegx_expand_epilogue (bool);
extern int tilegx_initial_elimination_offset (int, int);
extern rtx tilegx_return_addr (int, rtx);
extern rtx tilegx_eh_return_handler_rtx (void);
extern int tilegx_adjust_insn_length (rtx_insn *, int);
extern int tilegx_asm_preferred_eh_data_format (int, int);
extern void tilegx_final_prescan_insn (rtx_insn *);
extern const char *tilegx_asm_output_opcode (FILE *, const char *);
extern void tilegx_function_profiler (FILE *, int);
/* Declare functions in tilegx-c.c */
extern void tilegx_cpu_cpp_builtins (struct cpp_reader *);
#endif /* GCC_TILEGX_PROTOS_H */
|
/*
* Copyright (C) 2003-2010 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.
*/
/*
* The .mpdignore backend code.
*
*/
#ifndef MPD_EXCLUDE_H
#define MPD_EXCLUDE_H
#include <glib.h>
#include <stdbool.h>
/**
* Loads and parses a .mpdignore file.
*/
GSList *
exclude_list_load(const char *path_fs);
/**
* Frees a list returned by exclude_list_load().
*/
void
exclude_list_free(GSList *list);
/**
* Checks whether one of the patterns in the .mpdignore file matches
* the specified file name.
*/
bool
exclude_list_check(GSList *list, const char *name_fs);
#endif
|
/*
* Copyright (C) 2008-2014 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2009 David Robillard <d@drobilla.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __ardour_audiofile_tagger_h__
#define __ardour_audiofile_tagger_h__
#include <string>
#include <taglib/id3v2tag.h>
#include <taglib/infotag.h>
#include <taglib/tag.h>
#include <taglib/taglib.h>
#include <taglib/xiphcomment.h>
#include "ardour/libardour_visibility.h"
namespace ARDOUR
{
class SessionMetadata;
/// Class with static functions for tagging audiofiles
class LIBARDOUR_API AudiofileTagger
{
public:
/* Tags file with metadata, return true on success */
static bool tag_file (std::string const& filename, SessionMetadata const& metadata);
private:
static bool tag_generic (TagLib::Tag& tag, SessionMetadata const& metadata);
static bool tag_vorbis_comment (TagLib::Ogg::XiphComment& tag, SessionMetadata const& metadata);
static bool tag_riff_info (TagLib::RIFF::Info::Tag& tag, SessionMetadata const& metadata);
static bool tag_id3v2 (TagLib::ID3v2::Tag& tag, SessionMetadata const& metadata);
};
} // namespace ARDOUR
#endif /* __ardour_audiofile_tagger_h__ */
|
/*
*
* This source code is part of
*
* G R O M A C S
*
* GROningen MAchine for Chemical Simulations
*
* VERSION 3.2.0
* Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* 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.
*
* If you want to redistribute modifications, please consider that
* scientific software is very special. Version control is crucial -
* bugs must be traceable. We will be happy to consider code for
* inclusion in the official distribution, but derived work must not
* be called official GROMACS. Details are found in the README & COPYING
* files - if they are missing, get the official version at www.gromacs.org.
*
* To help us fund GROMACS development, we humbly ask that you cite
* the papers on the package - you can find them in the top README file.
*
* For more info, check our website at http://www.gromacs.org
*
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
#ifndef _pulldown_h
#define _pulldown_h
#include "popup.h"
typedef struct {
t_windata wd;
int nmenu;
int nsel;
int *xpos;
t_menu **m;
const char **title;
} t_pulldown;
extern t_pulldown *init_pd(t_x11 *x11,Window Parent,int width,int height,
unsigned long fg,unsigned long bg,
int nmenu,int *nsub,t_mentry *ent[],
const char **title);
/* nmenu is the number of submenus, title are the titles of
* the submenus, nsub are the numbers of entries in each submenu
* ent are the entries in the pulldown menu, analogous to these in the
* popup menu.
* The Parent is the parent window, the width is the width of the parent
* window. The Menu is constructed as a bar on the topside of the window
* (as usual). It calculates it own height by the font size.
* !!!
* !!! Do not destroy the ent structure, or the titles, while using
* !!! the menu.
* !!!
* When the menu is selected, a ClientMessage will be sent to the Parent
* specifying the selected item in xclient.data.l[0].
*/
extern void hide_pd(t_x11 *x11,t_pulldown *pd);
/* Hides any menu that is still on the screen when it shouldn't */
extern void check_pd_item(t_pulldown *pd,int nreturn,gmx_bool bStatus);
/* Set the bChecked field in the pd item with return code
* nreturn to bStatus. This function must always be called when
* the bChecked flag has to changed.
*/
extern void done_pd(t_x11 *x11,t_pulldown *pd);
/* This routine destroys the menu pd, and unregisters it with x11 */
extern int pd_width(t_pulldown *pd);
/* Return the width of the window */
extern int pd_height(t_pulldown *pd);
/* Return the height of the window */
#endif /* _pulldown_h */
|
/*
* Copyright (c) 2005 Massachusetts Institute of Technology
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* $Id$ */
#define _NIMLIB_
#include<windows.h>
#include<sync.h>
#include<assert.h>
#define LOCK_OPEN 0
#define LOCK_READING 1
#define LOCK_WRITING 2
KHMEXP void KHMAPI InitializeRwLock(PRWLOCK pLock)
{
pLock->locks = 0;
pLock->status = LOCK_OPEN;
InitializeCriticalSection(&(pLock->cs));
pLock->writewx = CreateEvent(NULL,
FALSE, /* Manual reset */
TRUE, /* Initial state */
NULL);
pLock->readwx = CreateEvent(NULL,
TRUE, /* Manual reset */
TRUE, /* Initial state */
NULL);
}
KHMEXP void KHMAPI DeleteRwLock(PRWLOCK pLock)
{
EnterCriticalSection(&pLock->cs);
CloseHandle(pLock->readwx);
CloseHandle(pLock->writewx);
pLock->readwx = NULL;
pLock->writewx = NULL;
LeaveCriticalSection(&pLock->cs);
DeleteCriticalSection(&(pLock->cs));
}
KHMEXP void KHMAPI LockObtainRead(PRWLOCK pLock)
{
while(1) {
WaitForSingleObject(pLock->readwx, INFINITE);
EnterCriticalSection(&pLock->cs);
if(pLock->status == LOCK_WRITING) {
LeaveCriticalSection(&(pLock->cs));
continue;
} else
break;
}
pLock->locks ++;
pLock->status = LOCK_READING;
ResetEvent(pLock->writewx);
LeaveCriticalSection(&(pLock->cs));
}
KHMEXP void KHMAPI LockReleaseRead(PRWLOCK pLock)
{
EnterCriticalSection(&(pLock->cs));
assert(pLock->status == LOCK_READING);
pLock->locks--;
if(!pLock->locks) {
pLock->status = LOCK_OPEN;
SetEvent(pLock->readwx);
SetEvent(pLock->writewx);
}
LeaveCriticalSection(&(pLock->cs));
}
KHMEXP void KHMAPI LockObtainWrite(PRWLOCK pLock)
{
EnterCriticalSection(&(pLock->cs));
if(pLock->status == LOCK_WRITING &&
pLock->writer == GetCurrentThreadId()) {
pLock->locks++;
LeaveCriticalSection(&(pLock->cs));
return;
}
LeaveCriticalSection(&(pLock->cs));
while(1) {
WaitForSingleObject(pLock->writewx, INFINITE);
EnterCriticalSection(&(pLock->cs));
if(pLock->status == LOCK_OPEN)
break;
LeaveCriticalSection(&(pLock->cs));
}
pLock->status = LOCK_WRITING;
pLock->locks++;
pLock->writer = GetCurrentThreadId();
ResetEvent(pLock->readwx);
ResetEvent(pLock->writewx);
LeaveCriticalSection(&(pLock->cs));
}
KHMEXP void KHMAPI LockReleaseWrite(PRWLOCK pLock)
{
EnterCriticalSection(&(pLock->cs));
assert(pLock->status == LOCK_WRITING);
pLock->locks--;
if(!pLock->locks) {
pLock->status = LOCK_OPEN;
pLock->writer = 0;
SetEvent(pLock->readwx);
SetEvent(pLock->writewx);
}
LeaveCriticalSection(&(pLock->cs));
}
|
/*
* Handling of different ABIs (personalities).
*
* We group personalities into execution domains which have their
* own handlers for kernel entry points, signal mapping, etc...
*
* 2001-05-06 Complete rewrite, Christoph Hellwig (hch@infradead.org)
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/module.h>
#include <linux/personality.h>
#include <linux/sched.h>
#include <linux/sysctl.h>
#include <linux/types.h>
static void default_handler(int, struct pt_regs *);
static struct exec_domain *exec_domains = &default_exec_domain;
static rwlock_t exec_domains_lock = RW_LOCK_UNLOCKED;
static u_long ident_map[32] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31
};
struct exec_domain default_exec_domain = {
.name = "Linux", /* name */
.handler = default_handler, /* lcall7 causes a seg fault. */
.pers_low = 0, /* PER_LINUX personality. */
.pers_high = 0, /* PER_LINUX personality. */
.signal_map = ident_map, /* Identity map signals. */
.signal_invmap = ident_map, /* - both ways. */
};
static void
default_handler(int segment, struct pt_regs *regp)
{
set_personality(0);
if (current_thread_info()->exec_domain->handler != default_handler)
current_thread_info()->exec_domain->handler(segment, regp);
else
send_sig(SIGSEGV, current, 1);
}
static struct exec_domain *
lookup_exec_domain(u_long personality)
{
struct exec_domain * ep;
u_long pers = personality(personality);
read_lock(&exec_domains_lock);
for (ep = exec_domains; ep; ep = ep->next) {
if (pers >= ep->pers_low && pers <= ep->pers_high)
if (try_module_get(ep->module))
goto out;
}
#ifdef CONFIG_KMOD
read_unlock(&exec_domains_lock);
request_module("personality-%ld", pers);
read_lock(&exec_domains_lock);
for (ep = exec_domains; ep; ep = ep->next) {
if (pers >= ep->pers_low && pers <= ep->pers_high)
if (try_module_get(ep->module))
goto out;
}
#endif
ep = &default_exec_domain;
out:
read_unlock(&exec_domains_lock);
return (ep);
}
int
register_exec_domain(struct exec_domain *ep)
{
struct exec_domain *tmp;
int err = -EBUSY;
if (ep == NULL)
return -EINVAL;
if (ep->next != NULL)
return -EBUSY;
write_lock(&exec_domains_lock);
for (tmp = exec_domains; tmp; tmp = tmp->next) {
if (tmp == ep)
goto out;
}
ep->next = exec_domains;
exec_domains = ep;
err = 0;
out:
write_unlock(&exec_domains_lock);
return (err);
}
int
unregister_exec_domain(struct exec_domain *ep)
{
struct exec_domain **epp;
epp = &exec_domains;
write_lock(&exec_domains_lock);
for (epp = &exec_domains; *epp; epp = &(*epp)->next) {
if (ep == *epp)
goto unregister;
}
write_unlock(&exec_domains_lock);
return -EINVAL;
unregister:
*epp = ep->next;
ep->next = NULL;
write_unlock(&exec_domains_lock);
return 0;
}
int
__set_personality(u_long personality)
{
struct exec_domain *ep, *oep;
ep = lookup_exec_domain(personality);
if (ep == current_thread_info()->exec_domain) {
current->personality = personality;
return 0;
}
if (atomic_read(¤t->fs->count) != 1) {
struct fs_struct *fsp, *ofsp;
fsp = copy_fs_struct(current->fs);
if (fsp == NULL) {
module_put(ep->module);
return -ENOMEM;
}
task_lock(current);
ofsp = current->fs;
current->fs = fsp;
task_unlock(current);
put_fs_struct(ofsp);
}
/*
* At that point we are guaranteed to be the sole owner of
* current->fs.
*/
current->personality = personality;
oep = current_thread_info()->exec_domain;
current_thread_info()->exec_domain = ep;
set_fs_altroot();
module_put(oep->module);
return 0;
}
int
get_exec_domain_list(char *page)
{
struct exec_domain *ep;
int len = 0;
read_lock(&exec_domains_lock);
for (ep = exec_domains; ep && len < PAGE_SIZE - 80; ep = ep->next)
len += sprintf(page + len, "%d-%d\t%-16s\t[%s]\n",
ep->pers_low, ep->pers_high, ep->name,
module_name(ep->module));
read_unlock(&exec_domains_lock);
return (len);
}
asmlinkage long
sys_personality(u_long personality)
{
u_long old = current->personality;
if (personality != 0xffffffff) {
set_personality(personality);
if (current->personality != personality)
return -EINVAL;
}
return (long)old;
}
EXPORT_SYMBOL(register_exec_domain);
EXPORT_SYMBOL(unregister_exec_domain);
EXPORT_SYMBOL(__set_personality);
|
/*
* Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
* Copyright (C) 2007-2009 PetaLogix
* Copyright (C) 2006 Atmark Techno, Inc.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/string.h>
#include <linux/seq_file.h>
#include <linux/cpu.h>
#include <linux/initrd.h>
#include <linux/console.h>
#include <linux/debugfs.h>
#include <asm/setup.h>
#include <asm/sections.h>
#include <asm/page.h>
#include <linux/io.h>
#include <linux/bug.h>
#include <linux/param.h>
#include <linux/pci.h>
#include <linux/cache.h>
#include <linux/of_platform.h>
#include <linux/dma-mapping.h>
#include <asm/cacheflush.h>
#include <asm/entry.h>
#include <asm/cpuinfo.h>
#include <asm/system.h>
#include <asm/prom.h>
#include <asm/pgtable.h>
DEFINE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */
DEFINE_PER_CPU(unsigned int, KM); /* Kernel/user mode */
DEFINE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
DEFINE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
DEFINE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
unsigned int boot_cpuid;
char cmd_line[COMMAND_LINE_SIZE];
void __init setup_arch(char **cmdline_p)
{
*cmdline_p = cmd_line;
console_verbose();
unflatten_device_tree();
setup_cpuinfo();
microblaze_cache_init();
setup_memory();
#ifdef CONFIG_EARLY_PRINTK
/* remap early console to virtual address */
remap_early_printk();
#endif
xilinx_pci_init();
#if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER)
printk(KERN_NOTICE "Self modified code enable\n");
#endif
#ifdef CONFIG_VT
#if defined(CONFIG_XILINX_CONSOLE)
conswitchp = &xil_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif
}
#ifdef CONFIG_MTD_UCLINUX
/* Handle both romfs and cramfs types, without generating unnecessary
code (ie no point checking for CRAMFS if it's not even enabled) */
inline unsigned get_romfs_len(unsigned *addr)
{
#ifdef CONFIG_ROMFS_FS
if (memcmp(&addr[0], "-rom1fs-", 8) == 0) /* romfs */
return be32_to_cpu(addr[2]);
#endif
#ifdef CONFIG_CRAMFS
if (addr[0] == le32_to_cpu(0x28cd3d45)) /* cramfs */
return le32_to_cpu(addr[1]);
#endif
return 0;
}
#endif /* CONFIG_MTD_UCLINUX_EBSS */
void __init machine_early_init(const char *cmdline, unsigned int ram,
unsigned int fdt, unsigned int msr)
{
unsigned long *src, *dst;
unsigned int offset = 0;
/* If CONFIG_MTD_UCLINUX is defined, assume ROMFS is at the
* end of kernel. There are two position which we want to check.
* The first is __init_end and the second __bss_start.
*/
#ifdef CONFIG_MTD_UCLINUX
int romfs_size;
unsigned int romfs_base;
char *old_klimit = klimit;
romfs_base = (ram ? ram : (unsigned int)&__init_end);
romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
if (!romfs_size) {
romfs_base = (unsigned int)&__bss_start;
romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
}
/* Move ROMFS out of BSS before clearing it */
if (romfs_size > 0) {
memmove(&_ebss, (int *)romfs_base, romfs_size);
klimit += romfs_size;
}
#endif
/* clearing bss section */
memset(__bss_start, 0, __bss_stop-__bss_start);
memset(_ssbss, 0, _esbss-_ssbss);
/* Copy command line passed from bootloader */
#ifndef CONFIG_CMDLINE_BOOL
if (cmdline && cmdline[0] != '\0')
strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
#endif
lockdep_init();
/* initialize device tree for usage in early_printk */
early_init_devtree((void *)_fdt_start);
#ifdef CONFIG_EARLY_PRINTK
setup_early_printk(NULL);
#endif
printk("Ramdisk addr 0x%08x, ", ram);
if (fdt)
printk("FDT at 0x%08x\n", fdt);
else
printk("Compiled-in FDT at 0x%08x\n",
(unsigned int)_fdt_start);
#ifdef CONFIG_MTD_UCLINUX
printk("Found romfs @ 0x%08x (0x%08x)\n",
romfs_base, romfs_size);
printk("#### klimit %p ####\n", old_klimit);
BUG_ON(romfs_size < 0); /* What else can we do? */
printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
romfs_size, romfs_base, (unsigned)&_ebss);
printk("New klimit: 0x%08x\n", (unsigned)klimit);
#endif
#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
if (msr)
printk("!!!Your kernel has setup MSR instruction but "
"CPU don't have it %x\n", msr);
#else
if (!msr)
printk("!!!Your kernel not setup MSR instruction but "
"CPU have it %x\n", msr);
#endif
/* Do not copy reset vectors. offset = 0x2 means skip the first
* two instructions. dst is pointer to MB vectors which are placed
* in block ram. If you want to copy reset vector setup offset to 0x0 */
#if !CONFIG_MANUAL_RESET_VECTOR
offset = 0x2;
#endif
dst = (unsigned long *) (offset * sizeof(u32));
for (src = __ivt_start + offset; src < __ivt_end; src++, dst++)
*dst = *src;
/* Initialize global data */
per_cpu(KM, 0) = 0x1; /* We start in kernel mode */
per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
}
#ifdef CONFIG_DEBUG_FS
struct dentry *of_debugfs_root;
static int microblaze_debugfs_init(void)
{
of_debugfs_root = debugfs_create_dir("microblaze", NULL);
return of_debugfs_root == NULL;
}
arch_initcall(microblaze_debugfs_init);
#endif
static int dflt_bus_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
struct device *dev = data;
/* We are only intereted in device addition */
if (action != BUS_NOTIFY_ADD_DEVICE)
return 0;
set_dma_ops(dev, &dma_direct_ops);
return NOTIFY_DONE;
}
static struct notifier_block dflt_plat_bus_notifier = {
.notifier_call = dflt_bus_notify,
.priority = INT_MAX,
};
static int __init setup_bus_notifier(void)
{
bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier);
return 0;
}
arch_initcall(setup_bus_notifier);
|
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TextTrackRepresentation_h
#define TextTrackRepresentation_h
#if ENABLE(VIDEO_TRACK)
#include "IntRect.h"
#include "PlatformLayer.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class GraphicsContext;
class IntRect;
class TextTrackRepresentationClient {
public:
virtual ~TextTrackRepresentationClient() { }
virtual void paintTextTrackRepresentation(GraphicsContext*, const IntRect&) = 0;
virtual void textTrackRepresentationBoundsChanged(const IntRect&) = 0;
};
class TextTrackRepresentation {
public:
static PassOwnPtr<TextTrackRepresentation> create(TextTrackRepresentationClient*);
virtual ~TextTrackRepresentation() { }
virtual void update() = 0;
#if USE(ACCELERATED_COMPOSITING)
virtual PlatformLayer* platformLayer() = 0;
#endif
virtual void setContentScale(float) = 0;
virtual IntRect bounds() const = 0;
};
}
#endif
#endif // TextTrackRepresentation_h
|
/**
\file glib/obex-lowlevel.h
OpenOBEX glib bindings low level code.
OpenOBEX library - Free implementation of the Object Exchange protocol.
Copyright (C) 2005-2006 Marcel Holtmann <marcel@holtmann.org>
OpenOBEX is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OpenOBEX. If not, see <http://www.gnu.org/>.
*/
#include <openobex/obex.h>
#ifdef OBEX_CLIENT
#undef OBEX_CLIENT
#endif
typedef struct {
void (*connect_cfm)(obex_t *handle, void *data);
void (*disconn_ind)(obex_t *handle, void *data);
void (*progress_ind)(obex_t *handle, void *data);
void (*command_ind)(obex_t *handle, int event, void *data);
} obex_callback_t;
obex_t *obex_open(int fd, obex_callback_t *callback, void *data);
void obex_close(obex_t *handle);
void obex_poll(obex_t *handle);
int obex_connect(obex_t *handle, const unsigned char *target, size_t size);
int obex_disconnect(obex_t *handle);
int obex_put(obex_t *handle, const char *type, const char *name, int size, time_t mtime);
int obex_get(obex_t *handle, const char *type, const char *name);
int obex_write(obex_t *handle, const char *buf, size_t count, size_t *bytes_written);
int obex_read(obex_t *handle, char *buf, size_t count, size_t *bytes_read);
int obex_abort(obex_t *handle);
int obex_flush(obex_t *handle);
int obex_close_transfer(obex_t *handle);
int obex_get_response(obex_t *handle);
void obex_do_callback(obex_t *handle);
int obex_setpath(obex_t *handle, const char *path, int create);
int obex_delete(obex_t *handle, const char *name);
|
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sched.h>
#include <sys/types.h>
/* Retrieve scheduling algorithm for a particular purpose. */
int
__sched_getscheduler (pid_t pid)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (sched_getscheduler)
weak_alias (__sched_getscheduler, sched_getscheduler)
#include <stub-tag.h>
|
/* $Id: isdn_concap.c,v 1.2 2006/04/18 08:04:25 ijsung Exp $
*
* Linux ISDN subsystem, protocol encapsulation
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
/* Stuff to support the concap_proto by isdn4linux. isdn4linux - specific
* stuff goes here. Stuff that depends only on the concap protocol goes to
* another -- protocol specific -- source file.
*
*/
#include <linux/isdn.h>
#include "isdn_x25iface.h"
#include "isdn_net.h"
#include <linux/concap.h>
#include "isdn_concap.h"
/* The following set of device service operations are for encapsulation
protocols that require for reliable datalink semantics. That means:
- before any data is to be submitted the connection must explicitly
be set up.
- after the successful set up of the connection is signalled the
connection is considered to be reliably up.
Auto-dialing ist not compatible with this requirements. Thus, auto-dialing
is completely bypassed.
It might be possible to implement a (non standardized) datalink protocol
that provides a reliable data link service while using some auto dialing
mechanism. Such a protocol would need an auxiliary channel (i.e. user-user-
signaling on the D-channel) while the B-channel is down.
*/
static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev;
isdn_net_local *lp = isdn_net_get_locked_lp(nd);
IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
if (!lp) {
IX25DEBUG( "isdn_concap_dl_data_req: %s : isdn_net_send_skb returned %d\n", concap -> net_dev -> name, 1);
return 1;
}
lp->huptimer = 0;
isdn_net_writebuf_skb(lp, skb);
spin_unlock_bh(&lp->xmit_lock);
IX25DEBUG( "isdn_concap_dl_data_req: %s : isdn_net_send_skb returned %d\n", concap -> net_dev -> name, 0);
return 0;
}
static int isdn_concap_dl_connect_req(struct concap_proto *concap)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
int ret;
IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
/* dial ... */
ret = isdn_net_dial_req( lp );
if ( ret ) IX25DEBUG("dialing failed\n");
return ret;
}
static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
{
IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
isdn_net_hangup( concap -> net_dev );
return 0;
}
struct concap_device_ops isdn_concap_reliable_dl_dops = {
&isdn_concap_dl_data_req,
&isdn_concap_dl_connect_req,
&isdn_concap_dl_disconn_req
};
/* The following should better go into a dedicated source file such that
this sourcefile does not need to include any protocol specific header
files. For now:
*/
struct concap_proto * isdn_concap_new( int encap )
{
switch ( encap ) {
case ISDN_NET_ENCAP_X25IFACE:
return isdn_x25iface_proto_new();
}
return NULL;
}
|
/*****************************************************************
|
| AP4 - FileByteStream
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento4|GPL.
| Bento4|GPL 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.
|
| Bento4|GPL 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 Bento4|GPL; see the file COPYING. If not, write to the
| Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
| 02111-1307, USA.
|
****************************************************************/
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
#include "Ap4Types.h"
#include "Ap4ByteStream.h"
#include "Ap4Config.h"
#ifndef _AP4_FILE_BYTE_STREAM_H_
#define _AP4_FILE_BYTE_STREAM_H_
/*----------------------------------------------------------------------
| AP4_FileByteStream
+---------------------------------------------------------------------*/
class AP4_FileByteStream: public AP4_ByteStream
{
public:
// types
typedef enum {
STREAM_MODE_READ = 0,
STREAM_MODE_WRITE = 1,
STREAM_MODE_READ_WRITE = 2
} Mode;
/**
* Create a stream from a file (opened or created).
*
* @param name Name of the file open or create
* @param mode Mode to use for the file
* @param stream Refrence to a pointer where the stream object will
* be returned
* @return AP4_SUCCESS if the file can be opened or created, or an error code if
* it cannot
*/
static AP4_Result Create(const char* name, Mode mode, AP4_ByteStream*& stream);
// constructors
AP4_FileByteStream(AP4_ByteStream* delegate) : m_Delegate(delegate) {}
#if !defined(AP4_CONFIG_NO_EXCEPTIONS)
/**
* @deprecated
*/
AP4_FileByteStream(const char* name, Mode mode);
#endif
// AP4_ByteStream methods
AP4_Result ReadPartial(void* buffer,
AP4_Size bytesToRead,
AP4_Size& bytesRead) {
return m_Delegate->ReadPartial(buffer, bytesToRead, bytesRead);
}
AP4_Result WritePartial(const void* buffer,
AP4_Size bytesToWrite,
AP4_Size& bytesWritten) {
return m_Delegate->WritePartial(buffer, bytesToWrite, bytesWritten);
}
AP4_Result Seek(AP4_Position position) { return m_Delegate->Seek(position); }
AP4_Result Tell(AP4_Position& position) { return m_Delegate->Tell(position); }
AP4_Result GetSize(AP4_LargeSize& size) { return m_Delegate->GetSize(size); }
AP4_Result Flush() { return m_Delegate->Flush(); }
// AP4_Referenceable methods
void AddReference() { m_Delegate->AddReference(); }
void Release() { m_Delegate->Release(); }
protected:
// methods
virtual ~AP4_FileByteStream() {
delete m_Delegate;
}
// members
AP4_ByteStream* m_Delegate;
};
#endif // _AP4_FILE_BYTE_STREAM_H_
|
/* Copyright (C) 2005 Analog Devices
Author: Jean-Marc Valin */
/**
@file fixed_bfin.h
@brief Blackfin fixed-point operations
*/
/*
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 Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FIXED_BFIN_H
#define FIXED_BFIN_H
#include "bfin.h"
#undef PDIV32_16
static inline spx_word16_t PDIV32_16(spx_word32_t a, spx_word16_t b)
{
spx_word32_t res, bb;
bb = b;
a += b>>1;
__asm__ (
"P0 = 15;\n\t"
"R0 = %1;\n\t"
"R1 = %2;\n\t"
//"R0 = R0 + R1;\n\t"
"R0 <<= 1;\n\t"
"DIVS (R0, R1);\n\t"
"LOOP divide%= LC0 = P0;\n\t"
"LOOP_BEGIN divide%=;\n\t"
"DIVQ (R0, R1);\n\t"
"LOOP_END divide%=;\n\t"
"R0 = R0.L;\n\t"
"%0 = R0;\n\t"
: "=m" (res)
: "m" (a), "m" (bb)
: "P0", "R0", "R1", "ASTAT" BFIN_HWLOOP0_REGS);
return res;
}
#undef DIV32_16
static inline spx_word16_t DIV32_16(spx_word32_t a, spx_word16_t b)
{
spx_word32_t res, bb;
bb = b;
/* Make the roundinf consistent with the C version
(do we need to do that?)*/
if (a<0)
a += (b-1);
__asm__ (
"P0 = 15;\n\t"
"R0 = %1;\n\t"
"R1 = %2;\n\t"
"R0 <<= 1;\n\t"
"DIVS (R0, R1);\n\t"
"LOOP divide%= LC0 = P0;\n\t"
"LOOP_BEGIN divide%=;\n\t"
"DIVQ (R0, R1);\n\t"
"LOOP_END divide%=;\n\t"
"R0 = R0.L;\n\t"
"%0 = R0;\n\t"
: "=m" (res)
: "m" (a), "m" (bb)
: "P0", "R0", "R1", "ASTAT" BFIN_HWLOOP0_REGS);
return res;
}
#undef MAX16
static inline spx_word16_t MAX16(spx_word16_t a, spx_word16_t b)
{
spx_word32_t res;
__asm__ (
"%1 = %1.L (X);\n\t"
"%2 = %2.L (X);\n\t"
"%0 = MAX(%1,%2);"
: "=d" (res)
: "%d" (a), "d" (b)
: "ASTAT"
);
return res;
}
#undef MULT16_32_Q15
static inline spx_word32_t MULT16_32_Q15(spx_word16_t a, spx_word32_t b)
{
spx_word32_t res;
__asm__
(
"A1 = %2.L*%1.L (M);\n\t"
"A1 = A1 >>> 15;\n\t"
"%0 = (A1 += %2.L*%1.H) ;\n\t"
: "=&W" (res), "=&d" (b)
: "d" (a), "1" (b)
: "A1", "ASTAT"
);
return res;
}
#undef MAC16_32_Q15
static inline spx_word32_t MAC16_32_Q15(spx_word32_t c, spx_word16_t a, spx_word32_t b)
{
spx_word32_t res;
__asm__
(
"A1 = %2.L*%1.L (M);\n\t"
"A1 = A1 >>> 15;\n\t"
"%0 = (A1 += %2.L*%1.H);\n\t"
"%0 = %0 + %4;\n\t"
: "=&W" (res), "=&d" (b)
: "d" (a), "1" (b), "d" (c)
: "A1", "ASTAT"
);
return res;
}
#undef MULT16_32_Q14
static inline spx_word32_t MULT16_32_Q14(spx_word16_t a, spx_word32_t b)
{
spx_word32_t res;
__asm__
(
"%2 <<= 1;\n\t"
"A1 = %1.L*%2.L (M);\n\t"
"A1 = A1 >>> 15;\n\t"
"%0 = (A1 += %1.L*%2.H);\n\t"
: "=W" (res), "=d" (a), "=d" (b)
: "1" (a), "2" (b)
: "A1", "ASTAT"
);
return res;
}
#undef MAC16_32_Q14
static inline spx_word32_t MAC16_32_Q14(spx_word32_t c, spx_word16_t a, spx_word32_t b)
{
spx_word32_t res;
__asm__
(
"%1 <<= 1;\n\t"
"A1 = %2.L*%1.L (M);\n\t"
"A1 = A1 >>> 15;\n\t"
"%0 = (A1 += %2.L*%1.H);\n\t"
"%0 = %0 + %4;\n\t"
: "=&W" (res), "=&d" (b)
: "d" (a), "1" (b), "d" (c)
: "A1", "ASTAT"
);
return res;
}
#endif
|
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDATAWIDGETMAPPER_H
#define QDATAWIDGETMAPPER_H
#include "QtCore/qobject.h"
#ifndef QT_NO_DATAWIDGETMAPPER
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class QAbstractItemDelegate;
class QAbstractItemModel;
class QModelIndex;
class QDataWidgetMapperPrivate;
class Q_GUI_EXPORT QDataWidgetMapper: public QObject
{
Q_OBJECT
Q_ENUMS(SubmitPolicy)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy)
public:
QDataWidgetMapper(QObject *parent = 0);
~QDataWidgetMapper();
void setModel(QAbstractItemModel *model);
QAbstractItemModel *model() const;
void setItemDelegate(QAbstractItemDelegate *delegate);
QAbstractItemDelegate *itemDelegate() const;
void setRootIndex(const QModelIndex &index);
QModelIndex rootIndex() const;
void setOrientation(Qt::Orientation aOrientation);
Qt::Orientation orientation() const;
enum SubmitPolicy { AutoSubmit, ManualSubmit };
void setSubmitPolicy(SubmitPolicy policy);
SubmitPolicy submitPolicy() const;
void addMapping(QWidget *widget, int section);
void addMapping(QWidget *widget, int section, const QByteArray &propertyName);
void removeMapping(QWidget *widget);
int mappedSection(QWidget *widget) const;
QByteArray mappedPropertyName(QWidget *widget) const;
QWidget *mappedWidgetAt(int section) const;
void clearMapping();
int currentIndex() const;
public Q_SLOTS:
void revert();
bool submit();
void toFirst();
void toLast();
void toNext();
void toPrevious();
virtual void setCurrentIndex(int index);
void setCurrentModelIndex(const QModelIndex &index);
Q_SIGNALS:
void currentIndexChanged(int index);
private:
Q_DECLARE_PRIVATE(QDataWidgetMapper)
Q_DISABLE_COPY(QDataWidgetMapper)
Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &))
Q_PRIVATE_SLOT(d_func(), void _q_commitData(QWidget *))
Q_PRIVATE_SLOT(d_func(), void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint))
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QT_NO_DATAWIDGETMAPPER
#endif
|
/**
* @file
*
* @brief Allocate Space for Array in Memory
* @ingroup libcsupport
*/
/*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(RTEMS_NEWLIB) && !defined(HAVE_CALLOC)
#include "malloc_p.h"
#include <stdlib.h>
#include <string.h>
void *calloc(
size_t nelem,
size_t elsize
)
{
register char *cptr;
size_t length;
MSBUMP(calloc_calls, 1);
length = nelem * elsize;
cptr = malloc( length );
if ( cptr )
memset( cptr, '\0', length );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
return cptr;
}
#endif
|
#ifndef __MRUS51S_H_
#define __MRUS51S_H_
#include <linux/wakelock.h>
struct mrus51s_platform_data_struct {
int (*gpio_config) (int mode);
int irq_gpio;
struct wake_lock mrus_wake_lock;
struct workqueue_struct *mrus51s_wq;
struct work_struct work;
struct timer_list timer_detect;//timer to schdule the task to send uevent;
struct device *dev;
};
#endif
|
/*
* Linux cfg80211 driver - Android related functions
*
* Copyright (C) 1999-2017, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: wl_android.h 608194 2015-12-24 04:34:35Z $
*/
#include <linux/module.h>
#include <linux/netdevice.h>
#include <wldev_common.h>
/* If any feature uses the Generic Netlink Interface, put it here to enable WL_GENL
* automatically
*/
#if defined(BT_WIFI_HANDOVER) || defined(WL_NAN)
#define WL_GENL
#endif
#ifdef WL_GENL
#include <net/genetlink.h>
#endif
/**
* Android platform dependent functions, feel free to add Android specific functions here
* (save the macros in dhd). Please do NOT declare functions that are NOT exposed to dhd
* or cfg, define them as static in wl_android.c
*/
/**
* wl_android_init will be called from module init function (dhd_module_init now), similarly
* wl_android_exit will be called from module exit function (dhd_module_cleanup now)
*/
int wl_android_init(void);
int wl_android_exit(void);
void wl_android_post_init(void);
int wl_android_wifi_on(struct net_device *dev);
int wl_android_wifi_off(struct net_device *dev, bool on_failure);
int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
#ifdef WL_GENL
typedef struct bcm_event_hdr {
u16 event_type;
u16 len;
} bcm_event_hdr_t;
/* attributes (variables): the index in this enum is used as a reference for the type,
* userspace application has to indicate the corresponding type
* the policy is used for security considerations
*/
enum {
BCM_GENL_ATTR_UNSPEC,
BCM_GENL_ATTR_STRING,
BCM_GENL_ATTR_MSG,
__BCM_GENL_ATTR_MAX
};
#define BCM_GENL_ATTR_MAX (__BCM_GENL_ATTR_MAX - 1)
/* commands: enumeration of all commands (functions),
* used by userspace application to identify command to be ececuted
*/
enum {
BCM_GENL_CMD_UNSPEC,
BCM_GENL_CMD_MSG,
__BCM_GENL_CMD_MAX
};
#define BCM_GENL_CMD_MAX (__BCM_GENL_CMD_MAX - 1)
/* Enum values used by the BCM supplicant to identify the events */
enum {
BCM_E_UNSPEC,
BCM_E_SVC_FOUND,
BCM_E_DEV_FOUND,
BCM_E_DEV_LOST,
#ifdef BT_WIFI_HANDOVER
BCM_E_DEV_BT_WIFI_HO_REQ,
#endif
BCM_E_MAX
};
s32 wl_genl_send_msg(struct net_device *ndev, u32 event_type,
u8 *string, u16 len, u8 *hdr, u16 hdrlen);
#endif /* WL_GENL */
s32 wl_netlink_send_msg(int pid, int type, int seq, void *data, size_t size);
/* hostap mac mode */
#define MACLIST_MODE_DISABLED 0
#define MACLIST_MODE_DENY 1
#define MACLIST_MODE_ALLOW 2
/* max number of assoc list */
#define MAX_NUM_OF_ASSOCLIST 64
/* Bandwidth */
#define WL_CH_BANDWIDTH_20MHZ 20
#define WL_CH_BANDWIDTH_40MHZ 40
#define WL_CH_BANDWIDTH_80MHZ 80
/* max number of mac filter list
* restrict max number to 10 as maximum cmd string size is 255
*/
#define MAX_NUM_MAC_FILT 10
int wl_android_set_ap_mac_list(struct net_device *dev, int macmode, struct maclist *maclist);
int wl_android_set_roam_offload_bssid_list(struct net_device *dev, const char *cmd);
|
/*
*
* This source code is part of
*
* G R O M A C S
*
* GROningen MAchine for Chemical Simulations
*
* VERSION 3.2.0
* Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* 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.
*
* If you want to redistribute modifications, please consider that
* scientific software is very special. Version control is crucial -
* bugs must be traceable. We will be happy to consider code for
* inclusion in the official distribution, but derived work must not
* be called official GROMACS. Details are found in the README & COPYING
* files - if they are missing, get the official version at www.gromacs.org.
*
* To help us fund GROMACS development, we humbly ask that you cite
* the papers on the package - you can find them in the top README file.
*
* For more info, check our website at http://www.gromacs.org
*
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
#ifndef _mvdata_h
#define _mvdata_h
#include "typedefs.h"
#ifdef __cplusplus
extern "C" {
#endif
void bcast_ir_mtop(const t_commrec *cr,
t_inputrec *inputrec,gmx_mtop_t *mtop);
/* Broadcasts ir and mtop from the master to all nodes in cr->mpi_comm_mygroup.
*/
void bcast_state_setup(const t_commrec *cr,t_state *state);
/* Broadcasts the state sizes and flags
* from the master to all nodes in cr->mpi_comm_mygroup.
* The arrays are not broadcasted.
*/
void bcast_state(const t_commrec *cr,t_state *state,gmx_bool bAlloc);
/* Broadcasts state from the master to all nodes in cr->mpi_comm_mygroup.
* The arrays in state are allocated when bAlloc is TRUE.
*/
/* Routines for particle decomposition only in mvxvf.c */
void move_cgcm(FILE *log,const t_commrec *cr,rvec cg_cm[]);
void move_rvecs(const t_commrec *cr,gmx_bool bForward,gmx_bool bSum,
int left,int right,rvec vecs[],rvec buf[],
int shift,t_nrnb *nrnb);
void move_reals(const t_commrec *cr,gmx_bool bForward,gmx_bool bSum,
int left,int right,real reals[],real buf[],
int shift,t_nrnb *nrnb);
void move_x(FILE *log,const t_commrec *cr,
int left,int right,rvec x[],t_nrnb *nrnb);
void move_rborn(FILE *log,const t_commrec *cr,
int left,int right,real rborn[],t_nrnb *nrnb);
void move_f(FILE *log,const t_commrec *cr,
int left,int right,rvec f[],rvec fadd[],
t_nrnb *nrnb);
void move_gpol(FILE *log,const t_commrec *cr,
int left,int right,real gpol[],real gpol_add[],
t_nrnb *nrnb);
#ifdef __cplusplus
}
#endif
#endif /* _mvdata_h */
|
/*
* Copyright (C) 2012 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _TIGER_REG_ISP_H_
#define _TIGER_REG_ISP_H_
#include <mach/globalregs.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define BIT_0 0x01
#define BIT_1 0x02
#define BIT_2 0x04
#define BIT_3 0x08
#define BIT_4 0x10
#define BIT_5 0x20
#define BIT_6 0x40
#define BIT_7 0x80
#define BIT_8 0x0100
#define BIT_9 0x0200
#define BIT_10 0x0400
#define BIT_11 0x0800
#define BIT_12 0x1000
#define BIT_13 0x2000
#define BIT_14 0x4000
#define BIT_15 0x8000
#define BIT_16 0x010000
#define BIT_17 0x020000
#define BIT_18 0x040000
#define BIT_19 0x080000
#define BIT_20 0x100000
#define BIT_21 0x200000
#define BIT_22 0x400000
#define BIT_23 0x800000
#define BIT_24 0x01000000
#define BIT_25 0x02000000
#define BIT_26 0x04000000
#define BIT_27 0x08000000
#define BIT_28 0x10000000
#define BIT_29 0x20000000
#define BIT_30 0x40000000
#define BIT_31 0x80000000
#define ISP_DCAM_BASE DCAM_BASE
#define ISP_DCAM_INT_STS (ISP_DCAM_BASE + 0x0030UL)
#define ISP_DCAM_INT_CLR (ISP_DCAM_BASE + 0x0038UL)
#define ISP_BASE_ADDR ISP_BASE
#define ISP_LNC_LOAD (ISP_BASE_ADDR+0x0220UL)
#define ISP_AXI_MASTER (ISP_BASE_ADDR+0x2000UL)
#define ISP_INT_RAW (ISP_BASE_ADDR+0x2080UL)
#define ISP_INT_STATUS (ISP_BASE_ADDR+0x2084UL)
#define ISP_INT_EN (ISP_BASE_ADDR+0x2078UL)
#define ISP_INT_CLEAR (ISP_BASE_ADDR+0x207cUL)
#define ISP_REG_MAX_SIZE SPRD_ISP_SIZE
#define ISP_AHB_BASE SPRD_AHB_BASE
#define ISP_AHB_CTL0 (ISP_AHB_BASE + 0x0200UL)
#define ISP_MODULE_EB (ISP_AHB_CTL0 + 0x0000UL)
#define ISP_MODULE_RESET (ISP_AHB_CTL0 + 0x0010UL)
#define ISP_CORE_CLK_EB (ISP_AHB_BASE + 0x0208UL)
/*irq line number in system*/
#define ISP_IRQ IRQ_ISP_INT
#define DCAM_IRQ IRQ_DCAM_INT
#define ISP_EB_BIT BIT_12
#define ISP_RST_BIT BIT_8
#define ISP_CORE_CLK_EB_BIT BIT_7
#define ISP_IRQ_HW_MASK_V0000 (0xfff)
#define ISP_IRQ_NUM_V0000 (12)
#define ISP_TMP_BUF_SIZE_MAX_V0000 (36 * 1024)
#ifdef __cplusplus
}
#endif
#endif //_TIGER_REG_ISP_H_
|
/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. 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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <mysql.h>
#include <mysqld_error.h>
#include <my_pthread.h>
#include <my_sys.h>
#include <mysys_err.h>
#include <m_string.h>
#include <m_ctype.h>
#include "errmsg.h"
#include <violite.h>
#include <sys/stat.h>
#include <signal.h>
#include <time.h>
#include <sql_common.h>
#include "embedded_priv.h"
#include "client_settings.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#if !defined(__WIN__)
#ifdef HAVE_SELECT_H
# include <select.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#endif
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#ifndef INADDR_NONE
#define INADDR_NONE -1
#endif
extern ulong net_buffer_length;
extern ulong max_allowed_packet;
#if defined(__WIN__)
#define ERRNO WSAGetLastError()
#define perror(A)
#else
#include <errno.h>
#define ERRNO errno
#define SOCKET_ERROR -1
#define closesocket(A) close(A)
#endif
#ifdef HAVE_GETPWUID
struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
#ifdef __WIN__
static my_bool is_NT(void)
{
char *os=getenv("OS");
return (os && !strcmp(os, "Windows_NT")) ? 1 : 0;
}
#endif
int mysql_init_character_set(MYSQL *mysql);
MYSQL * STDCALL
mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag)
{
char name_buff[USERNAME_LENGTH + 1];
DBUG_ENTER("mysql_real_connect");
DBUG_PRINT("enter",("host: %s db: %s user: %s (libmysqld)",
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
/* Test whether we're already connected */
if (mysql->server_version)
{
set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
DBUG_RETURN(0);
}
if (!host || !host[0])
host= mysql->options.host;
if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION ||
(mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION &&
host && *host && strcmp(host,LOCAL_HOST)))
DBUG_RETURN(cli_mysql_real_connect(mysql, host, user,
passwd, db, port,
unix_socket, client_flag));
mysql->methods= &embedded_methods;
/* use default options */
if (mysql->options.my_cnf_file || mysql->options.my_cnf_group)
{
mysql_read_default_options(&mysql->options,
(mysql->options.my_cnf_file ?
mysql->options.my_cnf_file : "my"),
mysql->options.my_cnf_group);
my_free(mysql->options.my_cnf_file);
my_free(mysql->options.my_cnf_group);
mysql->options.my_cnf_file=mysql->options.my_cnf_group=0;
}
if (!db || !db[0])
db=mysql->options.db;
if (!user || !user[0])
user=mysql->options.user;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!passwd)
{
passwd=mysql->options.password;
#if !defined(DONT_USE_MYSQL_PWD)
if (!passwd)
passwd=getenv("MYSQL_PWD"); /* get it from environment */
#endif
}
mysql->passwd= passwd ? my_strdup(passwd,MYF(0)) : NULL;
#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/
if (!user || !user[0])
{
read_user_name(name_buff);
if (name_buff[0])
user= name_buff;
}
if (!user)
user= "";
/*
We need to alloc some space for mysql->info but don't want to
put extra 'my_free's in mysql_close.
So we alloc it with the 'user' string to be freed at once
*/
mysql->user= my_strdup(user, MYF(0));
port=0;
unix_socket=0;
client_flag|=mysql->options.client_flag;
/* Send client information for access check */
client_flag|=CLIENT_CAPABILITIES;
if (client_flag & CLIENT_MULTI_STATEMENTS)
client_flag|= CLIENT_MULTI_RESULTS;
/*
no compression in embedded as we don't send any data,
and no pluggable auth, as we cannot do a client-server dialog
*/
client_flag&= ~(CLIENT_COMPRESS | CLIENT_COMPRESS_EVENT | CLIENT_PLUGIN_AUTH);
if (db)
client_flag|=CLIENT_CONNECT_WITH_DB;
mysql->info_buffer= my_malloc(MYSQL_ERRMSG_SIZE, MYF(0));
mysql->thd= create_embedded_thd(client_flag);
init_embedded_mysql(mysql, client_flag);
if (mysql_init_character_set(mysql))
goto error;
if (check_embedded_connection(mysql, db))
goto error;
mysql->server_status= SERVER_STATUS_AUTOCOMMIT;
if (mysql->options.init_commands)
{
DYNAMIC_ARRAY *init_commands= mysql->options.init_commands;
char **ptr= (char**)init_commands->buffer;
char **end= ptr + init_commands->elements;
for (; ptr<end; ptr++)
{
MYSQL_RES *res;
if (mysql_query(mysql,*ptr))
goto error;
if (mysql->fields)
{
if (!(res= (*mysql->methods->use_result)(mysql)))
goto error;
mysql_free_result(res);
}
}
}
DBUG_PRINT("exit",("Mysql handler: 0x%lx", (long) mysql));
DBUG_RETURN(mysql);
error:
DBUG_PRINT("error",("message: %u (%s)",
mysql->net.last_errno,
mysql->net.last_error));
{
/* Free alloced memory */
my_bool free_me=mysql->free_me;
free_old_query(mysql);
mysql->free_me=0;
mysql_close(mysql);
mysql->free_me=free_me;
}
DBUG_RETURN(0);
}
|
#ifndef __KVM_X86_LAPIC_H
#define __KVM_X86_LAPIC_H
#include "iodev.h"
#include "kvm_timer.h"
#include <linux/kvm_host.h>
struct kvm_lapic {
unsigned long base_address;
struct kvm_io_device dev;
struct kvm_timer lapic_timer;
u32 divide_count;
struct kvm_vcpu *vcpu;
bool irr_pending;
/* Number of bits set in ISR. */
s16 isr_count;
/* The highest vector set in ISR; if -1 - invalid, must scan ISR. */
int highest_isr_cache;
/**
* APIC register page. The layout matches the register layout seen by
* the guest 1:1, because it is accessed by the vmx microcode.
* Note: Only one register, the TPR, is used by the microcode.
*/
struct page *regs_page;
void *regs;
gpa_t vapic_addr;
struct page *vapic_page;
};
int kvm_create_lapic(struct kvm_vcpu *vcpu);
void kvm_free_lapic(struct kvm_vcpu *vcpu);
int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu);
int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu);
int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
void kvm_lapic_reset(struct kvm_vcpu *vcpu);
u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);
void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value);
u64 kvm_lapic_get_base(struct kvm_vcpu *vcpu);
void kvm_apic_set_version(struct kvm_vcpu *vcpu);
int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest);
int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda);
int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq);
int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type);
u64 kvm_get_apic_base(struct kvm_vcpu *vcpu);
void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data);
void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu);
int kvm_lapic_enabled(struct kvm_vcpu *vcpu);
bool kvm_apic_present(struct kvm_vcpu *vcpu);
int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu);
u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu);
void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data);
void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr);
void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu);
void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu);
int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data);
int kvm_x2apic_msr_read(struct kvm_vcpu *vcpu, u32 msr, u64 *data);
int kvm_lapic_enable_pv_eoi(struct kvm_vcpu *vcpu, u64 data);
#endif
|
/* Copyright (c) 2002-2012 Croteam Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#ifndef SE_INCL_STATISTICS_INTERNAL_H
#define SE_INCL_STATISTICS_INTERNAL_H
#ifdef PRAGMA_ONCE
#pragma once
#endif
#if !ENGINE_EXPORTS
#error engine-internal file included out of engine!
#endif
#include <Engine/Base/CTString.h>
#include <Engine/Base/Timer.h>
#include <Engine/Templates/StaticArray.h>
class CStatEntry {
public:
INDEX se_iOrder; // order in output
virtual CTString Report(void) = 0;
};
/*
* Statistics counter.
*/
class CStatCounter : public CStatEntry {
public:
CTString sc_strFormat; // printing format (must contain one %f or %g or %e)
FLOAT sc_fCount; // the counter itself
FLOAT sc_fFactor; // printout factor
inline void Clear(void) {};
virtual CTString Report(void);
};
/*
* Statistics timer.
*/
class CStatTimer : public CStatEntry {
public:
CTString st_strFormat; // printing format (must contain one %f or %g or %e)
CTimerValue st_tvStarted; // time when the timer was started last time
CTimerValue st_tvElapsed; // total elapsed time of the timer
FLOAT st_fFactor; // printout factor
inline void Clear(void) {};
virtual CTString Report(void);
};
/*
* Statistics label.
*/
class CStatLabel : public CStatEntry {
public:
CTString sl_strFormat; // printing format
inline void Clear(void) {};
virtual CTString Report(void);
};
/*
* Class for gathering and reporting statistics information.
*/
class CStatForm {
public:
// implementation:
CStaticArray<class CStatCounter> sf_ascCounters; // profiling counters
CStaticArray<class CStatTimer> sf_astTimers; // profiling timers
CStaticArray<class CStatLabel> sf_aslLabels; // profiling labels
// interface:
enum StatLabelIndex
{
SLI_COUNT
};
enum StatTimerIndex
{
STI_WORLDTRANSFORM,
STI_WORLDVISIBILITY,
STI_WORLDRENDERING,
STI_MODELSETUP,
STI_MODELRENDERING,
STI_PARTICLERENDERING,
STI_FLARESRENDERING,
STI_SOUNDUPDATE,
STI_SOUNDMIXING,
STI_TIMER,
STI_MAINLOOP,
STI_RAYCAST,
STI_SHADOWUPDATE,
STI_EFFECTRENDER,
STI_BINDTEXTURE,
STI_GFXAPI,
STI_SWAPBUFFERS,
STI_COUNT
};
enum StatCounterIndex
{
SCI_SCENE_TRIANGLES,
SCI_SCENE_TRIANGLEPASSES,
SCI_SECTORS,
SCI_POLYGONS,
SCI_DETAILPOLYGONS,
SCI_POLYGONEDGES,
SCI_EDGETRANSITIONS,
SCI_SOUNDSMIXING,
SCI_SOUNDSACTIVE,
SCI_CACHEDSHADOWS,
SCI_FLATSHADOWS,
SCI_CACHEDSHADOWBYTES,
SCI_DYNAMICSHADOWS,
SCI_DYNAMICSHADOWBYTES,
SCI_SHADOWBINDS,
SCI_SHADOWBINDBYTES,
SCI_TEXTUREBINDS,
SCI_TEXTUREBINDBYTES,
SCI_TEXTUREUPLOADS,
SCI_TEXTUREUPLOADBYTES,
SCI_PARTICLES,
SCI_MODELS,
SCI_MODELSHADOWS,
SCI_TRIANGLES_USEDMIP,
SCI_TRIANGLES_FIRSTMIP,
SCI_SHADOWTRIANGLES_USEDMIP,
SCI_SHADOWTRIANGLES_FIRSTMIP,
SCI_COUNT
};
CStatForm(void);
void Clear(void);
/* Increment counter by given count. */
inline void IncrementCounter(INDEX iCounter, FLOAT fAdd=1) {
sf_ascCounters[iCounter].sc_fCount += fAdd;
};
/* Start a timer. */
inline void StartTimer(INDEX iTimer) {
CStatTimer &st = sf_astTimers[iTimer];
ASSERT( sf_astTimers[iTimer].st_tvStarted.tv_llValue == -1);
st.st_tvStarted = _pTimer->GetHighPrecisionTimer();
};
/* Stop a timer. */
inline void StopTimer(INDEX iTimer) {
CStatTimer &st = sf_astTimers[iTimer];
ASSERT( sf_astTimers[iTimer].st_tvStarted.tv_llValue != -1);
st.st_tvElapsed += _pTimer->GetHighPrecisionTimer()-st.st_tvStarted;
st.st_tvStarted.tv_llValue = -1;
};
/* Check whether the timer is counting. */
inline BOOL CheckTimer(INDEX iTimer) {
CStatTimer &st = sf_astTimers[iTimer];
return (st.st_tvStarted.tv_llValue != -1);
};
// initialize component
void InitCounter(INDEX iCounter, INDEX iOrder, const char *strFormat, FLOAT fFactor);
void InitTimer(INDEX iTimer, INDEX iOrder, const char *strFormat, FLOAT fFactor);
void InitLabel(INDEX iLabel, INDEX iOrder, const char *strFormat);
// reset all values
void Reset(void);
// make a new report
void Report(CTString &strReport);
};
// one globaly used stats report
ENGINE_API extern CStatForm _sfStats;
#endif /* include-once check. */
|
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** Any non-GPL usage of this software or parts of this software is strictly
** forbidden.
**
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
** $Id: output.h,v 1.21 2004/09/04 14:56:28 menno Exp $
**/
#ifndef __OUTPUT_H__
#define __OUTPUT_H__
#ifdef __cplusplus
extern "C" {
#endif
void* downMix( NeAACDecHandle hDecoder, real_t **input, uint16_t frame_len, uint8_t channel);
void* output_to_PCM(NeAACDecHandle hDecoder,
real_t **input,
void *samplebuffer,
uint8_t channels,
uint16_t frame_len,
uint8_t format);
#ifdef __cplusplus
}
#endif
#endif
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCAMERAEXPOSURECONTROL_H
#define QCAMERAEXPOSURECONTROL_H
#include <QtMultimedia/qmediacontrol.h>
#include <QtMultimedia/qmediaobject.h>
#include <QtMultimedia/qcameraexposure.h>
#include <QtMultimedia/qcamera.h>
#include <QtMultimedia/qmediaenumdebug.h>
QT_BEGIN_NAMESPACE
// Required for QDoc workaround
class QString;
class Q_MULTIMEDIA_EXPORT QCameraExposureControl : public QMediaControl
{
Q_OBJECT
Q_ENUMS(ExposureParameter)
public:
~QCameraExposureControl();
enum ExposureParameter {
ISO,
Aperture,
ShutterSpeed,
ExposureCompensation,
FlashPower,
FlashCompensation,
TorchPower,
SpotMeteringPoint,
ExposureMode,
MeteringMode,
ExtendedExposureParameter = 1000
};
virtual bool isParameterSupported(ExposureParameter parameter) const = 0;
virtual QVariantList supportedParameterRange(ExposureParameter parameter, bool *continuous) const = 0;
virtual QVariant requestedValue(ExposureParameter parameter) const = 0;
virtual QVariant actualValue(ExposureParameter parameter) const = 0;
virtual bool setValue(ExposureParameter parameter, const QVariant& value) = 0;
Q_SIGNALS:
void requestedValueChanged(int parameter);
void actualValueChanged(int parameter);
void parameterRangeChanged(int parameter);
protected:
QCameraExposureControl(QObject* parent = 0);
};
#define QCameraExposureControl_iid "org.qt-project.qt.cameraexposurecontrol/5.0"
Q_MEDIA_DECLARE_CONTROL(QCameraExposureControl, QCameraExposureControl_iid)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QCameraExposureControl::ExposureParameter)
Q_MEDIA_ENUM_DEBUG(QCameraExposureControl, ExposureParameter)
#endif // QCAMERAEXPOSURECONTROL_H
|
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum 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 cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @author Christian <c@ethdev.com>
* @date 2014
* Formatting functions for errors referencing positions and locations in the source.
*/
#pragma once
#include <ostream>
#include <libsolidity/BaseTypes.h>
namespace dev
{
struct Exception; // forward
namespace solidity
{
class Scanner; // forward
class CompilerStack; // forward
struct SourceReferenceFormatter
{
public:
static void printSourceLocation(std::ostream& _stream, Location const& _location, Scanner const& _scanner);
static void printExceptionInformation(std::ostream& _stream, Exception const& _exception,
std::string const& _name, CompilerStack const& _compiler);
};
}
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "thrift.h"
#include "protocol/thrift_binary_protocol.h"
#include "protocol/thrift_binary_protocol_factory.h"
G_DEFINE_TYPE(ThriftBinaryProtocolFactory, thrift_binary_protocol_factory, THRIFT_TYPE_PROTOCOL_FACTORY)
ThriftProtocol *
thrift_binary_protocol_factory_get_protocol (ThriftProtocolFactory *factory,
ThriftTransport *transport)
{
THRIFT_UNUSED_VAR (factory);
ThriftBinaryProtocol *tb = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL,
"transport", transport, NULL);
return THRIFT_PROTOCOL (tb);
}
static void
thrift_binary_protocol_factory_class_init (ThriftBinaryProtocolFactoryClass *cls)
{
ThriftProtocolFactoryClass *protocol_factory_class = THRIFT_PROTOCOL_FACTORY_CLASS (cls);
protocol_factory_class->get_protocol = thrift_binary_protocol_factory_get_protocol;
}
static void
thrift_binary_protocol_factory_init (ThriftBinaryProtocolFactory *factory)
{
THRIFT_UNUSED_VAR (factory);
}
|
/* Lzma86Enc.h -- LZMA + x86 (BCJ) Filter Encoder
2008-08-05
Igor Pavlov
Public domain */
#ifndef __LZMA86ENC_H
#define __LZMA86ENC_H
#include "Types.h"
/*
It's an example for LZMA + x86 Filter use.
You can use .lzma86 extension, if you write that stream to file.
.lzma86 header adds one additional byte to standard .lzma header.
.lzma86 header (14 bytes):
Offset Size Description
0 1 = 0 - no filter,
= 1 - x86 filter
1 1 lc, lp and pb in encoded form
2 4 dictSize (little endian)
6 8 uncompressed size (little endian)
Lzma86_Encode
-------------
level - compression level: 0 <= level <= 9, the default value for "level" is 5.
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes, for level = 5.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
For better compression ratio dictSize must be >= inSize.
filterMode:
SZ_FILTER_NO - no Filter
SZ_FILTER_YES - x86 Filter
SZ_FILTER_AUTO - it tries both alternatives to select best.
Encoder will use 2 or 3 passes:
2 passes when FILTER_NO provides better compression.
3 passes when FILTER_YES provides better compression.
Lzma86Encode allocates Data with MyAlloc functions.
RAM Requirements for compressing:
RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize
filterMode FilterBlockSize
SZ_FILTER_NO 0
SZ_FILTER_YES inSize
SZ_FILTER_AUTO inSize
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
enum ESzFilterMode
{
SZ_FILTER_NO,
SZ_FILTER_YES,
SZ_FILTER_AUTO
};
SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
int level, UInt32 dictSize, int filterMode);
#endif
|
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef PLSEEKPOINTMOD_INC
#define PLSEEKPOINTMOD_INC
#include "pnModifier/plMultiModifier.h"
#include "pnMessage/plMessage.h"
// PLSEEKPOINTMOD
// This modifier is something the avatar knows how to go to. (you know, seek)
// It's kind of like a magnet that, when activated, draws the avatar...
// Seen another way, it's a point with a name and a type....
class plSeekPointMod : public plMultiModifier
{
protected:
virtual bool IEval(double secs, float del, uint32_t dirty) {return true;}
char * fName; // public because you can't change it
public:
plSeekPointMod();
plSeekPointMod(char *name);
virtual ~plSeekPointMod();
const char * GetName() { return fName; };
void SetName(char * name) { fName = name; };
CLASSNAME_REGISTER( plSeekPointMod );
GETINTERFACE_ANY( plSeekPointMod, plMultiModifier );
virtual void AddTarget(plSceneObject* so);
bool MsgReceive(plMessage* msg);
virtual void Read(hsStream *stream, hsResMgr *mgr);
virtual void Write(hsStream *stream, hsResMgr *mgr);
};
#endif
|
/* Fat binary fallback mpn_copyi
Copyright 2003 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP 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. */
#include "mpir.h"
#include "gmp-impl.h"
void mpn_copyi(mp_ptr rp,mp_srcptr sp,mp_size_t n)
{
MPN_COPY_INCR(rp,sp,n);
return;
}
|
/***************************************************************************
* Copyright (C) 1998-2010 by authors (see AUTHORS.txt ) *
* *
* This file is part of LuxRays. *
* *
* LuxRays is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* LuxRays 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/>. *
* *
* LuxRays website: http://www.luxrender.net *
***************************************************************************/
#ifndef _EDITACTION_H
#define _EDITACTION_H
#include <set>
#include "smalllux.h"
enum EditAction {
FILM_EDIT, // Use this for image Film resize
CAMERA_EDIT, // Use this for any Camera parameter editing
GEOMETRY_EDIT, // Use this for any DataSet related editing
INSTANCE_TRANS_EDIT, // Use this for any instance transformation related editing
MATERIALS_EDIT, // Use this for any Material related editing
MATERIAL_TYPES_EDIT, // Use this if the kind of materials changes
AREALIGHTS_EDIT, // Use this for any AreaLight related editing
INFINITELIGHT_EDIT, // Use this for any InfiniteLight related editing
SUNLIGHT_EDIT, // Use this for any SunLight related editing
SKYLIGHT_EDIT, // Use this for any SkyLight related editing
TEXTUREMAPS_EDIT // Use this for any TextureMaps related editing
};
class EditActionList {
public:
EditActionList() { };
~EditActionList() { };
void Reset() { actions.clear(); }
void AddAction(const EditAction a) { actions.insert(a); };
void AddAllAction() {
AddAction(FILM_EDIT);
AddAction(CAMERA_EDIT);
AddAction(GEOMETRY_EDIT);
AddAction(INSTANCE_TRANS_EDIT);
AddAction(MATERIALS_EDIT);
AddAction(MATERIAL_TYPES_EDIT);
AddAction(AREALIGHTS_EDIT);
AddAction(INFINITELIGHT_EDIT);
AddAction(SUNLIGHT_EDIT);
AddAction(SKYLIGHT_EDIT);
AddAction(TEXTUREMAPS_EDIT);
}
bool Has(const EditAction a) const { return (actions.find(a) != actions.end()); };
size_t Size() const { return actions.size(); };
friend std::ostream &operator<<(std::ostream &os, const EditActionList &eal);
private:
set<EditAction> actions;
};
inline std::ostream &operator<<(std::ostream &os, const EditActionList &eal) {
os << "EditActionList[";
bool sep = false;
for (set<EditAction>::const_iterator it = eal.actions.begin(); it!=eal.actions.end(); ++it) {
if (sep)
os << ", ";
switch (*it) {
case FILM_EDIT:
os << "FILM_EDIT";
break;
case CAMERA_EDIT:
os << "CAMERA_EDIT";
break;
case GEOMETRY_EDIT:
os << "GEOMETRY_EDIT";
break;
case INSTANCE_TRANS_EDIT:
os << "INSTANCE_TRANS_EDIT";
break;
case MATERIALS_EDIT:
os << "MATERIALS_EDIT";
break;
case MATERIAL_TYPES_EDIT:
os << "MATERIAL_TYPES_EDIT";
break;
case AREALIGHTS_EDIT:
os << "AREALIGHTS_EDIT";
break;
case INFINITELIGHT_EDIT:
os << "INFINITELIGHT_EDIT";
break;
case SUNLIGHT_EDIT:
os << "SUNLIGHT_EDIT";
break;
case SKYLIGHT_EDIT:
os << "SKYLIGHT_EDIT";
break;
case TEXTUREMAPS_EDIT:
os << "TEXTUREMAPS_EDIT";
break;
default:
os << "UNKNOWN[" << *it << "]";
break;
}
}
os << "]";
return os;
}
#endif /* _EDITACTION_H */
|
// define default debug level
#ifdef DEBUG_NXTRANSLATE
#define DEBUG1_NXTRANSLATE
#endif
// ----- level three debugging
#ifdef DEBUG3_NXTRANSLATE
#define DEBUG2_NXTRANSLATE
#define DEBUG3_NEXUS_UTIL
#define DEBUG3_XML_PARSER
#endif
// ----- level two debugging
#ifdef DEBUG2_NXTRANSLATE
#define DEBUG1_NXTRANSLATE
#define DEBUG2_NEXUS_UTIL
#define DEBUG2_XML_PARSER
#endif
// ----- level one debugging
#ifdef DEBUG1_NXTRANSLATE
#define DEBUG1_NEXUS_UTIL
#define DEBUG1_XML_PARSER
#endif
|
/*
** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
**
** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
** Universitaet Karlsruhe, Germany
** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
** Universitaet Wuppertal, Germany
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Library General Public
** License as published by the Free Software Foundation; either
** version 2 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** You should have received a copy of the GNU Library General Public
** License along with this library; if not, write to the Free
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* CVS $Id: b_bsub.c,v 1.21 2014/01/30 17:24:03 cxsc Exp $ */
/************************************************************************/
/* */
/* Descriptive Name : b_bsub.c Processor : C */
/* */
/* Subtract numbers in intern representation */
/* */
/* Function value : int 0 - intern numbers added */
/* OFLOW - exponent overflow */
/* UFLOW - exponent underflow */
/* ALLOC - allocation error */
/* */
/************************************************************************/
#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif
#ifdef LINT_ARGS
local int b_bsub(multiprecision i1,multiprecision i2,multiprecision r)
#else
local int b_bsub(i1,i2,r)
multiprecision i1;
multiprecision i2; /* pointer to intern variables */
multiprecision r; /* pointer to intern result */
#endif
{
a_intg cv; /* compare value */
/*----------------------------------------------------------------------*/
if (i1->z)
{
if (b_bcpy(i2,r)) return(ALLOC);
r->s = 1-i2->s;
return(0);
}
/* first operand is zero */
/*----------------------------------------------------------------------*/
if (i2->z) return(b_bcpy(i1,r));
/* second operand is zero */
/*----------------------------------------------------------------------*/
cv = b_bacm(i1,i2);
/* compare absolute values of intern numbers */
/*----------------------------------------------------------------------*/
if (i1->s!=i2->s)
{
r->s = i1->s;
if (cv>=0)
return(b_baad(i1,i2,r));
else
return(b_baad(i2,i1,r));
} /* addition of equaly signed numbers */
/*----------------------------------------------------------------------*/
if (cv<0)
{
r->s = 1-i1->s;
return(b_basu(i2,i1,r));
} /* subtract first from second absolute value */
/*----------------------------------------------------------------------*/
if (cv)
{
r->s = i1->s;
return(b_basu(i1,i2,r));
} /* subtract second from first absolute value */
/*----------------------------------------------------------------------*/
if (r->l)
{
r->l = 0;
#ifdef HEAP_CHECK
b_freh((a_char *)&r->m,(a_char *)r->m,(a_char *)"b_bsub");
#endif
B_FREE(r->m)
}
r->z = 1;
r->r = 0; /* subtraction of equal absolute values */
/*----------------------------------------------------------------------*/
return(0);
}
|
/* OSCATS: Open-Source Computerized Adaptive Testing System
* CAT Algorithm: Estimate latent IRT ability
* Copyright 2011 Michael Culbertson <culbert1@illinois.edu>
*
* OSCATS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OSCATS 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 OSCATS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LIBOSCATS_ALGORITHM_ESTIMATE_H_
#define _LIBOSCATS_ALGORITHM_ESTIMATE_H_
#include <glib-object.h>
#include <algorithm.h>
#include <integrate.h>
G_BEGIN_DECLS
#define OSCATS_TYPE_ALG_ESTIMATE (oscats_alg_estimate_get_type())
#define OSCATS_ALG_ESTIMATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSCATS_TYPE_ALG_ESTIMATE, OscatsAlgEstimate))
#define OSCATS_IS_ALG_ESTIMATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSCATS_TYPE_ALG_ESTIMATE))
#define OSCATS_ALG_ESTIMATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OSCATS_TYPE_ALG_ESTIMATE, OscatsAlgEstimateClass))
#define OSCATS_IS_ALG_ESTIMATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSCATS_TYPE_ALG_ESTIMATE))
#define OSCATS_ALG_ESTIMATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OSCATS_TYPE_ALG_ESTIMATE, OscatsAlgEstimateClass))
typedef struct _OscatsAlgEstimate OscatsAlgEstimate;
typedef struct _OscatsAlgEstimateClass OscatsAlgEstimateClass;
/**
* OscatsAlgEstimate
*
* Statistics algorithm (#OscatsTest::administered).
* Update the examinee's latent IRT ability estimate.
*/
struct _OscatsAlgEstimate {
OscatsAlgorithm parent_instance;
/*< private >*/
gboolean eap, independent;
guint Nposterior;
GQuark modelKey, thetaKey;
gdouble tol;
GGslVector *Dprior;
gsl_vector *mu; // population parameters for eap
gsl_matrix *Sigma_half;
// Temporary integration slots, held without reference
OscatsExaminee *e;
// Working space
OscatsIntegrate *integrator, *normalizer;
OscatsPoint *x;
gsl_vector *tmp, *tmp2;
gint flag;
guint dim;
};
struct _OscatsAlgEstimateClass {
OscatsAlgorithmClass parent_class;
};
GType oscats_alg_estimate_get_type();
G_END_DECLS
#endif
|
/*
Copyright 2009 Marc Suñe Clos, Isaac Gelado
This file is part of the NetGPU framework.
The NetGPU framework is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The NetGPU framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*/
#ifndef General_h
#define General_h
#include "../../../../Util.h"
//Macros used to create CONCATENATED names
#define _COMPOUND_NAME(PREFIX,NAME)\
PREFIX##_##NAME
#define COMPOUND_NAME(PREFIX,NAME)\
_COMPOUND_NAME(PREFIX,NAME)
/* GENERAL MACROS */
#define BUFFER_BLOCKS (MAX_BUFFER_PACKETS/ANALYSIS_TPB)
#define ARRAY_SIZE(type) \
(sizeof(type)*MAX_BUFFER_PACKETS)
#if HAS_WINDOW == 1
//Window special case
#define POS threadIdx.x + (state.blockIterator*blockDim.x)
#define RELATIVE_MINING_POS (threadIdx.x + ((state.blockIterator-state.windowState.blocksPreviouslyMined)*blockDim.x))
#else
#define POS threadIdx.x + (blockIdx.x*blockDim.x) //Absolute thread number
#endif
/* Packet inside buffer */
#if HAS_WINDOW == 1
#define PACKET (&GPU_buffer[RELATIVE_MINING_POS])
#else
#define PACKET (&GPU_buffer[POS])
#endif
/*GPU_data element */
#define DATA_ELEMENT GPU_data[POS]
/*GPU_results element */
#define RESULT_ELEMENT GPU_results[POS]
/* GETS HEADERS POINTER at level*/
#define GET_HEADER_POINTER(level) \
(((uint8_t*)&(PACKET->packet))+PACKET->headers.offset[level])
//Gets field safely, to get disaligned fields
#define GET_FIELD(field) cudaNetworkToHost(cudaSafeGet(&(field))) //TODO: ENDIANISME ELIMINAR EL CUDANETWORKTOHOST
//* BARRIERS */
//Block barrier
#define SYNCTHREADS() __syncthreads()
//Predefined Analysis Barrier (syncblocks)
#ifndef DONT_EXPAND_SYNCBLOCKS
#define SYNCBLOCKS_PRECODED() } \
template<typename T,typename R>\
__global__ void COMPOUND_NAME(COMPOUND_NAME(ANALYSIS_NAME,PredefinedKernel),_PRECODED_COUNTER)(packet_t* GPU_buffer,T* GPU_data,R* GPU_results, analysisState_t state){\
do{}while(0)
#endif
//User Grid barrier
#ifndef DONT_EXPAND_SYNCBLOCKS
#define SYNCBLOCKS() } \
template<typename T,typename R>\
__device__ __inline__ void COMPOUND_NAME(COMPOUND_NAME(ANALYSIS_NAME,AnalysisExtraRoutine),__COUNTER__)(packet_t* GPU_buffer, T* GPU_data,R* GPU_results, analysisState_t state){\
do{}while(0)
#endif
/* HAS_REACHED_WINDOW_LIMIT MACRO */
#define IF_HAS_REACHED_WINDOW_LIMIT()\
if(state.windowState.hasReachedWindowLimit)
#endif //General_h
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_uikitevents_h_
#define SDL_uikitevents_h_
#include "../SDL_sysvideo.h"
extern void UIKit_PumpEvents(_THIS);
extern void SDL_InitGCKeyboard(void);
extern SDL_bool SDL_HasGCKeyboard(void);
extern void SDL_QuitGCKeyboard(void);
extern void SDL_InitGCMouse(void);
extern SDL_bool SDL_HasGCMouse(void);
extern void SDL_QuitGCMouse(void);
#endif /* SDL_uikitevents_h_ */
/* vi: set ts=4 sw=4 expandtab: */
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLJSICONS_H
#define QMLJSICONS_H
#include <qmljs/qmljs_global.h>
#include <qmljs/parser/qmljsast_p.h>
QT_FORWARD_DECLARE_CLASS(QIcon)
namespace QmlJS {
class IconsPrivate;
class QMLJS_EXPORT Icons
{
public:
~Icons();
static Icons *instance();
void setIconFilesPath(const QString &iconPath);
QIcon icon(const QString &packageName, const QString typeName) const;
QIcon icon(AST::Node *node) const;
QIcon objectDefinitionIcon() const;
QIcon scriptBindingIcon() const;
QIcon publicMemberIcon() const;
QIcon functionDeclarationIcon() const;
private:
Icons();
static Icons *m_instance;
IconsPrivate *d;
};
} // namespace QmlJS
#endif // QMLJSICONS_H
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef ANDROIDRUNSUPPORT_H
#define ANDROIDRUNSUPPORT_H
#include "androidrunconfiguration.h"
namespace ProjectExplorer { class RunControl; }
namespace Android {
namespace Internal {
class AndroidRunner;
class AndroidRunSupport : public QObject
{
Q_OBJECT
public:
AndroidRunSupport(AndroidRunConfiguration *runConfig,
ProjectExplorer::RunControl *runControl);
protected slots:
virtual void handleRemoteProcessFinished(const QString &errorMsg);
virtual void handleRemoteOutput(const QByteArray &output);
virtual void handleRemoteErrorOutput(const QByteArray &output);
protected:
ProjectExplorer::RunControl* m_runControl;
AndroidRunner * const m_runner;
};
} // namespace Internal
} // namespace Android
#endif // ANDROIDRUNSUPPORT_H
|
/*
* Copyright 2012 <James.Bottomley@HansenPartnership.com>
*
* see COPYING file
*/
#include <stdint.h>
#define __STDC_VERSION__ 199901L
#include <efi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <guid.h>
#include <variables.h>
#include <version.h>
static void
usage(const char *progname)
{
printf("Usage: %s [-g <guid>] <crt file> <efi sig list file>\n", progname);
}
static void
help(const char * progname)
{
usage(progname);
printf("Take an input X509 certificate (in PEM format) and convert it to an EFI\n"
"signature list file containing only that single certificate\n\n"
"Options:\n"
"\t-g <guid> Use <guid> as the owner of the signature. If this is not\n"
"\t supplied, an all zero guid will be used\n"
);
}
int
main(int argc, char *argv[])
{
char *certfile, *efifile;
const char *progname = argv[0];
EFI_GUID owner = { 0 };
while (argc > 1) {
if (strcmp("--version", argv[1]) == 0) {
version(progname);
exit(0);
} else if (strcmp("--help", argv[1]) == 0) {
help(progname);
exit(0);
} else if (strcmp("-g", argv[1]) == 0) {
str_to_guid(argv[2], &owner);
argv += 2;
argc -= 2;
} else {
break;
}
}
if (argc != 3) {
exit(1);
}
certfile = argv[1];
efifile = argv[2];
ERR_load_crypto_strings();
OpenSSL_add_all_digests();
OpenSSL_add_all_ciphers();
/* here we may get highly unlikely failures or we'll get a
* complaint about FIPS signatures (usually becuase the FIPS
* module isn't present). In either case ignore the errors
* (malloc will cause other failures out lower down */
ERR_clear_error();
BIO *cert_bio = BIO_new_file(certfile, "r");
X509 *cert = PEM_read_bio_X509(cert_bio, NULL, NULL, NULL);
int PkCertLen = i2d_X509(cert, NULL);
PkCertLen += sizeof(EFI_SIGNATURE_LIST) + OFFSET_OF(EFI_SIGNATURE_DATA, SignatureData);
EFI_SIGNATURE_LIST *PkCert = malloc (PkCertLen);
if (!PkCert) {
fprintf(stderr, "failed to malloc cert\n");
exit(1);
}
unsigned char *tmp = (unsigned char *)PkCert + sizeof(EFI_SIGNATURE_LIST) + OFFSET_OF(EFI_SIGNATURE_DATA, SignatureData);
i2d_X509(cert, &tmp);
PkCert->SignatureListSize = PkCertLen;
PkCert->SignatureSize = (UINT32) (PkCertLen - sizeof(EFI_SIGNATURE_LIST));
PkCert->SignatureHeaderSize = 0;
PkCert->SignatureType = EFI_CERT_X509_GUID;
EFI_SIGNATURE_DATA *PkCertData = (void *)PkCert + sizeof(EFI_SIGNATURE_LIST);
PkCertData->SignatureOwner = owner;
FILE *f = fopen(efifile, "w");
if (!f) {
fprintf(stderr, "failed to open efi file %s: ", efifile);
perror("");
exit(1);
}
if (fwrite(PkCert, 1, PkCertLen, f) != PkCertLen) {
perror("Did not write enough bytes to efi file");
exit(1);
}
return 0;
}
|
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a8 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3
// CHECK-VFP3: "target-features"="+dsp,+neon,+vfp3"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a9 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-FP16
// CHECK-VFP3-FP16: "target-features"="+dsp,+fp16,+neon,+vfp3"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4
// CHECK-VFP4: "target-features"="+dsp,+neon,+vfp4"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a12 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a15 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a17 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple thumbv7s-linux-gnueabi -target-cpu swift -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu krait -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// CHECK-VFP4-DIV: "target-features"="+dsp,+hwdiv,+hwdiv-arm,+neon,+vfp4"
// RUN: %clang_cc1 -triple thumbv7s-apple-ios7.0 -target-cpu cyclone -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a32 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a35 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple armv8-linux-gnueabi -target-cpu cortex-a53 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a72 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a73 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m1 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// CHECK-BASIC-V8: "target-features"="+crc,+crypto,+dsp,+fp-armv8,+hwdiv,+hwdiv-arm,+neon"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-DIV
// CHECK-VFP3-D16-DIV: "target-features"="+d16,+dsp,+hwdiv,+hwdiv-arm,+vfp3"
// RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4f -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-THUMB-DIV
// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+d16,+dsp,+hwdiv,+vfp3"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r8 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
// CHECK-VFP3-D16-FP16-DIV: "target-features"="+d16,+dsp,+fp16,+hwdiv,+hwdiv-arm,+vfp3"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-D16-SP-THUMB-DIV
// CHECK-VFP4-D16-SP-THUMB-DIV: "target-features"="+d16,+dsp,+fp-only-sp,+hwdiv,+vfp4"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP5-D16-THUMB-DIV
// CHECK-VFP5-D16-THUMB-DIV: "target-features"="+d16,+dsp,+fp-armv8,+hwdiv"
// RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-THUMB-DIV
// CHECK-THUMB-DIV: "target-features"="+dsp,+hwdiv"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m3 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-THUMB-DIV-M3
// CHECK-THUMB-DIV-M3: "target-features"="+hwdiv"
void foo() {}
|
/* $OpenBSD: f_string.c,v 1.15 2014/07/10 21:58:08 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>
int
i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
{
int i, n = 0;
static const char h[] = "0123456789ABCDEF";
char buf[2];
if (a == NULL)
return (0);
if (a->length == 0) {
if (BIO_write(bp, "0", 1) != 1)
goto err;
n = 1;
} else {
for (i = 0; i < a->length; i++) {
if ((i != 0) && (i % 35 == 0)) {
if (BIO_write(bp, "\\\n", 2) != 2)
goto err;
n += 2;
}
buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f];
buf[1] = h[((unsigned char)a->data[i]) & 0x0f];
if (BIO_write(bp, buf, 2) != 2)
goto err;
n += 2;
}
}
return (n);
err:
return (-1);
}
int
a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
{
int ret = 0;
int i, j, k, m, n, again, bufsize;
unsigned char *s = NULL, *sp;
unsigned char *bufp;
int first = 1;
size_t num = 0, slen = 0;
bufsize = BIO_gets(bp, buf, size);
for (;;) {
if (bufsize < 1) {
if (first)
break;
else
goto err_sl;
}
first = 0;
i = bufsize;
if (buf[i-1] == '\n')
buf[--i] = '\0';
if (i == 0)
goto err_sl;
if (buf[i-1] == '\r')
buf[--i] = '\0';
if (i == 0)
goto err_sl;
again = (buf[i - 1] == '\\');
for (j = i - 1; j > 0; j--) {
if (!(((buf[j] >= '0') && (buf[j] <= '9')) ||
((buf[j] >= 'a') && (buf[j] <= 'f')) ||
((buf[j] >= 'A') && (buf[j] <= 'F')))) {
i = j;
break;
}
}
buf[i] = '\0';
/* We have now cleared all the crap off the end of the
* line */
if (i < 2)
goto err_sl;
bufp = (unsigned char *)buf;
k = 0;
i -= again;
if (i % 2 != 0) {
ASN1err(ASN1_F_A2I_ASN1_STRING,
ASN1_R_ODD_NUMBER_OF_CHARS);
goto err;
}
i /= 2;
if (num + i > slen) {
sp = realloc(s, num + i);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_STRING,
ERR_R_MALLOC_FAILURE);
goto err;
}
s = sp;
slen = num + i;
}
for (j = 0; j < i; j++, k += 2) {
for (n = 0; n < 2; n++) {
m = bufp[k + n];
if ((m >= '0') && (m <= '9'))
m -= '0';
else if ((m >= 'a') && (m <= 'f'))
m = m - 'a' + 10;
else if ((m >= 'A') && (m <= 'F'))
m = m - 'A' + 10;
else {
ASN1err(ASN1_F_A2I_ASN1_STRING,
ASN1_R_NON_HEX_CHARACTERS);
goto err;
}
s[num + j] <<= 4;
s[num + j] |= m;
}
}
num += i;
if (again)
bufsize = BIO_gets(bp, buf, size);
else
break;
}
bs->length = num;
bs->data = s;
return (1);
err_sl:
ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE);
err:
free(s);
return (ret);
}
|
/**
******************************************************************************
* @file lcd_log_conf.h
* @author MCD Application Team
* @version V1.1.0
* @date 19-March-2012
* @brief lcd_log configuration template file.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LCD_LOG_CONF_H__
#define __LCD_LOG_CONF_H__
/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include "stm32f4_discovery_lcd.h"
/** @addtogroup LCD_LOG
* @{
*/
/** @defgroup LCD_LOG
* @brief This file is the
* @{
*/
/** @defgroup LCD_LOG_CONF_Exported_Defines
* @{
*/
/* Comment the line below to disable the scroll back and forward features */
//#define LCD_SCROLL_ENABLED
/* Define the LCD default text color */
#define LCD_LOG_DEFAULT_COLOR White
/* Define the display window settings */
#define YWINDOW_MIN 3
#define YWINDOW_SIZE 9
#define XWINDOW_MAX 50
/* Define the cache depth */
#define CACHE_SIZE 50
/** @defgroup LCD_LOG_CONF_Exported_TypesDefinitions
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_Exported_Macros
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_CONF_Exported_Variables
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_CONF_Exported_FunctionsPrototype
* @{
*/
/**
* @}
*/
#endif //__LCD_LOG_CONF_H__
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//------------------------------------------------------------------------------
// File: expose.h
//
// Desc: macros to allow the same enum to be exposed to native and managed.
//
// USAGE:
//
// see comments at top of exposeenums2managed.h
//
// Copyright (c) 2003-2004, Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
// !!! do not pragma once or macro guard this file.
// it gets used multiple times by the same compilation units
#undef ENUM
#undef ENUM16
#undef FLAGS
#undef TAG
// end of file - expose.h
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _SSH_GUAC_SFTP_H
#define _SSH_GUAC_SFTP_H
#include "config.h"
#include <guacamole/client.h>
#include <guacamole/stream.h>
#include <guacamole/user.h>
/**
* Handles an incoming stream from a Guacamole "file" instruction, saving the
* contents of that stream to the file having the given name within the
* upload directory set by guac_sftp_set_upload_path().
*/
guac_user_file_handler guac_sftp_file_handler;
/**
* Initiates an SFTP file download to the user via the Guacamole "file"
* instruction. The download will be automatically monitored and continued
* after this function terminates in response to "ack" instructions received by
* the client.
*
* @param client
* The client associated with the terminal emulator receiving the file.
*
* @param filename
* The filename of the file to download, relative to the given filesystem.
*
* @return
* The file stream created for the file download, already configured to
* properly handle "ack" responses, etc. from the client.
*/
guac_stream* guac_sftp_download_file(guac_client* client, char* filename);
/**
* Sets the destination directory for future uploads submitted via Guacamole
* "file" instruction. This function has no bearing on the destination
* directories of files uploaded with "put" instructions.
*
* @param client
* The client setting the upload path.
*
* @param path
* The path to use for future uploads submitted via "file" instruction.
*/
void guac_sftp_set_upload_path(guac_client* client, char* path);
#endif
|
#ifndef AUXILIAR_H
#define AUXILIAR_H
/*=========================================================================*\
* Auxiliar routines for class hierarchy manipulation
* LuaSocket toolkit (but completely independent of other LuaSocket modules)
*
* A LuaSocket class is a name associated with Lua metatables. A LuaSocket
* group is a name associated with a class. A class can belong to any number
* of groups. This module provides the functionality to:
*
* - create new classes
* - add classes to groups
* - set the class of objects
* - check if an object belongs to a given class or group
* - get the userdata associated to objects
* - print objects in a pretty way
*
* LuaSocket class names follow the convention <module>{<class>}. Modules
* can define any number of classes and groups. The module tcp.c, for
* example, defines the classes tcp{master}, tcp{client} and tcp{server} and
* the groups tcp{client,server} and tcp{any}. Module functions can then
* perform type-checking on their arguments by either class or group.
*
* LuaSocket metatables define the __index metamethod as being a table. This
* table has one field for each method supported by the class, and a field
* "class" with the class name.
*
* The mapping from class name to the corresponding metatable and the
* reverse mapping are done using lauxlib.
*
* RCS ID: $Id: auxiliar.h,v 1.9 2005/10/07 04:40:59 diego Exp $
\*=========================================================================*/
#include "lua.h"
#include "lauxlib.h"
int auxiliar_open(lua_State *L);
void auxiliar_newclass(lua_State *L, const char *classname, const luaL_Reg *func);
void auxiliar_add2group(lua_State *L, const char *classname, const char *group);
void auxiliar_setclass(lua_State *L, const char *classname, int objidx);
void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx);
void *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx);
void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx);
void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx);
int auxiliar_checkboolean(lua_State *L, int objidx);
int auxiliar_tostring(lua_State *L);
#endif /* AUXILIAR_H */
|
/* Copyright 2015 Samsung Electronics Co., LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/***************************************************************************
* Exports a scene to file.
***************************************************************************/
#ifndef EXPORTER_H_
#define EXPORTER_H_
#include "objects/scene.h"
namespace gvr {
namespace Exporter {
int writeToFile(Scene *scene, const std::string filename);
};
}
#endif
|
/****************************************************************************
*
* Copyright 2018 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/
/**
* @file
* Ethernet output function - handles OUTGOING ethernet level traffic, implements
* ARP resolving.
* To be used in most low-level netif implementations
*/
/*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
* Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
#ifndef LWIP_HDR_NETIF_ETHARP_H
#define LWIP_HDR_NETIF_ETHARP_H
#include <net/lwip/opt.h>
#if defined(LWIP_ARP) || defined(LWIP_ETHERNET) /* don't build if not configured for use in lwipopts.h */
#include <net/lwip/pbuf.h>
#include <net/lwip/ip4_addr.h>
#include <net/lwip/netif.h>
#include <net/lwip/ip4.h>
#include <net/lwip/prot/ethernet.h>
#include <net/lwip/netif/ppp/ppp_opts.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(LWIP_IPV4) && defined(LWIP_ARP) /* don't build if not configured for use in lwipopts.h */
#include <net/lwip/prot/etharp.h>
/** 1 seconds period */
#define ARP_TMR_INTERVAL 1000
#if ARP_QUEUEING
/** struct for queueing outgoing packets for unknown address
* defined here to be accessed by memp.h
*/
struct etharp_q_entry {
struct etharp_q_entry *next;
struct pbuf *p;
};
#endif /* ARP_QUEUEING */
#define etharp_init() /* Compatibility define, no init needed. */
void etharp_tmr(void);
s8_t etharp_find_addr(struct netif *netif, const ip4_addr_t * ipaddr, struct eth_addr **eth_ret, const ip4_addr_t ** ip_ret);
u8_t etharp_get_entry(u8_t i, ip4_addr_t ** ipaddr, struct netif **netif, struct eth_addr **eth_ret);
err_t etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t * ipaddr);
err_t etharp_query(struct netif *netif, const ip4_addr_t * ipaddr, struct pbuf *q);
err_t etharp_request(struct netif *netif, const ip4_addr_t * ipaddr);
/** For Ethernet network interfaces, we might want to send "gratuitous ARP";
* this is an ARP packet sent by a node in order to spontaneously cause other
* nodes to update an entry in their ARP cache.
* From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */
#define etharp_gratuitous(netif) etharp_request((netif), netif_ip4_addr(netif))
void etharp_cleanup_netif(struct netif *netif);
#if ETHARP_SUPPORT_STATIC_ENTRIES
err_t etharp_add_static_entry(const ip4_addr_t * ipaddr, struct eth_addr *ethaddr);
err_t etharp_remove_static_entry(const ip4_addr_t * ipaddr);
#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
#endif /* LWIP_IPV4 && LWIP_ARP */
void etharp_input(struct pbuf *p, struct netif *netif);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_ARP || LWIP_ETHERNET */
#endif /* LWIP_HDR_NETIF_ETHARP_H */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.