text stringlengths 4 6.14k |
|---|
/*
* cgroup.h: Interface to tools for managing cgroups
*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* See COPYING.LIB for the License of this software
*
* Authors:
* Dan Smith <danms@us.ibm.com>
*/
#ifndef CGROUP_H
# define CGROUP_H
struct virCgroup;
typedef struct virCgroup *virCgroupPtr;
enum {
VIR_CGROUP_CONTROLLER_CPU,
VIR_CGROUP_CONTROLLER_CPUACCT,
VIR_CGROUP_CONTROLLER_CPUSET,
VIR_CGROUP_CONTROLLER_MEMORY,
VIR_CGROUP_CONTROLLER_DEVICES,
VIR_CGROUP_CONTROLLER_FREEZER,
VIR_CGROUP_CONTROLLER_BLKIO,
VIR_CGROUP_CONTROLLER_LAST
};
VIR_ENUM_DECL(virCgroupController);
int virCgroupForDriver(const char *name,
virCgroupPtr *group,
int privileged,
int create);
int virCgroupForDomain(virCgroupPtr driver,
const char *name,
virCgroupPtr *group,
int create);
int virCgroupPathOfController(virCgroupPtr group,
int controller,
const char *key,
char **path);
int virCgroupAddTask(virCgroupPtr group, pid_t pid);
int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight);
int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight);
int virCgroupSetMemory(virCgroupPtr group, unsigned long long kb);
int virCgroupGetMemoryUsage(virCgroupPtr group, unsigned long *kb);
int virCgroupSetMemoryHardLimit(virCgroupPtr group, unsigned long long kb);
int virCgroupGetMemoryHardLimit(virCgroupPtr group, unsigned long long *kb);
int virCgroupSetMemorySoftLimit(virCgroupPtr group, unsigned long long kb);
int virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb);
int virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb);
int virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb);
enum {
VIR_CGROUP_DEVICE_READ = 1,
VIR_CGROUP_DEVICE_WRITE = 2,
VIR_CGROUP_DEVICE_MKNOD = 4,
VIR_CGROUP_DEVICE_RW = VIR_CGROUP_DEVICE_READ | VIR_CGROUP_DEVICE_WRITE,
VIR_CGROUP_DEVICE_RWM = VIR_CGROUP_DEVICE_RW | VIR_CGROUP_DEVICE_MKNOD,
};
int virCgroupDenyAllDevices(virCgroupPtr group);
int virCgroupAllowDevice(virCgroupPtr group,
char type,
int major,
int minor,
int perms);
int virCgroupAllowDeviceMajor(virCgroupPtr group,
char type,
int major,
int perms);
int virCgroupAllowDevicePath(virCgroupPtr group,
const char *path,
int perms);
int virCgroupDenyDevice(virCgroupPtr group,
char type,
int major,
int minor,
int perms);
int virCgroupDenyDeviceMajor(virCgroupPtr group,
char type,
int major,
int perms);
int virCgroupDenyDevicePath(virCgroupPtr group,
const char *path,
int perms);
int virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares);
int virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares);
int virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long *usage);
int virCgroupSetFreezerState(virCgroupPtr group, const char *state);
int virCgroupGetFreezerState(virCgroupPtr group, char **state);
int virCgroupRemove(virCgroupPtr group);
void virCgroupFree(virCgroupPtr *group);
bool virCgroupMounted(virCgroupPtr cgroup, int controller);
int virCgroupKill(virCgroupPtr group, int signum);
int virCgroupKillRecursive(virCgroupPtr group, int signum);
int virCgroupKillPainfully(virCgroupPtr group);
#endif /* CGROUP_H */
|
/*---------------------------------------------------------------------------+
| mul_Xsig.S |
| $Id: mul_Xsig.c,v 1.1.1.1 2003/09/25 03:12:54 fht Exp $
| |
| Multiply a 12 byte fixed point number by another fixed point number. |
| |
| Copyright (C) 1992,1994,1995 |
| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
| Australia. E-mail billm@jacobi.maths.monash.edu.au |
| |
| |
| The result is neither rounded nor normalized, and the ls bit or so may |
| be wrong. |
| |
+---------------------------------------------------------------------------*/
#include "fpu_emu.h"
#include "poly.h"
void mul32_Xsig(Xsig *x, const u32 ba)
{
Xsig y;
u32 zl;
u64 b = ba, z;
z = b * x->lsw;
y.lsw = z >> 32;
z = b * x->midw;
y.midw = z >> 32;
zl = z;
y.lsw += zl;
if ( zl > y.lsw )
y.midw ++;
z = b * x->msw;
y.msw = z >> 32;
zl = z;
y.midw += zl;
if ( zl > y.midw )
y.msw ++;
*x = y;
}
void mul64_Xsig(Xsig *x, const u64 *b)
{
Xsig yh, yl;
yh = *x;
yl = *x;
mul32_Xsig(&yh, (*b) >> 32);
mul32_Xsig(&yl, *b);
x->msw = yh.msw;
x->midw = yh.midw + yl.msw;
if ( yh.midw > x->midw )
x->msw ++;
x->lsw = yh.lsw + yl.midw;
if ( yh.lsw > x->lsw )
{
x->midw ++;
if ( x->midw == 0 )
x->msw ++;
}
}
void mul_Xsig_Xsig(Xsig *x, const Xsig *b)
{
u32 yh;
u64 y, z;
y = b->lsw;
y *= x->msw;
yh = y >> 32;
z = b->msw;
z <<= 32;
z += b->midw;
mul64_Xsig(x, &z);
x->lsw += yh;
if ( yh > x->lsw )
{
x->midw ++;
if ( x->midw == 0 )
x->msw ++;
}
}
|
/*
* Ion xrandr module
* Copyright (C) 2004 Ragnar Rova
* 2005-2007 Tuomo Valkonen
*
* by Ragnar Rova <rr@mima.x.se>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License,or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not,write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <limits.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrandr.h>
#include <libtu/rb.h>
#include <ioncore/common.h>
#include <ioncore/eventh.h>
#include <ioncore/global.h>
#include <ioncore/event.h>
#include <ioncore/mplex.h>
#include <ioncore/xwindow.h>
#include <ioncore/../version.h>
char mod_xrandr_ion_api_version[]=ION_API_VERSION;
static bool hasXrandR=FALSE;
static int xrr_event_base;
static int xrr_error_base;
Rb_node rotations=NULL;
static int rr2scrrot(int rr)
{
switch(rr){
case RR_Rotate_0: return SCREEN_ROTATION_0;
case RR_Rotate_90: return SCREEN_ROTATION_90;
case RR_Rotate_180: return SCREEN_ROTATION_180;
case RR_Rotate_270: return SCREEN_ROTATION_270;
default: return SCREEN_ROTATION_0;
}
}
static void insrot(int id, int r)
{
Rb_node node;
node=rb_inserti(rotations, id, NULL);
if(node!=NULL)
node->v.ival=r;
}
bool handle_xrandr_event(XEvent *ev)
{
if(hasXrandR && ev->type == xrr_event_base + RRScreenChangeNotify) {
XRRScreenChangeNotifyEvent *rev=(XRRScreenChangeNotifyEvent *)ev;
WFitParams fp;
WScreen *screen;
bool pivot=FALSE;
screen=XWINDOW_REGION_OF_T(rev->root, WScreen);
if(screen!=NULL){
int r;
Rb_node node;
int found;
r=rr2scrrot(rev->rotation);
fp.g.x=REGION_GEOM(screen).x;
fp.g.y=REGION_GEOM(screen).y;
if(rev->rotation==RR_Rotate_90 || rev->rotation==RR_Rotate_270){
fp.g.w=rev->height;
fp.g.h=rev->width;
}else{
fp.g.w=rev->width;
fp.g.h=rev->height;
}
fp.mode=REGION_FIT_EXACT;
node=rb_find_ikey_n(rotations, screen->id, &found);
if(!found){
insrot(screen->id, r);
}else if(r!=node->v.ival){
int or=node->v.ival;
fp.mode|=REGION_FIT_ROTATE;
fp.rotation=(r>or
? SCREEN_ROTATION_0+r-or
: (SCREEN_ROTATION_270+1)+r-or);
node->v.ival=r;
}
REGION_GEOM(screen)=fp.g;
mplex_managed_geom((WMPlex*)screen, &(fp.g));
mplex_do_fit_managed((WMPlex*)screen, &fp);
}
return TRUE;
}
return FALSE;
}
static bool check_pivots()
{
WScreen *scr;
XRRScreenConfiguration *cfg;
rotations=make_rb();
if(rotations==NULL)
return FALSE;
FOR_ALL_SCREENS(scr){
Rotation rot=RR_Rotate_90;
XRRRotations(ioncore_g.dpy, scr->id, &rot);
insrot(scr->id, rr2scrrot(rot));
}
return TRUE;
}
bool mod_xrandr_init()
{
hasXrandR=
XRRQueryExtension(ioncore_g.dpy,&xrr_event_base,&xrr_error_base);
if(!check_pivots())
return FALSE;
if(hasXrandR){
XRRSelectInput(ioncore_g.dpy,ioncore_g.rootwins->dummy_win,
RRScreenChangeNotifyMask);
}else{
warn_obj("mod_xrandr","XRandR is not supported on this display");
}
hook_add(ioncore_handle_event_alt,(WHookDummy *)handle_xrandr_event);
return TRUE;
}
bool mod_xrandr_deinit()
{
hook_remove(ioncore_handle_event_alt,
(WHookDummy *)handle_xrandr_event);
return TRUE;
}
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef QmlPropertyView_h
#define QmlPropertyView_h
#include <qmlmodelview.h>
#include <declarativewidgetview.h>
#include <QHash>
#include <QDeclarativePropertyMap>
#include <QStackedWidget>
#include <QTimer>
#include "qmlanchorbindingproxy.h"
#include "designerpropertymap.h"
#include "propertyeditorvalue.h"
#include "propertyeditorcontextobject.h"
QT_BEGIN_NAMESPACE
class QShortcut;
class QStackedWidget;
class QTimer;
QT_END_NAMESPACE
class PropertyEditorValue;
namespace QmlDesigner {
class PropertyEditorTransaction;
class CollapseButton;
class StackedWidget;
class PropertyEditor: public QmlModelView
{
Q_OBJECT
class NodeType {
public:
NodeType(PropertyEditor *propertyEditor);
~NodeType();
void setup(const QmlObjectNode &fxObjectNode, const QString &stateName, const QUrl &qmlSpecificsFile, PropertyEditor *propertyEditor);
void initialSetup(const QString &typeName, const QUrl &qmlSpecificsFile, PropertyEditor *propertyEditor);
void setValue(const QmlObjectNode &fxObjectNode, const QString &name, const QVariant &value);
DeclarativeWidgetView *m_view;
Internal::QmlAnchorBindingProxy m_backendAnchorBinding;
DesignerPropertyMap<PropertyEditorValue> m_backendValuesPropertyMap;
QScopedPointer<PropertyEditorTransaction> m_propertyEditorTransaction;
QScopedPointer<PropertyEditorValue> m_dummyPropertyEditorValue;
QScopedPointer<PropertyEditorContextObject> m_contextObject;
};
public:
PropertyEditor(QWidget *parent = 0);
~PropertyEditor();
void setQmlDir(const QString &qmlDirPath);
QWidget* createPropertiesPage();
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList);
void nodeAboutToBeRemoved(const ModelNode &removedNode);
void propertiesAdded(const NodeState &state, const QList<NodeProperty>& propertyList);
void propertiesRemoved(const QList<AbstractProperty>& propertyList);
void propertyValuesChanged(const NodeState &state, const QList<NodeProperty>& propertyList);
void modelAttached(Model *model);
void modelAboutToBeDetached(Model *model);
ModelState modelState() const;
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange);
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange);
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
protected:
void timerEvent(QTimerEvent *event);
void otherPropertyChanged(const QmlObjectNode &, const QString &propertyName);
void transformChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName);
void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState);
void setupPane(const QString &typeName);
void setValue(const QmlObjectNode &fxObjectNode, const QString &name, const QVariant &value);
private slots:
void reloadQml();
void changeValue(const QString &name);
void changeExpression(const QString &name);
void updateSize();
void setupPanes();
private: //functions
QString qmlFileName(const NodeMetaInfo &nodeInfo) const;
QUrl fileToUrl(const QString &filePath) const;
QUrl qmlForNode(const ModelNode &modelNode, QString &className) const;
QString locateQmlFile(const QString &relativePath) const;
void select(const ModelNode& node);
void resetView();
void delayedResetView();
private: //variables
ModelNode m_selectedNode;
QWidget *m_parent;
QShortcut *m_updateShortcut;
int m_timerId;
StackedWidget* m_stackedWidget;
QString m_qmlDir;
QHash<QString, NodeType *> m_typeHash;
NodeType *m_currentType;
bool m_locked;
bool m_setupCompleted;
QTimer *m_singleShotTimer;
};
class StackedWidget : public QStackedWidget
{
Q_OBJECT
public:
StackedWidget(QWidget *parent = 0) : QStackedWidget(parent) {}
signals:
void resized();
protected:
void resizeEvent(QResizeEvent * event)
{
QStackedWidget::resizeEvent(event);
emit resized();
}
};
}
#endif // QmlPropertyView_h
|
/*****************************************************************************
* Project: RooFit *
* Package: RooFitCore *
* File: $Id: RooFormulaVar.h,v 1.29 2007/08/09 19:55:47 wouter Exp $
* Authors: *
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
* *
* Copyright (c) 2000-2005, Regents of the University of California *
* and Stanford University. All rights reserved. *
* *
* Redistribution and use in source and binary forms, *
* with or without modification, are permitted according to the terms *
* listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
*****************************************************************************/
#ifndef ROO_FORMULA_VAR
#define ROO_FORMULA_VAR
#include "RooAbsReal.h"
#include "RooFormula.h"
#include "RooArgList.h"
#include "RooListProxy.h"
class RooArgSet ;
class RooFormulaVar : public RooAbsReal {
public:
// Constructors, assignment etc
inline RooFormulaVar() : _formula(0), _nset(0) { }
RooFormulaVar(const char *name, const char *title, const char* formula, const RooArgList& dependents);
RooFormulaVar(const char *name, const char *title, const RooArgList& dependents);
RooFormulaVar(const RooFormulaVar& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooFormulaVar(*this,newname); }
virtual ~RooFormulaVar();
inline Bool_t ok() const { return formula().ok() ; }
inline RooAbsArg* getParameter(const char* name) const {
// Return pointer to parameter with given name
return _actualVars.find(name) ;
}
inline RooAbsArg* getParameter(Int_t index) const {
// Return pointer to parameter at given index
return _actualVars.at(index) ;
}
// I/O streaming interface (machine readable)
virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
virtual void writeToStream(ostream& os, Bool_t compact) const ;
// Printing interface (human readable)
virtual void printMultiline(ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
void printMetaArgs(ostream& os) const ;
// Debugging
void dumpFormula() { formula().dump() ; }
virtual Double_t defaultErrorLevel() const ;
protected:
// Function evaluation
virtual Double_t evaluate() const ;
RooFormula& formula() const ;
// Post-processing of server redirection
virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
virtual Bool_t isValidReal(Double_t value, Bool_t printError) const ;
RooListProxy _actualVars ; // Actual parameters used by formula engine
mutable RooFormula* _formula ; //! Formula engine
mutable RooArgSet* _nset ; //! Normalization set to be passed along to contents
TString _formExpr ; // Formula expression string
ClassDef(RooFormulaVar,1) // Real-valued function of other RooAbsArgs calculated by a TFormula expression
};
#endif
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__47E52255_7AEF_4C03_B3F1_81A50E7592B0__INCLUDED_)
#define AFX_STDAFX_H__47E52255_7AEF_4C03_B3F1_81A50E7592B0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Insert your headers here
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__47E52255_7AEF_4C03_B3F1_81A50E7592B0__INCLUDED_)
|
/* Regression test for fd.o#27242
*
* Copyright © 2010 Collabora Ltd. <http://www.collabora.co.uk/>
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved.
*/
#include "config.h"
#include <telepathy-glib/debug.h>
#include <telepathy-glib/util.h>
#include "tests/lib/stub-object.h"
#include "tests/lib/util.h"
typedef struct
{
guint caught;
GObject *emitter;
GObject *observer;
} Test;
#define DATA_KEY "signal-connect-object Test struct"
static void
increment_caught (GObject *emitter,
GParamSpec *param_spec,
gpointer user_data)
{
GObject *observer = user_data;
Test *test = g_object_get_data (observer, DATA_KEY);
g_assert (test->emitter != NULL);
g_assert (G_IS_OBJECT (test->emitter));
g_assert (emitter != NULL);
g_assert (emitter == test->emitter);
g_assert (test->observer != NULL);
g_assert (G_IS_OBJECT (test->observer));
g_assert (observer != NULL);
g_assert (observer == test->observer);
g_assert (param_spec != NULL);
g_assert_cmpstr (g_param_spec_get_name (param_spec), ==, "name");
test->caught++;
}
static void
increment_caught_swapped (gpointer user_data,
GParamSpec *param_spec,
GObject *emitter)
{
increment_caught (emitter, param_spec, user_data);
}
static void
setup (Test *test,
gconstpointer data)
{
tp_debug_set_flags ("all");
test->caught = 0;
test->observer = tp_tests_object_new_static_class (
tp_tests_stub_object_get_type (), NULL);
g_object_set_data (test->observer, DATA_KEY, test);
test->emitter = tp_tests_object_new_static_class (
tp_tests_stub_object_get_type (), NULL);
}
static void
teardown (Test *test,
gconstpointer data)
{
tp_clear_object (&test->emitter);
tp_clear_object (&test->observer);
}
static void
test_no_unref (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught), test->observer, 0);
g_object_notify (test->emitter, "name");
g_assert_cmpuint (test->caught, ==, 1);
}
static void
test_swapped (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught_swapped), test->observer,
G_CONNECT_SWAPPED);
g_object_notify (test->emitter, "name");
g_assert_cmpuint (test->caught, ==, 1);
}
static void
test_dead_observer (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught), test->observer, 0);
g_object_notify (test->emitter, "name");
g_object_notify (test->emitter, "name");
tp_clear_object (&test->observer);
g_object_notify (test->emitter, "name");
g_assert_cmpuint (test->caught, ==, 2);
}
static void
test_dead_emitter (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught), test->observer, 0);
g_object_notify (test->emitter, "name");
g_object_notify (test->emitter, "name");
tp_clear_object (&test->emitter);
g_assert_cmpuint (test->caught, ==, 2);
}
static void
test_disconnected (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
gulong id;
id = tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught), test->observer, 0);
g_object_notify (test->emitter, "name");
g_object_notify (test->emitter, "name");
g_signal_handler_disconnect (test->emitter, id);
g_object_notify (test->emitter, "name");
g_assert_cmpuint (test->caught, ==, 2);
}
static void
test_dead_observer_and_disconnected (Test *test,
gconstpointer data G_GNUC_UNUSED)
{
gulong id;
id = tp_g_signal_connect_object (test->emitter, "notify::name",
G_CALLBACK (increment_caught), test->observer, 0);
g_object_notify (test->emitter, "name");
g_object_notify (test->emitter, "name");
g_signal_handler_disconnect (test->emitter, id);
tp_clear_object (&test->observer);
g_object_notify (test->emitter, "name");
g_assert_cmpuint (test->caught, ==, 2);
}
int
main (int argc,
char **argv)
{
#define TEST_PREFIX "/signal-connect-object/"
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id=");
g_test_add (TEST_PREFIX "no_unref", Test, NULL, setup, test_no_unref,
teardown);
g_test_add (TEST_PREFIX "swapped", Test, NULL, setup, test_swapped,
teardown);
g_test_add (TEST_PREFIX "dead_observer", Test, NULL, setup,
test_dead_observer, teardown);
g_test_add (TEST_PREFIX "dead_emitter", Test, NULL, setup,
test_dead_emitter, teardown);
g_test_add (TEST_PREFIX "disconnected", Test, NULL, setup,
test_disconnected, teardown);
g_test_add (TEST_PREFIX "dead_observer_and_disconnected", Test, NULL, setup,
test_dead_observer_and_disconnected, teardown);
return g_test_run ();
}
|
/**************************************************************************
** This file is part of LiteIDE
**
** Copyright (c) 2011-2019 LiteIDE. All rights reserved.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** In addition, as a special exception, that plugins developed for LiteIDE,
** are allowed to remain closed sourced and can be distributed under any license .
** These rights are included in the file LGPL_EXCEPTION.txt in this package.
**
**************************************************************************/
// Module: pluginsdialog.h
// Creator: visualfc <visualfc@gmail.com>
#ifndef PLUGINSDIALOG_H
#define PLUGINSDIALOG_H
#include <QDialog>
#include "liteapi/liteapi.h"
namespace Ui {
class PluginsDialog;
}
class QStandardItemModel;
class QStandardItem;
class PluginManager;
class PluginsDialog : public QDialog
{
Q_OBJECT
public:
explicit PluginsDialog(LiteApi::IApplication *app, QWidget *parent = 0);
~PluginsDialog();
void appendInfo(const LiteApi::PluginInfo *info);
public slots:
void itemChanged(QStandardItem*);
private:
LiteApi::IApplication *m_liteApp;
Ui::PluginsDialog *ui;
QStandardItemModel *m_model;
};
#endif // PLUGINSDIALOG_H
|
/**
* @file llpanelimcontrolpanel.h
* @brief LLPanelIMControlPanel and related class definitions
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if 0
#ifndef LL_LLPANELIMCONTROLPANEL_H
#define LL_LLPANELIMCONTROLPANEL_H
#include "llpanel.h"
#include "llcallingcard.h"
class LLParticipantList;
class LLPanelChatControlPanel
: public LLPanel
{
public:
LLPanelChatControlPanel() :
mSessionId(LLUUID()) {};
~LLPanelChatControlPanel();
virtual BOOL postBuild();
virtual void setSessionId(const LLUUID& session_id);
const LLUUID& getSessionId() { return mSessionId; }
private:
LLUUID mSessionId;
// connection to voice channel state change signal
boost::signals2::connection mVoiceChannelStateChangeConnection;
};
class LLPanelGroupControlPanel : public LLPanelChatControlPanel
{
public:
LLPanelGroupControlPanel(const LLUUID& session_id);
~LLPanelGroupControlPanel();
BOOL postBuild();
void setSessionId(const LLUUID& session_id);
/*virtual*/ void draw();
protected:
LLUUID mGroupID;
LLParticipantList* mParticipantList;
private:
void onSortMenuItemClicked(const LLSD& userdata);
};
class LLPanelAdHocControlPanel : public LLPanelGroupControlPanel
{
public:
LLPanelAdHocControlPanel(const LLUUID& session_id);
BOOL postBuild();
};
#endif // LL_LLPANELIMCONTROLPANEL_H
#endif
|
/*
*
* NMEA library
* URL: http://nmea.sourceforge.net
* Author: Tim (xtimor@gmail.com)
* Licence: http://www.gnu.org/licenses/lgpl.html
* $Id: parser.h 4 2007-08-27 13:11:03Z xtimor $
*
*/
#ifndef __NMEA_PARSER_H__
#define __NMEA_PARSER_H__
#include "info.h"
#include "sentence.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* high level
*/
typedef void (*_nmeaPARSERcallback)(nmeaPACKTALKER talker, nmeaPACKTYPE type, void *pack);
typedef struct _nmeaPARSERCB
{
_nmeaPARSERcallback callback;
int packTalker;
int packType;
struct _nmeaPARSERCB *next_callback;
} nmeaPARSERCB;
typedef struct _nmeaPARSER
{
void *top_node;
void *end_node;
unsigned char *buffer;
int buff_size;
int buff_use;
nmeaPARSERCB *first_callback;
} nmeaPARSER;
int nmea_parser_init(nmeaPARSER *parser);
void nmea_parser_destroy(nmeaPARSER *parser);
void nmea_parser_addcallback(nmeaPARSER *parser,
nmeaPACKTALKER talker,
nmeaPACKTYPE type,
_nmeaPARSERcallback callback);
int nmea_parse(
nmeaPARSER *parser,
const char *buff, int buff_sz,
nmeaINFO *info
);
/*
* low level
*/
int nmea_parser_push(nmeaPARSER *parser, const char *buff, int buff_sz);
int nmea_parser_top(nmeaPARSER *parser);
int nmea_parser_pop(nmeaPARSER *parser, void **pack_ptr);
int nmea_parser_peek(nmeaPARSER *parser, void **pack_ptr);
int nmea_parser_drop(nmeaPARSER *parser);
int nmea_parser_buff_clear(nmeaPARSER *parser);
int nmea_parser_queue_clear(nmeaPARSER *parser);
#ifdef __cplusplus
}
#endif
#endif /* __NMEA_PARSER_H__ */
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* qimsys *
* Copyright (C) 2009-2015 by Tasuku Suzuki <stasuku@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Lesser Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef ENGINE_H
#define ENGINE_H
#include <qimsysengine.h>
namespace Japanese {
namespace GoogleIME {
class Engine : public QimsysEngine
{
Q_OBJECT
public:
Engine(QObject *parent = 0);
~Engine();
private:
class Private;
Private *d;
};
}
}
#endif//ENGINE_H
|
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This wraps the replaygain_analysis lib, which is LGPL. This wrapper
* allows analysis of different input resolutions by automatically
* scaling the input signal
*/
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABBAG__REPLAYGAIN_H
#define GRABBAG__REPLAYGAIN_H
#include "FLAC/metadata.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const unsigned GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED;
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS; /* = "REPLAYGAIN_REFERENCE_LOUDNESS" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN; /* = "REPLAYGAIN_TRACK_GAIN" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK; /* = "REPLAYGAIN_TRACK_PEAK" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN; /* = "REPLAYGAIN_ALBUM_GAIN" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK; /* = "REPLAYGAIN_ALBUM_PEAK" */
FLAC__bool grabbag__replaygain_is_valid_sample_frequency(unsigned sample_frequency);
FLAC__bool grabbag__replaygain_init(unsigned sample_frequency);
/* 'bps' must be valid for FLAC, i.e. >=4 and <= 32 */
FLAC__bool grabbag__replaygain_analyze(const FLAC__int32 * const input[], FLAC__bool is_stereo, unsigned bps, unsigned samples);
void grabbag__replaygain_get_album(float *gain, float *peak);
void grabbag__replaygain_get_title(float *gain, float *peak);
/* These three functions return an error string on error, or NULL if successful */
const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak);
const char *grabbag__replaygain_store_to_vorbiscomment(FLAC__StreamMetadata *block, float album_gain, float album_peak, float title_gain, float title_peak);
const char *grabbag__replaygain_store_to_vorbiscomment_reference(FLAC__StreamMetadata *block);
const char *grabbag__replaygain_store_to_vorbiscomment_album(FLAC__StreamMetadata *block, float album_gain, float album_peak);
const char *grabbag__replaygain_store_to_vorbiscomment_title(FLAC__StreamMetadata *block, float title_gain, float title_peak);
const char *grabbag__replaygain_store_to_file(const char *filename, float album_gain, float album_peak, float title_gain, float title_peak, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_reference(const char *filename, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_album(const char *filename, float album_gain, float album_peak, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_title(const char *filename, float title_gain, float title_peak, FLAC__bool preserve_modtime);
FLAC__bool grabbag__replaygain_load_from_vorbiscomment(const FLAC__StreamMetadata *block, FLAC__bool album_mode, FLAC__bool strict, double *reference, double *gain, double *peak);
double grabbag__replaygain_compute_scale_factor(double peak, double gain, double preamp, FLAC__bool prevent_clipping);
#ifdef __cplusplus
}
#endif
#endif
|
/**********************************************************************
* SQLGetTypeInfo
*
**********************************************************************
*
* This code was created by Peter Harvey (mostly during Christmas 98/99).
* This code is LGPL. Please ensure that this message remains in future
* distributions and uses of this code (thats about all I get out of it).
* - Peter Harvey pharvey@codebydesign.com
*
**********************************************************************/
#include "config.h"
#include "driver.h"
SQLRETURN _SQLGetTypeInfo( SQLHSTMT hDrvStmt,
SQLSMALLINT nSqlType )
{
#ifndef __FUNC__
#define _OTAR_RM_FUNC_
#define __FUNC__ "_SQLGetTypeInfo"
#endif
HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt;
/* SANITY CHECKS */
if ( NULL == hStmt )
return SQL_INVALID_HANDLE;
sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt );
logPushMsg( hStmt->hLog, __FILE__, __FUNC__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg );
/************************
* todo: REPLACE THIS COMMENT WITH SOMETHING USEFULL
************************/
logPushMsg( hStmt->hLog, __FILE__, __FUNC__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" );
return SQL_ERROR;
#ifdef _OTAR_RM_FUNC_
#undef _OTAR_RM_FUNC_
#undef __FUNC__
#endif
}
SQLRETURN SQLGetTypeInfo( SQLHSTMT hDrvStmt,
SQLSMALLINT nSqlType )
{
#ifndef __FUNC__
#define _OTAR_RM_FUNC_
#define __FUNC__ "SQLGetTypeInfo"
#endif
SQLRETURN r;
/************************
* SANITY CHECKS
************************/
if( NULL == hDrvStmt )
return SQL_INVALID_HANDLE;
/* LOCK THE MUTEX */
if( MUTEX_SUCESS != mutex_lock( &((HDRVENV)((HDRVDBC)((HDRVSTMT)hDrvStmt)->hDbc)->hEnv)->hEnvExtras->mutex, ((HDRVENV)((HDRVDBC)((HDRVSTMT)hDrvStmt)->hDbc)->hEnv)->hEnvExtras->nMutexTimeout ) )
{
logPushMsg( ((HDRVENV)((HDRVDBC)((HDRVSTMT)hDrvStmt)->hDbc)->hEnv)->hLog, __FILE__, __FUNC__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR mutex lock failed" );
return SQL_ERROR;
}
/* DOIT */
r = _SQLGetTypeInfo( hDrvStmt, nSqlType );
/* UNLOCK THE MUTEX */
if( MUTEX_SUCESS != mutex_unlock( &((HDRVENV)((HDRVDBC)((HDRVSTMT)hDrvStmt)->hDbc)->hEnv)->hEnvExtras->mutex) )
{
logPushMsg( ((HDRVENV)((HDRVDBC)((HDRVSTMT)hDrvStmt)->hDbc)->hEnv)->hLog, __FILE__, __FUNC__, __LINE__, LOG_ERROR, LOG_ERROR, "SQL_ERROR mutex unlock failed" );
return SQL_ERROR;
}
return r;
#ifdef _OTAR_RM_FUNC_
#undef _OTAR_RM_FUNC_
#undef __FUNC__
#endif
}
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef MAEMOSETTINGSPAGES_H
#define MAEMOSETTINGSPAGES_H
#include <coreplugin/dialogs/ioptionspage.h>
namespace Madde{
namespace Internal {
class MaemoQemuSettingsWidget;
class MaemoQemuSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
MaemoQemuSettingsPage(QObject *parent = 0);
bool matches(const QString &searchKeyWord) const;
QWidget *createPage(QWidget *parent);
void apply();
void finish();
static void showQemuCrashDialog();
static QString pageId();
static QString pageCategory();
private:
QString m_keywords;
MaemoQemuSettingsWidget *m_widget;
};
} // namespace Internal
} // namespace Madde
#endif // MAEMOSETTINGSPAGES_H
|
/**********************************************************************
* $Id: CommonBitsRemover.h 1820 2006-09-06 16:54:23Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#ifndef GEOS_PRECISION_COMMONBITSREMOVER_H
#define GEOS_PRECISION_COMMONBITSREMOVER_H
#include <geos/geom/Coordinate.h> // for composition
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
}
namespace precision {
class CommonBitsRemover;
class CommonCoordinateFilter;
}
}
namespace geos {
namespace precision { // geos.precision
/** \brief
* Allow computing and removing common mantissa bits from one or
* more Geometries.
*
*/
class CommonBitsRemover {
private:
geom::Coordinate commonCoord;
CommonCoordinateFilter *ccFilter;
public:
CommonBitsRemover();
~CommonBitsRemover();
/**
* Add a geometry to the set of geometries whose common bits are
* being computed. After this method has executed the
* common coordinate reflects the common bits of all added
* geometries.
*
* @param geom a Geometry to test for common bits
*/
void add(const geom::Geometry *geom);
/**
* The common bits of the Coordinates in the supplied Geometries.
*/
geom::Coordinate& getCommonCoordinate();
/** \brief
* Removes the common coordinate bits from a Geometry.
* The coordinates of the Geometry are changed.
*
* @param geom the Geometry from which to remove the common
* coordinate bits
* @return the shifted Geometry
*/
geom::Geometry* removeCommonBits(geom::Geometry *geom);
/** \brief
* Adds the common coordinate bits back into a Geometry.
* The coordinates of the Geometry are changed.
*
* @param geom the Geometry to which to add the common coordinate bits
* @return the shifted Geometry
*/
geom::Geometry* addCommonBits(geom::Geometry *geom);
};
} // namespace geos.precision
} // namespace geos
#endif // GEOS_PRECISION_COMMONBITSREMOVER_H
/**********************************************************************
* $Log$
* Revision 1.3 2006/04/07 08:30:30 strk
* made addCommonBits/removeCommonBits interface consistent, doxygen comments
*
* Revision 1.2 2006/04/06 14:36:52 strk
* Cleanup in geos::precision namespace (leaks plugged, auto_ptr use, ...)
*
* Revision 1.1 2006/03/23 09:17:19 strk
* precision.h header split, minor optimizations
*
**********************************************************************/
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by main.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
//----------------------------------------------------------------------------
// ZetaScale
// Copyright (c) 2016, SanDisk Corp. and/or all its affiliates.
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published by the Free
// Software Foundation;
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License v2.1 for more details.
//
// A copy of the GNU Lesser General Public License v2.1 is provided with this package and
// can also be found at: http://opensource.org/licenses/LGPL-2.1
// You should have received a copy of the GNU Lesser General Public License along with
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307 USA.
//----------------------------------------------------------------------------
/*
* File: fthSignal.h
* Author: drew
*
* Created on March 25, 2009
*
* (c) Copyright 2009, Schooner Information Technology, Inc.
* http: //www.schoonerinfotech.com/
*
* $Id: fthSignal.h 6477 2009-03-28 07:00:47Z drew $
*/
#ifndef _FTH_SIGNAL_H
#define _FTH_SIGNAL_H
#include "platform/signal.h"
/**
* @brief Initialize fthSignal subsystem.
*
* May be called before fthSignal so that all dynamic allocations are done
* before a baseline snapshot. Otherwise initialization will be implicit in
* the first fthSignal call.
*/
void fthSignalInit();
/**
* @brief Shutdown fthSignal subsystem
*
* May be called from an fthThread or pthread. The caller blocks synchronously
* on the signal handling thread's termination.
*/
void fthSignalShutdown();
/**
* @brief Handle signal in signal handling pthread
*
* One of the #fthInit functions must have previously been called.
*
* Technically speaking, conventional signal handlers are only allowed
* to modify sigatomic_t variables although in practice you can extend
* that to making system calls. Most library functions are right out
* because libraries aren't re-entrant.
*
* fthSignal causes the handlers to be called non-reentrantly
* in a single fthThread, with handlers being allowed to do all of the
* things pthreads (with caveats on blocking the scheduler) and
* fthThreads do.
*
* Signal handlers are not SA_ONESHOT.
*
* @param <IN> signum signal
* @param <IN> handler function to apply
* @return Previous function
*/
sighandler_t fthSignal(int signum, sighandler_t handler);
#endif
|
/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/shared_ptr.h"
#include "ifcpp/model/IfcPPObject.h"
#include "ifcpp/model/IfcPPGlobal.h"
#include "IfcFlowControllerType.h"
class IFCPP_EXPORT IfcSwitchingDeviceTypeEnum;
//ENTITY
class IFCPP_EXPORT IfcSwitchingDeviceType : public IfcFlowControllerType
{
public:
IfcSwitchingDeviceType();
IfcSwitchingDeviceType( int id );
~IfcSwitchingDeviceType();
virtual shared_ptr<IfcPPObject> getDeepCopy( IfcPPCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const boost::unordered_map<int,shared_ptr<IfcPPEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<IfcPPEntity> ptr_self );
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcSwitchingDeviceType"; }
// IfcRoot -----------------------------------------------------------
// attributes:
// shared_ptr<IfcGloballyUniqueId> m_GlobalId;
// shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional
// shared_ptr<IfcLabel> m_Name; //optional
// shared_ptr<IfcText> m_Description; //optional
// IfcObjectDefinition -----------------------------------------------------------
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssigns> > m_HasAssignments_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_Nests_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_IsNestedBy_inverse;
// std::vector<weak_ptr<IfcRelDeclares> > m_HasContext_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_IsDecomposedBy_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_Decomposes_inverse;
// std::vector<weak_ptr<IfcRelAssociates> > m_HasAssociations_inverse;
// IfcTypeObject -----------------------------------------------------------
// attributes:
// shared_ptr<IfcIdentifier> m_ApplicableOccurrence; //optional
// std::vector<shared_ptr<IfcPropertySetDefinition> > m_HasPropertySets; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelDefinesByType> > m_Types_inverse;
// IfcTypeProduct -----------------------------------------------------------
// attributes:
// std::vector<shared_ptr<IfcRepresentationMap> > m_RepresentationMaps; //optional
// shared_ptr<IfcLabel> m_Tag; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssignsToProduct> > m_ReferencedBy_inverse;
// IfcElementType -----------------------------------------------------------
// attributes:
// shared_ptr<IfcLabel> m_ElementType; //optional
// IfcDistributionElementType -----------------------------------------------------------
// IfcDistributionFlowElementType -----------------------------------------------------------
// IfcFlowControllerType -----------------------------------------------------------
// IfcSwitchingDeviceType -----------------------------------------------------------
// attributes:
shared_ptr<IfcSwitchingDeviceTypeEnum> m_PredefinedType;
};
|
//----------------------------------------------------------------------------
// ZetaScale
// Copyright (c) 2016, SanDisk Corp. and/or all its affiliates.
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published by the Free
// Software Foundation;
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License v2.1 for more details.
//
// A copy of the GNU Lesser General Public License v2.1 is provided with this package and
// can also be found at: http://opensource.org/licenses/LGPL-2.1
// You should have received a copy of the GNU Lesser General Public License along with
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307 USA.
//----------------------------------------------------------------------------
#ifndef REPLICATION_TEST_H
#define REPLICATION_TEST_H 1
/*
* File: sdr/protocol/replication/tests/test.h
*
* Author: drew
*
* Created on October 31, 2008
*
* (c) Copyright 2008, Schooner Information Technology, Inc.
* http://www.schoonerinfotech.com/
*
* $Id: test.h 5283 2008-12-24 02:45:30Z xwang $
*/
/**
* Test definition.
*
* XXX: drew 2008-11-4 In hindsight, I don't think the test needs this
* to integrate with the frame-work. Ad-hoc use of the sleep functions
* should be entirely sufficient.
*/
#include "platform/closure.h"
#include "platform/defs.h"
#include "platform/time.h"
struct replication_test;
enum replication_test_event_type {
/** @brief Event returned */
RT_EVENT_EVENT,
/** @brief No more events */
RT_EVENT_TEST_DONE,
/** @brief Wait for next event */
RT_EVENT_WAIT
}
/** @brief Replication test event callback */
PLAT_CLOSURE1(replication_test_event_cb,
struct replication_test *, test);
struct replication_test_event {
/** @brief When the event should happen */
struct timeval when;
/** @brief What to invoke */
replication_test_event_cb_t what;
};
/**
* @brief Replication test state
*
* Users may include this structure at the front of their test state.
*/
struct replication_test {
/**
* @brief Get asynchronous event from test.
*
* Simple tests may have a single event which wakes up their
* test thread at T=0 and change the state to return when the
* test should terminate.
*
* Events must be scheduled for a point in time after the
* previous.
*
* @return Whether an event exists; *event is only set if there is a
* next event at this point in time.
*/
enum replication_test_event_type
(*get_next_fn)(struct replication_test *test,
struct replication_test_event *event);
/** @brief Test framework associated with this test */
struct replication_test_framework *framework;
};
#endif /* ndef REPLICATION_TEST_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 QMLCPPENGINE_H
#define QMLCPPENGINE_H
#include <debugger/debuggerengine.h>
namespace Debugger {
namespace Internal {
class QmlEngine;
class QmlCppEngine : public DebuggerEngine
{
Q_OBJECT
public:
QmlCppEngine(const DebuggerStartParameters &sp, QString *errorMessage);
~QmlCppEngine();
bool canDisplayTooltip() const;
bool setToolTipExpression(TextEditor::BaseTextEditor *editor,
const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags);
void watchDataSelected(const QByteArray &iname);
void watchPoint(const QPoint &);
void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
void fetchDisassembler(DisassemblerAgent *);
void activateFrame(int index);
void reloadModules();
void examineModules();
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
void requestModuleSymbols(const QString &moduleName);
void reloadRegisters();
void reloadSourceFiles();
void reloadFullStack();
void setRegisterValue(int regnr, const QString &value);
bool hasCapability(unsigned cap) const;
bool isSynchronous() const;
QByteArray qtNamespace() const;
void createSnapshot();
void updateAll();
void attemptBreakpointSynchronization();
bool acceptsBreakpoint(BreakpointModelId id) const;
void selectThread(ThreadId threadId);
void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
DebuggerEngine *cppEngine() const;
DebuggerEngine *qmlEngine() const;
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &message);
void showMessage(const QString &msg, int channel = LogDebug,
int timeout = -1) const;
void resetLocation();
void notifyInferiorIll();
protected:
void detachDebugger();
void executeStep();
void executeStepOut();
void executeNext();
void executeStepI();
void executeNextI();
void executeReturn();
void continueInferior();
void interruptInferior();
void requestInterruptInferior();
void executeRunToLine(const ContextData &data);
void executeRunToFunction(const QString &functionName);
void executeJumpToLine(const ContextData &data);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
void setupEngine();
void setupInferior();
void runEngine();
void shutdownInferior();
void shutdownEngine();
void quitDebugger();
void abortDebugger();
void notifyInferiorRunOk();
void notifyInferiorSpontaneousStop();
void notifyEngineRunAndInferiorRunOk();
void notifyInferiorShutdownOk();
void notifyInferiorSetupOk();
void notifyEngineRemoteServerRunning(const QByteArray &, int pid);
signals:
void aboutToNotifyInferiorSetupOk();
private:
void engineStateChanged(DebuggerState newState);
void setState(DebuggerState newState, bool forced = false);
void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state);
void readyToExecuteQmlStep();
void setActiveEngine(DebuggerEngine *engine);
private:
QmlEngine *m_qmlEngine;
DebuggerEngine *m_cppEngine;
DebuggerEngine *m_activeEngine;
};
} // namespace Internal
} // namespace Debugger
#endif // QMLCPPENGINE_H
|
#ifndef TRACKER_H
#define TRACKER_H
#include <QString>
namespace RedmineConnector {
struct Tracker {
int id;
QString name;
};
}
#endif // TRACKER_H
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef NAVIGATEDIALOG_H
#define NAVIGATEDIALOG_H
#include <QDialog>
#include <QLineEdit>
#include <QComboBox>
#include "qgeorouterequest.h"
#include "qgeocoordinate.h"
using namespace QtMobility;
class NavigateDialog : public QDialog
{
Q_OBJECT
public:
NavigateDialog(QWidget *parent=0);
~NavigateDialog();
QString destinationAddress() const;
QGeoRouteRequest::TravelModes travelMode() const;
private:
QLineEdit *addressEdit;
QComboBox *modeCombo;
};
#endif // NAVIGATEDIALOG_H
|
/* libinfinity - a GObject-based infinote implementation
* Copyright (C) 2007-2010 Armin Burgmeier <armin@arbur.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., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef __INF_GTK_BROWSER_STORE_H__
#define __INF_GTK_BROWSER_STORE_H__
#include <libinfinity/client/infc-browser.h>
#include <libinfinity/common/inf-discovery.h>
#include <libinfinity/common/inf-xml-connection.h>
#include <libinfinity/communication/inf-communication-manager.h>
#include <gtk/gtk.h>
#include <glib-object.h>
G_BEGIN_DECLS
#define INF_GTK_TYPE_BROWSER_STORE (inf_gtk_browser_store_get_type())
#define INF_GTK_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStore))
#define INF_GTK_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStoreClass))
#define INF_GTK_IS_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_STORE))
#define INF_GTK_IS_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_BROWSER_STORE))
#define INF_GTK_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStoreClass))
typedef struct _InfGtkBrowserStore InfGtkBrowserStore;
typedef struct _InfGtkBrowserStoreClass InfGtkBrowserStoreClass;
struct _InfGtkBrowserStoreClass {
GObjectClass parent_class;
};
struct _InfGtkBrowserStore {
GObject parent;
};
GType
inf_gtk_browser_store_get_type(void) G_GNUC_CONST;
InfGtkBrowserStore*
inf_gtk_browser_store_new(InfIo* io,
InfCommunicationManager* comm_manager);
void
inf_gtk_browser_store_add_discovery(InfGtkBrowserStore* store,
InfDiscovery* discovery);
void
inf_gtk_browser_store_add_connection(InfGtkBrowserStore* store,
InfXmlConnection* connection,
const gchar* name);
void
inf_gtk_browser_store_remove_connection(InfGtkBrowserStore* store,
InfXmlConnection* connection);
void
inf_gtk_browser_store_clear_connection_error(InfGtkBrowserStore* store,
InfXmlConnection* connection);
void
inf_gtk_browser_store_set_connection_name(InfGtkBrowserStore* store,
InfXmlConnection* connection,
const gchar* name);
G_END_DECLS
#endif /* __INF_GTK_BROWSER_STORE_H__ */
/* vim:set et sw=2 ts=2: */
|
#ifndef __glutf90_h__
#define __glutf90_h__
/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
/* This header provides the binding interface for William Mitchell's
f90gl Fortran 90 GLUT binding. Other GLUT language bindings
can and should use this interace. */
/* I appreciate the guidance from William Mitchell
(mitchell@cam.nist.gov) in developing this friend interface
for use by the f90gl package. See ../../README.fortran */
#include <GL/glut.h>
/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
/* NOTE These values are part of a binary interface for the f90gl Fortran
90 binding and so must NOT changes (additions are allowed). */
/* GLUTwindow callbacks. */
#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */
#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */
#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */
#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */
#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */
#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */
#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */
#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */
#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */
#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */
#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */
#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */
#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */
#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */
#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */
#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */
#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */
#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */
#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */
#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */
/* Non-GLUTwindow callbacks. */
#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */
#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */
#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */
/* GLUT Fortran callback function types. */
typedef void (GLUTCALLBACK * GLUTdisplayFCB)(void);
typedef void (GLUTCALLBACK * GLUTreshapeFCB)(int*, int*);
/* NOTE the pressed key is int, not unsigned char for Fortran! */
typedef void (GLUTCALLBACK * GLUTkeyboardFCB)(int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTmouseFCB)(int*, int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTmotionFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTpassiveFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTentryFCB)(int*);
typedef void (GLUTCALLBACK * GLUTwindowStatusFCB)(int*);
typedef void (GLUTCALLBACK * GLUTvisibilityFCB)(int*);
typedef void (GLUTCALLBACK * GLUTspecialFCB)(int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTbuttonBoxFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTdialsFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTspaceMotionFCB)(int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTspaceRotateFCB)(int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTspaceButtonFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTtabletMotionFCB)(int*, int*);
typedef void (GLUTCALLBACK * GLUTtabletButtonFCB)(int*, int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTjoystickFCB)(unsigned int *buttonMask, int *x, int *y, int *z);
typedef void (GLUTCALLBACK * GLUTselectFCB)(int*);
typedef void (GLUTCALLBACK * GLUTtimerFCB)(int*);
typedef void (GLUTCALLBACK * GLUTmenuStateFCB)(int*); /* DEPRICATED. */
typedef void (GLUTCALLBACK * GLUTmenuStatusFCB)(int*, int*, int*);
typedef void (GLUTCALLBACK * GLUTidleFCB)(void);
/* Functions that set and return Fortran callback functions. */
GLUTAPI void* APIENTRY __glutGetFCB(int which);
GLUTAPI void APIENTRY __glutSetFCB(int which, void *func);
#endif /* __glutf90_h__ */ |
/* list.c
*
* Copyright © 2013 Canonical, Inc
* Author: Serge Hallyn <serge.hallyn@ubuntu.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <lxc/lxccontainer.h>
static void test_list_func(const char *lxcpath, const char *type,
int (*func)(const char *path, char ***names,
struct lxc_container ***cret))
{
int i, n, n2;
struct lxc_container **clist;
char **names;
printf("%-10s Counting containers\n", type);
n = func(lxcpath, NULL, NULL);
printf("%-10s Counted %d containers\n", type, n);
printf("%-10s Get container struct only\n", type);
n2 = func(lxcpath, NULL, &clist);
if (n2 != n)
printf("Warning: first call returned %d, second %d\n", n, n2);
for (i = 0; i < n2; i++) {
struct lxc_container *c = clist[i];
printf("%-10s Got container struct %s\n", type, c->name);
lxc_container_put(c);
}
if (n2 > 0) {
free(clist);
clist = NULL;
}
printf("%-10s Get names only\n", type);
n2 = func(lxcpath, &names, NULL);
if (n2 != n)
printf("Warning: first call returned %d, second %d\n", n, n2);
for (i = 0; i < n2; i++) {
printf("%-10s Got container name %s\n", type, names[i]);
free(names[i]);
}
if (n2 > 0) {
free(names);
names = NULL;
}
printf("%-10s Get names and containers\n", type);
n2 = func(lxcpath, &names, &clist);
if (n2 != n)
printf("Warning: first call returned %d, second %d\n", n, n2);
for (i = 0; i < n2; i++) {
struct lxc_container *c = clist[i];
printf("%-10s Got container struct %s, name %s\n", type, c->name, names[i]);
if (strcmp(c->name, names[i]))
fprintf(stderr, "ERROR: name mismatch!\n");
free(names[i]);
lxc_container_put(c);
}
if (n2 > 0) {
free(names);
free(clist);
}
}
int main(int argc, char *argv[])
{
const char *lxcpath = NULL;
if (argc > 1)
lxcpath = argv[1];
test_list_func(lxcpath, "Defined:", list_defined_containers);
test_list_func(lxcpath, "Active:", list_active_containers);
test_list_func(lxcpath, "All:", list_all_containers);
exit(0);
}
|
int fetch_char(void);
void initialize_readline(void);
void fetch_line(char *prompt);
|
/*
* Copyright (C) 2014-2015 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @defgroup boards_iotlab-m3 IoT-LAB M3 open node
* @ingroup boards
* @brief Board specific files for the iotlab-m3 board.
* @{
*
* @file
* @brief Board specific definitions for the iotlab-m3 board.
*
* @author Alaeddine Weslati <alaeddine.weslati@inria.fr>
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef BOARD_H_
#define BOARD_H_
#include <stdint.h>
#include "cpu.h"
#include "periph_conf.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Define the nominal CPU core clock in this board
*/
#define F_CPU CLOCK_CORECLOCK
/**
* @name Set the default baudrate to 500K for this board
* @{
*/
#ifndef STDIO_BAUDRATE
# define STDIO_BAUDRATE (500000U)
#endif
/** @} */
/**
* @name Define the interface to the AT86RF231 radio
*
* {spi bus, spi speed, cs pin, int pin, reset pin, sleep pin}
*/
#define AT86RF2XX_PARAMS_BOARD {.spi = SPI_0, \
.spi_speed = SPI_SPEED_5MHZ, \
.cs_pin = GPIO_PIN(PORT_A, 4), \
.int_pin = GPIO_PIN(PORT_C, 4), \
.sleep_pin = GPIO_PIN(PORT_A, 2), \
.reset_pin = GPIO_PIN(PORT_C, 1)}
/**
* @name Define the interface for the connected flash memory
* @{
*/
#define EXTFLASH_SPI SPI_1
#define EXTFLASH_CS GPIO_PIN(PORT_A,11)
#define EXTFLASH_WRITE GPIO_PIN(PORT_C,6)
#define EXTFLASH_HOLD GPIO_PIN(PORT_C,9)
/** @} */
/**
* @name Define the interface to the ISL29020 light sensor
* @{
*/
#define ISL29020_I2C I2C_0
#define ISL29020_ADDR 0x44
/** @} */
/**
* @name Define the interface to the LPS331AP pressure sensor
* @{
*/
#define LPS331AP_I2C I2C_0
#define LPS331AP_ADDR 0x5c
/** @} */
/**
* @name Define the interface for the L3G4200D gyroscope
* @{
*/
#define L3G4200D_I2C I2C_0
#define L3G4200D_ADDR 0x68
#define L3G4200D_DRDY GPIO_PIN(PORT_C,0)
#define L3G4200D_INT GPIO_PIN(PORT_C,5)
/** @} */
/**
* @name Define the interface to the LSM303DLHC accelerometer and magnetometer
* @{
*/
#define LSM303DLHC_I2C I2C_0
#define LSM303DLHC_ACC_ADDR (0x19)
#define LSM303DLHC_MAG_ADDR (0x1e)
#define LSM303DLHC_INT1 GPIO_PIN(PORT_B,12)
#define LSM303DLHC_INT2 GPIO_PIN(PORT_B,1)
#define LSM303DLHC_DRDY GPIO_PIN(PORT_B,2)
/** @} */
/**
* @name LED pin definitions
* @{
*/
#define LED_RED_PORT (GPIOD)
#define LED_RED_PIN (2)
#define LED_RED_GPIO GPIO_PIN(PORT_D,2)
#define LED_GREEN_PORT (GPIOB)
#define LED_GREEN_PIN (5)
#define LED_GREEN_GPIO GPIO_PIN(PORT_B,5)
#define LED_ORANGE_PORT (GPIOC)
#define LED_ORANGE_PIN (10)
#define LED_ORANGE_GPIO GPIO_PIN(PORT_C,10)
/** @} */
/**
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED_RED_ON (LED_RED_PORT->ODR &= ~(1<<LED_RED_PIN))
#define LED_RED_OFF (LED_RED_PORT->ODR |= (1<<LED_RED_PIN))
#define LED_RED_TOGGLE (LED_RED_PORT->ODR ^= (1<<LED_RED_PIN))
#define LED_GREEN_ON (LED_GREEN_PORT->ODR &= ~(1<<LED_GREEN_PIN))
#define LED_GREEN_OFF (LED_GREEN_PORT->ODR |= (1<<LED_GREEN_PIN))
#define LED_GREEN_TOGGLE (LED_GREEN_PORT->ODR ^= (1<<LED_GREEN_PIN))
#define LED_ORANGE_ON (LED_ORANGE_PORT->ODR &= ~(1<<LED_ORANGE_PIN))
#define LED_ORANGE_OFF (LED_ORANGE_PORT->ODR |= (1<<LED_ORANGE_PIN))
#define LED_ORANGE_TOGGLE (LED_ORANGE_PORT->ODR ^= (1<<LED_ORANGE_PIN))
/** @} */
/**
* @name xtimer tuning values
* @{
*/
#define XTIMER_OVERHEAD 6
#define XTIMER_SHOOT_EARLY 3
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H_ */
/** @} */
|
/*
* interface data access header
*
* $Id: interface.h 19862 2011-01-13 12:04:53Z dts12 $
*/
#ifndef NETSNMP_ACCESS_INTERFACE_CONFIG_H
#define NETSNMP_ACCESS_INTERFACE_CONFIG_H
/*
* all platforms use this generic code
*/
config_require(if-mib/data_access/interface)
/**---------------------------------------------------------------------*/
/*
* configure required files
*
* Notes:
*
* 1) prefer functionality over platform, where possible. If a method
* is available for multiple platforms, test that first. That way
* when a new platform is ported, it won't need a new test here.
*
* 2) don't do detail requirements here. If, for example,
* HPUX11 had different reuirements than other HPUX, that should
* be handled in the *_hpux.h header file.
*/
#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
config_exclude(mibII/interfaces)
# if defined( linux )
config_require(if-mib/data_access/interface_linux)
config_require(if-mib/data_access/interface_ioctl)
# elif defined( openbsd3 ) || defined( openbsd4 ) || \
defined( freebsd4 ) || defined( freebsd5 ) || defined( freebsd6 ) || \
defined (darwin) || defined( dragonfly )
config_require(if-mib/data_access/interface_sysctl)
# elif defined( solaris2 )
config_require(if-mib/data_access/interface_solaris2)
# else
config_error(This platform does not yet support IF-MIB rewrites)
# endif
#else
# define NETSNMP_ACCESS_INTERFACE_NOARCH 1
#endif
#endif /* NETSNMP_ACCESS_INTERFACE_CONFIG_H */
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include <libebook/libebook.h>
#include "ebook-test-utils.h"
#include "e-test-server-utils.h"
static ETestServerClosure book_closure =
{ E_TEST_SERVER_DEPRECATED_ADDRESS_BOOK, NULL, 0 };
static void
test_remove_contact_by_id_async (ETestServerFixture *fixture,
gconstpointer user_data)
{
EBook *book;
gchar *uid;
book = E_TEST_SERVER_UTILS_SERVICE (fixture, EBook);
uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
ebook_test_utils_book_async_remove_contact_by_id (
book, uid, ebook_test_utils_callback_quit, fixture->loop);
g_main_loop_run (fixture->loop);
g_free (uid);
}
gint
main (gint argc,
gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
#endif
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
g_test_add (
"/EBook/RemoveContactById/Async",
ETestServerFixture,
&book_closure,
e_test_server_utils_setup,
test_remove_contact_by_id_async,
e_test_server_utils_teardown);
return e_test_server_utils_run ();
}
|
#pragma once
#include <vector>
#include <unordered_map>
#include <latticelm/macros.h>
#include <latticelm/hashes.h>
#include <fstream>
#include <iostream>
namespace latticelm {
typedef int32_t WordId;
template < class Key >
class SymbolSet {
public:
typedef std::unordered_map<Key,WordId> Map;
typedef std::vector< Key > Vocab;
protected:
Map map_;
Vocab vocab_;
bool freeze_;
public:
SymbolSet() : map_(), vocab_(), freeze_(false) { }
~SymbolSet() { }
bool KeyInMap(const Key & key) {
auto it = map_.find(key);
if(it != map_.end()) {
return true;
}
return false;
}
WordId SafeGetId(const Key & key) {
auto it = map_.find(key);
if(it != map_.end()) {
return it->second;
} else {
THROW_ERROR("Key not present in map.");
}
}
WordId GetId(const Key & key) {
auto it = map_.find(key);
if(it != map_.end()) {
return it->second;
} else if(freeze_) {
return -1;
} else {
map_[key] = vocab_.size();
vocab_.push_back(key);
return vocab_.size()-1;
}
}
const Key & GetSym(WordId wid) {
if(wid < 0 || wid >= (WordId)vocab_.size())
THROW_ERROR("Invalid wordid in GetSym: " << wid << ", size=" << vocab_.size());
return vocab_[wid];
}
size_t size() { return vocab_.size(); }
void Write(std::string path) {
std::ofstream sym_file;
sym_file.open(path);
for(int i = 0; i < vocab_.size(); i++) {
sym_file << vocab_[i] << " " << i << std::endl;
}
sym_file.close();
}
};
}
|
// Created file "Lib\src\shell32\shguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_MyDocuments, 0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03);
|
/*
* Wrapper System library
*
* Copyright (C) 2010 <Johann Baudy> johann.baudy@gnu-log.net
* Copyright (C) 2010 <Benoit Gschwind> gschwind@gnu-log.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 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/***********************************************************************
* Includes
***********************************************************************/
#include <mine/common.h>
#include <System/unistd.h>
/* internal */
#include <unistd.h>
/***********************************************************************
* Functions
***********************************************************************/
MINEAPI int mine_unlink(const char * path) {
debug__("()");
return unlink(path);
}
|
// Created file "Lib\src\Uuid\propkeys"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PKEY_Calendar_ReminderTime, 0x72fc5ba4, 0x24f9, 0x4011, 0x9f, 0x3f, 0xad, 0xd2, 0x7a, 0xfa, 0xd8, 0x18);
|
/*
* The libclocale header wrapper
*
* Copyright (C) 2010-2021, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _CLOCALE_TEST_LIBCLOCALE_H )
#define _CLOCALE_TEST_LIBCLOCALE_H
#include <common.h>
#include <libclocale.h>
#endif /* !defined( _CLOCALE_TEST_LIBCLOCALE_H ) */
|
#include "types.h"
enum datacenter {
UNKNOWN,
CLIENT,
US_EAST,
US_WEST,
NUM_DATACENTERS
};
static inline datacenter operator++(datacenter& self) {
return (self = (datacenter) ((unsigned) self + 1));
}
const set<nid_t>& getNodesIn(datacenter);
void setNodeLocation(nid_t, datacenter);
datacenter getNodeLocation(nid_t);
nid_t getServer();
|
/****************************************************************************
**
** Copyright (C) 2006-2008 fullmetalcoder <fullmetalcoder@hotmail.fr>
**
** This file is part of the Edyuk project <http://edyuk.org>
**
** This file may be used under the terms of the GNU General Public License
** version 2 as published by the Free Software Foundation and appearing in the
** file GPL.txt included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef _QSINGLE_APPLICATION_H_
#define _QSINGLE_APPLICATION_H_
#include "qcumber.h"
/*!
\file qsingleapplication.h
\brief Definition of the QSingleApplication class.
*/
#include <QApplication>
class QInterProcessChannel;
class QCUMBER_EXPORT QSingleApplication : public QApplication
{
Q_OBJECT
public:
enum InstanciationPolicy
{
None,
ForwardArguments
};
enum MessagingPolicy
{
Ignore,
Events,
Signals
};
QSingleApplication(int& argc, char **argv, bool useGui, const QString & appName);
virtual ~QSingleApplication();
bool isInstanceAllowed() const;
MessagingPolicy messagingPolicy() const;
void setMessagingPolicy(MessagingPolicy p);
InstanciationPolicy instanciationPolicy() const;
void setInstanciationPolicy(InstanciationPolicy p);
public slots:
virtual int exec();
void sendRequest(const QString& s);
void sendRequest(const QStringList& l);
signals:
void request(const QString& s);
protected:
virtual bool event(QEvent *e);
protected slots:
virtual void message(const QString& msg);
virtual void request(const QStringList& r);
private:
QInterProcessChannel *pChannel;
MessagingPolicy m_messaging;
InstanciationPolicy m_instanciation;
};
#endif // !_QSINGLE_APPLICATION_H_
|
// Created file "Lib\src\amstrmid\X64\strmiids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(DSATTRIB_DSHOW_STREAM_DESC, 0x5fb5673b, 0x0a2a, 0x4565, 0x82, 0x7b, 0x68, 0x53, 0xfd, 0x75, 0xe6, 0x11);
|
/*
* quic.c
*
* Copyright (C) 2012-18 - ntop.org
*
* Based on code of:
* Andrea Buscarinu - <andrea.buscarinu@gmail.com>
* Michele Campus - <campus@ntop.org>
*
* This module 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 module 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.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "ndpi_protocol_ids.h"
#ifdef NDPI_PROTOCOL_QUIC
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_QUIC
#include "ndpi_api.h"
static int quic_ports(u_int16_t sport, u_int16_t dport)
{
if ((sport == 443 || dport == 443 || sport == 80 || dport == 80) &&
(sport != 123 && dport != 123))
return 1;
return 0;
}
/* ***************************************************************** */
static int quic_len(u_int8_t l) {
switch(l) {
case 0:
return(1);
break;
case 1:
return(2);
break;
case 2:
return(4);
break;
case 3:
return(8);
break;
}
return(0); /* NOTREACHED */
}
/* ***************************************************************** */
void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &flow->packet;
u_int32_t udp_len = packet->payload_packet_len;
u_int version_len = ((packet->payload[0] & 0x01) == 0) ? 0 : 4;
u_int cid_len = quic_len((packet->payload[0] & 0x0C) >> 2);
u_int seq_len = quic_len((packet->payload[0] & 0x30) >> 4);
u_int quic_hlen = 1 /* flags */ + version_len + seq_len + cid_len;
NDPI_LOG_DBG(ndpi_struct, "search QUIC\n");
if(packet->udp != NULL
&& (udp_len > (quic_hlen+4 /* QXXX */))
&& ((packet->payload[0] & 0xC2) == 0x00)
&& (quic_ports(ntohs(packet->udp->source), ntohs(packet->udp->dest)))
) {
int i;
if((version_len > 0) && (packet->payload[1+cid_len] != 'Q'))
goto no_quic;
NDPI_LOG_INFO(ndpi_struct, "found QUIC\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC, NDPI_PROTOCOL_UNKNOWN);
if(packet->payload[quic_hlen+12] != 0xA0)
quic_hlen++;
if(udp_len > quic_hlen + 16 + 4) {
if(!strncmp((char*)&packet->payload[quic_hlen+16], "CHLO" /* Client Hello */, 4)) {
/* Check if SNI (Server Name Identification) is present */
for(i=quic_hlen+12; i<udp_len-3; i++) {
if((packet->payload[i] == 'S')
&& (packet->payload[i+1] == 'N')
&& (packet->payload[i+2] == 'I')
&& (packet->payload[i+3] == 0)) {
u_int32_t offset = *((u_int32_t*)&packet->payload[i+4]);
u_int32_t prev_offset = *((u_int32_t*)&packet->payload[i-4]);
int len = offset-prev_offset;
int sni_offset = i+prev_offset+1;
while((sni_offset < udp_len) && (packet->payload[sni_offset] == '-'))
sni_offset++;
if((sni_offset+len) < udp_len) {
if(!ndpi_struct->disable_metadata_export) {
int max_len = sizeof(flow->host_server_name)-1, j = 0;
if(len > max_len) len = max_len;
while((len > 0) && (sni_offset < udp_len)) {
flow->host_server_name[j++] = packet->payload[sni_offset];
sni_offset++, len--;
}
ndpi_match_host_subprotocol(ndpi_struct, flow,
(char *)flow->host_server_name,
strlen((const char*)flow->host_server_name),
NDPI_PROTOCOL_QUIC);
}
}
break;
}
}
}
}
return;
}
no_quic:
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
/* ***************************************************************** */
void init_quic_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
NDPI_PROTOCOL_BITMASK *detection_bitmask)
{
ndpi_set_bitmask_protocol_detection("QUIC", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_QUIC, ndpi_search_quic,
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK);
*id += 1;
}
#endif /* NDPI_PROTOCOL_QUIC */
|
// Created file "Lib\src\Uuid\X64\mobility_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IAvailableNetworkMediaManagerDiagnostic, 0x14a821a0, 0x97e8, 0x11d9, 0x83, 0x09, 0x00, 0x0d, 0x9d, 0xff, 0x97, 0xd3);
|
/*
GoatVR - a modular virtual reality abstraction library
Copyright (C) 2014-2017 John Tsiombikas <nuclear@member.fsf.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AUTOCFG_H_
#define AUTOCFG_H_
/* a bunch of helpers, which set up sane defaults, and environment variable
* autoconfiguration of render modules, tracking sources, etc.
*
* These are auxiliary helper functions, which could have been written with
* the public API by a user program, but are implemented by goatvr for ease
* of use.
*/
namespace goatvr {
void activate_module();
} // namespace goatvr
#endif /* AUTOCFG_H_ */
|
/* Copyright (C) 2008-2015 Free Software Foundation, Inc.
Written by Adam Strzelecki <ono@java.pl>
This file is part of GNU Libidn.
GNU Libidn is free software: you can redistribute it and/or
modify it under the terms of either:
* 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.
or
* 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.
or both in parallel, as here.
GNU Libidn 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
#include "ac-stdint.h"
|
//hash.c:
/*
* Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
*
* This file is part of libroar a part of RoarAudio,
* a cross-platform sound system for both, home and professional use.
* See README for details.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3
* as published by the Free Software Foundation.
*
* libroar 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* NOTE for everyone want's to change something and send patches:
* read README and HACKING! There a addition information on
* the license of this document you need to read before you send
* any patches.
*
* NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
* or libpulse*:
* The libs libroaresd, libroararts and libroarpulse link this lib
* and are therefore GPL. Because of this it may be illigal to use
* them with any software that uses libesd, libartsc or libpulse*.
*/
#include "libroar.h"
#ifdef ROAR_HAVE_LIBGCRYPT
#include <gcrypt.h>
#endif
static const struct hashes {
const int id;
const char * name;
const ssize_t dlen;
} _libroar_hashes[] = {
/*
grep '^ +HT_' doc/new-cmds | sed 's/ *#(.*)$//; s/^ +HT_//; s/ *=.*$//' | while read n; do printf " {ROAR_HT_%-12s \"%-12s -1 },\n" $n, $n\",; done
*/
{ROAR_HT_NONE, "NONE", -1 },
{ROAR_HT_MD5, "MD5", 16 },
{ROAR_HT_SHA1, "SHA1", 20 },
{ROAR_HT_RIPEMD160, "RIPEMD160", 20 },
{ROAR_HT_MD2, "MD2", -1 },
{ROAR_HT_TIGER, "TIGER", 24 },
{ROAR_HT_HAVAL, "HAVAL", -1 },
{ROAR_HT_SHA256, "SHA256", 32 },
{ROAR_HT_SHA384, "SHA384", 48 },
{ROAR_HT_SHA512, "SHA512", 64 },
{ROAR_HT_SHA224, "SHA224", 28 },
{ROAR_HT_MD4, "MD4", 16 },
{ROAR_HT_CRC32, "CRC32", 4 },
{ROAR_HT_RFC1510, "RFC1510", 4 },
{ROAR_HT_RFC2440, "RFC2440", 3 },
{ROAR_HT_WHIRLPOOL, "WHIRLPOOL", 64 },
{ROAR_HT_UUID, "UUID", 16 },
{ROAR_HT_GTN8, "GTN8", 1 },
{ROAR_HT_GTN16, "GTN16", 2 },
{ROAR_HT_GTN32, "GTN32", 4 },
{ROAR_HT_GTN64, "GTN64", 8 },
{ROAR_HT_CLIENTID, "CLIENTID", -1 },
{ROAR_HT_STREAMID, "STREAMID", -1 },
{ROAR_HT_SOURCEID, "SOURCEID", -1 },
{ROAR_HT_SAMPLEID, "SAMPLEID", -1 },
{ROAR_HT_MIXERID, "MIXERID", -1 },
{ROAR_HT_BRIDGEID, "BRIDGEID", -1 },
{ROAR_HT_LISTENID, "LISTENID", -1 },
{ROAR_HT_ACTIONID, "ACTIONID", -1 },
{ROAR_HT_MSGQUEUEID, "MSGQUEUEID", -1 },
{ROAR_HT_MSGBUSID, "MSGBUSID", -1 },
{ROAR_HT_GTIN8, "GTIN8", 4 },
{ROAR_HT_GTIN13, "GTIN13", 8 },
{ROAR_HT_ISBN10, "ISBN10", 8 },
{ROAR_HT_ISBN13, "ISBN13", 8 },
{-1, NULL}
};
static inline int roar_ht2gcrypt_tested (const int ht) {
const char * name;
if ( ht > 512 )
return -1;
// test the algo:
name = gcry_md_algo_name(ht);
if ( name == NULL )
return -1;
if ( *name == 0 )
return -1;
return ht;
}
const char * roar_ht2str (const int ht) {
int i;
for (i = 0; _libroar_hashes[i].id != -1; i++)
if ( _libroar_hashes[i].id == ht )
return _libroar_hashes[i].name;
return NULL;
}
int roar_str2ht (const char * ht) {
int i;
for (i = 0; _libroar_hashes[i].id != -1; i++)
if ( !strcasecmp(_libroar_hashes[i].name, ht) )
return _libroar_hashes[i].id;
return -1;
}
ssize_t roar_ht_digestlen (const int ht) {
int i;
for (i = 0; _libroar_hashes[i].id != -1; i++)
if ( _libroar_hashes[i].id == ht )
return _libroar_hashes[i].dlen;
return -1;
}
int roar_ht_is_supported(const int ht) {
roar_crypto_init();
#ifdef ROAR_HAVE_LIBGCRYPT
if ( roar_ht2gcrypt_tested(ht) == -1 )
return 0;
return 1;
#else
return 0;
#endif
}
int roar_hash_buffer(void * digest, const void * data, size_t datalen, int algo) {
roar_crypto_init();
return roar_hash_salted_buffer(digest, data, datalen, algo, NULL, 0);
}
#ifdef ROAR_HAVE_LIBGCRYPT
static inline int roar_hash_salted_buffer_gcrypt(void * digest, const void * data, size_t datalen, int algo, const void * salt, size_t saltlen) {
gcry_md_hd_t hdl;
roar_crypto_init();
algo = roar_ht2gcrypt_tested(algo);
if ( algo == -1 )
return -1;
if ( salt == NULL ) {
// optimized for unsalted:
gcry_md_hash_buffer(algo, digest, data, datalen);
return 0;
} else {
if ( gcry_md_open(&hdl, algo, 0) != 0 )
return -1;
gcry_md_write(hdl, data, datalen);
gcry_md_write(hdl, salt, saltlen);
memcpy(digest, gcry_md_read(hdl, algo), gcry_md_get_algo_dlen(algo));
gcry_md_close(hdl);
}
return 0;
}
#endif
int roar_hash_salted_buffer(void * digest, const void * data, size_t datalen, int algo, const void * salt, size_t saltlen) {
if ( digest == NULL || data == NULL )
return -1;
#ifdef ROAR_HAVE_LIBGCRYPT
return roar_hash_salted_buffer_gcrypt(digest, data, datalen, algo, salt, saltlen);
#else
return -1;
#endif
}
//ll
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_RESETNETWORKINTERFACEATTRIBUTERESPONSE_H
#define QTAWS_RESETNETWORKINTERFACEATTRIBUTERESPONSE_H
#include "ec2response.h"
#include "resetnetworkinterfaceattributerequest.h"
namespace QtAws {
namespace EC2 {
class ResetNetworkInterfaceAttributeResponsePrivate;
class QTAWSEC2_EXPORT ResetNetworkInterfaceAttributeResponse : public Ec2Response {
Q_OBJECT
public:
ResetNetworkInterfaceAttributeResponse(const ResetNetworkInterfaceAttributeRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const ResetNetworkInterfaceAttributeRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(ResetNetworkInterfaceAttributeResponse)
Q_DISABLE_COPY(ResetNetworkInterfaceAttributeResponse)
};
} // namespace EC2
} // namespace QtAws
#endif
|
/* pem_x509.c */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
* 2001.
*/
/* ====================================================================
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509)
|
// Created file "Lib\src\amstrmid\strmiids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PIN_CATEGORY_CC, 0xfb6c4289, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
|
#include "../csm/csm_all.h"
int main() {
JO jo; /* the monkey */
LDP ld;
while((jo = json_read_stream(stdin))) {
if(!(ld = json_to_ld(jo))) {
fprintf(stderr, "Could not transform to laser_data:\n\n");
fprintf(stderr, "-----\n");
fprintf(stderr, "%s", json_object_to_json_string(jo));
fprintf(stderr, "-----\n");
continue;
}
jo = ld_to_json(ld);
printf("%s", json_object_to_json_string(jo));
printf("\n");
}
return 0;
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTTAGSFORRESOURCEREQUEST_P_H
#define QTAWS_LISTTAGSFORRESOURCEREQUEST_P_H
#include "protonrequest_p.h"
#include "listtagsforresourcerequest.h"
namespace QtAws {
namespace Proton {
class ListTagsForResourceRequest;
class ListTagsForResourceRequestPrivate : public ProtonRequestPrivate {
public:
ListTagsForResourceRequestPrivate(const ProtonRequest::Action action,
ListTagsForResourceRequest * const q);
ListTagsForResourceRequestPrivate(const ListTagsForResourceRequestPrivate &other,
ListTagsForResourceRequest * const q);
private:
Q_DECLARE_PUBLIC(ListTagsForResourceRequest)
};
} // namespace Proton
} // namespace QtAws
#endif
|
/*
* ETA/OS - FIFO sched class
* Copyright (C) 2014, 2015, 2016, 2017 Michel Megens <dev@bietje.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied wafifoanty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <etaos/kernel.h>
#include <etaos/types.h>
#include <etaos/error.h>
#include <etaos/sched.h>
#include <etaos/thread.h>
#include "rr_shared.h"
/**
* @addtogroup fifo
* @{
*/
/**
* @brief Insert a new thread into a queue.
* @param tpp Root queue pointer.
* @param tp Thread to insert.
*/
static void fifo_queue_insert(struct thread *volatile*tpp, struct thread *tp)
{
struct thread *thread;
#ifdef CONFIG_EVENT_MUTEX
tp->ec = 0;
#endif
tp->queue = tpp;
thread = *tpp;
if(thread == SIGNALED) {
thread = NULL;
#ifdef CONFIG_EVENT_MUTEX
tp->ec++;
#endif
} else if(thread) {
while(thread) {
tpp = &thread->se.next;
thread = thread->se.next;
}
}
tp->se.next = thread;
*tpp = tp;
#ifdef CONFIG_EVENT_MUTEX
if(tp->se.next && tp->se.next->ec) {
tp->ec += tp->se.next->ec;
tp->se.next->ec = 0;
}
#endif
}
#ifdef CONFIG_PREEMPT
static struct thread *fifo_next_runnable(struct rq *rq);
static bool fifo_preempt_chk(struct rq *rq, struct thread *cur,
struct thread *next)
{
if(prio(next) <= prio(cur))
return true;
return false;
}
#endif
#ifdef CONFIG_THREAD_QUEUE
/**
* @brief Add a new thread to a queue.
* @param qp Queue to add the thread to.
* @param tp Thread to add.
*/
static void fifo_thread_queue_add(struct thread_queue *qp, struct thread *tp)
{
fifo_queue_insert(&qp->qhead, tp);
}
/**
* @brief Remove a thread from a queue.
* @param qp Queue to remove from.
* @param tp Thread to remove.
*/
static void fifo_thread_queue_remove(struct thread_queue *qp, struct thread *tp)
{
rr_shared_queue_remove(&qp->qhead, tp);
}
#endif
/**
* @brief Add a new thread to the run queue.
* @param rq Run queue to add to.
* @param tp Thread to add.
*/
static void fifo_add_thread(struct rq *rq, struct thread *tp)
{
rq->num++;
fifo_queue_insert(&rq->rr_rq.run_queue, tp);
}
/**
* @brief Remove a thread from a rq.
* @param rq Run queue to remove from.
* @param tp Thread to remove.
* @retval -EOK on success.
* @return -EINVAL on error (no thread was removed).
*/
static int fifo_rm_thread(struct rq *rq, struct thread *tp)
{
int rc;
if((rc = rr_shared_queue_remove(&rq->rr_rq.run_queue, tp)) == 0)
rq->num--;
return rc;
}
/**
* @brief Get the next runnable thread on the run queue.
* @param rq RQ to get the next runnable thread from.
* @return The next runnable thread.
* @retval NULL if no runnable thread was found.
*/
static struct thread *fifo_next_runnable(struct rq *rq)
{
struct thread *runnable;
for(runnable = rq->rr_rq.run_queue; runnable;
runnable = runnable->se.next) {
if(!test_bit(THREAD_RUNNING_FLAG, &runnable->flags))
continue;
else
break;
}
return runnable;
}
#ifdef CONFIG_EVENT_MUTEX
/**
* @brief Get the next runnable thread after \p tp.
* @param tp Thread to get the 'next' of.
* @return The next of \p tp.
* @retval NULL if \p tp has no next thread.
*/
static struct thread *fifo_thread_after(struct thread *tp)
{
if(tp)
return tp->se.next;
else
return NULL;
}
#endif
/**
* @brief FIFO scheduling class.
*/
struct sched_class fifo_class = {
.init = NULL,
.rm_thread = &fifo_rm_thread,
.add_thread = &fifo_add_thread,
.next_runnable = &fifo_next_runnable,
#ifdef CONFIG_PREEMPT
.preempt_chk = &fifo_preempt_chk,
#endif
#ifdef CONFIG_EVENT_MUTEX
.thread_after = &fifo_thread_after,
#endif
.post_schedule = NULL,
#ifdef CONFIG_THREAD_QUEUE
.queue_add = &fifo_thread_queue_add,
.queue_rm = &fifo_thread_queue_remove,
#endif
};
/* @} */
|
// Created file "Lib\src\Shell32\X64\shguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(FOLDERTYPEID_GenericSearchResults, 0x7fde1a1e, 0x8b31, 0x49a5, 0x93, 0xb8, 0x6b, 0xe1, 0x4c, 0xfa, 0x49, 0x43);
|
/*---------------------------------------------------------------------------
--
-- tef distributed p2p database framework.
--
-- Copyright (c) 2016-2017 Viktor Bakhtin
-- mailto: dadavita@mail.ru
-- Licensed under the LGPL license:
--
----------------------------------------------------------------------------*/
#ifndef TEF_CONFIG_H
#define TEF_CONFIG_H
#define FUNC_LIVECYCLE 30 // secs
#define REPLY_LIVECYCLE 30 // secs
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_REPORTTASKPROGRESSREQUEST_H
#define QTAWS_REPORTTASKPROGRESSREQUEST_H
#include "datapipelinerequest.h"
namespace QtAws {
namespace DataPipeline {
class ReportTaskProgressRequestPrivate;
class QTAWSDATAPIPELINE_EXPORT ReportTaskProgressRequest : public DataPipelineRequest {
public:
ReportTaskProgressRequest(const ReportTaskProgressRequest &other);
ReportTaskProgressRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(ReportTaskProgressRequest)
};
} // namespace DataPipeline
} // namespace QtAws
#endif
|
/* mpfr_set_exp - set the exponent of a floating-point number
Copyright 2002-2004, 2006-2017 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
The GNU MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include "mpfr-impl.h"
int
mpfr_set_exp (mpfr_ptr x, mpfr_exp_t exponent)
{
if (MPFR_LIKELY (MPFR_IS_PURE_FP (x) &&
exponent >= __gmpfr_emin &&
exponent <= __gmpfr_emax))
{
MPFR_EXP(x) = exponent; /* do not use MPFR_SET_EXP of course... */
return 0;
}
else
{
return 1;
}
}
|
// Created file "Lib\src\Uuid\esguids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_SYSTEM_COOLING_POLICY, 0x94d3a615, 0xa899, 0x4ac5, 0xae, 0x2b, 0xe4, 0xd8, 0xf6, 0x34, 0x36, 0x7f);
|
/*
* The libfvalue header wrapper
*
* Copyright (C) 2008-2022, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined( _LIBPFF_LIBFVALUE_H )
#define _LIBPFF_LIBFVALUE_H
#include <common.h>
/* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue
*/
#if defined( HAVE_LOCAL_LIBFVALUE )
#include <libfvalue_codepage.h>
#include <libfvalue_data_handle.h>
#include <libfvalue_definitions.h>
#include <libfvalue_floating_point.h>
#include <libfvalue_integer.h>
#include <libfvalue_split_utf16_string.h>
#include <libfvalue_split_utf8_string.h>
#include <libfvalue_string.h>
#include <libfvalue_table.h>
#include <libfvalue_types.h>
#include <libfvalue_value.h>
#include <libfvalue_value_type.h>
#include <libfvalue_utf16_string.h>
#include <libfvalue_utf8_string.h>
#else
/* If libtool DLL support is enabled set LIBFVALUE_DLL_IMPORT
* before including libfvalue.h
*/
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define LIBFVALUE_DLL_IMPORT
#endif
#include <libfvalue.h>
#endif /* defined( HAVE_LOCAL_LIBFVALUE ) */
#endif /* !defined( _LIBPFF_LIBFVALUE_H ) */
|
// Created file "Lib\src\Uuid\oaidl_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_ITypeInfo2, 0x00020412, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
|
#pragma once
#include "stdafx.h"
#include "GClientLib.h"
#include "Globals.h"
using namespace System;
using namespace System::Threading;
using namespace GClientLib;
ref class CLI {
private:
bool quitApp;
SocketToObjectContainer^ STOContainer;
ToServerSocket^ socket;
SettingsReader^ settings;
std::string ClearCLI();
public:
CLI(GClientLib::ToServerSocket^ socket, GClientLib::SocketToObjectContainer^ STOContainer, GClientLib::SettingsReader^ settings);
void Start();
bool getQuitStatus();
};
|
/*
* Copyright (C) 2020 Ondrej Starek
*
* This file is part of OTest2.
*
* OTest2 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.
*
* OTest2 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 OTest2. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OTest2__OTEST2_PARSERANNOTATIONIMPL_H_
#define OTest2__OTEST2_PARSERANNOTATIONIMPL_H_
#include "parserannotation.h"
#include <clang/AST/Attr.h>
#include <clang/AST/DeclBase.h>
#include <clang/Basic/AttrKinds.h>
namespace OTest2 {
namespace Parser {
template<typename Compare_>
bool hasAnnotation(
const clang::Decl* decl_,
Compare_& cmp_) {
if(decl_->hasAttrs()) {
for(
auto iter_(decl_->attr_begin());
iter_ != decl_->attr_end();
++iter_) {
if((*iter_)->getKind() == clang::attr::Annotate) {
auto sa_(clang::cast<clang::AnnotateAttr>(*iter_));
auto str_(sa_->getAnnotation());
if(cmp_(str_.str())) {
return true;
}
}
}
}
return false;
}
} /* -- namespace Parser */
} /* -- namespace OTest2 */
#endif /* -- OTest2__OTEST2_PARSERANNOTATIONIMPL_H_ */
|
// Created file "Lib\src\Uuid\propkeys"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_USERINTERFACEBUTTON_ACTION, 0xa7066653, 0x8d6c, 0x40a8, 0x91, 0x0e, 0xa1, 0xf5, 0x4b, 0x84, 0xc7, 0xe5);
|
/*
* File: msg_acm.h
* Author: Zheng GONG(matthewzhenggong@gmail.com)
*
* This file is part of FIWT.
*
* FIWT is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
#ifndef MSG_ACM_H
#define MSG_ACM_H
#include "config.h"
#if AC_MODEL || AEROCOMP
#include "msg.h"
#include "servoTask.h"
#include "task.h"
#include <stdint.h>
#include <stddef.h>
#define BATTPACKLEN (1+BATTCELLADCNUM+4)
#define COMMPACKLEN (1+4*2+3)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct msgParamACM{
TaskHandle_p sen_Task;
TaskHandle_p servo_Task;
TaskHandle_p msg_Task;
servoParam_p serov_param;
}msgParamACM_t, *msgParamACM_p;
void msgRegistACM(msgParam_p, msgParamACM_p, unsigned);
bool sendDataPack(uint32_t time_token);
#ifdef __cplusplus
}
#endif
#endif /*AC_MODEL || AEROCOMP*/
#endif /* MSG_ACM_H */
|
/*
* vim:expandtab:shiftwidth=8:tabstop=8:
*/
/**
*
* \file fsal_truncate.c
* \author $Author: leibovic $
* \date $Date: 2005/07/29 09:39:05 $
* \version $Revision: 1.4 $
* \brief Truncate function.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "fsal.h"
#include "fsal_internal.h"
#include "fsal_convert.h"
#include "namespace.h"
/**
* FSAL_truncate:
* Modify the data length of a regular file.
*
* \param filehandle (input):
* Handle of the file is to be truncated.
* \param cred (input):
* Authentication context for the operation (user,...).
* \param length (input):
* The new data length for the file.
* \param object_attributes (optionnal input/output):
* The post operation attributes of the file.
* As input, it defines the attributes that the caller
* wants to retrieve (by positioning flags into this structure)
* and the output is built considering this input
* (it fills the structure according to the flags it contains).
* May be NULL.
*
* \return Major error codes :
* - ERR_FSAL_NO_ERROR (no error)
* - ERR_FSAL_STALE (filehandle does not address an existing object)
* - ERR_FSAL_INVAL (filehandle does not address a regular file)
* - ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
* - Other error codes can be returned :
* ERR_FSAL_ACCESS, ERR_FSAL_IO, ...
*/
fsal_status_t FUSEFSAL_truncate(fusefsal_handle_t * filehandle, /* IN */
fusefsal_op_context_t * p_context, /* IN */
fsal_size_t length, /* IN */
fusefsal_file_t * file_descriptor, /* Unused in this FSAL */
fsal_attrib_list_t * object_attributes /* [ IN/OUT ] */
)
{
int rc;
char object_path[FSAL_MAX_PATH_LEN];
/* sanity checks.
* note : object_attributes is optional.
*/
if(!filehandle || !p_context)
Return(ERR_FSAL_FAULT, 0, INDEX_FSAL_truncate);
if(!p_fs_ops->truncate)
Return(ERR_FSAL_NOTSUPP, 0, INDEX_FSAL_truncate);
/* get the full path for the object */
rc = NamespacePath(filehandle->data.inode, filehandle->data.device, filehandle->data.validator,
object_path);
if(rc)
Return(ERR_FSAL_STALE, rc, INDEX_FSAL_truncate);
/* set context for the next operation, so it can be retrieved by FS thread */
fsal_set_thread_context(p_context);
TakeTokenFSCall();
rc = p_fs_ops->truncate(object_path, (off_t) length);
ReleaseTokenFSCall();
if(rc)
Return(fuse2fsal_error(rc, TRUE), rc, INDEX_FSAL_truncate);
if(object_attributes)
{
fsal_status_t st;
st = FUSEFSAL_getattrs(filehandle, p_context, object_attributes);
if(FSAL_IS_ERROR(st))
{
FSAL_CLEAR_MASK(object_attributes->asked_attributes);
FSAL_SET_MASK(object_attributes->asked_attributes, FSAL_ATTR_RDATTR_ERR);
}
}
/* No error occured */
Return(ERR_FSAL_NO_ERROR, 0, INDEX_FSAL_truncate);
}
|
//meta.h:
/*
* Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010
*
* This file is part of RoarAudio,
* a cross-platform sound system for both, home and professional use.
* See README for details.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation.
*
* RoarAudio 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* NOTE: Even though this file is LGPLed it (may) include GPLed files
* so the license of this file is/may therefore downgraded to GPL.
* See HACKING for details.
*/
#ifndef _ROARAUDIO_META_H_
#define _ROARAUDIO_META_H_
#define ROAR_META_TYPE_NONE 0
#define ROAR_META_TYPE_TITLE 1
#define ROAR_META_TYPE_ALBUM 2
#define ROAR_META_TYPE_AUTHOR 3
#define ROAR_META_TYPE_AUTOR ROAR_META_TYPE_AUTHOR
#define ROAR_META_TYPE_ARTIST ROAR_META_TYPE_AUTHOR
#define ROAR_META_TYPE_VERSION 4
#define ROAR_META_TYPE_DATE 5
#define ROAR_META_TYPE_LICENSE 6
#define ROAR_META_TYPE_TRACKNUMBER 7
#define ROAR_META_TYPE_ORGANIZATION 8
#define ROAR_META_TYPE_DESCRIPTION 9
#define ROAR_META_TYPE_GENRE 10
#define ROAR_META_TYPE_LOCATION 11
#define ROAR_META_TYPE_CONTACT 12
#define ROAR_META_TYPE_STREAMURL 13
#define ROAR_META_TYPE_HOMEPAGE 14
#define ROAR_META_TYPE_THUMBNAIL 15
#define ROAR_META_TYPE_LENGTH 16
#define ROAR_META_TYPE_COMMENT 17
#define ROAR_META_TYPE_OTHER 18
#define ROAR_META_TYPE_FILENAME 19
#define ROAR_META_TYPE_FILEURL 20
#define ROAR_META_TYPE_SERVER 21
#define ROAR_META_TYPE_DURATION 22
#define ROAR_META_TYPE_WWW ROAR_META_TYPE_HOMEPAGE
#define ROAR_META_TYPE_WOAF 23 /* ID3: Official audio file webpage */
#define ROAR_META_TYPE_ENCODER 24
#define ROAR_META_TYPE_ENCODEDBY ROAR_META_TYPE_ENCODER
#define ROAR_META_TYPE_YEAR 25
#define ROAR_META_TYPE_DISCID 26
#define ROAR_META_TYPE_RPG_TRACK_PEAK 27
#define ROAR_META_TYPE_RPG_TRACK_GAIN 28
#define ROAR_META_TYPE_RPG_ALBUM_PEAK 29
#define ROAR_META_TYPE_RPG_ALBUM_GAIN 30
#define ROAR_META_TYPE_HASH 31
#define ROAR_META_TYPE_SIGNALINFO 32
#define ROAR_META_TYPE_AUDIOINFO ROAR_META_TYPE_SIGNALINFO
#define ROAR_META_TYPE_OFFSET 33
#define ROAR_META_TYPE_PERFORMER 34
#define ROAR_META_TYPE_COPYRIGHT 35
#define ROAR_META_MODE_SET 0
#define ROAR_META_MODE_ADD 1
#define ROAR_META_MODE_DELETE 2
#define ROAR_META_MODE_CLEAR 3
#define ROAR_META_MODE_FINALIZE 4
#define ROAR_META_MAX_NAMELEN 32
#define ROAR_META_MAX_PER_STREAM 16
struct roar_meta {
int type;
char key[ROAR_META_MAX_NAMELEN];
char * value;
};
#endif
//ll
|
/*
* MPlayer backend for the Phonon library
* Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
* Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MEDIASETTINGS_H
#define MEDIASETTINGS_H
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QSize>
/**
* Settings for the MPlayer process.
*
* MPlayer uses command line arguments.
* Here are all the arguments that we be given to MPlayer command line.
*
* FIXME This class is still dirty and some code needs to be removed.
* All javadoc commented variables are clean and tested, others are not.
*
* @see MPlayerLoader
* @author Tanguy Krotoff
*/
class MediaSettings {
public:
//Not clean and not used
enum Aspect { AspectAuto = 1, Aspect43 = 2, Aspect169 = 3, Aspect235 = 4,
Aspect149 = 8, Aspect1610 = 9, Aspect54 = 10 };
enum AudioChannels { ChDefault = 0, ChStereo = 2, ChSurround = 4,
ChFull51 = 6 };
enum StereoMode { Stereo = 0, Left = 1, Right = 2 };
enum IDs { NoneSelected = -1000, SubNone = 90000 };
//!Not clean and not used
MediaSettings();
~MediaSettings();
void clear();
/**
* MPlayer volume, see MPlayer manpage.
*
* -volume <-1-100> (also see -af volume)
* Sets the startup volume in the mixer, either hardware or software (if used with -softvol).
* A value of -1 (the default) will not change the volume.
*/
int volume;
/** Video contrast. */
int contrast;
/** Video brightness. */
int brightness;
/** Video hue. */
int hue;
/** Video saturation. */
int saturation;
/**
* Audio filters.
*
* - "karaoke"
* - "extrastereo"
* - "volnorm=2"
*/
QStringList audioFilters;
/**
* Video filters.
*/
QStringList videoFilters;
/**
* Optial device name for MPlayer.
*
* -dvd-device argument for MPlayer
* <pre>mplayer dvd://<title> -dvd-device d:</pre>
* <pre>mplayer dvd://1 -dvd-device /dev/dvd</pre>
*
* -cdrom-device argument for MPlayer
* <pre>mplayer vcd://<track> -cdrom-device d:</pre>
* <pre>mplayer vcd://1 -cdrom-device /dev/cdrom</pre>
* <pre>mplayer cdda://1 -cdrom-device /dev/cdrom</pre>
*/
QString opticalDeviceName;
//FIXME Everything after this point is not clean and is not used!
int gamma;
double current_sec;
int current_sub_id;
int current_audio_id;
int current_title_id;
int current_chapter_id;
int current_angle_id;
int aspect_ratio_id;
//bool fullscreen;
QString external_subtitles;
QString external_audio; // external audio file
int sub_delay;
int audio_delay;
// Subtitles position (0-100)
int sub_pos;
double sub_scale;
double sub_scale_ass;
double speed; // Speed of playback: 1.0 = normal speed
int current_deinterlacer;
bool add_letterbox;
int audio_use_channels;
int stereo_mode;
double panscan_factor; // mplayerwindow zoom
// This a property of the video and it should be
// in mediadata, but we have to save it to preserve
// this data among restarts.
double starting_time; // Some videos don't start at 0
//! The codec of the video is ffh264 and it's high definition
bool is264andHD;
// Advanced settings
QString forced_demuxer;
QString forced_video_codec;
QString forced_audio_codec;
// A copy of the original values, so we can restore them.
QString original_demuxer;
QString original_video_codec;
QString original_audio_codec;
// Options to mplayer (for this file only)
QString mplayer_additional_options;
QString mplayer_additional_video_filters;
QString mplayer_additional_audio_filters;
// Some things that were before in mediadata
// They can vary, because of filters, so better here
//Resolution used by mplayer
//Can be bigger that video resolution
//because of the aspect ratio or expand filter
int win_width;
int win_height;
double win_aspect();
};
#endif //MEDIASETTINGS_H
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETEBSDEFAULTKMSKEYIDREQUEST_H
#define QTAWS_GETEBSDEFAULTKMSKEYIDREQUEST_H
#include "ec2request.h"
namespace QtAws {
namespace EC2 {
class GetEbsDefaultKmsKeyIdRequestPrivate;
class QTAWSEC2_EXPORT GetEbsDefaultKmsKeyIdRequest : public Ec2Request {
public:
GetEbsDefaultKmsKeyIdRequest(const GetEbsDefaultKmsKeyIdRequest &other);
GetEbsDefaultKmsKeyIdRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(GetEbsDefaultKmsKeyIdRequest)
};
} // namespace EC2
} // namespace QtAws
#endif
|
/********************************************************
* @author Airead Fan <fgh1987168@gmail.com> *
* @date 201110月 18 09:20:18 CST *
********************************************************
* after studying C 92 days *
* after studying APUE 57 days *
* after studying ARM 10 days *
********************************************************/
/*
* 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 "imx233.h"
#include "sw_interrupt.h"
#include "swstd.h"
#include "sw_stdio.h"
extern void int_init(void);
extern void irq_enable(void);
extern void irq_disable(void);
/* regsiter define */
static struct HW_PINCTRL * const pinctrl =
(struct HW_PINCTRL *) REGS_PINCTRL_BASE_PHYS;
static struct HW_ICOLL * const icoll =
(struct HW_ICOLL *) REGS_ICOLL_BASE_PHYS;
typedef void (*INTERRUPT_HANDLER)(void);
/* FIXME: Is the low 2 bits of vector_table's address(1:0) 0? */
INTERRUPT_HANDLER vector_table[128];
/*
* Initialize Interrupt Collector
*/
int sw_int_init_icoll0()
{
/*
* clear soft reset, regs = HW_ICOLL_CTRL
* 31 | soft reset | 1 = turn on, 0 = turn off
* 30 | gate | 1 = gate off, 0 = gate on
* 23:21 | step pitch | 2 = 2 word, 1 = 1 word, 0 = 1 word
* 20 | bypass FSM | 1 = bypass, 0 = normal
* 19 | nesting | 1 = no nesting, 0 = normal
* 18 | ARM_RSE_MODE | 1 = enable, 0 = disable
* 17 | FIQ_FINAL_ENABLE | 1 = enable, 0 = disable
* 16 | IRQ_FINAL_ENABLE | 1 = enable, 0 = disable
*/
icoll->ctrl.clr = 1 << 31; /* turn off soft reset */
icoll->ctrl.clr = 1 << 30; /* gate on */
icoll->ctrl.clr = 7 << 21; /* 1 word */
icoll->ctrl.clr = 1 << 20; /* no bypass FSM */
icoll->ctrl.set = 1 << 19; /* no nesting*/
icoll->ctrl.clr = 1 << 18; /* ARM_RSE_MODE disable */
icoll->ctrl.clr = 1 << 17; /* FIQ disable */
icoll->ctrl.set = 1 << 16; /* IRQ enable */
sw_usleep(100); /* Stable clock */
/* set Interrupt Collector Interrupt Vector Base Address Register */
icoll->vbase.dat = (int)vector_table;
/* change to irq mode, and set irq stack */
int_init();
/* clear cpsr I bit, arm can handle interrupt */
irq_enable();
return 0;
}
/*
* Initialize Pin Contrl
*/
int sw_int_init_pinctrl(int bankn, int pinn, int irqlevel, int irqpol,
int irqsrc, int priority, void irq_handle(void))
{
int mux_num;
int mux_bit_num;
/* get mux_num */
if(pinn < 16){
mux_num = bankn * 2;
}else{
mux_num = bankn * 2 + 1;
}
/* get mux_bit_num */
if(pinn < 16){
mux_bit_num = pinn * 2;
}else{
mux_bit_num = (pinn - 16) * 2;
}
/*
* Set interrupt Level/Edge detection, regs = HW_PINCTRL_IRQLEVELn
* 1 = level, 0 = edge
*/
if(irqlevel == IRQ_LEVEL){
pinctrl->irqlevel[bankn].set = 1 << mux_bit_num;
}else if(irqlevel == IRQ_EDGE){
pinctrl->irqlevel[bankn].clr = 1 << mux_bit_num;
}else{
return -1;
}
/*
* Set Interrupt Polarity low/high, regs = HW_PINCTRL_IRQPOLn
* 0 = Low or falling edge,
* 1 = High or rising edge
*/
if(irqpol == IRQ_LOW){
pinctrl->irqpol[bankn].clr = 1 << pinn;
}else if(irqpol == IRQ_HIGH){
pinctrl->irqpol[bankn].set = 1 << pinn;
}else{
return -1;
}
/*
* Clear Interrupt Status, regs = HW_PINCTRL_IRQSTAT0
* 0= No interrupt pending;
* 1= Interrupt pending.
*/
pinctrl->irqstat[bankn].clr = 1 << pinn;
/*
* Set Interrupt Select, regs = HW_PINCTRL_PIN2IRQn
* 0= Deselect the pin's interrupt functionality.
* 1= Select the pin to be used as an interrupt source.
*/
pinctrl->pin2irq[bankn].set = 1 << pinn;
/*
* Set Interrupt Mask, regs = HW_PINCTRL_IRQENn
* 1= Enable interrupts corresponding bit
* 0= Disable interrupts corresponding bit
*/
pinctrl->irqen[bankn].set = 1 << pinn;
/*
* Register interrupt function
*/
vector_table[irqsrc] = irq_handle;
/*
* Set Interrupt Collector Interrupt, regs = HW_ICOLL_INTERRUPTn
* 4 | ENFIQ | 1 = enable, 0 = disable
* 3 | SOFTIRQ | 1 = force a soft interrupt, 0 = turn off
* 2 | ENABLE | 1 = enable, 0 = disable
* 1:0 | PRIORITY | 3 = 11, 2 = 10, 1 = 01; 0 = 00
*/
icoll->interrupt[irqsrc].clr = 1 << 4; /* disable FIQ */
icoll->interrupt[irqsrc].clr = 1 << 3; /* clear softirq */
icoll->interrupt[irqsrc].set = 1 << 2; /* enable IRQ */
icoll->interrupt[irqsrc].set = priority & 0x3; /* set priority */
return 0;
}
void irq_dist0(void)
{
icoll->vector.dat = icoll->vector.dat; /* FIXME: what's meaning? */
(*((INTERRUPT_HANDLER *)icoll->vector.dat))();
/*
* Set Level Acknowledge, regs = HW_ICOLL_LEVELACK
* 3:0 | IRQLEVELACK | level0 = 0x1, 1 = 0x2, 2 = 0x4, 3 0x8
*/
icoll->levelack.dat = 1; /* only fit level0, and no nest */
}
int irq_clear_pending(int bankn, int pinn, int priority)
{
/*
* Set Level Acknowledge, regs = HW_ICOLL_LEVELACK
* 3:0 | IRQLEVELACK | level0 = 0x1, 1 = 0x2, 2 = 0x4, 3 0x8
*/
//icoll->levelack.dat = 1 << priority; /* only fit level0, and no nest */
pinctrl->irqstat[bankn].clr = 1 << pinn;
return 0;
}
void int_databort(void)
{
sw_printf("data abort");
}
|
#ifndef PARSER_H
#define PARSER_H
#include <string>
#include <stack>
#include "lexer.h"
#include "state.h"
/**
* Utility for interpreting strings as mathematical expressions.
*
* A valid expression here consists only of plus signs, multiplication signs,
* parentheses and numbers.
*/
class Parser
{
public:
/**
* Destructs the parser.
*/
~Parser ();
/**
* Parses a string as a mathematical expression.
*
* @param expression The string to interpret as an expression.
* @return
*/
int parse (std::string & expression);
/**
* Pops and returns the last parsed token.
*
* @return The popped token.
*/
Token * pop ();
/**
* Pops and destroys the last parsed token.
*/
void popAndDestroy ();
/**
* Performs a reduction transition to the left.
*
* @param n The amount of states to undo.
* @param newToken The new token to insert.
* @param unvisitedToken The token which triggered this reduction.
*/
void reduce (unsigned int n, Token * newToken, Token * unvisitedToken);
/**
* Performs a shift transition to the right.
*
* @param token The token to add.
* @param state The state to add.
*/
void shift (Token * token, State * state);
protected:
Lexer * lexer;
std::stack<State *> states;
std::stack<Token *> tokens;
};
#endif // PARSER_H
|
#ifndef ELM_PREFS_CC_H
#define ELM_PREFS_CC_H
#include <Elementary.h>
#define ELM_INTERNAL_API_ARGESFSDFEFC
#include "elm_priv.h"
#include "elm_widget_prefs.h"
extern Eina_Prefix *pfx;
/*
* On Windows, if the file is not opened in binary mode,
* read does not return the correct size, because of
* CR / LF translation.
*/
#ifndef O_BINARY
# define O_BINARY 0
#endif
/* logging variables */
extern int _elm_prefs_cc_log_dom;
#define ELM_PREFS_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_elm_prefs_cc_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_elm_prefs_cc_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_elm_prefs_cc_log_dom, __VA_ARGS__)
#ifdef CRI
# undef CRI
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_elm_prefs_cc_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_elm_prefs_cc_log_dom, __VA_ARGS__)
/* types */
typedef struct _Elm_Prefs_File Elm_Prefs_File;
typedef struct _New_Object_Handler New_Object_Handler;
typedef struct _New_Statement_Handler New_Statement_Handler;
struct _Elm_Prefs_File
{
const char *compiler;
Eina_List *pages;
};
struct _New_Object_Handler
{
const char *type;
void (*func)(void);
};
struct _New_Statement_Handler
{
const char *type;
void (*func)(void);
};
/* global fn calls */
void compile(void);
char *parse_str(int n);
int parse_enum(int n, ...);
int parse_int(int n);
int parse_int_range(int n, int f, int t);
int parse_bool(int n);
double parse_float(int n);
void check_arg_count(int n);
void check_regex(const char *regex);
void set_verbatim(char *s, int l1, int l2);
void data_init();
void data_write();
void data_shutdown();
int object_handler_num(void);
int statement_handler_num(void);
void *mem_alloc(size_t size);
char *mem_strdup(const char *s);
#define SZ sizeof
/* global vars */
extern char *file_in;
extern char *tmp_dir;
extern char *file_out;
extern int line;
extern Eina_List *stack;
extern Eina_List *params;
extern Elm_Prefs_File *elm_prefs_file;
extern Eina_List *elm_prefs_pages;
extern New_Object_Handler object_handlers[];
extern New_Statement_Handler statement_handlers[];
#endif
|
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** V4l2DeviceSource.h
**
** V4L2 live555 source
**
** -------------------------------------------------------------------------*/
#ifndef V4L2_DEVICE_SOURCE
#define V4L2_DEVICE_SOURCE
#include <string>
#include <list>
#include <iostream>
// live555
#include <liveMedia.hh>
// project
#include "V4l2Capture.h"
// ---------------------------------
// V4L2 FramedSource
// ---------------------------------
const char marker[] = {0,0,0,1};
class V4L2DeviceSource: public FramedSource
{
public:
// ---------------------------------
// Captured frame
// ---------------------------------
struct Frame
{
Frame(char* buffer, int size, timeval timestamp) : m_buffer(buffer), m_size(size), m_timestamp(timestamp) {};
Frame(const Frame&);
Frame& operator=(const Frame&);
~Frame() { delete m_buffer; };
char* m_buffer;
int m_size;
timeval m_timestamp;
};
// ---------------------------------
// Compute simple stats
// ---------------------------------
class Stats
{
public:
Stats(const std::string & msg) : m_fps(0), m_fps_sec(0), m_size(0), m_msg(msg) {};
public:
int notify(int tv_sec, int framesize, int verbose);
protected:
int m_fps;
int m_fps_sec;
int m_size;
const std::string m_msg;
};
public:
static V4L2DeviceSource* createNew(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread) ;
std::string getAuxLine() { return m_auxLine; };
protected:
V4L2DeviceSource(UsageEnvironment& env, V4L2DeviceParameters params, V4l2Capture * device, int outputFd, unsigned int queueSize, int verbose, bool useThread);
virtual ~V4L2DeviceSource();
protected:
static void* threadStub(void* clientData) { return ((V4L2DeviceSource*) clientData)->thread();};
void* thread();
static void deliverFrameStub(void* clientData) {((V4L2DeviceSource*) clientData)->deliverFrame();};
void deliverFrame();
static void incomingPacketHandlerStub(void* clientData, int mask) { ((V4L2DeviceSource*) clientData)->getNextFrame(); };
int getNextFrame();
bool processConfigrationFrame(char * frame, int frameSize);
void processFrame(char * frame, int &frameSize, const timeval &ref);
void queueFrame(char * frame, int frameSize, const timeval &tv);
// overide FramedSource
virtual void doGetNextFrame();
virtual void doStopGettingFrames();
protected:
V4L2DeviceParameters m_params;
std::list<Frame*> m_captureQueue;
Stats m_in;
Stats m_out;
EventTriggerId m_eventTriggerId;
int m_outfd;
std::string m_auxLine;
V4l2Capture * m_device;
unsigned int m_queueSize;
int m_verbose;
pthread_t m_thid;
};
#endif
|
/*
* A solution to Exercise 2-2 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart, <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
uint32_t i = 0;
uint32_t lim = 100;
char c = 0;
char s[lim];
while (i < (lim - 1)) {
c = getchar();
if (c != '\n') {
if (c != EOF) {
s[i++] = c;
}
}
}
s[i] = '\0';
puts(s);
return EXIT_SUCCESS;
}
|
//---------------------------------------------------------------------------
#ifndef TINYHTTP_METHOD_H_
#define TINYHTTP_METHOD_H_
//---------------------------------------------------------------------------
#include <cinttypes>
//---------------------------------------------------------------------------
#include "../depend/net/include/tcp_connection.h"
//---------------------------------------------------------------------------
namespace tinyhttp
{
class RequestMessage;
class Method
{
public:
virtual void GET (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void POST (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void HEAD (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void OPTIONS (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void PUT (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void TRANCE (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void DELETE (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
virtual void CONNECT (const net::TCPConnPtr& tcp_conn, uint64_t rcv_time) = 0;
};
}//namespace tinyhttp
//---------------------------------------------------------------------------
#endif //define TINYHTTP_CALLBACK_H_
|
#define BS_CFG_IMPLEMENTATION
#include <utils/bs.h>
|
/**
* Win32 UTF-8 wrapper
*
* ----
*
* main() entry point.
* Compile or #include this file as part of your sources
* if your program runs in the console subsystem.
*/
#include "src/entry.h"
#undef main
int __cdecl wmain(void)
{
return win32_utf8_entry(win32_utf8_main);
}
// If both main() and wmain() are defined...
// • Visual Studio (or more specifically, LINK.EXE) defaults to main()
// • Pelles C defaults to wmain(), without even printing a "ambiguous entry
// point" warning
// • MinGW/GCC doesn't care, and expects wmain() if you specify -municode,
// and main() by default.
// Thus, we keep main() as a convenience fallback for GCC.
#ifndef _MSC_VER
int __cdecl main(void)
{
return win32_utf8_entry(win32_utf8_main);
}
#endif
|
#include <ctype.h>
#include <ncurses.h>
#include <breakout/konami.h>
bool konami_push(KONAMI *konami, int ch)
{
ch = toupper(ch);
if (konami->keys[konami->ok] != ch) {
konami->ok = 0;
return false;
}
if (++konami->ok == konami->nkeys) {
konami->ok = 0;
return true;
}
return false;
}
|
/*
** epic_editor.c for epic_editor in /home/remy_o/rendu/epic_js_fantasy/epic_editor
**
** Made by Olivier Remy
** Login <remy_o@epitech.net>
**
** Started on Sun May 11 03:09:47 2014 Olivier Remy
** Last update Sun Jun 8 18:30:46 2014 Olivier Remy
*/
#include "epic_editor.h"
void epic_editor(char *file)
{
int fd;
t_list *list;
t_map *map;
fd = c_open(file, O_RDONLY);
list = str_to_linelist(fd, '|');
if (list->first == NULL)
c_puterror("fichier lu vide");
map = make_map(list);
free(list);
aff_map(map);
free(map);
}
|
#define EXAMPLE_PCAP_WRITE_PATH "PcapExamples/example_copy.pcap"
#define EXAMPLE_PCAP_PATH "PcapExamples/example.pcap"
#define EXAMPLE2_PCAP_PATH "PcapExamples/example2.pcap"
#define EXAMPLE_PCAP_HTTP_REQUEST "PcapExamples/4KHttpRequests.pcap"
#define EXAMPLE_PCAP_HTTP_RESPONSE "PcapExamples/650HttpResponses.pcap"
#define EXAMPLE_PCAP_VLAN "PcapExamples/VlanPackets.pcap"
#define EXAMPLE_PCAP_DNS "PcapExamples/DnsPackets.pcap"
#define DPDK_PCAP_WRITE_PATH "PcapExamples/DpdkPackets.pcap"
#define SLL_PCAP_WRITE_PATH "PcapExamples/sll_copy.pcap"
#define SLL_PCAP_PATH "PcapExamples/sll.pcap"
#define RAW_IP_PCAP_WRITE_PATH "PcapExamples/raw_ip_copy.pcap"
#define RAW_IP_PCAP_PATH "PcapExamples/raw_ip.pcap"
#define RAW_IP_PCAPNG_PATH "PcapExamples/raw_ip.pcapng"
#define EXAMPLE_PCAPNG_PATH "PcapExamples/many_interfaces-1.pcapng"
#define EXAMPLE2_PCAPNG_PATH "PcapExamples/pcapng-example.pcapng"
#define EXAMPLE_PCAPNG_WRITE_PATH "PcapExamples/many_interfaces_copy.pcapng"
#define EXAMPLE2_PCAPNG_WRITE_PATH "PcapExamples/pcapng-example-write.pcapng"
#define EXAMPLE_PCAPNG_ZSTD_WRITE_PATH "PcapExamples/many_interfaces_copy.pcapng.zstd"
#define EXAMPLE2_PCAPNG_ZSTD_WRITE_PATH "PcapExamples/pcapng-example-write.pcapng.zstd"
#define EXAMPLE_PCAP_GRE "PcapExamples/GrePackets.cap"
#define EXAMPLE_PCAP_IGMP "PcapExamples/IgmpPackets.pcap"
#define EXAMPLE_LINKTYPE_IPV6 "PcapExamples/linktype_ipv6.pcap"
#define EXAMPLE_LINKTYPE_IPV4 "PcapExamples/linktype_ipv4.pcap"
|
int i;
main()
{
for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hello, world!\n",'/'/'/'));
}read(j,i,p){write(j/p+p,i---j,i/i);}
|
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://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.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// Created by raver119 on 30.01.18.
//
#ifndef LIBND4J_LOGICMERGE_H
#define LIBND4J_LOGICMERGE_H
#include <pointercast.h>
#include <graph/Graph.h>
namespace nd4j {
namespace graph {
class LogicMerge {
public:
static Nd4jStatus processNode(Graph* graph, Node* node);
};
}
}
#endif //LIBND4J_LOGICMERGE_H
|
/*
* This file is part of the DSView project.
* DSView is based on PulseView.
*
* Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_DEVICE_DEVINST_H
#define DSVIEW_PV_DEVICE_DEVINST_H
#include <boost/shared_ptr.hpp>
#include <string>
#include <glib.h>
#include <stdint.h>
#include <libsigrok4DSL/libsigrok.h>
struct sr_dev_inst;
struct sr_channel;
struct sr_channel_group;
//namespace pv {
class SigSession;
//namespace device {
class DevInst {
protected:
DevInst();
~DevInst();
public:
virtual sr_dev_inst* dev_inst() const = 0;
virtual void use(SigSession *owner);
virtual void release();
SigSession* owner() const;
virtual std::string format_device_title() const = 0;
GVariant* get_config(const sr_channel *ch, const sr_channel_group *group, int key);
bool set_config(sr_channel *ch, sr_channel_group *group, int key, GVariant *data);
GVariant* list_config(const sr_channel_group *group, int key);
void enable_probe(const sr_channel *probe, bool enable = true);
/**
* @brief Gets the sample limit from the driver.
*
* @return The returned sample limit from the driver, or 0 if the
* sample limit could not be read.
*/
uint64_t get_sample_limit();
/**
* @brief Gets the sample rate from the driver.
*
* @return The returned sample rate from the driver, or 0 if the
* sample rate could not be read.
*/
uint64_t get_sample_rate();
/**
* @brief Gets the sample time from the driver.
*
* @return The returned sample time from the driver, or 0 if the
* sample time could not be read.
*/
double get_sample_time();
/**
* @brief Gets the time base from the driver.
*
* @return The returned time base from the driver, or 0 if the
* time base could not be read.
*/
uint64_t get_time_base();
/**
* @brief Gets the device mode list from the driver.
*
* @return The returned device mode list from the driver, or NULL if the
* mode list could not be read.
*/
const GSList* get_dev_mode_list();
/**
* @brief Get the device name from the driver
*
* @return device name
*/
std::string name();
virtual bool is_trigger_enabled() const;
bool is_usable() const;
public:
virtual void start();
virtual void run();
virtual void* get_id() const;
virtual sr_channel* get_channel(int ch_index);
virtual void set_ch_enable(int ch_index, bool enable);
virtual void set_sample_rate(uint64_t sample_rate);
virtual void set_limit_samples(uint64_t sample_count);
virtual void set_voltage_div(int ch_index, uint64_t div);
virtual uint64_t get_voltage_div(int ch_index);
virtual void set_time_base(int ch_index, uint64_t ts);
protected:
SigSession *_owner;
void *_id;
bool _usable;
};
//} // device
//} // pv
#endif // DSVIEW_PV_DEVICE_DEVINST_H
|
//////////////////////////////
// Version 1.30
// Nov 24th, 2000
// Version 1.20
// Jun 9th, 2000
// Version 1.10
// Jan 23rd, 2000
// Version 1.00
// May 20th, 1999
// Todd C. Wilson, Fresh Ground Software
// (todd@nopcode.com)
// This header file will kick in settings for Visual C++ 5 and 6 that will (usually)
// result in smaller exe's.
// The "trick" is to tell the compiler to not pad out the function calls; this is done
// by not using the /O1 or /O2 option - if you do, you implicitly use /Gy, which pads
// out each and every function call. In one single 500k dll, I managed to cut out 120k
// by this alone!
// The other two "tricks" are telling the Linker to merge all data-type segments together
// in the exe file. The relocation, read-only (constants) data, and code section (.text)
// sections can almost always be merged. Each section merged can save 4k in exe space,
// since each section is padded out to 4k chunks. This is very noticeable with smaller
// exes, since you could have only 700 bytes of data, 300 bytes of code, 94 bytes of
// strings - padded out, this could be 12k of runtime, for 1094 bytes of stuff! For larger
// programs, this is less overall, but can save at least 4k.
// Note that if you're using MFC static or some other 3rd party libs, you may get poor
// results with merging the readonly (.rdata) section - the exe may grow larger.
// To use this feature, define _MERGE_DATA_ in your project or before this header is used.
// With Visual C++ 5, the program uses a file alignment of 512 bytes, which results
// in a small exe. Under VC6, the program instead uses 4k, which is the same as the
// section size. The reason (from what I understand) is that 4k is the chunk size of
// the virtual memory manager, and that WinAlign (an end-user tuning tool for Win98)
// will re-align the programs on this boundary. The problem with this is that all of
// Microsoft's system exes and dlls are *NOT* tuned like this, and using 4k causes serious
// exe bloat. Very noticeable for smaller programs.
// The "trick" for this is to use the undocumented FILEALIGN linker parm to change the
// padding from 4k to 1/2k, which results in a much smaller exe - anywhere from 20%-75%
// depending on the size. Note that this is the same as using /OPT:NOWIN98, which *is*
// a previously documented switch, but was left out of the docs for some reason in VC6 and
// all of the current MSDN's - see KB:Q235956 for more information.
// Microsoft does say that using the 4k alignment will "speed up process loading",
// but I've been unable to notice a difference, even on my P180, with a very large (4meg) exe.
// Please note, however, that this will probably not change the size of the COMPRESSED
// file (either in a .zip file or in an install archive), since this 4k is all zeroes and
// gets compressed away.
// Also, the /ALIGN:4096 switch will "magically" do the same thing, even though this is the
// default setting for this switch. Apparently this sets the same values as the above two
// switches do. We do not use this in this header, since it smacks of a bug and not a feature.
// Thanks to Michael Geary <Mike@Geary.com> for some additional tips!
#ifdef NDEBUG
// /Og (global optimizations), /Os (favor small code), /Oy (no frame pointers)
#pragma optimize("gsy",on)
#pragma comment(linker,"/RELEASE")
// Note that merging the .rdata section will result in LARGER exe's if you using
// MFC (esp. static link). If this is desirable, define _MERGE_RDATA_ in your project.
#ifdef _MERGE_RDATA_
#pragma comment(linker,"/merge:.rdata=.data")
#endif // _MERGE_RDATA_
#pragma comment(linker,"/merge:.text=.data")
#pragma comment(linker,"/merge:.reloc=.data")
// Merging sections with different attributes causes a linker warning, so
// turn off the warning. From Michael Geary. Undocumented, as usual!
#pragma comment(linker,"/ignore:4078")
// With Visual C++ 5, you already get the 512-byte alignment, so you will only need
// it for VC6, and maybe later.
#if _MSC_VER >= 1000
// Option #1: use /filealign
// Totally undocumented! And if you set it lower than 512 bytes, the program crashes.
// Either leave at 0x200 or 0x1000
//#pragma comment(linker,"/FILEALIGN:0x200")
// Option #2: use /opt:nowin98
// See KB:Q235956 or the READMEVC.htm in your VC directory for info on this one.
// This is our currently preferred option, since it is fully documented and unlikely
// to break in service packs and updates.
#pragma comment(linker,"/opt:nowin98")
// Option #3: use /align:4096
// A side effect of using the default align value is that it turns on the above switch.
// May break in future versions!
//#pragma comment(linker,"/ALIGN:4096")
#endif // _MSC_VER >= 1000
#endif // NDEBUG
|
//
// userInfoViewController.h
// WeChat
//
// Created by 郑雨鑫 on 15/12/5.
// Copyright © 2015年 郑雨鑫. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UserInfoViewController : UITableViewController
@end
|
// Copyright 2021 The Ray 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.
namespace ray {
namespace raylet {
class Mockpair_hash : public pair_hash {
public:
};
} // namespace raylet
} // namespace ray
namespace ray {
namespace raylet {
class MockBundleTransactionState : public BundleTransactionState {
public:
};
} // namespace raylet
} // namespace ray
namespace ray {
namespace raylet {
class MockPlacementGroupResourceManager : public PlacementGroupResourceManager {
public:
MOCK_METHOD(bool, PrepareBundle, (const BundleSpecification &bundle_spec), (override));
MOCK_METHOD(void, CommitBundle, (const BundleSpecification &bundle_spec), (override));
MOCK_METHOD(void, ReturnBundle, (const BundleSpecification &bundle_spec), (override));
};
} // namespace raylet
} // namespace ray
namespace ray {
namespace raylet {
class MockNewPlacementGroupResourceManager : public NewPlacementGroupResourceManager {
public:
};
} // namespace raylet
} // namespace ray
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
*/
#include "tomcrypt.h"
/**
@file crypt.c
Build strings, Tom St Denis
*/
const char *crypt_build_settings =
"LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n"
"LibTomCrypt is public domain software.\n"
"Built on " __DATE__ " at " __TIME__ "\n\n\n"
"Endianess: "
#if defined(ENDIAN_NEUTRAL)
"neutral\n"
#elif defined(ENDIAN_LITTLE)
"little"
#if defined(ENDIAN_32BITWORD)
" (32-bit words)\n"
#else
" (64-bit words)\n"
#endif
#elif defined(ENDIAN_BIG)
"big"
#if defined(ENDIAN_32BITWORD)
" (32-bit words)\n"
#else
" (64-bit words)\n"
#endif
#endif
"Clean stack: "
#if defined(LTC_CLEAN_STACK)
"enabled\n"
#else
"disabled\n"
#endif
"Ciphers built-in:\n"
#if defined(BLOWFISH)
" Blowfish\n"
#endif
#if defined(RC2)
" RC2\n"
#endif
#if defined(RC5)
" RC5\n"
#endif
#if defined(RC6)
" RC6\n"
#endif
#if defined(SAFERP)
" Safer+\n"
#endif
#if defined(SAFER)
" Safer\n"
#endif
#if defined(RIJNDAEL)
" Rijndael\n"
#endif
#if defined(XTEA)
" XTEA\n"
#endif
#if defined(TWOFISH)
" Twofish "
#if defined(TWOFISH_SMALL) && defined(TWOFISH_TABLES) && defined(TWOFISH_ALL_TABLES)
"(small, tables, all_tables)\n"
#elif defined(TWOFISH_SMALL) && defined(TWOFISH_TABLES)
"(small, tables)\n"
#elif defined(TWOFISH_SMALL) && defined(TWOFISH_ALL_TABLES)
"(small, all_tables)\n"
#elif defined(TWOFISH_TABLES) && defined(TWOFISH_ALL_TABLES)
"(tables, all_tables)\n"
#elif defined(TWOFISH_SMALL)
"(small)\n"
#elif defined(TWOFISH_TABLES)
"(tables)\n"
#elif defined(TWOFISH_ALL_TABLES)
"(all_tables)\n"
#else
"\n"
#endif
#endif
#if defined(DES)
" DES\n"
#endif
#if defined(CAST5)
" CAST5\n"
#endif
#if defined(NOEKEON)
" Noekeon\n"
#endif
#if defined(SKIPJACK)
" Skipjack\n"
#endif
#if defined(KHAZAD)
" Khazad\n"
#endif
#if defined(ANUBIS)
" Anubis "
#endif
#if defined(ANUBIS_TWEAK)
" (tweaked)"
#endif
"\n"
"\nHashes built-in:\n"
#if defined(SHA512)
" SHA-512\n"
#endif
#if defined(SHA384)
" SHA-384\n"
#endif
#if defined(SHA256)
" SHA-256\n"
#endif
#if defined(SHA224)
" SHA-224\n"
#endif
#if defined(TIGER)
" TIGER\n"
#endif
#if defined(SHA1)
" SHA1\n"
#endif
#if defined(MD5)
" MD5\n"
#endif
#if defined(MD4)
" MD4\n"
#endif
#if defined(MD2)
" MD2\n"
#endif
#if defined(RIPEMD128)
" RIPEMD128\n"
#endif
#if defined(RIPEMD160)
" RIPEMD160\n"
#endif
#if defined(WHIRLPOOL)
" WHIRLPOOL\n"
#endif
#if defined(CHC_HASH)
" CHC_HASH \n"
#endif
"\nBlock Chaining Modes:\n"
#if defined(CFB)
" CFB\n"
#endif
#if defined(OFB)
" OFB\n"
#endif
#if defined(ECB)
" ECB\n"
#endif
#if defined(CBC)
" CBC\n"
#endif
#if defined(CTR)
" CTR\n"
#endif
#if defined(LRW_MODE)
" LRW_MODE"
#if defined(LRW_TABLES)
" (LRW_TABLES) "
#endif
"\n"
#endif
#if defined(LTC_F8_MODE)
" F8 MODE\n"
#endif
"\nMACs:\n"
#if defined(HMAC)
" HMAC\n"
#endif
#if defined(OMAC)
" OMAC\n"
#endif
#if defined(PMAC)
" PMAC\n"
#endif
#if defined(PELICAN)
" PELICAN\n"
#endif
"\nENC + AUTH modes:\n"
#if defined(EAX_MODE)
" EAX_MODE\n"
#endif
#if defined(OCB_MODE)
" OCB_MODE\n"
#endif
#if defined(CCM_MODE)
" CCM_MODE\n"
#endif
#if defined(GCM_MODE)
" GCM_MODE "
#endif
#if defined(GCM_TABLES)
" (GCM_TABLES) "
#endif
"\n"
"\nPRNG:\n"
#if defined(YARROW)
" Yarrow\n"
#endif
#if defined(SPRNG)
" SPRNG\n"
#endif
#if defined(RC4)
" RC4\n"
#endif
#if defined(FORTUNA)
" Fortuna\n"
#endif
#if defined(SOBER128)
" SOBER128\n"
#endif
"\nPK Algs:\n"
#if defined(MRSA)
" RSA \n"
#endif
#if defined(MECC)
" ECC\n"
#endif
#if defined(MDSA)
" DSA\n"
#endif
#if defined(MKAT)
" Katja\n"
#endif
"\nCompiler:\n"
#if defined(WIN32)
" WIN32 platform detected.\n"
#endif
#if defined(__CYGWIN__)
" CYGWIN Detected.\n"
#endif
#if defined(__DJGPP__)
" DJGPP Detected.\n"
#endif
#if defined(_MSC_VER)
" MSVC compiler detected.\n"
#endif
#if defined(__GNUC__)
" GCC compiler detected.\n"
#endif
#if defined(INTEL_CC)
" Intel C Compiler detected.\n"
#endif
#if defined(__x86_64__)
" x86-64 detected.\n"
#endif
#if defined(LTC_PPC32)
" LTC_PPC32 defined \n"
#endif
"\nVarious others: "
#if defined(BASE64)
" BASE64 "
#endif
#if defined(MPI)
" MPI "
#endif
#if defined(TRY_UNRANDOM_FIRST)
" TRY_UNRANDOM_FIRST "
#endif
#if defined(LTC_TEST)
" LTC_TEST "
#endif
#if defined(PKCS_1)
" PKCS#1 "
#endif
#if defined(PKCS_5)
" PKCS#5 "
#endif
#if defined(LTC_SMALL_CODE)
" LTC_SMALL_CODE "
#endif
#if defined(LTC_NO_FILE)
" LTC_NO_FILE "
#endif
#if defined(LTC_DER)
" LTC_DER "
#endif
#if defined(LTC_FAST)
" LTC_FAST "
#endif
#if defined(LTC_NO_FAST)
" LTC_NO_FAST "
#endif
#if defined(LTC_NO_BSWAP)
" LTC_NO_BSWAP "
#endif
#if defined(LTC_NO_ASM)
" LTC_NO_ASM "
#endif
#if defined(LTC_NO_TEST)
" LTC_NO_TEST "
#endif
#if defined(LTC_NO_TABLES)
" LTC_NO_TABLES "
#endif
#if defined(LTC_PTHREAD)
" LTC_PTHREAD "
#endif
#if defined(LTM_DESC)
" LTM_DESC "
#endif
#if defined(TFM_DESC)
" TFM_DESC "
#endif
#if defined(MECC_ACCEL)
" MECC_ACCEL "
#endif
#if defined(GMP_DESC)
" GMP_DESC "
#endif
#if defined(LTC_EASY)
" (easy) "
#endif
#if defined(MECC_FP)
" MECC_FP "
#endif
"\n"
"\n\n\n"
;
/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt.c,v $ */
/* $Revision: 1.21 $ */
/* $Date: 2006/06/17 00:06:06 $ */
|
//
// AudioStreamer.h
// StreamingAudioPlayer
//
// Created by Matt Gallagher on 27/09/08.
// Copyright 2008 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
// This file is meant to be a repository for common defintions between AudioStreamerBC (backcompat, 3.1.x)
// and AudioStreamerCUR (iOS 3.2+), as well as a proxy which shunts messages to the appropriate AudioStreamer.
// - SPT
// Also note that we've had to change enumeration and class names here - this is because
// some modules may require the use of AudioStreamer in external libraries and the
// symbols cannot be changed on that end. The use of common symbols in Groupees without
// namespaces is a recurring problem, and we can thank Objective-C for it.
// - SPT
#ifdef USE_TI_MEDIA
#define LOG_QUEUED_BUFFERS 0
#define kNumAQBufs 16 // Number of audio queue buffers we allocate.
// Needs to be big enough to keep audio pipeline
// busy (non-zero number of queued buffers) but
// not so big that audio takes too long to begin
// (kNumAQBufs * kAQBufSize of data must be
// loaded before playback will start).
// Set LOG_QUEUED_BUFFERS to 1 to log how many
// buffers are queued at any time -- if it drops
// to zero too often, this value may need to
// increase. Min 3, typical 8-24.
#define kAQMaxPacketDescs 512 // Number of packet descriptions in our array
#define kAQDefaultBufSize 2048 // Number of bytes in each audio queue buffer
// Needs to be big enough to hold a packet of
// audio from the audio file. If number is too
// large, queuing of audio before playback starts
// will take too long.
// Highly compressed files can use smaller
// numbers (512 or less). 2048 should hold all
// but the largest packets. A buffer size error
// will occur if this number is too small.
typedef enum
{
AS_INITIALIZED = 0,
AS_STARTING_FILE_THREAD,
AS_WAITING_FOR_DATA,
AS_WAITING_FOR_QUEUE_TO_START,
AS_PLAYING,
AS_BUFFERING,
AS_STOPPING,
AS_STOPPED,
AS_PAUSED,
AS_FLUSHING_EOF
} TI_AudioStreamerState;
typedef enum
{
AS_NO_STOP = 0,
AS_STOPPING_EOF,
AS_STOPPING_USER_ACTION,
AS_STOPPING_ERROR,
AS_STOPPING_TEMPORARILY
} TI_AudioStreamerStopReason;
typedef enum
{
AS_NO_ERROR = 0,
AS_NETWORK_CONNECTION_FAILED,
AS_FILE_STREAM_GET_PROPERTY_FAILED,
AS_FILE_STREAM_SEEK_FAILED,
AS_FILE_STREAM_PARSE_BYTES_FAILED,
AS_FILE_STREAM_OPEN_FAILED,
AS_FILE_STREAM_CLOSE_FAILED,
AS_AUDIO_DATA_NOT_FOUND,
AS_AUDIO_QUEUE_CREATION_FAILED,
AS_AUDIO_QUEUE_BUFFER_ALLOCATION_FAILED,
AS_AUDIO_QUEUE_ENQUEUE_FAILED,
AS_AUDIO_QUEUE_ADD_LISTENER_FAILED,
AS_AUDIO_QUEUE_REMOVE_LISTENER_FAILED,
AS_AUDIO_QUEUE_START_FAILED,
AS_AUDIO_QUEUE_PAUSE_FAILED,
AS_AUDIO_QUEUE_BUFFER_MISMATCH,
AS_AUDIO_QUEUE_DISPOSE_FAILED,
AS_AUDIO_QUEUE_STOP_FAILED,
AS_AUDIO_QUEUE_FLUSH_FAILED,
AS_AUDIO_STREAMER_FAILED,
AS_GET_AUDIO_TIME_FAILED,
AS_AUDIO_BUFFER_TOO_SMALL
} TI_AudioStreamerErrorCode;
extern NSString * const ASStatusChangedNotification;
@protocol AudioStreamerDelegate<NSObject>
-(void)playbackStateChanged:(id)sender;
@end
@protocol AudioStreamerProtocol<NSObject>
@property TI_AudioStreamerErrorCode errorCode;
@property (readonly) TI_AudioStreamerState state;
@property (readonly) double progress;
@property (readwrite) UInt32 bitRate;
@property (readwrite,assign) id<AudioStreamerDelegate> delegate;
@property (nonatomic,readwrite,assign) NSUInteger bufferSize;
- (void)start;
- (void)stop;
- (void)pause;
- (BOOL)isPlaying;
- (BOOL)isPaused;
- (BOOL)isWaiting;
- (BOOL)isIdle;
@end
@interface TI_AudioStreamer : NSObject<AudioStreamerProtocol,AudioStreamerDelegate>
{
id<AudioStreamerProtocol> streamer;
id<AudioStreamerDelegate> delegate;
}
- (id)initWithURL:(NSURL *)aURL;
+ (NSString*)stringForErrorCode:(TI_AudioStreamerErrorCode)code;
@end
@compatibility_alias AudioStreamer TI_AudioStreamer;
#endif
|
//
// ViewController.h
// YLSimulatedStockOperation
//
// Created by Waterstrong on 2/11/16.
// Copyright © 2016 hoggenWang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#ifndef _NGX_HTTP_RWD_UTILS_H_
#define _NGX_HTTP_RWD_UTILS_H_
#include <ngx_core.h>
typedef ngx_int_t (*ngx_http_rwd_rbtree_compare_pt)(
ngx_rbtree_node_t *temp, ngx_rbtree_node_t*node);
extern void ngx_http_rwd_rbtree_insert_value(
ngx_rbtree_node_t *temp, ngx_rbtree_node_t *node,
ngx_rbtree_node_t *sentinel, ngx_http_rwd_rbtree_compare_pt compare_func);
extern ngx_rbtree_node_t *ngx_http_rwd_rbtree_lookup_value(
ngx_rbtree_t *rbtree, ngx_rbtree_node_t *target,
ngx_http_rwd_rbtree_compare_pt compare_func);
#endif /* ifndef _NGX_HTTP_RWD_UTILS_H_ */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/** This is generated, do not edit by hand. **/
#include <jni.h>
#include "Proxy.h"
namespace titanium {
namespace platform {
class AndroidModule : public titanium::Proxy
{
public:
explicit AndroidModule(jobject javaObject);
static void bindProxy(v8::Handle<v8::Object> exports);
static v8::Handle<v8::FunctionTemplate> getProxyTemplate();
static void dispose();
static v8::Persistent<v8::FunctionTemplate> proxyTemplate;
static jclass javaClass;
private:
// Methods -----------------------------------------------------------
// Dynamic property accessors ----------------------------------------
};
} // namespace platform
} // titanium
|
#ifndef BABYLON_INSPECTOR_ACTIONS_ACTION_STORE_H
#define BABYLON_INSPECTOR_ACTIONS_ACTION_STORE_H
#include <string>
#include <unordered_map>
#include <babylon/inspector/actions/inspector_action.h>
namespace BABYLON {
class ActionStore {
public:
ActionStore();
~ActionStore(); // = default
void addAction(const char* id, const char* icon, const char* label,
const char* shortcut, const SA::delegate<void()>& callback);
InspectorAction* getAction(const char* id);
private:
std::unordered_map<std::string, InspectorAction> _actions;
}; // end of class EditorStore
} // end of namespace BABYLON
#endif // BABYLON_INSPECTOR_ACTIONS_ACTION_STORE_H
|
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
/*
*/
#ifndef IMAGEMATH_H
#define IMAGEMATH_H
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "parmlist.h"
typedef void DDLNode;
typedef void DDLSymbolTable;
typedef DDLSymbolTable *FDFptr;
#include "ddl_c_interface.h"
#ifndef TRUE
#define TRUE (0==0)
#define FALSE (!TRUE)
#endif
#define LINEAR_FIXED 1
#define LINEAR_RECALC 2
#define LINEAR_RECALC_OFFSET 4
#define LINEAR_ANY 7
#define NONLINEAR 8
#define IN_DATA(vec,img,pixel) (in_data[vecindx[(vec)]+(img)][(pixel)])
#ifdef IMAGEMATH_MAIN
#define EXTERN
#else
#define EXTERN extern
#endif
EXTERN int img_width, img_height, img_depth, img_size;
EXTERN int *in_width, *in_height, *in_depth, *in_size;
EXTERN int pixel_indx;
EXTERN FDFptr *in_object;
EXTERN float **in_data;
EXTERN int nbr_infiles;
EXTERN int nbr_strings;
EXTERN char **in_strings;
EXTERN int nbr_params;
EXTERN float *in_params;
EXTERN int input_sizes_differ;
EXTERN int *out_width, *out_height, *out_depth, *out_size;
EXTERN FDFptr *out_object;
EXTERN float **out_data;
EXTERN int nbr_outfiles;
EXTERN int nbr_image_vecs;
EXTERN int *in_vec_len;
EXTERN int *vecindx;
extern int want_output(int n);
extern int create_output_files(int n, FDFptr cloner);
extern int write_output_files();
extern void *getmem();
extern void release_memitem(void *adr);
#undef EXTERN
#endif /* IMAGEMATH_H */
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <aws/elasticache/ElastiCache_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace ElastiCache
{
namespace Model
{
/**
* <p>Represents a single cache security group and its status.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/SecurityGroupMembership">AWS
* API Reference</a></p>
*/
class AWS_ELASTICACHE_API SecurityGroupMembership
{
public:
SecurityGroupMembership();
SecurityGroupMembership(const Aws::Utils::Xml::XmlNode& xmlNode);
SecurityGroupMembership& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>The identifier of the cache security group.</p>
*/
inline const Aws::String& GetSecurityGroupId() const{ return m_securityGroupId; }
/**
* <p>The identifier of the cache security group.</p>
*/
inline void SetSecurityGroupId(const Aws::String& value) { m_securityGroupIdHasBeenSet = true; m_securityGroupId = value; }
/**
* <p>The identifier of the cache security group.</p>
*/
inline void SetSecurityGroupId(Aws::String&& value) { m_securityGroupIdHasBeenSet = true; m_securityGroupId = std::move(value); }
/**
* <p>The identifier of the cache security group.</p>
*/
inline void SetSecurityGroupId(const char* value) { m_securityGroupIdHasBeenSet = true; m_securityGroupId.assign(value); }
/**
* <p>The identifier of the cache security group.</p>
*/
inline SecurityGroupMembership& WithSecurityGroupId(const Aws::String& value) { SetSecurityGroupId(value); return *this;}
/**
* <p>The identifier of the cache security group.</p>
*/
inline SecurityGroupMembership& WithSecurityGroupId(Aws::String&& value) { SetSecurityGroupId(std::move(value)); return *this;}
/**
* <p>The identifier of the cache security group.</p>
*/
inline SecurityGroupMembership& WithSecurityGroupId(const char* value) { SetSecurityGroupId(value); return *this;}
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline const Aws::String& GetStatus() const{ return m_status; }
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline void SetStatus(const Aws::String& value) { m_statusHasBeenSet = true; m_status = value; }
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline void SetStatus(Aws::String&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline void SetStatus(const char* value) { m_statusHasBeenSet = true; m_status.assign(value); }
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline SecurityGroupMembership& WithStatus(const Aws::String& value) { SetStatus(value); return *this;}
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline SecurityGroupMembership& WithStatus(Aws::String&& value) { SetStatus(std::move(value)); return *this;}
/**
* <p>The status of the cache security group membership. The status changes
* whenever a cache security group is modified, or when the cache security groups
* assigned to a cluster are modified.</p>
*/
inline SecurityGroupMembership& WithStatus(const char* value) { SetStatus(value); return *this;}
private:
Aws::String m_securityGroupId;
bool m_securityGroupIdHasBeenSet;
Aws::String m_status;
bool m_statusHasBeenSet;
};
} // namespace Model
} // namespace ElastiCache
} // namespace Aws
|
//
// ViewController.h
// momo
//
// Created by duanhuifen on 15/10/20.
// Copyright © 2015年 段慧芬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
// -*- c++ -*-
//
// Copyright 2011 A.N.M. Imroz Choudhury
//
// ParameterFunctionRemapper.h - Retrieves point locations from a
// Parametrized object, after transforming the range [0,1] to
// f([0,1]), where f is some function.
#ifndef PARAMETER_FUNCTION_REMAPPER_H
#define PARAMETER_FUNCTION_REMAPPER_H
// MTV headers.
#include <Core/Geometry/Parametrized.h>
namespace MTV{
template<typename Arg, typename Result>
class ParameterFunctionRemapper : public Parametrized {
public:
BoostPointers(ParameterFunctionRemapper);
public:
ParameterFunctionRemapper(Parametrized::ptr shape, Result(*f)(Arg))
: shape(shape),
f(f)
{}
Point position(float p){
return shape->position(f(p));
}
private:
Parametrized::ptr shape;
Result(*f)(Arg);
};
}
#endif
|
/**
* 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.
*/
#pragma once
#include <atomic>
#include <ctime>
#include <functional>
#include <wtf/FastMalloc.h>
#include <wtf/Forward.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/Optional.h>
#include <wtf/RunLoop.h>
#if USE(GLIB)
#include <wtf/glib/GRefPtr.h>
#endif
#if PLATFORM(WIN)
#include <wtf/win/Win32Handle.h>
#endif
namespace WTF {
enum class MemoryUsagePolicy {
Unrestricted, // Allocate as much as you want
Conservative, // Maybe you don't cache every single thing
Strict, // Time to start pinching pennies for real
Panic, // OH GOD WE'RE SINKING, THROW EVERYTHING OVERBOARD
};
enum class Critical { No, Yes };
enum class Synchronous { No, Yes };
typedef std::function<void(Critical, Synchronous)> LowMemoryHandler;
class MemoryPressureHandler {
friend class WTF::NeverDestroyed<MemoryPressureHandler>;
public:
WTF_EXPORT_PRIVATE static MemoryPressureHandler& singleton();
WTF_EXPORT_PRIVATE void install();
WTF_EXPORT_PRIVATE void setShouldUsePeriodicMemoryMonitor(bool);
void setMemoryKillCallback(WTF::Function<void()> function) { m_memoryKillCallback = WTFMove(function); }
void setProcessIsEligibleForMemoryKillCallback(WTF::Function<bool()> function) { m_processIsEligibleForMemoryKillCallback = WTFMove(function); }
void setMemoryPressureStatusChangedCallback(WTF::Function<void(bool)> function) { m_memoryPressureStatusChangedCallback = WTFMove(function); }
void setLowMemoryHandler(LowMemoryHandler&& handler)
{
m_lowMemoryHandler = WTFMove(handler);
}
bool isUnderMemoryPressure() const
{
return m_underMemoryPressure
#if PLATFORM(MAC)
|| m_memoryUsagePolicy >= MemoryUsagePolicy::Strict
#endif
|| m_isSimulatingMemoryPressure;
}
void setUnderMemoryPressure(bool);
#if OS(LINUX)
void setMemoryPressureMonitorHandle(int fd);
#endif
class ReliefLogger {
public:
explicit ReliefLogger(const char *log)
: m_logString(log)
, m_initialMemory(loggingEnabled() ? platformMemoryUsage() : MemoryUsage { })
{
}
~ReliefLogger()
{
if (loggingEnabled())
logMemoryUsageChange();
}
const char* logString() const { return m_logString; }
static void setLoggingEnabled(bool enabled) { s_loggingEnabled = enabled; }
static bool loggingEnabled()
{
#if RELEASE_LOG_DISABLED
return s_loggingEnabled;
#else
return true;
#endif
}
private:
struct MemoryUsage {
MemoryUsage() = default;
MemoryUsage(size_t resident, size_t physical)
: resident(resident)
, physical(physical)
{
}
size_t resident { 0 };
size_t physical { 0 };
};
std::optional<MemoryUsage> platformMemoryUsage();
void logMemoryUsageChange();
const char* m_logString;
std::optional<MemoryUsage> m_initialMemory;
WTF_EXPORT_PRIVATE static bool s_loggingEnabled;
};
WTF_EXPORT_PRIVATE void releaseMemory(Critical, Synchronous = Synchronous::No);
WTF_EXPORT_PRIVATE void beginSimulatedMemoryPressure();
WTF_EXPORT_PRIVATE void endSimulatedMemoryPressure();
private:
void memoryPressureStatusChanged();
void uninstall();
void holdOff(unsigned);
MemoryPressureHandler();
~MemoryPressureHandler() = delete;
void respondToMemoryPressure(Critical, Synchronous = Synchronous::No);
void platformReleaseMemory(Critical);
void platformInitialize();
NO_RETURN_DUE_TO_CRASH void didExceedMemoryLimitAndFailedToRecover();
void measurementTimerFired();
#if OS(LINUX)
class EventFDPoller {
WTF_MAKE_NONCOPYABLE(EventFDPoller); WTF_MAKE_FAST_ALLOCATED;
public:
EventFDPoller(int fd, std::function<void ()>&& notifyHandler);
~EventFDPoller();
private:
void readAndNotify() const;
std::optional<int> m_fd;
std::function<void ()> m_notifyHandler;
#if USE(GLIB)
GRefPtr<GSource> m_source;
#else
ThreadIdentifier m_threadID;
#endif
};
#endif
bool m_installed { false };
LowMemoryHandler m_lowMemoryHandler;
std::atomic<bool> m_underMemoryPressure;
bool m_isSimulatingMemoryPressure { false };
std::unique_ptr<RunLoop::Timer<MemoryPressureHandler>> m_measurementTimer;
MemoryUsagePolicy m_memoryUsagePolicy { MemoryUsagePolicy::Unrestricted };
WTF::Function<void()> m_memoryKillCallback;
WTF::Function<bool()> m_processIsEligibleForMemoryKillCallback;
WTF::Function<void(bool)> m_memoryPressureStatusChangedCallback;
#if OS(WINDOWS)
void windowsMeasurementTimerFired();
RunLoop::Timer<MemoryPressureHandler> m_windowsMeasurementTimer;
Win32Handle m_lowMemoryHandle;
#endif
#if OS(LINUX)
std::optional<int> m_eventFD;
std::optional<int> m_pressureLevelFD;
std::unique_ptr<EventFDPoller> m_eventFDPoller;
RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer;
void holdOffTimerFired();
void logErrorAndCloseFDs(const char* error);
bool tryEnsureEventFD();
#endif
};
extern WTFLogChannel LogMemoryPressure;
} // namespace WTF
using WTF::Critical;
using WTF::MemoryPressureHandler;
using WTF::Synchronous;
|
/*
* 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.
*/
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_apache_spark_ml_recommendation_CuMFJNIInterface */
#ifndef _Included_org_apache_spark_ml_recommendation_CuMFJNIInterface
#define _Included_org_apache_spark_ml_recommendation_CuMFJNIInterface
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_apache_spark_ml_recommendation_CuMFJNIInterface
* Method: doALSWithCSR
* Signature: (IIIID[[[F[I[I[F)[[F
*/
JNIEXPORT jobjectArray JNICALL Java_org_apache_spark_ml_recommendation_CuMFJNIInterface_doALSWithCSR
(JNIEnv *, jobject, jint, jint, jint, jint, jdouble, jobjectArray, jintArray, jintArray, jfloatArray);
/*
* Class: org_apache_spark_ml_recommendation_CuMFJNIInterface
* Method: testjni
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_apache_spark_ml_recommendation_CuMFJNIInterface_testjni
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
|
// gpucompute/ctc-utils.h
// Copyright 2015 Yajie Miao
// 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
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#ifndef EESEN_GPUCOMPUTE_CTC_UTILS_H_
#define EESEN_GPUCOMPUTE_CTC_UTILS_H_
//#if HAVE_CUDA == 1
#pragma GCC diagnostic warning "-fpermissive"
/*
* Some numeric limits and operations. These limits and operations
* are used in CTC computation/evaluation.
*/
template <typename T>
struct NumericLimits;
// some compilers (Mac) require the following 8 "const" to be "constexpr"?
template <>
struct NumericLimits<float>
{
static const float log_zero_ = -1e30f;
static const float exp_limit_ = 88.722839f;
static const float log_inf_ = 1e30f;
static const float max_ = 3.4028235e+038f;
};
template <>
struct NumericLimits<double>
{
static const double log_zero_ = -1e100;
static const double exp_limit_ = 709.78271289338397;
static const double log_inf_ = 1e100;
static const double max_ = 1.7976931348623157e+308;
};
#if HAVE_CUDA == 1
// a + b, where a and b are assumed to be in the log scale
template <typename T>
static inline __host__ __device__ T AddAB(T a, T b)
{
if (a == NumericLimits<T>::log_zero_ || b == NumericLimits<T>::log_zero_)
return NumericLimits<T>::log_zero_;
else
return a + b;
}
// a - b, where a and b are assumed to be in the log scale
template <typename T>
static inline __host__ __device__ T SubAB(T a, T b)
{
if (a == NumericLimits<T>::log_zero_)
return NumericLimits<T>::log_zero_;
else if (b == NumericLimits<T>::log_zero_)
return NumericLimits<T>::log_inf_;
else
return a - b;
}
// exp(a)
template <typename T>
static inline __host__ __device__ T ExpA(T a)
{
if (a <= NumericLimits<T>::log_zero_)
return 0;
else if (a >= NumericLimits<T>::exp_limit_)
return NumericLimits<T>::max_;
else
return exp(a);
}
// Approximation of log(a + b) = log(a) + log(1 + b/a), if b < a
// = log(b) + log(1 + a/b), if a < b
template <typename T>
static inline __host__ __device__ T LogAPlusB(T a, T b) // x and y are in log scale and so is the result
{
if (b < a)
return AddAB(a, log(1 + ExpA(SubAB(b, a))));
else
return AddAB(b, log(1 + ExpA(SubAB(a, b))));
}
#else
// exp(a)
template <typename T>
static inline T ExpA(T a)
{
return exp(a);
}
#endif // HAVE_CUDA
#endif
|
#define EFFECT1 "533295a5-000001de"
#define EFFECT2 "533295a2-000001dd"
#define EFFECT3 "5333f886-00000213"
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <aws/forecast/ForecastService_EXPORTS.h>
#include <aws/forecast/model/ParameterRanges.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace ForecastService
{
namespace Model
{
/**
* <p>Configuration information for a hyperparameter tuning job. You specify this
* object in the <a>CreatePredictor</a> request.</p> <p>A <i>hyperparameter</i> is
* a parameter that governs the model training process. You set hyperparameters
* before training starts, unlike model parameters, which are determined during
* training. The values of the hyperparameters effect which values are chosen for
* the model parameters.</p> <p>In a <i>hyperparameter tuning job</i>, Amazon
* Forecast chooses the set of hyperparameter values that optimize a specified
* metric. Forecast accomplishes this by running many training jobs over a range of
* hyperparameter values. The optimum set of values depends on the algorithm, the
* training data, and the specified metric objective.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/HyperParameterTuningJobConfig">AWS
* API Reference</a></p>
*/
class AWS_FORECASTSERVICE_API HyperParameterTuningJobConfig
{
public:
HyperParameterTuningJobConfig();
HyperParameterTuningJobConfig(Aws::Utils::Json::JsonView jsonValue);
HyperParameterTuningJobConfig& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline const ParameterRanges& GetParameterRanges() const{ return m_parameterRanges; }
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline bool ParameterRangesHasBeenSet() const { return m_parameterRangesHasBeenSet; }
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline void SetParameterRanges(const ParameterRanges& value) { m_parameterRangesHasBeenSet = true; m_parameterRanges = value; }
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline void SetParameterRanges(ParameterRanges&& value) { m_parameterRangesHasBeenSet = true; m_parameterRanges = std::move(value); }
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline HyperParameterTuningJobConfig& WithParameterRanges(const ParameterRanges& value) { SetParameterRanges(value); return *this;}
/**
* <p>Specifies the ranges of valid values for the hyperparameters.</p>
*/
inline HyperParameterTuningJobConfig& WithParameterRanges(ParameterRanges&& value) { SetParameterRanges(std::move(value)); return *this;}
private:
ParameterRanges m_parameterRanges;
bool m_parameterRangesHasBeenSet;
};
} // namespace Model
} // namespace ForecastService
} // namespace Aws
|
//
// NSCalendar+JXHExt.h
// 百思不得姐
//
// Created by juxiaohui on 16/9/8.
// Copyright © 2016年 juxiaohui. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSCalendar (JXHExt)
+(instancetype)calender;
@end
|
#pragma once
#include <stdint.h>
#include "il2cpp-config.h"
struct Il2CppString;
struct mscorlib_System_Decimal;
namespace il2cpp
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
class LIBIL2CPP_CODEGEN_API Decimal
{
public:
static double ToDouble(Il2CppDecimal d);
static int32_t FCallCompare(Il2CppDecimal* left, Il2CppDecimal* right);
static int32_t FCallToInt32(Il2CppDecimal d);
static int32_t GetHashCode(Il2CppDecimal* _this);
static float ToSingle(Il2CppDecimal d);
static void ConstructorDouble(Il2CppDecimal* _this, double value);
static void ConstructorFloat(Il2CppDecimal* _this, float value);
static void FCallAddSub(Il2CppDecimal* left, Il2CppDecimal* right, uint8_t sign);
static void FCallDivide(Il2CppDecimal* left, Il2CppDecimal* right);
static void FCallFloor(Il2CppDecimal* d);
static void FCallMultiply(Il2CppDecimal* d1, Il2CppDecimal* d2);
static void FCallRound(Il2CppDecimal* d, int32_t decimals);
static void FCallTruncate(Il2CppDecimal* d);
};
} /* namespace System */
} /* namespace mscorlib */
} /* namespace icalls */
} /* namespace il2cpp */
|
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009-2011 Alan Wright. All rights reserved.
// Distributable under the terms of either the Apache License (Version 2.0)
// or the GNU Lesser General Public License.
/////////////////////////////////////////////////////////////////////////////
#ifndef TERMSHASHPERFIELD_H
#define TERMSHASHPERFIELD_H
#include "InvertedDocConsumerPerField.h"
namespace Lucene
{
class TermsHashPerField : public InvertedDocConsumerPerField
{
public:
TermsHashPerField(DocInverterPerFieldPtr docInverterPerField, TermsHashPerThreadPtr perThread, TermsHashPerThreadPtr nextPerThread, FieldInfoPtr fieldInfo);
virtual ~TermsHashPerField();
LUCENE_CLASS(TermsHashPerField);
public:
TermsHashConsumerPerFieldPtr consumer;
TermsHashPerFieldPtr nextPerField;
DocInverterPerFieldWeakPtr _docInverterPerField;
TermsHashPerThreadPtr nextPerThread;
TermsHashPerThreadWeakPtr _perThread;
DocStatePtr docState;
FieldInvertStatePtr fieldState;
TermAttributePtr termAtt;
// Copied from our perThread
CharBlockPoolPtr charPool;
IntBlockPoolPtr intPool;
ByteBlockPoolPtr bytePool;
int32_t streamCount;
int32_t numPostingInt;
FieldInfoPtr fieldInfo;
bool postingsCompacted;
int32_t numPostings;
IntArray intUptos;
int32_t intUptoStart;
protected:
int32_t postingsHashSize;
int32_t postingsHashHalfSize;
int32_t postingsHashMask;
Collection<RawPostingListPtr> postingsHash;
RawPostingListPtr p;
bool doCall;
bool doNextCall;
public:
virtual void initialize();
void shrinkHash(int32_t targetSize);
void reset();
/// Called on hitting an aborting exception
virtual void abort();
void initReader(ByteSliceReaderPtr reader, RawPostingListPtr p, int32_t stream);
/// Collapse the hash table and sort in-place.
Collection<RawPostingListPtr> sortPostings();
/// Called before a field instance is being processed
virtual void start(FieldablePtr field);
/// Called once per field, and is given all Fieldable occurrences for this field in the document.
virtual bool start(Collection<FieldablePtr> fields, int32_t count);
void add(int32_t textStart);
/// Primary entry point (for first TermsHash)
virtual void add();
void writeByte(int32_t stream, int8_t b);
void writeBytes(int32_t stream, const uint8_t* b, int32_t offset, int32_t length);
void writeVInt(int32_t stream, int32_t i);
/// Called once per field per document, after all Fieldable occurrences are inverted
virtual void finish();
/// Called when postings hash is too small (> 50% occupied) or too large (< 20% occupied).
void rehashPostings(int32_t newSize);
protected:
void compactPostings();
/// Test whether the text for current RawPostingList p equals current tokenText.
bool postingEquals(const wchar_t* tokenText, int32_t tokenTextLen);
};
}
#endif
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Enum2459695545.h"
#include "System_System_Net_Sockets_ProtocolType2178963134.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Net.Sockets.ProtocolType
struct ProtocolType_t2178963134
{
public:
// System.Int32 System.Net.Sockets.ProtocolType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ProtocolType_t2178963134, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file 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.
*/
/**
* FUNCTION: memcpy
*
* This function overrides the original implementation of the memcpy function
* from string.h. It copies the values of n bytes from the *src to the *dst.
* It also checks if the size of the arrays pointed to by both the *dst and
* *src parameters are at least n bytes and if they overlap.
*/
#undef memcpy
#include <proof_helpers/nondet.h>
#include <stdint.h>
/**
* Override the version of memcpy used by CBMC.
*/
void *memcpy_impl(void *dst, const void *src, size_t n) {
__CPROVER_precondition(
__CPROVER_POINTER_OBJECT(dst) != __CPROVER_POINTER_OBJECT(src) ||
((const char *)src >= (const char *)dst + n) || ((const char *)dst >= (const char *)src + n),
"memcpy src/dst overlap");
__CPROVER_precondition(src != NULL && __CPROVER_r_ok(src, n), "memcpy source region readable");
__CPROVER_precondition(dst != NULL && __CPROVER_w_ok(dst, n), "memcpy destination region writeable");
return dst;
}
void *memcpy(void *dst, const void *src, size_t n) {
return memcpy_impl(dst, src, n);
}
void *__builtin___memcpy_chk(void *dst, const void *src, __CPROVER_size_t n, __CPROVER_size_t size) {
(void)size;
return memcpy_impl(dst, src, n);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.