text stringlengths 4 6.14k |
|---|
//
// 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 __MIXIM_TESTAPP_H_
#define __MIXIM_TESTAPP_H_
#include <omnetpp.h>
#include "../testUtils/TestModule.h"
#include "BaseModule.h"
#include "Mac80211MultiChannel.h"
#include "SimpleAddress.h"
/**
* @brief Executes most of the tests by sending packets to other instances of
* this module.
*/
class TestApp : public BaseModule,
public TestModule
{
private:
/** @brief Copy constructor is not allowed.
*/
TestApp(const TestApp&);
/** @brief Assignment operator is not allowed.
*/
TestApp& operator=(const TestApp&);
protected:
cGate* out;
int myIndex;
Mac80211MultiChannel* mac;
int pingsSent;
simtime_t lastPong;
protected:
virtual void initialize(int stage);
virtual void handleMessage(cMessage *msg);
virtual void finish();
void sendPacket(const LAddress::L2Type& dest = LAddress::L2BROADCAST);
void continueIn(simtime_t time);
void switchChannel(int channel);
simtime_t in(simtime_t delta);
public:
TestApp()
: BaseModule()
, TestModule()
, out(NULL)
, myIndex(0)
, mac(NULL)
, pingsSent(0)
, lastPong()
{}
enum {
WAITING = 2224,
TESTPACKET = 22331,
PONG = TESTPACKET + 10,
PING = PONG + 1,
};
int getCurrentChannel() const;
void testRun1(int stage);
void startTraffic();
void ping(int nr);
void pong();
};
#endif
|
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
FUNCTION
<<setvbuf>>---specify file or stream buffering
INDEX
setvbuf
ANSI_SYNOPSIS
#include <stdio.h>
int setvbuf(FILE *<[fp]>, char *<[buf]>,
int <[mode]>, size_t <[size]>);
TRAD_SYNOPSIS
#include <stdio.h>
int setvbuf(<[fp]>, <[buf]>, <[mode]>, <[size]>)
FILE *<[fp]>;
char *<[buf]>;
int <[mode]>;
size_t <[size]>;
DESCRIPTION
Use <<setvbuf>> to specify what kind of buffering you want for the
file or stream identified by <[fp]>, by using one of the following
values (from <<stdio.h>>) as the <[mode]> argument:
o+
o _IONBF
Do not use a buffer: send output directly to the host system for the
file or stream identified by <[fp]>.
o _IOFBF
Use full output buffering: output will be passed on to the host system
only when the buffer is full, or when an input operation intervenes.
o _IOLBF
Use line buffering: pass on output to the host system at every
newline, as well as when the buffer is full, or when an input
operation intervenes.
o-
Use the <[size]> argument to specify how large a buffer you wish. You
can supply the buffer itself, if you wish, by passing a pointer to a
suitable area of memory as <[buf]>. Otherwise, you may pass <<NULL>>
as the <[buf]> argument, and <<setvbuf>> will allocate the buffer.
WARNINGS
You may only use <<setvbuf>> before performing any file operation other
than opening the file.
If you supply a non-null <[buf]>, you must ensure that the associated
storage continues to be available until you close the stream
identified by <[fp]>.
RETURNS
A <<0>> result indicates success, <<EOF>> failure (invalid <[mode]> or
<[size]> can cause failure).
PORTABILITY
Both ANSI C and the System V Interface Definition (Issue 2) require
<<setvbuf>>. However, they differ on the meaning of a <<NULL>> buffer
pointer: the SVID issue 2 specification says that a <<NULL>> buffer
pointer requests unbuffered output. For maximum portability, avoid
<<NULL>> buffer pointers.
Both specifications describe the result on failure only as a
nonzero value.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
#include <_ansi.h>
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
/*
* Set one of the three kinds of buffering, optionally including a buffer.
*/
int
_DEFUN(setvbuf, (fp, buf, mode, size),
register FILE * fp _AND
char *buf _AND
register int mode _AND
register size_t size)
{
int ret = 0;
CHECK_INIT (_REENT, fp);
_flockfile (fp);
/*
* Verify arguments. The `int' limit on `size' is due to this
* particular implementation.
*/
if ((mode != _IOFBF && mode != _IOLBF && mode != _IONBF) || (int)(_POINTER_INT) size < 0)
{
_funlockfile (fp);
return (EOF);
}
/*
* Write current buffer, if any; drop read count, if any.
* Make sure putc() will not think fp is line buffered.
* Free old buffer if it was from malloc(). Clear line and
* non buffer flags, and clear malloc flag.
*/
_CAST_VOID fflush (fp);
fp->_r = 0;
fp->_lbfsize = 0;
if (fp->_flags & __SMBF)
_free_r (_REENT, (_PTR) fp->_bf._base);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF);
if (mode == _IONBF)
goto nbf;
/*
* Allocate buffer if needed. */
if (buf == NULL)
{
/* we need this here because malloc() may return a pointer
even if size == 0 */
if (!size) size = BUFSIZ;
if ((buf = malloc (size)) == NULL)
{
ret = EOF;
/* Try another size... */
buf = malloc (BUFSIZ);
size = BUFSIZ;
}
if (buf == NULL)
{
/* Can't allocate it, let's try another approach */
nbf:
fp->_flags |= __SNBF;
fp->_w = 0;
fp->_bf._base = fp->_p = fp->_nbuf;
fp->_bf._size = 1;
_funlockfile (fp);
return (ret);
}
fp->_flags |= __SMBF;
}
/*
* Now put back whichever flag is needed, and fix _lbfsize
* if line buffered. Ensure output flush on exit if the
* stream will be buffered at all.
* If buf is NULL then make _lbfsize 0 to force the buffer
* to be flushed and hence malloced on first use
*/
switch (mode)
{
case _IOLBF:
fp->_flags |= __SLBF;
fp->_lbfsize = buf ? -size : 0;
/* FALLTHROUGH */
case _IOFBF:
/* no flag */
_REENT->__cleanup = _cleanup_r;
fp->_bf._base = fp->_p = (unsigned char *) buf;
fp->_bf._size = size;
break;
}
/*
* Patch up write count if necessary.
*/
if (fp->_flags & __SWR)
fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : size;
_funlockfile (fp);
return 0;
}
|
/*
* Copyright (C) 2006 Voice System SRL
*
* This file is part of Kamailio, a free SIP server.
*
* Kamailio 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
*
* Kamailio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* History:
* --------
* 2006-04-14 initial version (bogdan)
*/
/*!
* \file
* \brief Timer related functions for the dialog module
* \ingroup dialog
* Module: \ref dialog
*/
#ifndef _DIALOG_DLG_TIMER_H_
#define _DIALOG_DLG_TIMER_H_
#include "../../locking.h"
/*! dialog timeout list */
typedef struct dlg_tl
{
struct dlg_tl *next;
struct dlg_tl *prev;
volatile unsigned int timeout; /*!< timeout in seconds */
} dlg_tl_t;
/*! dialog timer */
typedef struct dlg_timer
{
struct dlg_tl first; /*!< dialog timeout list */
gen_lock_t *lock; /*!< lock for the list */
} dlg_timer_t;
/*! dialog timer handler */
typedef void (*dlg_timer_handler)(struct dlg_tl *);
/*!
* \brief Initialize the dialog timer handler
* Initialize the dialog timer handler, allocate the lock and a global
* timer in shared memory. The global timer handler will be set on success.
* \param hdl dialog timer handler
* \return 0 on success, -1 on failure
*/
int init_dlg_timer(dlg_timer_handler);
/*!
* \brief Destroy global dialog timer
*/
void destroy_dlg_timer(void);
/*!
* \brief Insert a dialog timer to the list
* \param tl dialog timer list
* \param interval timeout value in seconds
* \return 0 on success, -1 when the input timer list is invalid
*/
int insert_dlg_timer(struct dlg_tl *tl, int interval);
/*!
* \brief Remove a dialog timer from the list
* \param tl dialog timer that should be removed
* \return 1 when the input timer is empty, 0 when the timer was removed,
* -1 when the input timer list is invalid
*/
int remove_dialog_timer(struct dlg_tl *tl);
/*!
* \brief Update a dialog timer on the list
* \param tl dialog timer
* \param timeout new timeout value in seconds
* \return 0 on success, -1 when the input list is invalid
* \note the update is implemented as a remove, insert
*/
int update_dlg_timer(struct dlg_tl *tl, int timeout);
/*!
* \brief Timer routine for expiration of dialogs
* Timer handler for expiration of dialogs, runs the global timer handler on them.
* \param ticks time for expiration checks
* \param attr unused
*/
void dlg_timer_routine(unsigned int ticks , void * attr);
#endif
|
/* ------------------------------------------------------------------
* Copyright (C) 2008 PacketVideo
*
* 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.
* -------------------------------------------------------------------
*/
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:
3GPP TS 26.073
ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
Available from http://www.3gpp.org
(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/
/*
------------------------------------------------------------------------------
Filename: /audio/gsm_amr/c/src/include/lpc.h
Date: 01/29/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Replaced "int" and/or "char" with OSCL defined types.
Description: Moved _cplusplus #ifdef after Include section.
Description:
------------------------------------------------------------------------------
INCLUDE DESCRIPTION
File : lpc.h
Purpose : 2 LP analyses centered at 2nd and 4th subframe
for mode 12.2. For all other modes a
LP analysis centered at 4th subframe is
performed.
------------------------------------------------------------------------------
*/
#ifndef _LPC_H_
#define _LPC_H_
#define lpc_h "$Id $"
/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "typedef.h"
#include "levinson.h"
#include "mode.h"
/*--------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif
/*----------------------------------------------------------------------------
; MACROS
; [Define module specific macros here]
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; DEFINES
; [Include all pre-processor statements here.]
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; EXTERNAL VARIABLES REFERENCES
; [Declare variables used in this module but defined elsewhere]
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; SIMPLE TYPEDEF'S
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; ENUMERATED TYPEDEF'S
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; STRUCTURES TYPEDEF'S
----------------------------------------------------------------------------*/
typedef struct
{
LevinsonState *levinsonSt;
} lpcState;
/*----------------------------------------------------------------------------
; GLOBAL FUNCTION DEFINITIONS
; [List function prototypes here]
----------------------------------------------------------------------------*/
Word16 lpc_init(lpcState **st);
/* initialize one instance of the pre processing state.
Stores pointer to filter status struct in *st. This pointer has to
be passed to lpc in each call.
returns 0 on success
*/
Word16 lpc_reset(lpcState *st);
/* reset of pre processing state (i.e. set state memory to zero)
returns 0 on success
*/
void lpc_exit(lpcState **st);
/* de-initialize pre processing state (i.e. free status struct)
stores NULL in *st
*/
void lpc(
lpcState *st, /* i/o: State struct */
enum Mode mode, /* i : coder mode */
Word16 x[], /* i : Input signal Q15 */
Word16 x_12k2[], /* i : Input signal (EFR) Q15 */
Word16 a[], /* o : predictor coefficients Q12 */
Flag *pOverflow
);
#ifdef __cplusplus
}
#endif
#endif /* _LPC_H_ */
|
/*
http://open.spotify.com/track/0QervLYxa3WBLkSTLkcGNw * Network.h
*
* Created on: 20 paź 2014
* Author: Wojtek Gumuła
*/
#ifndef SRC_NETWORK_H_
#define SRC_NETWORK_H_
#include <set>
#include <list>
#include <iostream>
#include <cmath> //distance computing
#include <random>
#include <algorithm>
#include "Node.h"
#include "Edge.h"
#include "TransportType.h"
#include "Route.h"
#include "../algorithm/Solver.h"
#include "../db/DataBase.h"
#include "../db/lib/Time.h"
class Solver; //forward declaration
/**
* main class, contains information
* about nodes and edges between them.
* Should be created from file containing
* data in GTFS or other format.
* loadFromFile method should load "db/db.ext" file
* and save it to inner variables.
*/
struct edgePointerCompare{
bool operator()(Edge* e1,Edge* e2) const{
return (e1->getID()<e2->getID());
}
};
struct nodePointerCompare{
bool operator()(Node* n1,Node* n2) const{
return (n1->getID()<n2->getID());
}
};
class Network {
public:
/**
* Network object constructor.
* If this constructor is called, loadFromFile method need to be called after.
*/
Network();
/**
* Network object constructor in which {@link Network::loadFromFile()} method is being called.
* @param f Name of file from which database is loaded.
*/
//Network(std::string f);
/**
* Destructs all objects in Network and itself.
*/
~Network();
/**
* Creates Network from database
*/
Network(DataBase& dataB);
/**
* Set solved used in {@link Network::findRouteBetween()} method.
* @param s Pointer to Solver being used.
*/
void setSolver(Solver * s);// todosetSolver(Route & (*ptr)(const Network &))?;
/**
* Searches for Route beetween two given points.
* @param start Start Node.
* @param end End Node.
* @return Pointer to Route between given nodes, NULL if no route can be found.
*/
Route * findRouteBetween(Node * start, Node * end, Time t);
/**
* This function is necessary for GUI.
* @return Returns some kind of stl container in which
* all nodes are stored in alphabetical order.
*/
std::list<Node *> getAllNodes() const;
/**
* For debug.
* @return Returns some kind of stl container in which
* all edges are stored.
*/
std::list<Edge *> getAllEdges()const;
/**
* Used of debug in console purposes.
* @param s Stream used for output.
* @param n Reference to Network being printed.
* @return Given stream.
*/
friend std::ostream& operator<<(std::ostream& s, const Network& n);
/**
* @param start Pointer to starting Node.
* @param end Pointer to ending Node.
* @return True if Edge from start to end exists in graph, false otherwise.
*/
bool isEdgeBetween(const Node * start, const Node * end) const; //returns true if edge between two nodes exists
/**
* @param id Id of desired Node.
* @return Pointer to desired Node if exists in graph, NULL otherwise.
*/
Node * getNode(unsigned int id) const; //get Node by id
/**
* @param id Id of desired Edge.
* @return Pointer to desired Edge if exists in graph, NULL otherwise.
*/
Edge* getEdge(unsigned int id) const; //get Edge by id
/**
* @param n Pointer to given Node.
* @return std::list of all Edges starting in given Node.
*/
std::list<Edge *> getEdgesForNode(const Node * n) const;
/**
* @param latitude Given latitude
* @param longtitude Given longtitude.
* @return Returns pointer to Node being closest to given geographic position.
*/
Node * getNodeCloseToPos(double latitude, double longtitude) const; //returns node close do desired position
/**
* two dimensional bool array containing data about connections
* for matrix[i][j], true means there is connection between node.id == i to node.id ==j.
*/
bool ** incidenceMatrix;
/*
* Calculates edge id form incident nodes ids
* Can be used if findEdge function
* @param startId id of node wher edge starts
* @param endId id of node where edge ends
* */
unsigned int calculateEdgeId(unsigned int startId, unsigned int endId) const;
bool validate();
static Network * generateRandomNetwork(unsigned width, unsigned height, long seed = 0, double probability = 1);
private:
std::set<Node *, nodePointerCompare> nodes;
std::set<Edge *, edgePointerCompare> edges;
/**
* Adds given Node to graph.
* @param n Pointer to Node.
* @return true if Node was added to graph, false otherwise.
*/
bool addNode(Node * n); //adds Node if not exists
/**
* Adds given Edge to graph.
* @param e Pointer to Edge.
* @return true if Edge was added to graph, false otherwise.
*/
bool addEdge(Edge * e); //adds Edge if not exists
/*
* Creates an incidence Matrix
* */
void createIncidenceMatrix();
Solver * solver;
};
#endif /* SRC_NETWORK_H_ */
|
#ifndef MUDLET_DLGABOUTDIALOG_H
#define MUDLET_DLGABOUTDIALOG_H
/***************************************************************************
* Copyright (C) 2008-2009 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "pre_guard.h"
#include "ui_about_dialog.h"
#include "post_guard.h"
class dlgAboutDialog : public QDialog, public Ui::about_dialog
{
Q_OBJECT
Q_DISABLE_COPY(dlgAboutDialog)
public:
dlgAboutDialog(QWidget* parent = 0);
};
#endif // MUDLET_DLGABOUTDIALOG_H
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them 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.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: LiteralStorage.h /main/1 1996/07/29 16:56:13 cde-hp $ */
// Copyright (c) 1996 James Clark
// See the file COPYING for copying permission.
#ifndef LiteralStorage_INCLUDED
#define LiteralStorage_INCLUDED 1
#ifdef __GNUG__
#pragma interface
#endif
#include "StorageManager.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class SP_API LiteralStorageManager : public StorageManager {
public:
LiteralStorageManager(const char *type);
StorageObject *makeStorageObject(const StringC &id,
const StringC &,
Boolean,
Boolean mayRewind,
Messenger &,
StringC &found);
const InputCodingSystem *requiredCodingSystem() const;
Boolean requiresCr() const;
const char *type() const;
Boolean inheritable() const;
private:
LiteralStorageManager(const LiteralStorageManager &); // undefined
void operator=(const LiteralStorageManager &); // undefined
const char *type_;
};
#ifdef SP_NAMESPACE
}
#endif
#endif /* not LiteralStorage_INCLUDED */
|
/*
encoding data and routines dependent on language; estonian
Copyright (C) 2003 David Necas (Yeti) <yeti@physics.muni.cz>
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as published
by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include "enca.h"
#include "internal.h"
#include "data/estonian/estonian.h"
/* Local prototypes. */
static int hook(EncaAnalyserState *analyser);
static int eol_hook(EncaAnalyserState *analyser);
static int hook_iso13win(EncaAnalyserState *analyser);
static int hook_iso4win(EncaAnalyserState *analyser);
static int hook_allinone(EncaAnalyserState *analyser);
/**
* ENCA_LANGUAGE_ET:
*
* Estonian language.
*
* Everything the world out there needs to know about this language.
**/
const EncaLanguageInfo ENCA_LANGUAGE_ET = {
"et",
"estonian",
NCHARSETS,
CHARSET_NAMES,
CHARSET_WEIGHTS,
SIGNIFICANT,
CHARSET_LETTERS,
CHARSET_PAIRS,
WEIGHT_SUM,
&hook,
&eol_hook,
NULL,
NULL
};
/**
* hook:
* @analyser: Analyser state whose charset ratings are to be modified.
*
* Launches language specific hooks for language "et".
*
* Returns: Nonzero if charset ratigns have been actually modified, zero
* otherwise.
**/
static int
hook(EncaAnalyserState *analyser)
{
int chg = 0;
/* we may want to run both, and in this order */
chg += hook_allinone(analyser);
chg += hook_iso13win(analyser);
return chg;
}
/**
* eol_hook:
* @analyser: Analyser state whose charset ratings are to be modified.
*
* Launches language specific EOL hooks for language "et".
*
* Returns: Nonzero if charset ratigns have been actually modified, zero
* otherwise.
**/
static int
eol_hook(EncaAnalyserState *analyser)
{
return hook_iso4win(analyser);
}
/**
* hook_iso13win:
* @analyser: Analyser state whose charset ratings are to be modified.
*
* Decides between iso8859-13 and cp1257 charsets for language "et".
*
* Returns: Nonzero if charset ratigns have been actually modified, zero
* otherwise.
**/
static int
hook_iso13win(EncaAnalyserState *analyser)
{
static EncaLanguageHookDataEOL hookdata[] = {
{ "iso885913", ENCA_SURFACE_EOL_LF, (size_t)-1 },
{ "cp1257", ENCA_SURFACE_MASK_EOL, (size_t)-1 },
};
return enca_language_hook_eol(analyser, ELEMENTS(hookdata), hookdata);
}
/**
* hook_iso4win:
* @analyser: Analyser state whose charset ratings are to be modified.
*
* Decides between iso8859-4 and cp1257 charsets for language "et".
*
* Returns: Nonzero if charset ratigns have been actually modified, zero
* otherwise.
**/
static int
hook_iso4win(EncaAnalyserState *analyser)
{
static EncaLanguageHookDataEOL hookdata[] = {
{ "iso88594", ENCA_SURFACE_EOL_LF, (size_t)-1 },
{ "cp1257", ENCA_SURFACE_MASK_EOL, (size_t)-1 },
};
return enca_language_hook_eol(analyser, ELEMENTS(hookdata), hookdata);
}
/**
* hook_allinone:
* @analyser: Analyser state whose charset ratings are to be modified.
*
* Decides between iso8859-4, iso8859-13, cp1257, and baltic charsets for
* language "et".
*
* Returns: Nonzero if charset ratigns have been actually modified, zero
* otherwise.
**/
static int
hook_allinone(EncaAnalyserState *analyser)
{
static const unsigned char list_iso88594[] = {
0xb9, 0xbe, 0xa9, 0xae
};
static const unsigned char list_iso885913[] = {
0xf0, 0xfe, 0xd0, 0xde
};
static const unsigned char list_baltic[] = {
0xf9, 0xea, 0xd9, 0xca
};
static const unsigned char list_cp1257[] = {
0xf0, 0xfe, 0xd0, 0xde
};
static EncaLanguageHookData1CS hookdata[] = {
MAKE_HOOK_LINE(iso88594),
MAKE_HOOK_LINE(iso885913),
MAKE_HOOK_LINE(baltic),
MAKE_HOOK_LINE(cp1257),
};
return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
/* vim: ts=2
*/
|
/*
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_MAPMANAGER_H
#define MANGOS_MAPMANAGER_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include "ace/Recursive_Thread_Mutex.h"
#include "Map.h"
#include "GridStates.h"
class Transport;
class BattleGround;
struct MANGOS_DLL_DECL MapID
{
explicit MapID(uint32 id) : nMapId(id), nInstanceId(0) {}
MapID(uint32 id, uint32 instid) : nMapId(id), nInstanceId(instid) {}
bool operator<(const MapID& val) const
{
if (nMapId == val.nMapId)
return nInstanceId < val.nInstanceId;
return nMapId < val.nMapId;
}
bool operator==(const MapID& val) const { return nMapId == val.nMapId && nInstanceId == val.nInstanceId; }
uint32 nMapId;
uint32 nInstanceId;
};
class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::ClassLevelLockable<MapManager, ACE_Recursive_Thread_Mutex> >
{
friend class MaNGOS::OperatorNew<MapManager>;
typedef ACE_Recursive_Thread_Mutex LOCK_TYPE;
typedef ACE_Guard<LOCK_TYPE> LOCK_TYPE_GUARD;
typedef MaNGOS::ClassLevelLockable<MapManager, ACE_Recursive_Thread_Mutex>::Lock Guard;
public:
typedef std::map<MapID, Map* > MapMapType;
Map* CreateMap(uint32, const WorldObject* obj);
Map* CreateBgMap(uint32 mapid, BattleGround* bg);
Map* FindMap(uint32 mapid, uint32 instanceId = 0) const;
void UpdateGridState(grid_state_t state, Map& map, NGridType& ngrid, GridInfo& ginfo, const uint32& x, const uint32& y, const uint32& t_diff);
// only const version for outer users
void DeleteInstance(uint32 mapid, uint32 instanceId);
void Initialize(void);
void Update(uint32);
void SetGridCleanUpDelay(uint32 t)
{
if (t < MIN_GRID_DELAY)
i_gridCleanUpDelay = MIN_GRID_DELAY;
else
i_gridCleanUpDelay = t;
}
void SetMapUpdateInterval(uint32 t)
{
if (t > MIN_MAP_UPDATE_DELAY)
t = MIN_MAP_UPDATE_DELAY;
i_timer.SetInterval(t);
i_timer.Reset();
}
// void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false);
void UnloadAll();
static bool ExistMapAndVMap(uint32 mapid, float x, float y);
static bool IsValidMAP(uint32 mapid);
static bool IsValidMapCoord(uint32 mapid, float x, float y)
{
return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x, y);
}
static bool IsValidMapCoord(uint32 mapid, float x, float y, float z)
{
return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x, y, z);
}
static bool IsValidMapCoord(uint32 mapid, float x, float y, float z, float o)
{
return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x, y, z, o);
}
static bool IsValidMapCoord(WorldLocation const& loc)
{
return IsValidMapCoord(loc.mapid, loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation);
}
void RemoveAllObjectsInRemoveList();
void LoadTransports();
typedef std::set<Transport*> TransportSet;
TransportSet m_Transports;
typedef std::map<uint32, TransportSet> TransportMap;
TransportMap m_TransportsByMap;
bool CanPlayerEnter(uint32 mapid, Player* player);
void InitializeVisibilityDistanceInfo();
/* statistics */
uint32 GetNumInstances();
uint32 GetNumPlayersInInstances();
// get list of all maps
const MapMapType& Maps() const { return i_maps; }
template<typename Do>
void DoForAllMapsWithMapId(uint32 mapId, Do& _do);
private:
// debugging code, should be deleted some day
GridState* si_GridStates[MAX_GRID_STATE];
int i_GridStateErrorCount;
private:
MapManager();
~MapManager();
MapManager(const MapManager&);
MapManager& operator=(const MapManager&);
void InitStateMachine();
void DeleteStateMachine();
Map* CreateInstance(uint32 id, Player* player);
DungeonMap* CreateDungeonMap(uint32 id, uint32 InstanceId, Difficulty difficulty, DungeonPersistentState* save = NULL);
BattleGroundMap* CreateBattleGroundMap(uint32 id, uint32 InstanceId, BattleGround* bg);
uint32 i_gridCleanUpDelay;
MapMapType i_maps;
IntervalTimer i_timer;
};
template<typename Do>
inline void MapManager::DoForAllMapsWithMapId(uint32 mapId, Do& _do)
{
MapMapType::const_iterator start = i_maps.lower_bound(MapID(mapId, 0));
MapMapType::const_iterator end = i_maps.lower_bound(MapID(mapId + 1, 0));
for (MapMapType::const_iterator itr = start; itr != end; ++itr)
_do(itr->second);
}
#define sMapMgr MapManager::Instance()
#endif
|
/*
* Copyright (C) 2011 Sansar Choinyambuu
* HSR Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "swid_error.h"
#include <bio/bio_writer.h>
#include <ietf/ietf_attr_pa_tnc_error.h>
ENUM(swid_error_code_names, TCG_SWID_ERROR, TCG_SWID_RESPONSE_TOO_LARGE,
"SWID Error",
"SWID Subscription Denied",
"SWID Response Too Large"
);
/**
* Described in header.
*/
pa_tnc_attr_t* swid_error_create(swid_error_code_t code, u_int32_t request_id,
u_int32_t max_attr_size, char *description)
{
bio_writer_t *writer;
chunk_t msg_info;
pa_tnc_attr_t *attr;
pen_type_t error_code;
error_code = pen_type_create( PEN_TCG, code);
writer = bio_writer_create(4);
writer->write_uint32(writer, request_id);
if (code == TCG_SWID_RESPONSE_TOO_LARGE)
{
writer->write_uint16(writer, max_attr_size);
}
if (description)
{
writer->write_data(writer, chunk_from_str(description));
}
msg_info = writer->get_buf(writer);
attr = ietf_attr_pa_tnc_error_create(error_code, msg_info);
writer->destroy(writer);
return attr;
}
|
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora, Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FileSystem_h
#define FileSystem_h
#if PLATFORM(GTK)
#include <gmodule.h>
#endif
#if PLATFORM(QT)
#include <QFile>
#include <QLibrary>
#if defined(Q_OS_WIN32)
#include <windows.h>
#endif
#endif
#if PLATFORM(CF) || (PLATFORM(QT) && defined(Q_WS_MAC))
#include <CoreFoundation/CFBundle.h>
#endif
#include <time.h>
#include <wtf/Platform.h>
#include <wtf/Vector.h>
#include "PlatformString.h"
typedef const struct __CFData* CFDataRef;
#if OS(WINDOWS)
// These are to avoid including <winbase.h> in a header for Chromium
typedef void *HANDLE;
// Assuming STRICT
typedef struct HINSTANCE__* HINSTANCE;
typedef HINSTANCE HMODULE;
#endif
namespace WebCore {
class CString;
// PlatformModule
#if OS(WINDOWS)
typedef HMODULE PlatformModule;
#elif PLATFORM(QT)
#if defined(Q_WS_MAC)
typedef CFBundleRef PlatformModule;
#else
typedef QLibrary* PlatformModule;
#endif // defined(Q_WS_MAC)
#elif PLATFORM(GTK)
typedef GModule* PlatformModule;
#elif PLATFORM(CF)
typedef CFBundleRef PlatformModule;
#else
typedef void* PlatformModule;
#endif
// PlatformModuleVersion
#if OS(WINDOWS)
struct PlatformModuleVersion {
unsigned leastSig;
unsigned mostSig;
PlatformModuleVersion(unsigned)
: leastSig(0)
, mostSig(0)
{
}
PlatformModuleVersion(unsigned lsb, unsigned msb)
: leastSig(lsb)
, mostSig(msb)
{
}
};
#else
typedef unsigned PlatformModuleVersion;
#endif
// PlatformFileHandle
#if PLATFORM(QT)
typedef QFile* PlatformFileHandle;
const PlatformFileHandle invalidPlatformFileHandle = 0;
#elif OS(WINDOWS)
typedef HANDLE PlatformFileHandle;
// FIXME: -1 is INVALID_HANDLE_VALUE, defined in <winbase.h>. Chromium tries to
// avoid using Windows headers in headers. We'd rather move this into the .cpp.
const PlatformFileHandle invalidPlatformFileHandle = reinterpret_cast<HANDLE>(-1);
#else
typedef int PlatformFileHandle;
const PlatformFileHandle invalidPlatformFileHandle = -1;
#endif
bool fileExists(const String&);
bool deleteFile(const String&);
bool deleteEmptyDirectory(const String&);
bool getFileSize(const String&, long long& result);
bool getFileModificationTime(const String&, time_t& result);
String pathByAppendingComponent(const String& path, const String& component);
bool makeAllDirectories(const String& path);
String homeDirectoryPath();
String pathGetFileName(const String&);
String directoryName(const String&);
Vector<String> listDirectory(const String& path, const String& filter = String());
CString fileSystemRepresentation(const String&);
inline bool isHandleValid(const PlatformFileHandle& handle) { return handle != invalidPlatformFileHandle; }
// Prefix is what the filename should be prefixed with, not the full path.
CString openTemporaryFile(const char* prefix, PlatformFileHandle&);
void closeFile(PlatformFileHandle&);
int writeToFile(PlatformFileHandle, const char* data, int length);
/* SISO_HTMLCOMPOSER begin*/
#if PLATFORM(ANDROID)
CString openLocalFile(const String& basePath, const String& extension , PlatformFileHandle& handle);
#endif
/*SISO_HTMLCOMPOSER END*/
// Methods for dealing with loadable modules
bool unloadModule(PlatformModule);
#if PLATFORM(WIN)
String localUserSpecificStorageDirectory();
String roamingUserSpecificStorageDirectory();
bool safeCreateFile(const String&, CFDataRef);
#endif
#if PLATFORM(GTK)
String filenameToString(const char*);
char* filenameFromString(const String&);
String filenameForDisplay(const String&);
#endif
#if PLATFORM(CHROMIUM)
String pathGetDisplayFileName(const String&);
#endif
} // namespace WebCore
#endif // FileSystem_h
|
/*
* linux/arch/arm/kernel/xscale-cp0.c
*
* XScale DSP and iWMMXt coprocessor context switching and handling
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/io.h>
#include <asm/thread_notify.h>
static inline void dsp_save_state(u32 *state)
{
__asm__ __volatile__ (
"mrrc p0, 0, %0, %1, c0\n"
: "=r" (state[0]), "=r" (state[1]));
}
static inline void dsp_load_state(u32 *state)
{
__asm__ __volatile__ (
"mcrr p0, 0, %0, %1, c0\n"
: : "r" (state[0]), "r" (state[1]));
}
static int dsp_do(struct notifier_block *self, unsigned long cmd, void *t)
{
struct thread_info *thread = t;
switch (cmd) {
case THREAD_NOTIFY_FLUSH:
thread->cpu_context.extra[0] = 0;
thread->cpu_context.extra[1] = 0;
break;
case THREAD_NOTIFY_SWITCH:
dsp_save_state(current_thread_info()->cpu_context.extra);
dsp_load_state(thread->cpu_context.extra);
break;
}
return NOTIFY_DONE;
}
static struct notifier_block dsp_notifier_block = {
.notifier_call = dsp_do,
};
#ifdef CONFIG_IWMMXT
static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t)
{
struct thread_info *thread = t;
switch (cmd) {
case THREAD_NOTIFY_FLUSH:
/*
* flush_thread() zeroes thread->fpstate, so no need
* to do anything here.
*
* FALLTHROUGH: Ensure we don't try to overwrite our newly
* initialised state information on the first fault.
*/
case THREAD_NOTIFY_RELEASE:
iwmmxt_task_release(thread);
break;
case THREAD_NOTIFY_SWITCH:
iwmmxt_task_switch(thread);
break;
}
return NOTIFY_DONE;
}
static struct notifier_block iwmmxt_notifier_block = {
.notifier_call = iwmmxt_do,
};
#endif
static u32 __init xscale_cp_access_read(void)
{
u32 value;
__asm__ __volatile__ (
#if defined(CONFIG_CPU_PJ4)
"mrc p15, 0, %0, c1, c0, 2\n\t"
#else
"mrc p15, 0, %0, c15, c1, 0\n\t"
#endif
: "=r" (value));
return value;
}
static void __init xscale_cp_access_write(u32 value)
{
u32 temp;
__asm__ __volatile__ (
#if defined(CONFIG_CPU_PJ4)
"mcr p15, 0, %1, c1, c0, 2\n\t"
"mrc p15, 0, %0, c1, c0, 2\n\t"
#else
"mcr p15, 0, %1, c15, c1, 0\n\t"
"mrc p15, 0, %0, c15, c1, 0\n\t"
#endif
"mov %0, %0\n\t"
"sub pc, pc, #4\n\t"
: "=r" (temp) : "r" (value));
}
/*
* Detect whether we have a MAC coprocessor (40 bit register) or an
* iWMMXt coprocessor (64 bit registers) by loading 00000100:00000000
* into a coprocessor register and reading it back, and checking
* whether the upper word survived intact.
*/
static int __init cpu_has_iwmmxt(void)
{
u32 lo;
u32 hi;
#if defined(CONFIG_CPU_PJ4)
#ifdef CONFIG_IWMMXT
return 1;
#else
return 0;
#endif
#endif
/*
* This sequence is interpreted by the DSP coprocessor as:
* mar acc0, %2, %3
* mra %0, %1, acc0
*
* And by the iWMMXt coprocessor as:
* tmcrr wR0, %2, %3
* tmrrc %0, %1, wR0
*/
__asm__ __volatile__ (
"mcrr p0, 0, %2, %3, c0\n"
"mrrc p0, 0, %0, %1, c0\n"
: "=r" (lo), "=r" (hi)
: "r" (0), "r" (0x100));
return !!hi;
}
/*
* If we detect that the CPU has iWMMXt (and CONFIG_IWMMXT=y), we
* disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy
* switch code handle iWMMXt context switching. If on the other
* hand the CPU has a DSP coprocessor, we keep access to CP0 enabled
* all the time, and save/restore acc0 on context switch in non-lazy
* fashion.
*/
static int __init xscale_cp0_init(void)
{
u32 cp_access;
#if defined(CONFIG_CPU_PJ4)
cp_access = xscale_cp_access_read() & ~0xf;
xscale_cp_access_write(cp_access | 0x3);
#else
cp_access = xscale_cp_access_read() & ~3;
xscale_cp_access_write(cp_access | 1);
#endif
if (cpu_has_iwmmxt()) {
#ifndef CONFIG_IWMMXT
printk(KERN_WARNING "CAUTION: XScale iWMMXt coprocessor "
"detected, but kernel support is missing.\n");
#else
printk(KERN_INFO "XScale iWMMXt coprocessor detected.\n");
elf_hwcap |= HWCAP_IWMMXT;
thread_register_notifier(&iwmmxt_notifier_block);
#endif
}
#if defined(CONFIG_CPU_XSCALE) || defined(CONFIG_CPU_XSC3)
else {
printk(KERN_INFO "XScale DSP coprocessor detected.\n");
thread_register_notifier(&dsp_notifier_block);
cp_access |= 1;
}
#endif
xscale_cp_access_write(cp_access);
return 0;
}
late_initcall(xscale_cp0_init);
|
/*
* Copyright (c) 2003, 2007-11 Matteo Frigo
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
*
* 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 "ifftw.h"
solver *X(mksolver)(size_t size, const solver_adt *adt)
{
solver *s = (solver *)MALLOC(size, SOLVERS);
s->adt = adt;
s->refcnt = 0;
return s;
}
void X(solver_use)(solver *ego)
{
++ego->refcnt;
}
void X(solver_destroy)(solver *ego)
{
if ((--ego->refcnt) == 0) {
if (ego->adt->destroy)
ego->adt->destroy(ego);
X(ifree)(ego);
}
}
void X(solver_register)(planner *plnr, solver *s)
{
plnr->adt->register_solver(plnr, s);
}
|
/*****************************************************************************
*
* \file
*
* \brief TWIS driver for AVR32 UC3.
*
* This file defines a useful set of functions for TWIS on AVR32 devices.
*
*****************************************************************************/
/**
* Copyright (c) 2010-2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#ifndef _TWIS_H_
#define _TWIS_H_
/**
* \defgroup group_avr32_drivers_twis TWI - Two-Wire Slave Interface
*
* Driver for the TWIS (Two-Wire Slave Interface).
* This driver provides access to the main features of the TWIS controller.
* The TWIS interconnects a TWI slave on a unique two-wire bus.
* The TWIS is programmable as a slave with sequential or single-byte access.
* Internal Address access and Ten bit addressing mode is supported.
*
* \{
*/
#include <avr32/io.h>
#include <stdint.h>
#include "compiler.h"
#include "status_codes.h"
#include "conf_twis.h"
/**
* \name TWI Driver Compatibility
* Codes for UC3 devices using TWI modules can easily be ported
* to UC3 devices with TWIM module
* @{
*/
#define avr32_twi_t avr32_twis_t
#define twi_options_t twis_options_t
#define twi_package_t twis_package_t
#define twi_slave_fct_t twis_slave_fct_t
#define twi_slave_init twis_slave_init
//! @}
/*!
* \brief Input parameters when initializing the twi module mode
*/
typedef struct
{
//! The PBA clock frequency.
uint32_t pba_hz;
//! The baudrate of the TWI bus.
uint32_t speed;
//! The desired address.
uint8_t chip;
//! smbus mode
bool smbus;
//! tenbit mode
bool tenbit;
}
twis_options_t;
/*!
* \brief Information concerning the data transmission
*/
typedef struct
{
//! TWI chip address to communicate with.
uint8_t chip;
//! TWI address/commands to issue to the other chip (node).
uint32_t addr;
//! Length of the TWI data address segment (1-3 bytes).
uint8_t addr_length;
//! Pointer to the transmit buffer
void *buffer;
//! The number of bytes in the buffer
uint32_t length;
}
twis_package_t;
/*!
* \brief Pointer on TWI slave user specific application routines
*/
typedef struct
{
//! Routine to receive data from TWI master
void (*rx) (uint8_t);
//! Routine to transmit data to TWI master
uint8_t (*tx) (void);
//! Routine to signal a TWI STOP
void (*stop) (void);
}
twis_slave_fct_t;
// Function Declarations
status_code_t twis_slave_init (volatile avr32_twis_t *twis,
const twis_options_t *opt, const twis_slave_fct_t *slave_fct);
void twis_send_data_ack(volatile avr32_twis_t *twis);
void twis_send_data_nack(volatile avr32_twis_t *twis, bool stop_callback);
/**
* \}
*/
#endif // _TWIS_H_
|
/* vi: set expandtab sw=4 sts=4: */
/* opkg_solver.h - handle package installation and removal actions
using an external solver.
Copyright (C) 2015 National Instruments Corp.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*/
#ifndef OPKG_SOLVER_H
#define OPKG_SOLVER_H
#ifdef __cplusplus
extern "C" {
#endif
int opkg_solver_install(int num_pkgs, char **pkg_names);
int opkg_solver_remove(int num_pkgs, char **pkg_names);
int opkg_solver_upgrade(int num_pkgs, char **pkg_names);
int opkg_solver_distupgrade(int num_pkgs, char **pkg_names);
#ifdef __cplusplus
}
#endif
#endif /* OPKG_SOLVER_H */
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them 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.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: cmsentry.c /main/4 1995/11/09 12:41:44 rswiston $ */
/*
* (c) Copyright 1993, 1994 Hewlett-Packard Company
* (c) Copyright 1993, 1994 International Business Machines Corp.
* (c) Copyright 1993, 1994 Novell, Inc.
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
*/
#include <EUSCompat.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "cmsentry.h"
#include "cmsdata.h"
#include "nametbl.h"
#include "attr.h"
/******************************************************************************
* forward declaration of static functions used within the file
******************************************************************************/
static CSA_return_code
_ExtractEntryAttrsFromEntry(uint srcsize, cms_attribute *srcattrs,
uint *dstsize, cms_attribute **dstattrs, boolean_t time_only);
/*****************************************************************************
* extern functions
*****************************************************************************/
/*
* Given a hashed name table, initialize a new cms_entry with
* the given list of attribute values
*/
extern CSA_return_code
_DtCmsMakeHashedEntry(
_DtCmsCalendar *cal,
uint num,
cms_attribute *attrs,
cms_entry **entry)
{
int i, index;
cms_entry *eptr;
CSA_return_code stat = CSA_SUCCESS;
if (cal == NULL || entry == NULL)
return (CSA_E_INVALID_PARAMETER);
if ((eptr = _DtCm_make_cms_entry(cal->entry_tbl)) == NULL)
return (CSA_E_INSUFFICIENT_MEMORY);
for (i = 0; i < num && stat == CSA_SUCCESS; i++) {
index = _DtCm_get_index_from_table(cal->entry_tbl,
attrs[i].name.name);
if (index > 0) {
/* check type */
if (index > _DtCM_DEFINED_ENTRY_ATTR_SIZE &&
attrs[i].value &&
attrs[i].value->type != cal->types[index])
stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
else
stat = _DtCm_copy_cms_attr_val(attrs[i].value,
&eptr->attrs[index].value);
} else if (attrs[i].value) {
if ((stat = _DtCmExtendNameTable(attrs[i].name.name, 0,
attrs[i].value->type, _DtCm_entry_name_tbl,
_DtCM_DEFINED_ENTRY_ATTR_SIZE,
_CSA_entry_attribute_names, &cal->entry_tbl,
&cal->types)) == CSA_SUCCESS) {
attrs[i].name.num = cal->entry_tbl->size;
stat = _DtCmGrowAttrArray(&eptr->num_attrs,
&eptr->attrs, &attrs[i]);
}
}
}
if (stat != CSA_SUCCESS) {
_DtCm_free_cms_entry(eptr);
return (stat);
}
*entry = eptr;
return (CSA_SUCCESS);
}
extern void
_DtCmsFreeEntryAttrResItem(cms_get_entry_attr_res_item *elist)
{
cms_get_entry_attr_res_item *ptr;
while (elist) {
ptr = elist->next;
_DtCm_free_cms_attributes(elist->num_attrs, elist->attrs);
free(elist);
elist = ptr;
}
}
extern CSA_return_code
_DtCmsGetCmsEntryForClient(cms_entry *e, cms_entry **e_r, boolean_t time_only)
{
cms_entry *ptr;
CSA_return_code stat;
if (e == NULL || e_r == NULL)
return (CSA_E_INVALID_PARAMETER);
if ((ptr = (cms_entry *)calloc(1, sizeof(cms_entry))) == NULL)
return (CSA_E_INSUFFICIENT_MEMORY);
if ((stat = _ExtractEntryAttrsFromEntry(e->num_attrs, e->attrs,
&ptr->num_attrs, &ptr->attrs,time_only)) != CSA_SUCCESS) {
free(ptr);
return (stat);
} else {
ptr->key = e->key;
*e_r = ptr;
return (CSA_SUCCESS);
}
}
/*****************************************************************************
* static functions used within the file
*****************************************************************************/
static CSA_return_code
_ExtractEntryAttrsFromEntry(
uint srcsize,
cms_attribute *srcattrs,
uint *dstsize,
cms_attribute **dstattrs,
boolean_t time_only)
{
CSA_return_code stat;
int i, j;
cms_attribute *attrs;
if (dstsize == NULL || dstattrs == NULL)
return (CSA_E_INVALID_PARAMETER);
*dstsize = 0;
*dstattrs = NULL;
if (srcsize == 0)
return (CSA_SUCCESS);
if ((attrs = calloc(1, sizeof(cms_attribute) * srcsize)) == NULL)
return (CSA_E_INSUFFICIENT_MEMORY);
for (i = 0, j = 0; i <= srcsize; i++) {
if (srcattrs[i].value == NULL)
continue;
if ((stat = _DtCm_copy_cms_attribute(&attrs[j], &srcattrs[i],
B_TRUE)) != CSA_SUCCESS)
break;
else {
if ( (i == CSA_ENTRY_ATTR_SUMMARY_I) && (time_only == B_TRUE) ) {
if (attrs[j].value && attrs[j].value->item.string_value)
attrs[j].value->item.string_value[0] = '\0';
}
j++;
}
}
if (stat == CSA_SUCCESS && j > 0) {
*dstsize = j;
*dstattrs = attrs;
} else {
_DtCm_free_cms_attributes(j, attrs);
free(attrs);
}
return (stat);
}
|
/*
* shell__get_tinyrl.c
*/
#include "private.h"
/*--------------------------------------------------------- */
tinyrl_t *
clish_shell__get_tinyrl(const clish_shell_t *this)
{
return this->tinyrl;
}
/*--------------------------------------------------------- */
|
/*
* include/asm-arm/arch-omap/mtd-xip.h
*
* A handler for OMAP MTD-XIP support
*
* Based on the original code from include/linux/mtd/xip.h
* authored by Nicolas Pitre.
*
* Author: Nicolas Pitre
* Created: Nov 2, 2004
* Copyright: (C) 2004 MontaVista Software, Inc.
*
* Author: Someone <someone@mvista.com>
*
* 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#ifndef __ARCH_OMAP_MTD_XIP_H__
#define __ARCH_OMAP_MTD_XIP_H__
#include <asm/hardware.h>
#define OMAP_MPU_TIMER_BASE (0xfffec500)
#define OMAP_MPU_TIMER_OFFSET 0x100
typedef struct {
u32 cntl; /* CNTL_TIMER, R/W */
u32 load_tim; /* LOAD_TIM, W */
u32 read_tim; /* READ_TIM, R */
} xip_omap_mpu_timer_regs_t;
#define xip_omap_mpu_timer_base(n) \
((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
(n)*OMAP_MPU_TIMER_OFFSET))
static inline unsigned long xip_omap_mpu_timer_read(int nr)
{
volatile xip_omap_mpu_timer_regs_t* timer = xip_omap_mpu_timer_base(nr);
return timer->read_tim;
}
#define xip_irqpending() \
(omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
#define xip_currtime() (~xip_omap_mpu_timer_read(0))
#ifdef CONFIG_MACH_OMAP_PERSEUS2
#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 7)
#else
#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
#endif
/* TODO: define xip_cpu_idle() and arch_idle() or make use of CONFIG_CPU_ARMxxx in linux/mtd/xip.h*/
#endif /* __ARCH_OMAP_MTD_XIP_H__ */
|
/***************************************************************************
thumbnaileditor.h - description
-------------------
begin : Thu Mar 2 2005
copyright : (C) 2005 by Jason Harris
email : kstars@30doradus.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef THUMBNAILEDITOR_H_
#define THUMBNAILEDITOR_H_
#include <QMouseEvent>
#include <QPaintEvent>
#include <QDialog>
#include "ui_thumbnaileditor.h"
class ThumbnailPicker;
class ThumbnailEditorUI : public QFrame, public Ui::ThumbnailEditor {
Q_OBJECT
public:
explicit ThumbnailEditorUI( QWidget *parent );
};
class ThumbnailEditor : public QDialog
{
Q_OBJECT
public:
ThumbnailEditor( ThumbnailPicker *_tp, double _w, double _h );
~ThumbnailEditor();
QPixmap thumbnail();
private slots:
void slotUpdateCropLabel();
private:
ThumbnailEditorUI *ui;
ThumbnailPicker *tp;
double w, h;
};
#endif
|
/*
Copyright (C) 2013- The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef RMONITOR_POLL_H
#define RMONITOR_POLL_H
#include "rmsummary.h"
struct rmsummary *rmonitor_measure_process(pid_t pid);
int rmonitor_measure_process_update_to_peak(struct rmsummary *tr, pid_t pid);
struct rmsummary *rmonitor_measure_host(char *);
int rmonitor_get_children(pid_t pid, uint64_t **children);
#endif
|
#ifndef __USB_CDC_H__
#define __USB_CDC_H__
#include "usbd_desc.h"
#include "usbd_cdc.h"
#include "usbd_cdc_interface.h"
#define USB_GPIO A
#define USB_VBUS_PIN 9
#define USB_ID_PIN 10
#define USB_DM_PIN 11
#define USB_DP_PIN 12
#ifdef BOARD_E407
#define USB_VBUSON_GPIO B
#define USB_VBUSON_PIN 0
#endif
void usb_cdc_init(void);
#endif
|
/***************************************************************************
* Copyright 2009-2010 Nevo Hua <nevo.hua@playxiangqi.com> *
* *
* This file is part of NevoChess. *
* *
* NevoChess is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* NevoChess 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 NevoChess. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#import <UIKit/UIKit.h>
#import "SingleSelectionController.h"
#import "NetworkSettingController.h"
@interface OptionsViewController : UITableViewController <SingleSelectionDelegate,
NetworkSettingDelegate>
{
IBOutlet UISwitch* _soundSwitch;
// --- Piece Style.
NSArray* _pieceChoices;
NSUInteger _pieceType;
// --- Board Style.
NSArray* _boardChoices;
NSUInteger _boardType;
// --- AI Level and Type.
NSArray* _aiLevelChoices;
NSUInteger _aiLevel;
NSArray* _aiTypeChoices;
NSUInteger _aiType;
// --- Network
NSString* _username;
}
- (IBAction) autoConnectValueChanged:(id)sender;
@end
|
#ifndef TRANSFERENGINE_H
#define TRANSFERENGINE_H
#include <QObject>
#include <QtDBus>
#include <QList>
#include <QDBusMetaType>
#include "transfermethodinfo.h"
class TransferEngine: public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
TransferEngine(QObject* parent = 0);
const QList<TransferMethodInfo>& transferMethods();
public:
int count();
signals:
void countChanged();
private:
static const QString DBUS_SERVICE;
static const QString DBUS_SERVICE_PATH;
private:
QList<TransferMethodInfo> _methods;
};
#endif // TRANSFERENGINE_H
|
/**
******************************************************************************
* @file USB_Device/HID_Standalone/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.0.1
* @date 17-February-2017
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void OTG_FS_IRQHandler(void);
void OTG_FS_WKUP_IRQHandler(void);
void EXTI15_10_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#ifndef __BACKEND_H__
#define __BACKEND_H__
#include <gtk/gtk.h>
#include <cairo-xlib.h>
#include <lightdm.h>
struct _backend_componet
{
GKeyFile * conffile;
GKeyFile * statekeyfile;
char * statefile;
LightDMGreeter * greeter;
};
gboolean backend_init_greeter (void);
void backend_finalize (void);
GKeyFile * open_key_file (const char *file);
void backend_set_screen_background (void);
void backend_authenticate_username_only (const gchar *username);
void backend_authenticate_process (const gchar *text);
void backend_set_config (GtkSettings * settings);
void backend_get_conf_background (GdkPixbuf ** bg_pixbuf, GdkRGBA *bg_color);
void backend_state_file_set_keyboard (const char * kb);
void backend_state_file_set_language (const char * lang);
void backend_state_file_set_session (const char * session);
gchar * backend_state_file_get_session (void);
gchar * backend_state_file_get_language (void);
gchar * backend_state_file_get_keyboard (void);
gchar * backend_state_file_get_user (void);
unsigned char chk_machine_type (void);
#endif /* __BACKEND_H__ */
|
/*
Copyright (C) 2010 Srivats P.
This file is part of "Ostinato"
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef _DRONE_H
#define _DRONE_H
#include "ui_drone.h"
#include <QMenu>
#include <QSystemTrayIcon>
class RpcServer;
namespace OstProto { class OstService; }
class Drone : public QWidget, Ui::Drone
{
Q_OBJECT
public:
Drone(QWidget *parent = 0);
~Drone();
bool init();
signals:
void hideMe(bool hidden);
protected:
void changeEvent(QEvent *event);
private:
QSystemTrayIcon *trayIcon_;
QMenu *trayIconMenu_;
RpcServer *rpcServer;
OstProto::OstService *service;
private slots:
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
};
#endif
|
/**
******************************************************************************
* @file stm32l0xx_it.c
* @brief Interrupt Service Routines.
******************************************************************************
*
* COPYRIGHT(c) 2015 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32l0xx_hal.h"
#include "stm32l0xx.h"
#include "stm32l0xx_it.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M0+ Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
HAL_SYSTICK_IRQHandler();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
/******************************************************************************/
/* STM32L0xx Peripheral Interrupt Handlers */
/* Add here the Interrupt Handlers for the used peripherals. */
/* For the available peripheral interrupt handler names, */
/* please refer to the startup file (startup_stm32l0xx.s). */
/******************************************************************************/
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
#define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/thread_checker.h"
#include "webrtc/voice_engine/channel_manager.h"
#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
#include <memory>
#include <string>
#include <vector>
namespace webrtc {
class AudioSinkInterface;
class PacketRouter;
class RtpPacketSender;
class Transport;
class TransportFeedbackObserver;
namespace voe {
class Channel;
// This class provides the "view" of a voe::Channel that we need to implement
// webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two
// purposes:
// 1. Allow mocking just the interfaces used, instead of the entire
// voe::Channel class.
// 2. Provide a refined interface for the stream classes, including assumptions
// on return values and input adaptation.
class ChannelProxy {
public:
ChannelProxy();
explicit ChannelProxy(const ChannelOwner& channel_owner);
virtual ~ChannelProxy();
virtual void SetRTCPStatus(bool enable);
virtual void SetLocalSSRC(uint32_t ssrc);
virtual void SetRTCP_CNAME(const std::string& c_name);
virtual void SetNACKStatus(bool enable, int max_packets);
virtual void SetSendAbsoluteSenderTimeStatus(bool enable, int id);
virtual void SetSendAudioLevelIndicationStatus(bool enable, int id);
virtual void SetReceiveAbsoluteSenderTimeStatus(bool enable, int id);
virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id);
virtual void EnableSendTransportSequenceNumber(int id);
virtual void EnableReceiveTransportSequenceNumber(int id);
virtual void RegisterSenderCongestionControlObjects(
RtpPacketSender* rtp_packet_sender,
TransportFeedbackObserver* transport_feedback_observer,
PacketRouter* packet_router);
virtual void RegisterReceiverCongestionControlObjects(
PacketRouter* packet_router);
virtual void ResetCongestionControlObjects();
virtual CallStatistics GetRTCPStatistics() const;
virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const;
virtual NetworkStatistics GetNetworkStatistics() const;
virtual AudioDecodingCallStats GetDecodingCallStatistics() const;
virtual int32_t GetSpeechOutputLevelFullRange() const;
virtual uint32_t GetDelayEstimate() const;
virtual bool SetSendTelephoneEventPayloadType(int payload_type);
virtual bool SendTelephoneEventOutband(int event, int duration_ms);
virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink);
virtual void SetInputMute(bool muted);
virtual void RegisterExternalTransport(Transport* transport);
virtual void DeRegisterExternalTransport();
virtual bool ReceivedRTPPacket(const uint8_t* packet,
size_t length,
const PacketTime& packet_time);
virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length);
virtual const rtc::scoped_refptr<AudioDecoderFactory>&
GetAudioDecoderFactory() const;
virtual void SetChannelOutputVolumeScaling(float scaling);
private:
Channel* channel() const;
rtc::ThreadChecker thread_checker_;
ChannelOwner channel_owner_;
RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy);
};
} // namespace voe
} // namespace webrtc
#endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
|
/***************************************************************************
begin : Thu Jul 08 2010
copyright : (C) 2010 by Martin Preuss
email : martin@aqbanking.de
***************************************************************************
* This file is part of the project "AqBanking". *
* Please see toplevel file COPYING of that project for license details. *
***************************************************************************/
#ifndef AQHBCI_DLG_EDITUSER_PINTAN_P_H
#define AQHBCI_DLG_EDITUSER_PINTAN_P_H
#include "dlg_edituserpintan_l.h"
#include <aqhbci/user.h>
typedef struct AH_EDIT_USER_PINTAN_DIALOG AH_EDIT_USER_PINTAN_DIALOG;
struct AH_EDIT_USER_PINTAN_DIALOG {
AB_BANKING *banking;
AB_USER *user;
int doLock;
AB_COUNTRY_CONSTLIST2 *countryList;
AH_TAN_METHOD_LIST *tanMethodList;
};
static void GWENHYWFAR_CB AH_EditUserPinTanDialog_FreeData(void *bp, void *p);
static int GWENHYWFAR_CB AH_EditUserPinTanDialog_SignalHandler(GWEN_DIALOG *dlg,
GWEN_DIALOG_EVENTTYPE t,
const char *sender);
#endif
|
/*
|==============================================================================
| Copyright (C) 2004-2011 Prosilica. All Rights Reserved.
|
| Redistribution of this header file, in original or modified form, without
| prior written consent of Prosilica is prohibited.
|
|==============================================================================
|
| File: ImageLib.h
|
| Project/lib: PvAPI
|
| Target: Win32, Linux, QNX
|
| Description: Provide a function to save a Frame in a TIFF image file.
|
| Notes:
|
|
| LIBTIFF Use and Copyright
| ~~~~~~~~~~~~~~~~~~~~~~~~~
|
| Copyright (c) 1988-1997 Sam Leffler
| Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
| Permission to use, copy, modify, distribute, and sell this software and
| its documentation for any purpose is hereby granted without fee, provided
| that (i) the above copyright notices and this permission notice appear in
| all copies of the software and related documentation, and (ii) the names of
| Sam Leffler and Silicon Graphics may not be used in any advertising or
| publicity relating to the software without the specific, prior written
| permission of Sam Leffler and Silicon Graphics.
|
| THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
| EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
| WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
| IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
| ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
| OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
| WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
| LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
| OF THIS SOFTWARE.
|
|==============================================================================
| dd/mon/yy Author Notes
|------------------------------------------------------------------------------
| 01/01/04 JLV Original.
| 24/03/11 AKA Updated to LibTIFF 3.9.4. Now builds with VC++ 2008, 2010.
|==============================================================================
*/
#ifndef IMAGELIB_H_INCLUDE
#define IMAGELIB_H_INCLUDE
//===== INCLUDE FILES =========================================================
#include "PvApi.h"
#ifdef __cplusplus
extern "C" {
#endif
//===== FUNCTION PROTOTYPES ===================================================
bool ImageWriteTiff(const char* filename, const tPvFrame* pFrame);
}
#endif // IMAGELIB_H_INCLUDE
|
#include <sys/file.h>
#include <sys/fprop.h>
#include <sys/mman.h>
#include <format.h>
#include <main.h>
#include <util.h>
ERRTAG("sparse");
static void skip(int fd, long len)
{
off_t temp;
sys_llseek(fd, len, &temp, SEEK_CUR);
}
static void fill(int fd, long len, int rn)
{
char buf[len];
int rd;
if((rd = sys_read(rn, buf, len)) < 0)
fail("read", NULL, rd);
if(rd < len)
fail("incomplete read", NULL, rd);
writeall(fd, buf, len);
}
int main(int argc, char** argv)
{
int fd, rn;
char* name = argv[1];
char* rand = "/dev/urandom";
if(argc != 2)
fail("bad call", NULL, 0);
if((fd = sys_open3(name, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0)
fail(NULL, name, fd);
if((rn = sys_open(rand, O_RDONLY)) < 0)
fail(NULL, rand, rn);
skip(fd, 10*PAGE);
fill(fd, 5*PAGE, rn);
skip(fd, 20*PAGE);
fill(fd, 15*PAGE, rn);
skip(fd, 1*PAGE);
return 0;
}
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "n1_message_class.h"
char* OpenAPI_n1_message_class_ToString(OpenAPI_n1_message_class_e n1_message_class)
{
const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP", "LCS" };
size_t sizeofArray = sizeof(n1_message_classArray) / sizeof(n1_message_classArray[0]);
if (n1_message_class < sizeofArray)
return (char *)n1_message_classArray[n1_message_class];
else
return (char *)"Unknown";
}
OpenAPI_n1_message_class_e OpenAPI_n1_message_class_FromString(char* n1_message_class)
{
int stringToReturn = 0;
const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP", "LCS" };
size_t sizeofArray = sizeof(n1_message_classArray) / sizeof(n1_message_classArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(n1_message_class, n1_message_classArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}
|
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
static GFXINLINE void init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
(void) state;
}
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
(void) index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
(void) data;
}
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
}
#endif /* _GDISP_LLD_BOARD_H */
|
/* libkrellm/glcd
|
| Copyright (C) 2013-2015 Bill Wilson billw@gkrellm.net
|
| libkrellm/glcd is free software: you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| (at your option) any later version.
|
| libkrellm/glcd is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with the libkrellm. If not, see <http://www.gnu.org/licenses/>.
|
*/
#ifdef HAVE_WIRINGPI
#include <inttypes.h>
#include <unistd.h>
#include "glcd-widgets.h"
#include "utils.h"
extern SList *glcd_widget_list;
/* ====================================================== */
/* make static after debug */
GlcdEventTouch event_touch;
void
glcd_event_handler(Glcd *glcd)
{
TouchCalibratePoint display, raw;
if (glcd_touch_data_available(glcd))
{
glcd_touch_read_conversion(glcd, TRUE);
event_touch.x_raw = raw.x = glcd_touch_get_raw_x(glcd);
event_touch.y_raw = raw.y = glcd_touch_get_raw_y(glcd);
touch_calibrate_point(&display, &raw, &glcd->touch.calibrate_matrix);
event_touch.x = display.x;
event_touch.y = display.y;
// event_touch.x = glcd_touch_get_display_x(glcd);
// event_touch.y = glcd_touch_get_display_y(glcd);
// event_touch.x_raw = glcd_touch_get_raw_x(glcd);
// event_touch.y_raw = glcd_touch_get_raw_y(glcd);
// event_touch.time = millis();
event_touch.valid = TRUE;
}
}
GlcdEventTouch *
glcd_event_get_touch(Glcd *glcd)
{
GlcdEventTouch *te = NULL;
glcd_event_handler(glcd);
if (event_touch.valid)
te = &event_touch;
event_touch.valid = FALSE;
return te;
}
void
glcd_event_wait_for_touch_release(Glcd *glcd)
{
while (1)
{
usleep(10000);
if (!glcd_touch_data_available(glcd))
break;
glcd_touch_read_conversion(glcd, FALSE);
}
}
GlcdButton *
glcd_event_touch_in_button(GlcdEventTouch *te)
{
SList *list;
GlcdWidget *pWid;
int x, y;
for (list = glcd_widget_list; list; list = list->next)
{
pWid = (GlcdWidget *) list->data;
if (pWid->type != WIDGET_TYPE_BUTTON)
continue;
x = pWid->x + pWid->draw_area->x0;
y = pWid->y + pWid->draw_area->y0;
if ( te->x >= x && te->x <= x + pWid->dx
&& te->y >= y && te->y <= y + pWid->dy
)
return (GlcdButton *) pWid;
}
return NULL;
}
GlcdSlider *
glcd_event_touch_in_slider(GlcdEventTouch *te)
{
GlcdWidget *pWid;
GlcdSlider *pSld;
SList *list;
int x, y;
for (list = glcd_widget_list; list; list = list->next)
{
pWid = (GlcdWidget *) list->data;
if (pWid->type != WIDGET_TYPE_SLIDER)
continue;
pSld = (GlcdSlider *) pWid;
x = pWid->x + pWid->draw_area->x0;
y = pWid->y + pWid->draw_area->y0;
if ( te->x >= x && te->x < x + pWid->dx
&& te->y >= y && te->y < y + pWid->dy
)
{
te->x -= pWid->draw_area->x0;
te->y -= pWid->draw_area->y0;
return pSld;
}
}
return NULL;
}
boolean
glcd_event_check(Glcd *glcd)
{
GlcdEventTouch *pEv;
GlcdWidget *pWid;
GlcdButton *pBut;
GlcdSlider *pSld;
GlcdRegion *pBR;
int dv, dt, value;
if ((pEv = glcd_event_get_touch(glcd)) == NULL)
return FALSE;
if ((pBut = glcd_event_touch_in_button(pEv)) != NULL)
{
glcd_button_draw(pBut, BUTTON_DOWN);
glcd->frame_buffer_update(glcd);
glcd_event_wait_for_touch_release(glcd);
glcd_button_draw(pBut, BUTTON_UP);
glcd->frame_buffer_update(glcd);
if (pBut->callback)
(*pBut->callback)(pBut);
}
else if ((pSld = glcd_event_touch_in_slider(pEv)) != NULL)
{
pWid = (GlcdWidget *) pSld;
pBR = &pSld->bar_region;
/* A slider touch event region is the vertical bar region, but the
| knob can only be adjusted by the slide_length (bar length minus
| the knob length). So, scale touches within this region from
| value_min to value_max.
*/
if (pWid->flags & WIDGET_FLAG_H_PACK)
dv = pBR->y + (pSld->knob_length /2) + pSld->slide_length - pEv->y;
else
dv = pEv->x - (pBR->x + pSld->knob_length / 2);
if (dv < 0)
dv = 0;
else if (dv > pSld->slide_length)
dv = pSld->slide_length;
value = pSld->value_min + (pSld->value_max - pSld->value_min) * dv
/ pSld->slide_length;
/* Update low changes in slider value at a slower rate than
| higher value changes to try to smooth the slider action.
*/
dv = abs(value - pSld->value);
dt = pEv->time - pSld->time;
if ( dv > 5 /* full speed slider */
|| (dv > 3 && dt > 200) /* 5 updates/sec */
|| (dv > 0 && dt > 333) /* 3 updates/sec */
)
{
glcd_slider_draw(pSld);
pSld->value = value;
pSld->time = pEv->time;
if (pSld->callback)
(*pSld->callback)(pSld);
}
}
return TRUE;
}
#endif /* WIRINGPI */
|
/******************************************************************************
Curse of War -- Real Time Strategy Game for Linux.
Copyright (C) 2013 Alexey Nikolaev.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef _GRID_H
#define _GRID_H
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "common.h"
#define FLAG_ON 1
#define FLAG_OFF 0
#define FLAG_POWER 8
#define RANDOM_INEQUALITY -1
#define MAX_AVLBL_LOC 7
/* enum unit_class
*
* Units/Creatures that can be controlled by the players:
* Only citizens are available. */
enum unit_class { citizen=0 };
/* enum tile_class
*
* Territory classes:
* mountain is a natural barrier
* mine is a source of gold
* grassland is a habitable territory that does not have cities
* village, town, and castle are three kinds of cities with different population growth rate
* (castles have the highest rate, while villages have the lowest).
*
* */
enum tile_class { abyss=0, mountain=1, mine=2, grassland=3, village=4, town=5, castle=6 };
/* is_a_city(t)
returns 1 for village, town, or castle */
int is_a_city(enum tile_class t);
/* is_inhabitable(t)
returns 1 for grassland, village, town, or castle */
int is_inhabitable(enum tile_class t);
int is_visible(enum tile_class t);
enum stencil {st_rhombus, st_rect, st_hex};
/* stencil_avlbl_loc_num (st)
* number of available locations for the stencil st */
int stencil_avlbl_loc_num (enum stencil st);
/* struct tile
*
* Tiles are the smallest pieces of the map.
*
* Components:
* cl is the tile's territory class,
* pl is the id if the player, owner of the tile
* units is the array that contains information about the population of the tile
* (info for all players, and for all unit classes)
*
* */
struct tile {
enum tile_class cl;
int pl;
int units[MAX_PLAYER][MAX_CLASS];
};
/* struct loc
*
* Location.
*
* Components:
* i (horizontal axis)
* j (vertical axis)
* */
struct loc {
int i;
int j;
};
/* There are 6 possible directions to move from a tile. Hexagonal geometry. */
extern const struct loc dirs[DIRECTIONS];
/* struct grid
*
* 2D Array of tiles + width and height information.
* The map is stored in this structure.
*/
struct grid {
int width;
int height;
struct tile tiles[MAX_WIDTH][MAX_HEIGHT];
};
/* grid_init (&g, w, h)
*
* Initialize the grid g. Set its width to w and height to h.
* It also generates the tiles: Random mountains, mines and cities
*/
void grid_init(struct grid *g, int w, int h);
void apply_stencil(enum stencil st, struct grid *g, int d, struct loc loc[MAX_AVLBL_LOC], int *avlbl_loc_num);
/* conflict (&g, loc_arr, avlbl_loc_num, players, players_num, human_player)
*
* Enhances an already initialized grid.
* Places at most 4 players at the corners of the map, gives them a castle and 2 mines nearby.
* One of those players is always controlled by a human player.
*
* players is the array of the ids of the possible opponents (represented by integers, usually 1 < i < MAX_PLAYER),
* players_num is the size of the players array
*
* locations_num is the number of starting locations (can be equal to 2, 3, or 4)
* human_player is the id of the human player (usually = 1)
*
* conditions = {1, ... number of available locations}, 1 = the best.
*
* ineq = inequality from 0 to 4.
*
*/
int conflict (struct grid *g, struct loc loc_arr[], int available_loc_num,
int players[], int players_num, int locations_num, int ui_players[], int ui_players_num,
int conditions, int ineq);
/* is_conected(&g)
* Check connectedness of the grid */
int is_connected (struct grid *g);
/* struct flag_grid
*
* Similar to the struct grid, but stores information about player's flags.
* Each player has his own struct grid_flag.
*
* flag[i][j] == 1, if there is a flag.
*
* call[i][j] determine the power of attraction to this location.
* Must be updated when flags are added or removed.
*/
struct flag_grid {
int width;
int height;
int flag [MAX_WIDTH][MAX_HEIGHT];
int call [MAX_WIDTH][MAX_HEIGHT];
};
/* flag_grid_init (&fg, w, h)
*
* A simple initialization of the flag grid fg.
*/
void flag_grid_init(struct flag_grid *fg, int w, int h);
/* spread(&g, u, v, x, y, val, factor)
* and
* even(&g, u, x, y, val)
*
* Helper functions, primarily are used for maintaining call[i][j] for flag grids
*/
void spread (struct grid *g, int u[MAX_WIDTH][MAX_HEIGHT], int v[MAX_WIDTH][MAX_HEIGHT], int x, int y, int val, int factor);
void even (struct grid *g, int v[MAX_WIDTH][MAX_HEIGHT], int x, int y, int val);
/* add_flag (&g, &fg, x, y, v)
*
* Adds a flag to the flag grid fg at the location (x,y) with power v.
*/
void add_flag (struct grid *g, struct flag_grid *fg, int x, int y, int val);
/* remove_flag (&g, &fg, x, y, v)
*
* Removes a flag from the flag grid fg at the location (x,y) with power v.
*/
void remove_flag (struct grid *g, struct flag_grid *fg, int x, int y, int val);
/* remove_flags_with_prob (&g, &fg, prob)
*
* Iterates over all tiles, and removes flags with probability prob.
* That is, it removes all flags if prob==1.
*/
void remove_flags_with_prob (struct grid *g, struct flag_grid *fg, float prob);
#endif
|
/* vim: set expandtab ts=4 sw=4: */
/*
* You may redistribute this program and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AddrInterfaceAdapter_H
#define AddrInterfaceAdapter_H
#include "interface/Interface.h"
#include "interface/addressable/AddrInterface.h"
#include "memory/Allocator.h"
struct AddrInterface* AddrInterfaceAdapter_new(struct Interface* toWrap, struct Allocator* alloc);
#endif
|
/* w32help.h - W32 speicif functions
* Copyright (C) 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute and/or modify this
* part of GnuPG 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.
*
* GnuPG 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 copies of the GNU General Public License
* and the GNU Lesser General Public License along with this program;
* if not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_COMMON_W32HELP_H
#define GNUPG_COMMON_W32HELP_H
#ifdef HAVE_W32_SYSTEM
/*-- w32-reg.c --*/
char *read_w32_registry_string (const char *root,
const char *dir, const char *name );
/* Other stuff. */
#ifdef HAVE_W32CE_SYSTEM
/* Setmode is missing in cegcc but available since CE 5.0. */
int _setmode (int handle, int mode);
# define setmode(a,b) _setmode ((a),(b))
static inline int
umask (int a)
{
(void)a;
return 0;
}
#endif /*HAVE_W32CE_SYSTEM*/
#endif /*HAVE_W32_SYSTEM*/
#endif /*GNUPG_COMMON_MISCHELP_H*/
|
#ifndef _LINUX_AUXVEC_H
#define _LINUX_AUXVEC_H
#include <asm/auxvec.h>
/* Symbolic values for the entries in the auxiliary table
put on the initial stack */
#define AT_NULL 0 /* end of vector */
#define AT_IGNORE 1 /* entry should be ignored */
#define AT_EXECFD 2 /* file descriptor of program */
#define AT_PHDR 3 /* program headers for program */
#define AT_PHENT 4 /* size of program header entry */
#define AT_PHNUM 5 /* number of program headers */
#define AT_PAGESZ 6 /* system page size */
#define AT_BASE 7 /* base address of interpreter */
#define AT_FLAGS 8 /* flags */
#define AT_ENTRY 9 /* entry point of program */
#define AT_NOTELF 10 /* program is not ELF */
#define AT_UID 11 /* real uid */
#define AT_EUID 12 /* effective uid */
#define AT_GID 13 /* real gid */
#define AT_EGID 14 /* effective gid */
#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
#define AT_CLKTCK 17 /* frequency at which times() increments */
/* AT_* values 18 through 22 are reserved */
#define AT_SECURE 23 /* secure mode boolean */
#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
* differ from AT_PLATFORM. */
#define AT_RANDOM 25 /* address of 16 random bytes */
#define AT_HWCAP2 26 /* extension of AT_HWCAP */
#define AT_EXECFN 31 /* filename of program */
#endif /* _LINUX_AUXVEC_H */
|
//
//
//
#ifndef __LPVISUAL_H__
#define __LPVISUAL_H__
#include "display.h"
#include <lpmd/plugin.h>
#include <lpmd/visualizer.h>
#include <lpmd/array.h>
using namespace lpmd;
class LPVisual:public lpmd::Visualizer, public lpmd::Plugin
{
public:
//Metodos Generales
LPVisual(std::string args);
~LPVisual();
void ShowHelp() const;
//Metodos Propios de modulo lpvisual
void SpawnWindowThread(const lpmd::Simulation & sim);
void Apply(const lpmd::Simulation & sim);
private:
bool active, applied_once;
Display * dispman;
void * shm;
long shmsize, clrsize, datasize, ptsize, stsize, bgsize, gbgsize; // size of shared memory blocks
Array<std::string> tags;
Array<std::string> plot;
Array<std::string> xrange;
Array<std::string> yrange;
Array<std::string> camerapos;
Array<std::string> cameraobj;
Array<std::string> cameraup;
};
#endif
|
/* Output Graphviz specification of a state machine generated by Bison.
Copyright (C) 2006, 2010-2013 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert and Satya Kiran Popuri. */
#ifndef GRAPHVIZ_H_
# define GRAPHVIZ_H_
#include "state.h"
/** Begin a Dot graph.
*
* \param fout output stream.
*/
void start_graph (FILE *fout);
/** Output a Dot node.
*
* \param id identifier of the node
* \param label human readable label of the node (no Dot escaping needed).
* \param fout output stream.
*/
void output_node (int id, char const *label, FILE *fout);
/** Output a Dot edge.
* \param source id of the source node
* \param destination id of the target node
* \param label human readable label of the edge
* (no Dot escaping needed). Can be 0.
* \param style Dot style of the edge (e.g., "dotted" or "solid").
* \param fout output stream.
*/
void output_edge (int source, int destination, char const *label,
char const *style, FILE *fout);
/** Output a reduction.
* \param s current state
* \param reds the set of reductions
* \param fout output stream.
*/
void output_red (state const *s, reductions const *reds, FILE *fout);
/** End a Dot graph.
*
* \param fout output stream.
*/
void finish_graph (FILE *fout);
/** Escape a lookahead token.
*
* \param name the token.
*/
char const *escape (char const *name);
#endif /* ! GRAPHVIZ_H_ */
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by plResBrowser.rc
//
#define IDI_ICON1 101
#define IDI_APPICON 101
#define IDR_APPMENU 102
#define IDD_INFODLG 103
#define IDD_ABOUT 104
#define IDR_ACCELERATOR1 106
#define IDD_FINDOBJ 107
#define IDI_INDEXICON 108
#define IDI_DATAICON 109
#define IDI_PATCHICON 110
#define IDI_MERGEDDATAICON 111
#define IDI_MERGEDINDEXICON 112
#define IDC_NAME 1000
#define IDC_AGE 1001
#define IDC_CHAPTER 1002
#define IDC_PAGE 1003
#define IDC_LOCATION 1004
#define IDC_RESERVED 1005
#define IDC_CLASS 1006
#define IDC_STARTPOS 1007
#define IDC_LENGTH 1008
#define IDC_CANLOAD 1009
#define IDC_STARTPOS_LABEL 1010
#define IDC_SIZE_LABEL 1011
#define IDC_INTERLEAVED 1012
#define IDC_RELVERSION 1013
#define IDC_SEARCHSTRING 1014
#define IDC_DATAVERSION 1014
#define IDC_IDXCHECKSUM 1015
#define IDC_DATACHECKSUM 1016
#define IDC_CHECKSUMTYPE 1017
#define IDC_SHOWASHEX 1018
#define IDC_SCROLLBAR 1019
#define IDC_PARTIALPATCH 1019
#define IDC_FRAME 1020
#define IDC_HEADERPATCH 1020
#define IDC_COPIED 1021
#define IDC_NEW 1022
#define IDC_ZOOM 1023
#define IDC_ZOOMSLIDER 1024
#define IDC_SEGINFO 1025
#define IDC_LOCAL_ONLY 1025
#define IDC_BUILTIN 1026
#define IDC_VOLATILE 1027
#define ID_FILE_OPEN 40001
#define ID_FILE_EXIT 40002
#define ID_FILE_OPENDIRECTORY 40003
#define ID_FILE_ABOUT 40004
#define ID_FILE_FINDOBJECT 40005
#define ID_FILE_FINDNEXT 40006
#define ID_FILE_VERIFYPAGE 40007
#define ID_FILE_ONLYLOAD 40008
#define ID_FILE_SAVESELECTED 40009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40010
#define _APS_NEXT_CONTROL_VALUE 1026
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
//
// some of the pin mapping functions of the Teensduino extension to the Arduino IDE
// do not function the same as the other Arduino extensions
//
#define TEENSYDUINO_IDE
//digitalPinToTimer(pin) function works like Arduino but Timers are not defined
#define TIMER0B 1
#define TIMER1A 7
#define TIMER1B 8
#define TIMER1C 9
#define TIMER2A 6
#define TIMER2B 2
#define TIMER3A 5
#define TIMER3B 4
#define TIMER3C 3
// digitalPinToPort function just returns the pin number so need to create our own
#define PA 1
#define PB 2
#define PC 3
#define PD 4
#define PE 5
#define PF 6
#undef digitalPinToPort
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, // 0 - PD0 - INT0 - PWM
PD, // 1 - PD1 - INT1 - PWM
PD, // 2 - PD2 - INT2 - RX
PD, // 3 - PD3 - INT3 - TX
PD, // 4 - PD4
PD, // 5 - PD5
PD, // 6 - PD6
PD, // 7 - PD7
PE, // 8 - PE0
PE, // 9 - PE1
PC, // 10 - PC0
PC, // 11 - PC1
PC, // 12 - PC2
PC, // 13 - PC3
PC, // 14 - PC4 - PWM
PC, // 15 - PC5 - PWM
PC, // 16 - PC6 - PWM
PC, // 17 - PC7
PE, // 18 - PE6 - INT6
PE, // 19 - PE7 - INT7
PB, // 20 - PB0
PB, // 21 - PB1
PB, // 22 - PB2
PB, // 23 - PB3
PB, // 24 - PB4 - PWM
PB, // 25 - PB5 - PWM
PB, // 26 - PB6 - PWM
PB, // 27 - PB7 - PWM
PA, // 28 - PA0
PA, // 29 - PA1
PA, // 30 - PA2
PA, // 31 - PA3
PA, // 32 - PA4
PA, // 33 - PA5
PA, // 34 - PA6
PA, // 35 - PA7
PE, // 36 - PE4 - INT4
PE, // 37 - PE5 - INT5
PF, // 38 - PF0 - A0
PF, // 39 - PF1 - A1
PF, // 40 - PF2 - A2
PF, // 41 - PF3 - A3
PF, // 42 - PF4 - A4
PF, // 43 - PF5 - A5
PF, // 44 - PF6 - A6
PF, // 45 - PF7 - A7
PE, // 46 - PE2 (not defined in teensyduino)
PE, // 47 - PE3 (not defined in teensyduino)
};
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
// digitalPinToBitMask(pin) is OK
#define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
// disable the PWMs so we can use it as is
// portModeRegister(pin) is OK
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "xmlprotocol/error.h"
#include <utils/pathchooser.h>
#include <QDialog>
QT_BEGIN_NAMESPACE
class QPlainTextEdit;
class QDialogButtonBox;
QT_END_NAMESPACE
namespace Valgrind {
namespace Internal {
class MemcheckErrorView;
class ValgrindBaseSettings;
class SuppressionDialog : public QDialog
{
Q_OBJECT
public:
SuppressionDialog(MemcheckErrorView *view,
const QList<XmlProtocol::Error> &errors);
static void maybeShow(MemcheckErrorView *view);
private slots:
void validate();
private:
void accept();
void reject();
MemcheckErrorView *m_view;
ValgrindBaseSettings *m_settings;
bool m_cleanupIfCanceled;
QList<XmlProtocol::Error> m_errors;
Utils::PathChooser *m_fileChooser;
QPlainTextEdit *m_suppressionEdit;
QDialogButtonBox *m_buttonBox;
};
} // namespace Internal
} // namespace Valgrind
|
#ifndef __JVX_DSP_BASE_RANGECHECK__H__
#define __JVX_DSP_BASE_RANGECHECK__H__
#include "jvx_dsp_base_types.h"
void jvx_rangeCheck_jvxData(jvxData *x,
jvxData min,
jvxData max,
const char *moduleName,
const char *prmName);
void jvx_rangeCheck_int(int *x,
int min,
int max,
const char *moduleName,
const char *prmName);
void jvx_rangeCheck_int16(jvxInt16 *x,
jvxInt16 min,
jvxInt16 max,
const char *moduleName,
const char *prmName);
void jvx_rangeCheck_jvxSize(jvxSize *x,
jvxSize min,
jvxSize max,
const char *moduleName,
const char *prmName);
#endif
|
/*
* Wapiti - A linear-chain CRF tool
*
* Copyright (c) 2009-2013 CNRS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef options_h
#define options_h
#include <stdint.h>
#include <stdbool.h>
#include "wapiti.h"
/* opt_t:
* This structure hold all user configurable parameter for Wapiti and is
* filled with parameters from command line.
*/
typedef struct opt_s opt_t;
struct opt_s {
int mode;
char *input, *output;
bool maxent;
// Options for training
char *type;
char *algo, *pattern;
char *model, *devel;
char *rstate, *sstate;
bool compact, sparse;
uint32_t nthread;
uint32_t jobsize;
uint32_t maxiter;
double rho1, rho2;
// Window size criterion
uint32_t objwin;
uint32_t stopwin;
double stopeps;
// Options specific to L-BFGS
struct {
bool clip;
uint32_t histsz;
uint32_t maxls;
} lbfgs;
// Options specific to SGD-L1
struct {
double eta0;
double alpha;
} sgdl1;
// Options specific to BCD
struct {
double kappa;
} bcd;
// Options specific to RPROP
struct {
double stpmin;
double stpmax;
double stpinc;
double stpdec;
bool cutoff;
} rprop;
// Options for labelling
bool label;
bool check;
bool outsc;
bool lblpost;
uint32_t nbest;
bool force;
// Options for model dump
int prec;
bool all;
};
extern const opt_t opt_defaults;
void opt_parse(int argc, char *argv[argc], opt_t *opt);
#endif
|
/*
* post_fsm.h
*
* Created: 31/01/2014 03:28:34
* Author: Xevel
*/
#ifndef POST_FSM_H_
#define POST_FSM_H_
#include "../common.h"
#define BACKEND_PORT (80)
#ifdef DEV
#define BACKEND_NAME "api-test.airboxlab.com"
#else
#define BACKEND_NAME "api.airboxlab.com"
#endif
#define CONNECT_TIMEOUT_MS (15000)
#define GET_BACKEND_IP_TIMEOUT_MS (3000)
#define TCP_CONNECT_RETRIES (3)
#define HTTP_REPLY_TIMEOUT_MS (3000)
#define HTTP_RESPONSE_EXPECTED "HTTP/1.1 200"
#define HTTP_RESPONSE_EXPECTED_LEN (12)
#define SET_PROFILE_AND_RETRY (0) // set to 1 to do a profile setting and retry when the CC3000 could not connect to the AP or get an IP.
extern uint32_t backend_ip;
extern uint8_t returned_led_state;
uint8_t wifi_set_profile( char* ssid, char* password, uint8_t encrypt_mode);
uint8_t post_fsm();
void reset_fsm();
void end_fsm();
uint8_t post_fsm_error();
#endif /* POST_FSM_H_ */ |
/*
Unix SMB/CIFS implementation.
NT Domain Authentication SMB / MSRPC client
Copyright (C) Andrew Tridgell 1992-2000
Copyright (C) Jeremy Allison 1998.
Largely re-written by Jeremy Allison (C) 2005.
Copyright (C) Guenther Deschner 2008.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _RPC_CLIENT_CLI_NETLOGON_H_
#define _RPC_CLIENT_CLI_NETLOGON_H_
struct cli_state;
struct messaging_context;
struct cli_credentials;
struct netlogon_creds_cli_context;
struct dcerpc_binding_handle;
#include "librpc/rpc/rpc_common.h"
/* The following definitions come from rpc_client/cli_netlogon.c */
NTSTATUS rpccli_pre_open_netlogon_creds(void);
NTSTATUS rpccli_create_netlogon_creds_ctx(
struct cli_credentials *creds,
const char *server_computer,
struct messaging_context *msg_ctx,
TALLOC_CTX *mem_ctx,
struct netlogon_creds_cli_context **creds_ctx);
NTSTATUS rpccli_setup_netlogon_creds_locked(
struct cli_state *cli,
enum dcerpc_transport_t transport,
struct netlogon_creds_cli_context *creds_ctx,
bool force_reauth,
struct cli_credentials *cli_creds,
uint32_t *negotiate_flags);
NTSTATUS rpccli_setup_netlogon_creds(
struct cli_state *cli,
enum dcerpc_transport_t transport,
struct netlogon_creds_cli_context *creds_ctx,
bool force_reauth,
struct cli_credentials *cli_creds);
NTSTATUS rpccli_connect_netlogon(
struct cli_state *cli,
enum dcerpc_transport_t transport,
struct netlogon_creds_cli_context *creds_ctx,
bool force_reauth,
struct cli_credentials *trust_creds,
struct rpc_pipe_client **_rpccli);
NTSTATUS rpccli_netlogon_password_logon(
struct netlogon_creds_cli_context *creds,
struct dcerpc_binding_handle *binding_handle,
TALLOC_CTX *mem_ctx,
uint32_t logon_parameters,
const char *domain,
const char *username,
const char *password,
const char *workstation,
const uint64_t logon_id,
enum netr_LogonInfoClass logon_type,
uint8_t *authoritative,
uint32_t *flags,
uint16_t *_validation_level,
union netr_Validation **_validation);
NTSTATUS rpccli_netlogon_network_logon(
struct netlogon_creds_cli_context *creds_ctx,
struct dcerpc_binding_handle *binding_handle,
TALLOC_CTX *mem_ctx,
uint32_t logon_parameters,
const char *username,
const char *domain,
const char *workstation,
const uint64_t logon_id,
const uint8_t chal[8],
DATA_BLOB lm_response,
DATA_BLOB nt_response,
enum netr_LogonInfoClass logon_type,
uint8_t *authoritative,
uint32_t *flags,
uint16_t *_validation_level,
union netr_Validation **_validation);
NTSTATUS rpccli_netlogon_interactive_logon(
struct netlogon_creds_cli_context *creds_ctx,
struct dcerpc_binding_handle *binding_handle,
TALLOC_CTX *mem_ctx,
uint32_t logon_parameters,
const char *username,
const char *domain,
const char *workstation,
const uint64_t logon_id,
DATA_BLOB lm_hash,
DATA_BLOB nt_hash,
enum netr_LogonInfoClass logon_type,
uint8_t *authoritative,
uint32_t *flags,
uint16_t *_validation_level,
union netr_Validation **_validation);
#endif /* _RPC_CLIENT_CLI_NETLOGON_H_ */
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsICancelable.idl
*/
#ifndef __gen_nsICancelable_h__
#define __gen_nsICancelable_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsICancelable */
#define NS_ICANCELABLE_IID_STR "d94ac0a0-bb18-46b8-844e-84159064b0bd"
#define NS_ICANCELABLE_IID \
{0xd94ac0a0, 0xbb18, 0x46b8, \
{ 0x84, 0x4e, 0x84, 0x15, 0x90, 0x64, 0xb0, 0xbd }}
class NS_NO_VTABLE nsICancelable : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANCELABLE_IID)
/* void cancel (in nsresult aReason); */
NS_IMETHOD Cancel(nsresult aReason) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICancelable, NS_ICANCELABLE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICANCELABLE \
NS_IMETHOD Cancel(nsresult aReason);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICANCELABLE(_to) \
NS_IMETHOD Cancel(nsresult aReason) { return _to Cancel(aReason); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICANCELABLE(_to) \
NS_IMETHOD Cancel(nsresult aReason) { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(aReason); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsCancelable : public nsICancelable
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICANCELABLE
nsCancelable();
private:
~nsCancelable();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsCancelable, nsICancelable)
nsCancelable::nsCancelable()
{
/* member initializers and constructor code */
}
nsCancelable::~nsCancelable()
{
/* destructor code */
}
/* void cancel (in nsresult aReason); */
NS_IMETHODIMP nsCancelable::Cancel(nsresult aReason)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsICancelable_h__ */
|
#ifndef MCP3008SPI_H
#include <time.h> //needed for clock_gettime
#define MCP3008SPI_H
void mcp3008Spi(char* devspi, unsigned char spiMode, unsigned int spiSpeed, unsigned char spibitsPerWord);
int spiOpen(char* devspi);
int spiClose();
int spiWriteRead( unsigned char *data, int length);
int get_mcp3008_channels(int vals[], int nchannels, struct timespec* ptp);
#endif
|
/*
* Copyright 2011-2012 Arx Libertatis Team (see the AUTHORS file)
*
* This file is part of Arx Libertatis.
*
* Arx Libertatis is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Arx Libertatis 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 Arx Libertatis. If not, see <http://www.gnu.org/licenses/>.
*/
/* Based on:
===========================================================================
ARX FATALIS GPL Source Code
Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company.
This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code').
Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code. If not, see
<http://www.gnu.org/licenses/>.
In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these
additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx
Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o
ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef ARX_IO_SCREENSHOT_H
#define ARX_IO_SCREENSHOT_H
#include "io/fs/FilePath.h"
class SnapShot {
public:
explicit SnapShot(const fs::path & name);
~SnapShot();
fs::path getNextFilePath();
bool GetSnapShot();
private:
fs::path m_basePath;
};
void InitSnapShot(const fs::path & name);
void GetSnapShot();
void FreeSnapShot();
#endif // ARX_IO_SCREENSHOT_H
|
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
* 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,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
* redistribution must be conditioned upon including a substantially
* similar Disclaimer requirement for further binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*
* $Id: athchans.c 4094 2009-09-02 20:01:52Z proski $
*/
/*
* athchans [-i interface] chan ...
* (default interface is wifi0).
*/
#include <sys/types.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <getopt.h>
#include <err.h>
#include <include/compat.h>
#include "wireless_copy.h"
#include "net80211/ieee80211.h"
#include "net80211/ieee80211_crypto.h"
#include "net80211/ieee80211_ioctl.h"
static int s = -1;
static const char *progname;
static void
checksocket(void)
{
if (s < 0 ? (s = socket(AF_INET, SOCK_DGRAM, 0)) == -1 : 0)
perror("socket(SOCK_DGRAM)");
}
#define IOCTL_ERR(x) [x - SIOCIWFIRSTPRIV] = "ioctl[" #x "]"
static int
set80211priv(const char *dev, int op, void *data, int len, int show_err)
{
struct iwreq iwr;
checksocket();
memset(&iwr, 0, sizeof(iwr));
strncpy(iwr.ifr_name, dev, IFNAMSIZ);
if (len < IFNAMSIZ) {
/*
* Argument data fits inline; put it there.
*/
memcpy(iwr.u.name, data, len);
} else {
/*
* Argument data too big for inline transfer; setup a
* parameter block instead; the kernel will transfer
* the data for the driver.
*/
iwr.u.data.pointer = data;
iwr.u.data.length = len;
}
if (ioctl(s, op, &iwr) < 0) {
if (show_err) {
static const char *opnames[] = {
IOCTL_ERR(IEEE80211_IOCTL_SETPARAM),
IOCTL_ERR(IEEE80211_IOCTL_GETPARAM),
IOCTL_ERR(IEEE80211_IOCTL_SETMODE),
IOCTL_ERR(IEEE80211_IOCTL_GETMODE),
IOCTL_ERR(IEEE80211_IOCTL_SETWMMPARAMS),
IOCTL_ERR(IEEE80211_IOCTL_GETWMMPARAMS),
IOCTL_ERR(IEEE80211_IOCTL_SETCHANLIST),
IOCTL_ERR(IEEE80211_IOCTL_GETCHANLIST),
IOCTL_ERR(IEEE80211_IOCTL_CHANSWITCH),
IOCTL_ERR(IEEE80211_IOCTL_GETCHANINFO),
IOCTL_ERR(IEEE80211_IOCTL_SETOPTIE),
IOCTL_ERR(IEEE80211_IOCTL_GETOPTIE),
IOCTL_ERR(IEEE80211_IOCTL_SETMLME),
IOCTL_ERR(IEEE80211_IOCTL_RADAR),
IOCTL_ERR(IEEE80211_IOCTL_SETKEY),
IOCTL_ERR(IEEE80211_IOCTL_DELKEY),
IOCTL_ERR(IEEE80211_IOCTL_HALMAP),
IOCTL_ERR(IEEE80211_IOCTL_ADDMAC),
IOCTL_ERR(IEEE80211_IOCTL_DELMAC),
IOCTL_ERR(IEEE80211_IOCTL_WDSADDMAC),
IOCTL_ERR(IEEE80211_IOCTL_WDSDELMAC),
};
if (IEEE80211_IOCTL_SETPARAM <= op &&
op <= IEEE80211_IOCTL_SETCHANLIST)
perror(opnames[op - SIOCIWFIRSTPRIV]);
else
perror("ioctl[unknown???]");
}
return -1;
}
return 0;
}
static void
usage(void)
{
fprintf(stderr, "usage: %s [-i device] channels...\n", progname);
exit(-1);
}
#define MAXCHAN ((int)(sizeof(struct ieee80211req_chanlist) * NBBY))
int
main(int argc, char *argv[])
{
const char *ifname = "wifi0";
struct ieee80211req_chanlist chanlist;
int c;
progname = argv[0];
while ((c = getopt(argc, argv, "i:")) != -1)
switch (c) {
case 'i':
ifname = optarg;
break;
default:
usage();
/*NOTREACHED*/
}
argc -= optind;
argv += optind;
if (argc < 1)
usage();
memset(&chanlist, 0, sizeof(chanlist));
for (; argc > 0; argc--, argv++) {
int first, last, f;
switch (sscanf(argv[0], "%u-%u", &first, &last)) {
case 1:
if (first > MAXCHAN)
errx(-1, "%s: channel %u out of range, max %u",
progname, first, MAXCHAN);
setbit(chanlist.ic_channels, first);
break;
case 2:
if (first > MAXCHAN)
errx(-1, "%s: channel %u out of range, max %u",
progname, first, MAXCHAN);
if (last > MAXCHAN)
errx(-1, "%s: channel %u out of range, max %u",
progname, last, MAXCHAN);
if (first > last)
errx(-1, "%s: void channel range, %u > %u",
progname, first, last);
for (f = first; f <= last; f++)
setbit(chanlist.ic_channels, f);
break;
}
}
return set80211priv(ifname, IEEE80211_IOCTL_SETCHANLIST,
&chanlist, sizeof(chanlist), 1);
}
|
/* api.c
*
*
* Copyright (C) 2017 Jakob Kreuze <jakob@memeware.net>
*
* This file is part of Toxic.
*
* Toxic is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Toxic 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 Toxic. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <dirent.h>
#include <stdint.h>
#include <tox/tox.h>
#include "execute.h"
#include "friendlist.h"
#include "line_info.h"
#include "message_queue.h"
#include "misc_tools.h"
#include "settings.h"
#include "toxic_strings.h"
#include "windows.h"
#ifdef PYTHON
#include "python_api.h"
Tox *user_tox;
static WINDOW *cur_window;
static ToxWindow *self_window;
void api_display(const char *const msg)
{
if (msg == NULL) {
return;
}
self_window = get_active_window();
line_info_add(self_window, NULL, NULL, NULL, SYS_MSG, 0, 0, msg);
}
FriendsList api_get_friendslist(void)
{
return Friends;
}
char *api_get_nick(void)
{
size_t len = tox_self_get_name_size(user_tox);
uint8_t *name = malloc(len + 1);
if (name == NULL) {
return NULL;
}
tox_self_get_name(user_tox, name);
name[len] = '\0';
return (char *) name;
}
Tox_User_Status api_get_status(void)
{
return tox_self_get_status(user_tox);
}
char *api_get_status_message(void)
{
size_t len = tox_self_get_status_message_size(user_tox);
uint8_t *status = malloc(len + 1);
if (status == NULL) {
return NULL;
}
tox_self_get_status_message(user_tox, status);
status[len] = '\0';
return (char *) status;
}
void api_send(const char *msg)
{
if (msg == NULL || self_window->chatwin->cqueue == NULL) {
return;
}
char *name = api_get_nick();
if (name == NULL) {
return;
}
self_window = get_active_window();
snprintf((char *) self_window->chatwin->line, sizeof(self_window->chatwin->line), "%s", msg);
add_line_to_hist(self_window->chatwin);
int id = line_info_add(self_window, true, name, NULL, OUT_MSG, 0, 0, "%s", msg);
cqueue_add(self_window->chatwin->cqueue, msg, strlen(msg), OUT_MSG, id);
free(name);
}
void api_execute(const char *input, int mode)
{
self_window = get_active_window();
execute(cur_window, self_window, user_tox, input, mode);
}
int do_plugin_command(int num_args, char (*args)[MAX_STR_SIZE])
{
return do_python_command(num_args, args);
}
int num_registered_handlers(void)
{
return python_num_registered_handlers();
}
int help_max_width(void)
{
return python_help_max_width();
}
void draw_handler_help(WINDOW *win)
{
python_draw_handler_help(win);
}
void cmd_run(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
FILE *fp;
const char *error_str;
cur_window = window;
self_window = self;
if (argc != 1) {
if (argc < 1) {
error_str = "Path must be specified.";
} else {
error_str = "Only one argument allowed.";
}
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, error_str);
return;
}
fp = fopen(argv[1], "r");
if (fp == NULL) {
error_str = "Path does not exist.";
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, error_str);
return;
}
run_python(fp, argv[1]);
fclose(fp);
}
void invoke_autoruns(WINDOW *window, ToxWindow *self)
{
char abspath_buf[PATH_MAX + 256];
char err_buf[PATH_MAX + 128];
if (user_settings->autorun_path[0] == '\0') {
return;
}
DIR *d = opendir(user_settings->autorun_path);
if (d == NULL) {
snprintf(err_buf, sizeof(err_buf), "Autorun path does not exist: %s", user_settings->autorun_path);
api_display(err_buf);
return;
}
struct dirent *dir = NULL;
cur_window = window;
self_window = self;
while ((dir = readdir(d)) != NULL) {
size_t path_len = strlen(dir->d_name);
if (!strcmp(dir->d_name + path_len - 3, ".py")) {
snprintf(abspath_buf, sizeof(abspath_buf), "%s%s", user_settings->autorun_path, dir->d_name);
FILE *fp = fopen(abspath_buf, "r");
if (fp == NULL) {
snprintf(err_buf, sizeof(err_buf), "Invalid path: %s", abspath_buf);
api_display(err_buf);
continue;
}
run_python(fp, abspath_buf);
fclose(fp);
}
}
closedir(d);
}
#endif /* PYTHON */
|
/*=============================================================================
* Tanca - SelectionWindow.h
*=============================================================================
* Base class widget that is used by several selection dialogs
*=============================================================================
* Tanca ( https://github.com/belegar/tanca ) - This file is part of Tanca
* Copyright (C) 2003-2999 - Anthony Rabine
* anthony.rabine@tarotclub.fr
*
* Tanca is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tanca 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 Tanca. If not, see <http://www.gnu.org/licenses/>.
*
*=============================================================================
*/
#ifndef SELECTION_WINDOW_H
#define SELECTION_WINDOW_H
#include <QDialog>
#include "ui_SelectionWindow.h"
#include "TableHelper.h"
class SelectionWindow : public QDialog
{
Q_OBJECT
public:
SelectionWindow(QWidget *parent, const QString &title, int minSize, int maxSize);
void SetHeader(const QStringList &tableHeader);
void StartUpdate(int size);
void FinishUpdate();
void AddLeftEntry(const std::list<Value> &rowData);
void AddRightEntry(const QString &text);
size_t GetMaxSize() { return mMaxSize; }
void SetName(const QString &name);
void SetNumber(uint32_t number);
uint32_t GetNumber();
QString GetName();
void AllowZeroNumber(bool enable);
// Virtual methods that must be implemented in the child classes
virtual void ClickedRight(int index) = 0;
virtual void ClickedLeft(int id) = 0;
void SetLabelNumber(const QString &name);
private slots:
void slotAccept();
void slotClicked();
void slotPlayerItemActivated();
void slotSelectionItemActivated(QListWidgetItem *item);
void slotFilter();
protected:
Ui::SelectionWindow ui;
TableHelper mHelper;
size_t mMinSize;
size_t mMaxSize;
QStringList mTableHeader;
};
#endif // SELECTION_WINDOW_H
|
#include "truncate.h"
#include "../base.h"
#include "../errno.h"
#include <linux-syscalls/linux.h>
long sys_truncate(const char* path, long long length)
{
int ret;
#ifdef __NR_truncate64
ret = LINUX_SYSCALL(__NR_truncate64, path, LL_ARG(length));
#else
ret = LINUX_SYSCALL(__NR_truncate, path, LL_ARG(length));
#endif
if (ret < 0)
ret = errno_linux_to_bsd(ret);
return ret;
}
|
/*
script.h -- script module;
Copyright (C) 2015, 2016, 2017 Bruno Félix Rezende Ribeiro
<oitofelix@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MININIM_SCRIPT_H
#define MININIM_SCRIPT_H
#define BEGIN_LUA(name) int name (lua_State *L) {
#define END_LUA }
#define DECLARE_LUA(name) int name (lua_State *L)
#define lua_abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \
lua_gettop(L) + (i) + 1)
/* functions */
void init_script (void);
void finalize_script (void);
void lock_thread (void);
void unlock_thread (void);
void *L_check_type (lua_State *L, int index, const char *tname);
bool L_call (lua_State *L, int nargs, int nresults);
bool L_run_hook (lua_State *L);
void L_set_registry_by_ptr (lua_State *L, void *p);
void L_get_registry_by_ptr (lua_State *L, void *p);
int L_set_registry_by_ref (lua_State *L, int *r);
void L_get_registry_by_ref (lua_State *L, int r);
void L_push_interface (lua_State *L, const char *tname);
void L_set_weak_registry_by_ptr (lua_State *L, void *p);
void L_get_weak_registry_by_ptr (lua_State *L, void *p);
void L_gc (lua_State *L);
int L_error_expected_got (lua_State *L, int index,
const char *expected_tname);
/* variables */
extern lua_State *main_L;
#endif /* MININIM_SCRIPT_H */
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SUMMARYPAGE_H
#define SUMMARYPAGE_H
#include <QWidget>
class QLabel;
class QScrollArea;
class QVBoxLayout;
class SummaryPage : public QWidget
{
Q_OBJECT
public:
explicit SummaryPage( QWidget* parent = nullptr );
void onActivate();
private:
QVBoxLayout* m_layout = nullptr;
QWidget* m_contentWidget = nullptr;
void createContentWidget();
QLabel* createTitleLabel( const QString& text ) const;
QLabel* createBodyLabel( const QString& text ) const;
QScrollArea* m_scrollArea;
};
#endif // SUMMARYPAGE_H
|
/*
* This File is part of Pindel; a program to locate genomic variation.
* https://trac.nbic.nl/pindel/
*
* Copyright (C) 2011 Kai Ye
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FARENDSEARCHER_H_
#define FARENDSEARCHER_H_
class FarEndSearcher {
public:
FarEndSearcher(const std::string & CurrentChr_in, SPLIT_READ & Temp_One_Read_in);
void GetFarEnd(const int &in_start, const int &in_end);
void GetFarEnd_OtherStrand(const short &RangeIndex);
void GetFarEnd_SingleStrandUpStream(const short &RangeIndex);
void GetFarEnd_SingleStrandDownStream(const short &RangeIndex);
void SearchFarEndAtPos( const std::string& chromosome, SPLIT_READ& read, const unsigned int searchCenter, const unsigned int range);
virtual ~FarEndSearcher();
private:
void GetFarEnd_General(const int &in_start, const int &in_end, const bool &UseRangeIndex, const short &RangeIndex);
const std::string* CurrentChr;
SPLIT_READ* Temp_One_Read;
};
void SearchFarEndAtPos( const std::string& chromosome, SPLIT_READ& Temp_One_Read, const unsigned int SearchCenter, const unsigned int Range);
#endif /* FARENDSEARCHER_H_ */
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-avx2-128.h"
#include "../common/t1bv_12.c"
|
/*
* Copyright (C) 1999-2002, 2004, 2005, 2007-2009, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef NS_OS_H
#define NS_OS_H 1
/*! \file */
#include <isc/types.h>
void
ns_os_init(const char *progname);
void
ns_os_daemonize(void);
void
ns_os_opendevnull(void);
void
ns_os_closedevnull(void);
void
ns_os_chroot(const char *root);
void
ns_os_inituserinfo(const char *username);
void
ns_os_changeuser(void);
void
ns_os_adjustnofile(void);
void
ns_os_minprivs(void);
FILE *
ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
void
ns_os_writepidfile(const char *filename, isc_boolean_t first_time);
isc_boolean_t
ns_os_issingleton(const char *filename);
void
ns_os_shutdown(void);
isc_result_t
ns_os_gethostname(char *buf, size_t len);
void
ns_os_shutdownmsg(char *command, isc_buffer_t *text);
void
ns_os_tzset(void);
void
ns_os_started(void);
char *
ns_os_uname(void);
#endif /* NS_OS_H */
|
/* The following code is the modified part of the libxslt
* available at http://xmlsoft.org/libxslt
* under the terms of the MIT License
* http://opensource.org/licenses/mit-license.html
*/
/*
* Summary: interface for the XSLT import support
* Description: macros and fuctions needed to implement and
* access the import tree
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_IMPORTS_H__
#define __XML_XSLT_IMPORTS_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_GET_IMPORT_PTR:
*
* A macro to import pointers from the stylesheet cascading order.
*/
#define XSLT_GET_IMPORT_PTR(res, style, name) { \
xsltStylesheetPtr st = style; \
res = NULL; \
while (st != NULL) { \
if (st->name != NULL) { res = st->name; break; } \
st = xsltNextImport(st); \
}}
/**
* XSLT_GET_IMPORT_INT:
*
* A macro to import intergers from the stylesheet cascading order.
*/
#define XSLT_GET_IMPORT_INT(res, style, name) { \
xsltStylesheetPtr st = style; \
res = -1; \
while (st != NULL) { \
if (st->name != -1) { res = st->name; break; } \
st = xsltNextImport(st); \
}}
/*
* Module interfaces
*/
XSLTPUBFUN int XSLTCALL
xsltParseStylesheetImport(xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN int XSLTCALL
xsltParseStylesheetInclude
(xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltNextImport (xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL
xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL
xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
xmlNodePtr node);
XSLTPUBFUN xsltTemplatePtr XSLTCALL
xsltFindTemplate (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *nameURI);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_IMPORTS_H__ */
|
// ======================================================================== //
// Copyright 2009-2014 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#pragma once
#include <vector>
#include <string>
#include "sys/platform.h"
#include "sys/ref.h"
#include "sys/filename.h"
#include "math/color.h"
namespace embree
{
/* virtual interface to image */
class Image : public RefCount {
public:
Image (size_t width, size_t height, const std::string& name) : width(width), height(height), name(name) {}
virtual ~Image() {}
virtual Color4 get(size_t x, size_t y) const = 0;
virtual void set(size_t x, size_t y, const Color4& c) = 0;
void set(size_t x, size_t y, const Color& c) { set(x,y,Color4(c.r,c.g,c.b,1.0f)); }
public:
size_t width,height;
std::string name;
};
/* main image class templated over element type */
template<typename T>
class ImageT : public Image {
public:
/*! create empty image */
ImageT (size_t width = 0, size_t height = 0, const std::string& name = "")
: Image(width,height,name)
{
data = (T*) malloc(width*height*sizeof(T));
memset(data,0,width*height*sizeof(T));
}
/*! create image of constant color */
ImageT (size_t width, size_t height, const T& color, const std::string& name = "")
: Image(width,height,name)
{
data = (T*) malloc(width*height*sizeof(T));
for (size_t i=0; i<width*height; i++) data[i] = color;
}
/*! initialize image from color data */
ImageT (size_t width, size_t height, T* color, const bool copy = true, const std::string& name = "")
: Image(width,height,name)
{
if (copy) {
data = (T*) malloc(width*height*sizeof(T));
for (size_t i=0; i<width*height; i++) data[i] = color[i];
}
else {
data = color;
}
}
/*! image destruction */
virtual ~ImageT() {
if (data) free(data); data = NULL;
}
/*! returns pixel color */
__forceinline Color4 get(size_t x, size_t y) const {
return Color4(data[y*width+x]);
}
/*! sets pixel */
__forceinline void set(size_t x, size_t y, const Color4& c) {
c.set(data[y*width+x]);
}
/*! returns data pointer of image */
__forceinline void* ptr() {
return (void*)data;
}
/*! returns and forgets about data pointer of image */
__forceinline void* steal_ptr() {
T* ptr = data;
data = NULL;
return (void*)ptr;
}
protected:
T* data;
};
/*! Shortcuts for common image types. */
typedef ImageT<Col3c> Image3c;
typedef ImageT<Col3f> Image3f;
typedef ImageT<Col4c> Image4c;
typedef ImageT<Col4f> Image4f;
/*! Generate a JPEG encoded image from a RGB8 buffer in memory. */
void encodeRGB8_to_JPEG(unsigned char *image, size_t width, size_t height, unsigned char **encoded, size_t *capacity);
/*! Loads image from EXR file. */
Ref<Image> loadExr(const FileName& fileName);
/*! Loads image from file. Format is auto detected. */
Ref<Image> loadImage(const FileName& filename, bool cache = false);
/*! Loads image from JPEG file. */
Ref<Image> loadJPEG(const FileName& fileName);
/*! Loads image using ImageMagick. */
Ref<Image> loadMagick(const FileName& fileName);
/*! Loads image from PFM file. */
Ref<Image> loadPFM(const FileName& fileName);
/*! Loads image from PNG file. */
//Ref<Image> loadPNG(const FileName& fileName);
/*! Loads image from PPM file. */
Ref<Image> loadPPM(const FileName& fileName);
/*! Loads image from TIFF file. */
//Ref<Image> loadTIFF(const FileName& fileName);
/*! Store image to EXR file. */
void storeExr(const Ref<Image>& img, const FileName& fileName);
/*! Store image to file. Format is auto detected. */
void storeImage(const Ref<Image>& image, const FileName& filename);
/*! Store image to JPEG file. */
void storeJPEG(const Ref<Image>& img, const FileName& fileName);
/*! Store image to file using ImageMagick. */
void storeMagick(const Ref<Image>& img, const FileName& fileName);
/*! Store image to PFM file. */
void storePFM(const Ref<Image>& img, const FileName& fileName);
/*! Store image to PNG file. */
//void storePNG(const Ref<Image>& img, const FileName& fileName);
/*! Store image to PPM file. */
void storePPM(const Ref<Image>& img, const FileName& fileName);
/*! Store image to TGA file. */
void storeTga(const Ref<Image>& img, const FileName& fileName);
/*! Store image to TIFF file. */
//void storeTIFF(const Ref<Image>& img, const FileName& fileName);
}
|
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2015 Software Radio Systems Limited
*
* \section LICENSE
*
* This file is part of the srsLTE library.
*
* srsLTE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/**********************************************************************************************
* File: turbodecoder.h
*
* Description: Turbo Decoder.
* Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent
* encoders and one turbo code internal interleaver. The coding rate of turbo
* encoder is 1/3.
* MAP_GEN is the MAX-LOG-MAP generic implementation of the decoder.
*
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2
*********************************************************************************************/
#ifndef TURBODECODER_GEN_
#define TURBODECODER_GEN_
#include "srslte/config.h"
#include "srslte/fec/tc_interl.h"
#include "srslte/fec/cbsegm.h"
#define SRSLTE_TCOD_RATE 3
#define SRSLTE_TCOD_TOTALTAIL 12
#define SRSLTE_TCOD_MAX_LEN_CB 6144
#define SRSLTE_TCOD_MAX_LEN_CODED (SRSLTE_TCOD_RATE*SRSLTE_TCOD_MAX_LEN_CB+SRSLTE_TCOD_TOTALTAIL)
typedef struct SRSLTE_API {
int max_long_cb;
float *beta;
} srslte_map_gen_vl_t;
typedef struct SRSLTE_API {
int max_long_cb;
srslte_map_gen_vl_t dec;
float *llr1;
float *llr2;
float *w;
float *syst;
float *parity;
int current_cbidx;
srslte_tc_interl_t interleaver[SRSLTE_NOF_TC_CB_SIZES];
} srslte_tdec_gen_t;
SRSLTE_API int srslte_tdec_gen_init(srslte_tdec_gen_t * h,
uint32_t max_long_cb);
SRSLTE_API void srslte_tdec_gen_free(srslte_tdec_gen_t * h);
SRSLTE_API int srslte_tdec_gen_reset(srslte_tdec_gen_t * h, uint32_t long_cb);
SRSLTE_API void srslte_tdec_gen_iteration(srslte_tdec_gen_t * h,
float * input,
uint32_t long_cb);
SRSLTE_API void srslte_tdec_gen_decision(srslte_tdec_gen_t * h,
uint8_t *output,
uint32_t long_cb);
SRSLTE_API void srslte_tdec_gen_decision_byte(srslte_tdec_gen_t * h,
uint8_t *output,
uint32_t long_cb);
SRSLTE_API int srslte_tdec_gen_run_all(srslte_tdec_gen_t * h,
float * input,
uint8_t *output,
uint32_t nof_iterations,
uint32_t long_cb);
#endif
|
#pragma once
enum class render_layer {
// GEN INTROSPECTOR enum class render_layer
INVALID,
DISABLED,
GROUND,
PLANTED_ITEMS,
SOLID_OBSTACLES,
REMNANTS,
ITEMS_ON_GROUND,
SENTIENCES,
FOREGROUND,
FOREGROUND_GLOWS,
DIM_WANDERING_PIXELS,
CONTINUOUS_SOUNDS,
CONTINUOUS_PARTICLES,
ILLUMINATING_WANDERING_PIXELS,
LIGHTS,
AREA_MARKERS,
POINT_MARKERS,
CALLOUT_MARKERS,
COUNT
// END GEN INTROSPECTOR
}; |
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef MANHATTANSTYLE_H
#define MANHATTANSTYLE_H
#include "core_global.h"
#include <QtGui/QProxyStyle>
QT_BEGIN_NAMESPACE
class QLinearGradient;
class QBrush;
QT_END_NAMESPACE
class ManhattanStylePrivate;
class CORE_EXPORT ManhattanStyle : public QProxyStyle
{
Q_OBJECT
public:
ManhattanStyle(const QString &);
~ManhattanStyle();
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const;
QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const;
SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = 0) const;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = 0) const;
int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const;
QRect itemRect(QPainter *p, const QRect &r, int flags, bool enabled, const QPixmap *pixmap, const QString &text, int len = -1) const;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const;
int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
QPalette standardPalette() const;
void polish(QWidget *widget);
void polish(QPalette &pal);
void polish(QApplication *app);
void unpolish(QWidget *widget);
void unpolish(QApplication *app);
protected Q_SLOTS:
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
private:
ManhattanStylePrivate *d;
Q_DISABLE_COPY(ManhattanStyle)
};
#endif // MANHATTANSTYLE_H
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QLANDMARKCATEGORYREMOVEREQUEST_H
#define QLANDMARKCATEGORYREMOVEREQUEST_H
#include "qlandmarkabstractrequest.h"
QTM_BEGIN_NAMESPACE
class QLandmarkCategoryRemoveRequestPrivate;
class Q_LOCATION_EXPORT QLandmarkCategoryRemoveRequest : public QLandmarkAbstractRequest
{
Q_OBJECT
public:
QLandmarkCategoryRemoveRequest(QLandmarkManager *manager, QObject *parent = 0);
~QLandmarkCategoryRemoveRequest();
QList<QLandmarkCategoryId> categoryIds() const;
void setCategoryIds(const QList<QLandmarkCategoryId> &categoryIds);
void setCategoryId(const QLandmarkCategoryId &categoryId);
void setCategories(const QList<QLandmarkCategory> &categories);
void setCategory(const QLandmarkCategory &category);
QMap<int, QLandmarkManager::Error> errorMap() const;
private:
Q_DISABLE_COPY(QLandmarkCategoryRemoveRequest)
Q_DECLARE_PRIVATE(QLandmarkCategoryRemoveRequest)
friend class QLandmarkManagerEngine;
};
QTM_END_NAMESPACE
#endif
|
/*
Copyright (C) 2009 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <gmp.h>
#include "flint.h"
#include "fmpz.h"
#include "long_extras.h"
int
main(void)
{
fmpz_t x;
int i, result;
FLINT_TEST_INIT(state);
flint_printf("get/set_si....");
fflush(stdout);
fmpz_init(x);
fmpz_set_si(x, COEFF_MIN);
if (COEFF_IS_MPZ(*x) || fmpz_get_si(x) != COEFF_MIN)
{
flint_printf("FAIL: COEFF_MIN");
abort();
}
fmpz_set_si(x, COEFF_MAX);
if (COEFF_IS_MPZ(*x) || fmpz_get_si(x) != COEFF_MAX)
{
flint_printf("FAIL: COEFF_MIN");
abort();
}
fmpz_set_si(x, WORD_MIN);
if (!COEFF_IS_MPZ(*x) || fmpz_get_si(x) != WORD_MIN)
{
flint_printf("FAIL: WORD_MIN");
abort();
}
fmpz_set_si(x, WORD_MIN);
if (!COEFF_IS_MPZ(*x) || fmpz_get_si(x) != WORD_MIN)
{
flint_printf("FAIL: WORD_MAX");
abort();
}
fmpz_clear(x);
for (i = 0; i < 10000 * flint_test_multiplier(); i++)
{
fmpz_t a;
slong b, c;
b = z_randtest(state);
fmpz_init(a);
fmpz_set_si(a, b);
c = fmpz_get_si(a);
result = (b == c);
if (!result)
{
flint_printf("FAIL:\n");
flint_printf("b = %wd, c = %wd\n", b, c);
abort();
}
fmpz_clear(a);
}
FLINT_TEST_CLEANUP(state);
flint_printf("PASS\n");
return 0;
}
|
/**************************************************************************
**
** 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 DEBUGGER_LOGWINDOW_H
#define DEBUGGER_LOGWINDOW_H
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class QCursor;
class QLabel;
class QLineEdit;
class QPlainTextEdit;
QT_END_NAMESPACE
namespace Debugger {
namespace Internal {
class LogWindow : public QWidget
{
Q_OBJECT
public:
explicit LogWindow(QWidget *parent = 0);
void setCursor(const QCursor &cursor);
QString combinedContents() const;
QString inputContents() const;
static QString logTimeStamp();
static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = 0);
public slots:
void clearContents();
void sendCommand();
void showOutput(int channel, const QString &output);
void showInput(int channel, const QString &input);
signals:
void showPage();
void statusMessageRequested(const QString &msg, int);
private:
QPlainTextEdit *m_combinedText; // combined input/output
QPlainTextEdit *m_inputText; // scriptable input alone
QLineEdit *m_commandEdit;
QLabel *m_commandLabel;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_LOGWINDOW_H
|
/**
******************************************************************************
* @file stm8s_it.h
* @author MCD Application Team
* @version V2.2.0
* @date 30-September-2014
* @brief This file contains the headers of the interrupt handlers
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM8S_IT_H
#define __STM8S_IT_H
/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif /* __STM8S_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* sched_get_priority_max() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
#include <sched.h>
_syscall1(int, sched_get_priority_max, int, policy)
|
/*
* Copyright (C) 2016-2017 Andes Technology, Inc.
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* Copyright (C) 1999-2013 Free Software Foundation, Inc.
Contributed by Philip Blundell <philb@gnu.org>, 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
#include <sys/ucontext.h>
#define SIGCONTEXT siginfo_t *_si, struct ucontext *
#define SIGCONTEXT_EXTRA_ARGS _si,
#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.nds32_ipc)
#define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.nds32_fp)
#define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.nds32_sp)
#define CALL_SIGHANDLER(handler, signo, ctx) \
(handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
|
#ifndef MIDGARD_TEST_BASE_ABSTRACT_H
#define MIDGARD_TEST_BASE_ABSTRACT_H
#include "midgard_test.h"
typedef struct {
MidgardConnection *mgd;
MidgardObject *object;
} MidgardBaseAbstractTest;
void midgard_test_types_and_extending_base_abstract (MidgardBaseAbstractTest *mwct, gconstpointer data);
void midgard_test_types_and_extending_base_abstract_derived_type (MidgardBaseAbstractTest *mwct, gconstpointer data);
void midgard_test_types_and_extending_base_abstract_derived_type_with_interfaces (MidgardBaseAbstractTest *mwct, gconstpointer data);
void midgard_test_types_and_extending_interfaces (MidgardBaseAbstractTest *mwct, gconstpointer data);
void midgard_test_types_and_extending_dbobject_with_interfaces (MidgardBaseAbstractTest *mwct, gconstpointer data);
#endif /* MIDGARD_TEST_BASE_ABSTRACT_H */
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef NEARFIELDTAGIMPLCOMMON_SYMBIAN_H
#define NEARFIELDTAGIMPLCOMMON_SYMBIAN_H
#include <qnearfieldtarget.h>
#include <qnearfieldtarget_p.h>
#include "nearfieldtag_symbian.h"
#include "nearfieldndeftarget_symbian.h"
#include "nearfieldutility_symbian.h"
#include "nearfieldtagasyncrequest_symbian.h"
#include "nearfieldtagoperationcallback_symbian.h"
#include "nearfieldtagndefoperationcallback_symbian.h"
#include "nearfieldtagndefrequest_symbian.h"
#include "nearfieldtagcommandrequest_symbian.h"
#include "nearfieldtagcommandsrequest_symbian.h"
class QNearFieldTagImplCommon
{
public:
bool DoReadNdefMessages(MNearFieldNdefOperationCallback * const aCallback);
bool DoSetNdefMessages(const QList<QNdefMessage> &messages, MNearFieldNdefOperationCallback * const aCallback);
bool DoHasNdefMessages();
bool DoSendCommand(const QByteArray& command, MNearFieldTagOperationCallback * const aCallback, bool deferred = true);
bool IssueNextRequest(QNearFieldTarget::RequestId aId);
void RemoveRequestFromQueue(QNearFieldTarget::RequestId aId);
QNearFieldTarget::RequestId AllocateRequestId();
void DoCancelSendCommand();
void DoCancelNdefAccess();
QNearFieldTarget::Error SymbianError2QtError(int error);
virtual void EmitNdefMessageRead(const QNdefMessage &message) = 0;
virtual void EmitNdefMessagesWritten() = 0;
virtual void EmitRequestCompleted(const QNearFieldTarget::RequestId &id) = 0;
virtual void EmitError(int error, const QNearFieldTarget::RequestId &id) = 0;
virtual void HandleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &command, const QByteArray &response, bool emitRequestCompleted) = 0;
virtual void HandleResponse(const QNearFieldTarget::RequestId &id, const QVariantList& response, int error) = 0;
virtual QVariant decodeResponse(const QByteArray& command, const QByteArray& response) = 0;
public:
QNearFieldTagImplCommon(CNearFieldNdefTarget *tag);
virtual ~QNearFieldTagImplCommon();
protected:
bool _hasNdefMessage();
QNearFieldTarget::RequestId _ndefMessages();
QNearFieldTarget::RequestId _setNdefMessages(const QList<QNdefMessage> &messages);
void _setAccessMethods(const QNearFieldTarget::AccessMethods& accessMethods)
{
mAccessMethods = accessMethods;
}
QNearFieldTarget::AccessMethods _accessMethods() const
{
return mAccessMethods;
}
QNearFieldTarget::RequestId _sendCommand(const QByteArray &command);
QNearFieldTarget::RequestId _sendCommands(const QList<QByteArray> &command);
bool _waitForRequestCompleted(const QNearFieldTarget::RequestId &id, int msecs = 5000);
bool _waitForRequestCompletedNoSignal(const QNearFieldTarget::RequestId &id, int msecs = 5000);
QByteArray _uid() const;
bool _isProcessingRequest() const;
protected:
CNearFieldNdefTarget * mTag;
QNearFieldTarget::AccessMethods mAccessMethods;
mutable QByteArray mUid;
RPointerArray<CNdefMessage> mMessageList;
RBuf8 mResponse;
QList<MNearFieldTagAsyncRequest *> mPendingRequestList;
MNearFieldTagAsyncRequest * mCurrentRequest;
TTimeIntervalMicroSeconds32 mTimeout;
RPointerArray<CNdefMessage> mInputMessageList;
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNETWORKINTERFACE_H
#define QNETWORKINTERFACE_H
#include <QtCore/qshareddata.h>
#include <QtNetwork/qhostaddress.h>
#ifndef QT_NO_NETWORKINTERFACE
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Network)
template<typename T> class QList;
class QNetworkAddressEntryPrivate;
class Q_NETWORK_EXPORT QNetworkAddressEntry
{
public:
QNetworkAddressEntry();
QNetworkAddressEntry(const QNetworkAddressEntry &other);
QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other);
~QNetworkAddressEntry();
bool operator==(const QNetworkAddressEntry &other) const;
inline bool operator!=(const QNetworkAddressEntry &other) const
{ return !(*this == other); }
QHostAddress ip() const;
void setIp(const QHostAddress &newIp);
QHostAddress netmask() const;
void setNetmask(const QHostAddress &newNetmask);
int prefixLength() const;
void setPrefixLength(int length);
QHostAddress broadcast() const;
void setBroadcast(const QHostAddress &newBroadcast);
private:
QNetworkAddressEntryPrivate *d;
};
class QNetworkInterfacePrivate;
class Q_NETWORK_EXPORT QNetworkInterface
{
public:
enum InterfaceFlag {
IsUp = 0x1,
IsRunning = 0x2,
CanBroadcast = 0x4,
IsLoopBack = 0x8,
IsPointToPoint = 0x10,
CanMulticast = 0x20
};
Q_DECLARE_FLAGS(InterfaceFlags, InterfaceFlag)
QNetworkInterface();
QNetworkInterface(const QNetworkInterface &other);
QNetworkInterface &operator=(const QNetworkInterface &other);
~QNetworkInterface();
bool isValid() const;
int index() const;
QString name() const;
QString humanReadableName() const;
InterfaceFlags flags() const;
QString hardwareAddress() const;
QList<QNetworkAddressEntry> addressEntries() const;
static QNetworkInterface interfaceFromName(const QString &name);
static QNetworkInterface interfaceFromIndex(int index);
static QList<QNetworkInterface> allInterfaces();
static QList<QHostAddress> allAddresses();
private:
friend class QNetworkInterfacePrivate;
QSharedDataPointer<QNetworkInterfacePrivate> d;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkInterface::InterfaceFlags)
#ifndef QT_NO_DEBUG_STREAM
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface);
#endif
QT_END_NAMESPACE
QT_END_HEADER
#endif // QT_NO_NETWORKINTERFACE
#endif
|
// @(#)root/pyroot:$Id$
// Author: Wim Lavrijsen, Jan 2005
#ifndef PYROOT_PROPERTYPROXY_H
#define PYROOT_PROPERTYPROXY_H
// Bindings
#include "Converters.h"
// ROOT
#include "DllImport.h"
#include "TClassRef.h"
class TDataMember;
class TGlobal;
// Standard
#include <string>
namespace PyROOT {
/** Proxy to ROOT data presented as python property
@author WLAV
@date 02/12/2005
@version 2.0
*/
class ObjectProxy;
class PropertyProxy {
public:
void Set( TDataMember* );
void Set( TGlobal* );
std::string GetName() { return fName; }
Long_t GetAddress( ObjectProxy* pyobj /* owner */ );
public: // public, as the python C-API works with C structs
PyObject_HEAD
Long_t fOffset;
Long_t fProperty;
TConverter* fConverter;
ClassInfo_t* fParent;
std::string fName;
private: // private, as the python C-API will handle creation
PropertyProxy() {}
};
//- property proxy type and type verification --------------------------------
R__EXTERN PyTypeObject PropertyProxy_Type;
template< typename T >
inline Bool_t PropertyProxy_Check( T* object )
{
return object && PyObject_TypeCheck( object, &PropertyProxy_Type );
}
template< typename T >
inline Bool_t PropertyProxy_CheckExact( T* object )
{
return object && Py_TYPE(object) == &PropertyProxy_Type;
}
//- creation -----------------------------------------------------------------
template< class T >
inline PropertyProxy* PropertyProxy_New( const T& dmi )
{
// Create an initialize a new property descriptor, given the C++ datum.
PropertyProxy* pyprop =
(PropertyProxy*)PropertyProxy_Type.tp_new( &PropertyProxy_Type, 0, 0 );
pyprop->Set( dmi );
return pyprop;
}
} // namespace PyROOT
#endif // !PYROOT_PROPERTYPROXY_H
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** 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 The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QuickITEMNODEINSTANCE_H
#define QuickITEMNODEINSTANCE_H
#include <QtGlobal>
#include "objectnodeinstance.h"
#include <QQuickItem>
#include <designersupportdelegate.h>
namespace QmlDesigner {
namespace Internal {
class QuickItemNodeInstance : public ObjectNodeInstance
{
public:
typedef QSharedPointer<QuickItemNodeInstance> Pointer;
typedef QWeakPointer<QuickItemNodeInstance> WeakPointer;
~QuickItemNodeInstance();
static Pointer create(QObject *objectToBeWrapped);
static void createEffectItem(bool createEffectItem);
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance) override;
QQuickItem *contentItem() const override;
bool hasContent() const override;
QRectF contentItemBoundingBox() const override;
QRectF boundingRect() const override;
QTransform contentTransform() const override;
QTransform sceneTransform() const override;
double opacity() const override;
double rotation() const override;
double scale() const override;
QPointF transformOriginPoint() const override;
double zValue() const override;
QPointF position() const override;
QSizeF size() const override;
QTransform transform() const override;
QTransform contentItemTransform() const override;
int penWidth() const override;
QImage renderImage() const override;
QImage renderPreviewImage(const QSize &previewImageSize) const override;
void updateAllDirtyNodesRecursive() override;
QObject *parent() const override;
QList<ServerNodeInstance> childItems() const override;
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty) override;
void setPropertyVariant(const PropertyName &name, const QVariant &value) override;
void setPropertyBinding(const PropertyName &name, const QString &expression) override;
QVariant property(const PropertyName &name) const override;
void resetProperty(const PropertyName &name) override;
bool isAnchoredByChildren() const override;
bool hasAnchor(const PropertyName &name) const override;
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const override;
bool isAnchoredBySibling() const override;
bool isResizable() const override;
bool isMovable() const override;
bool isQuickItem() const override;
QList<ServerNodeInstance> stateInstances() const override;
void doComponentComplete() override;
QList<QQuickItem*> allItemsRecursive() const override;
protected:
explicit QuickItemNodeInstance(QQuickItem*);
QQuickItem *quickItem() const;
void setMovable(bool movable);
void setResizable(bool resizable);
void setHasContent(bool hasContent);
DesignerSupport *designerSupport() const;
Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
void updateDirtyNodesRecursive(QQuickItem *parentItem) const;
void updateAllDirtyNodesRecursive(QQuickItem *parentItem) const;
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal();
void resetVertical();
QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
void refresh();
static bool anyItemHasContent(QQuickItem *quickItem);
static bool childItemsHaveContent(QQuickItem *quickItem);
double x() const;
double y() const;
private: //variables
QPointer<QQuickItem> m_contentItem;
bool m_isResizable;
bool m_isMovable;
bool m_hasHeight;
bool m_hasWidth;
bool m_hasContent;
double m_x;
double m_y;
double m_width;
double m_height;
static bool s_createEffectItem;
};
} // namespace Internal
} // namespace QmlDesigner
#endif // QuickITEMNODEINSTANCE_H
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDIRECTFBSCREEN_H
#define QDIRECTFBSCREEN_H
#include "qdirectfbconvenience.h"
#include "qdirectfbcursor.h"
#include <QtGui/QPlatformIntegration>
#include <directfb.h>
QT_BEGIN_NAMESPACE
class QDirectFbScreen : public QPlatformScreen
{
public:
QDirectFbScreen(int display);
QRect geometry() const { return m_geometry; }
int depth() const { return m_depth; }
QImage::Format format() const { return m_format; }
QSize physicalSize() const { return m_physicalSize; }
// DirectFb helpers
IDirectFBDisplayLayer *dfbLayer() const;
public:
QRect m_geometry;
int m_depth;
QImage::Format m_format;
QSize m_physicalSize;
QDirectFBPointer<IDirectFBDisplayLayer> m_layer;
private:
QScopedPointer<QDirectFBCursor> m_cursor;
};
QT_END_NAMESPACE
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.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 info@qt.nokia.com.
**
**************************************************************************/
#ifndef GUIAPPWIZARD_H
#define GUIAPPWIZARD_H
#include "qtwizard.h"
namespace Qt4ProjectManager {
namespace Internal {
struct GuiAppParameters;
class GuiAppWizard : public QtWizard
{
Q_DISABLE_COPY(GuiAppWizard)
Q_OBJECT
public:
GuiAppWizard();
protected:
GuiAppWizard(const QString &id,
const QString &category,
const QString &categoryTranslationScope,
const QString &displayCategory,
const QString &name,
const QString &description,
const QIcon &icon,
bool createMobile);
virtual QWizard *createWizardDialog(QWidget *parent,
const QString &defaultPath,
const WizardPageList &extensionPages) const;
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
QString *errorMessage) const;
private:
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
const GuiAppParameters ¶ms,
QString *target, QString *errorMessage);
bool m_createMobileProject;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // GUIAPPWIZARD_H
|
/*
* Copyright (c) 2006 - 2018 QIU ZHONG HUAI <huai2011@163.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes CC software, freely available from
* <https://github.com/huai2001/CC/>".
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cc/single_link.h>
/**/
bool_t CC_CALL cc_single_link_append(cc_single_link_t *thiz, cc_single_link_t *append)
{
if (thiz == NULL || append == NULL || cc_single_link_empty(append) == TRUE)
return FALSE;
if (cc_single_link_empty(thiz) == TRUE) {
thiz->head = append->head;
thiz->tail = append->tail;
thiz->count = append->count;
return TRUE;
}
if (thiz->head == NULL) {
thiz->head = append->head;
} else {
thiz->tail->next = append->head;
}
thiz->tail = append->tail;
thiz->count += append->count;
return TRUE;
}
/**/
cc_single_iterator_t* CC_CALL cc_single_link_pop_front(cc_single_link_t *thiz)
{
cc_single_iterator_t *ret = NULL;
if (thiz == NULL || cc_single_link_empty(thiz) == TRUE)
return NULL;
ret = thiz->head;
thiz->head = ret->next;
if (thiz->head != NULL) {
/*clean*/
thiz->count--;
CC_ASSERT(thiz->count >= 0);
} else if (thiz->tail == ret) {
/* link is empty clear link */
thiz->head = thiz->tail = NULL;
thiz->count = 0;
} else {
CC_ASSERT(FALSE);
}
/**/
ret->next = NULL;
return ret;
}
/**/
bool_t CC_CALL cc_single_link_push_front(cc_single_link_t* thiz, cc_single_iterator_t *iter)
{
iter->next = NULL;
if (thiz->head == NULL) {
thiz->tail = iter;
} else {
iter->next = thiz->head;
}
thiz->head = iter;
thiz->count++;
return TRUE;
}
/**/
bool_t CC_CALL cc_single_link_push_back(cc_single_link_t *thiz, cc_single_iterator_t *iter)
{
iter->next = NULL;
if (thiz->head == NULL) {
thiz->head = iter;
} else {
thiz->tail->next = iter;
}
thiz->tail = iter;
thiz->count++;
return TRUE;
}
|
/** @defgroup spi_defines SPI Defines
*
* @brief <b>Defined Constants and Types for the STM32G4xx SPI</b>
*
* @ingroup STM32G4xx_defines
*
* @version 1.0.0
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
* 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 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_SPI_H
#define LIBOPENCM3_SPI_H
#include <libopencm3/stm32/common/spi_common_v2.h>
#endif
|
/**
* @file msp430Bootloader.h
* @brief boot loader functions on MSP430
* @since Jul 31, 2012
* @author MRSL
* \internal
* TODO FIND mrdouglass
* \endinternal
*/
#ifndef MSP430BOOTLOADER_H_
#define MSP430BOOTLOADER_H_
/**
* @brief Gets msp430 local software version
* @returns msp430 local software version
*/
uint8 msp430BSLGetLocalVersionNumber(void);
/**
* @brief Gets msp430 local hardware version
* @returns msp430 local hardware version
*/
uint8 msp430BSLGetLocalVersionHardwareNumber(void);
/**
* @brief This method is used to initialize the MSP430 and interrupts for the BSL
* @returns void
*/
void msp430BSLInit(void);
#endif /* MSP430BOOTLOADER_H_ */
|
// -*- Mode:C++ -*-
/************************************************************************\
* *
* This file is part of Avango. *
* *
* Copyright 1997 - 2008 Fraunhofer-Gesellschaft zur Foerderung der *
* angewandten Forschung (FhG), Munich, Germany. *
* *
* Avango 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 3. *
* *
* Avango 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 Avango. If not, see <http://www.gnu.org/licenses/>. *
* *
* Avango is a trademark owned by FhG. *
* *
\************************************************************************/
#if !defined(AVANGO_DISTRIBUTED_H)
#define AVANGO_DISTRIBUTED_H
/**
* \file
* \ingroup av
*/
#include <unordered_set>
#include <avango/Base.h>
#include <avango/Config.h>
#include <avango/Link.h>
namespace av
{
#if defined(AVANGO_DISTRIBUTION_SUPPORT)
class NetID;
class NetInfo;
class Msg;
class NetNode;
#endif // #if defined(AVANGO_DISTRIBUTION_SUPPORT)
/**
* The Distributed class is the base class for all classes that can be distributed.
* It provides a simple public interface to some of the internals of the distribution.
* Although, normally the application programmer should not need to be concerned with such
* details.
*
* \ingroup av
*
*/
class AV_DLL Distributed : public Base
{
AV_BASE_DECLARE_ABSTRACT();
public:
/**
* Constructor
*/
Distributed();
protected:
/**
* Destructor made protected to prevent allocation on stack.
*/
virtual ~Distributed();
/**
* Returns \c true if this object has been created by the calling process.
* If this object is a replicated copy created by some other process, \c false
* is returned.
*/
bool isOwned() const;
#if defined(AVANGO_DISTRIBUTION_SUPPORT)
public:
/**
* Returns \c true if this node is distributed.
*/
bool isDistributed() const;
/**
* Returns the distribution group wide unique identifier for this object.
* If the this object is not distributed NetID::NullID is returned.
*/
const NetID& netID() const;
/**
* Returns the network wide unique identifier for the process which created this object.
*/
const std::string& netCreator() const;
/**
* Returns the NetNode of this instance.
*/
const NetNode* netNode() const;
/**
* Returns the NetNode of this instance.
*/
NetNode* netNode();
/**
* Write to a net msg
*/
virtual void push(Msg& netMsg) = 0;
/**
* Read from a net msg
*/
virtual void pop(Msg& netMsg) = 0;
protected:
friend class NetNode;
void setNetInfo(NetInfo* netInfo);
NetInfo* getNetInfo();
// notify the network of a local change
void notifyLocalChange();
// client code can do something here
virtual void becomingDistributed();
virtual void becomingUndistributed();
private:
NetInfo* mNetInfo;
#endif // #if defined(AVANGO_DISTRIBUTION_SUPPORT)
};
typedef std::unordered_set<Link<Distributed>, AnyLink::Hasher, std::equal_to<AnyLink> > DistributedSet;
}
#endif // #if !defined(AVANGO_DISTRIBUTED_H)
|
#ifndef ZUSE_TOKENS_H
#define ZUSE_TOKENS_H
#include "hammer.h"
#include "token.h"
#include "doc_listener.h"
#include <vector>
namespace zuse
{
///
/// \brief All tokens of a source file
///
class Tokens
{
public:
Tokens(DocListener &listener);
Tokens(const Tokens&) = delete;
Tokens &operator=(const Tokens&) = delete;
void setHotLight(ssize_t back);
void light(const Ast *inner);
void clear();
void sync(const AstList *root);
void updateScalar(const AstInternal *outer, size_t inner);
std::string pluck(size_t r);
void jackKick(AstInternal *&outer, size_t &inner, bool down);
void hackLead(AstInternal *&outer, size_t &inner, bool right);
/// @name Hammer's Interface
///@{
void put(size_t r, size_t c, const std::vector<Token*> &ts);
void erase(const Region &r);
///@}
friend std::ostream &operator<<(std::ostream &os, const Tokens &ts);
private:
static bool isHjklTarget(const Ast *a);
Region locate(const Ast *tar);
void suckComma(Region ®ion);
void newLine(size_t r, size_t c);
void joinLine(size_t r);
size_t anchor(size_t r, size_t c);
Region anchor(const Region &r);
private:
std::vector<std::vector<std::unique_ptr<Token>>> mRows;
Hammer mHammer;
DocListener &mListener;
};
std::ostream &operator<<(std::ostream &os, const Tokens &ts);
} // namespace zuse
#endif // ZUSE_TOKENS_H
|
/*
Dokan : user-mode file system library for Windows
Copyright (C) 2015 - 2017 Adrien J. <liryna.stark@gmail.com> and Maxime C. <maxime@islog.com>
Copyright (C) 2007 - 2011 Hiroki Asakawa <info@dokan-dev.net>
http://dokan-dev.github.io
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 <http://www.gnu.org/licenses/>.
*/
#include "dokan.h"
NTSTATUS
DokanBuildRequest(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
BOOLEAN AtIrqlPassiveLevel = FALSE;
BOOLEAN IsTopLevelIrp = FALSE;
NTSTATUS Status = STATUS_UNSUCCESSFUL;
__try {
__try {
AtIrqlPassiveLevel = (KeGetCurrentIrql() == PASSIVE_LEVEL);
if (AtIrqlPassiveLevel) {
FsRtlEnterFileSystem();
}
if (!IoGetTopLevelIrp()) {
IsTopLevelIrp = TRUE;
IoSetTopLevelIrp(Irp);
}
Status = DokanDispatchRequest(DeviceObject, Irp);
} __except (DokanExceptionFilter(Irp, GetExceptionInformation())) {
Status = DokanExceptionHandler(DeviceObject, Irp, GetExceptionCode());
}
} __finally {
if (IsTopLevelIrp) {
IoSetTopLevelIrp(NULL);
}
if (AtIrqlPassiveLevel) {
FsRtlExitFileSystem();
}
}
return Status;
}
NTSTATUS
DokanDispatchRequest(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
PIO_STACK_LOCATION irpSp;
irpSp = IoGetCurrentIrpStackLocation(Irp);
if (irpSp->MajorFunction != IRP_MJ_FILE_SYSTEM_CONTROL &&
irpSp->MajorFunction != IRP_MJ_SHUTDOWN &&
irpSp->MajorFunction != IRP_MJ_CLEANUP &&
irpSp->MajorFunction != IRP_MJ_CLOSE &&
irpSp->MajorFunction != IRP_MJ_PNP) {
if (IsUnmountPending(DeviceObject)) {
DDbgPrint(" Volume is not mounted so return STATUS_NO_SUCH_DEVICE\n");
NTSTATUS status = STATUS_NO_SUCH_DEVICE;
DokanCompleteIrpRequest(Irp, status, 0);
return status;
}
}
// If volume is write protected and this request
// would modify it then return write protected status.
if (IS_DEVICE_READ_ONLY(DeviceObject)) {
if ((irpSp->MajorFunction == IRP_MJ_WRITE) ||
(irpSp->MajorFunction == IRP_MJ_SET_INFORMATION) ||
(irpSp->MajorFunction == IRP_MJ_SET_EA) ||
(irpSp->MajorFunction == IRP_MJ_FLUSH_BUFFERS) ||
(irpSp->MajorFunction == IRP_MJ_SET_SECURITY) ||
(irpSp->MajorFunction == IRP_MJ_SET_VOLUME_INFORMATION) ||
(irpSp->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL &&
irpSp->MinorFunction == IRP_MN_USER_FS_REQUEST &&
irpSp->Parameters.FileSystemControl.FsControlCode ==
FSCTL_MARK_VOLUME_DIRTY)) {
DDbgPrint(" Media is write protected\n");
DokanCompleteIrpRequest(Irp, STATUS_MEDIA_WRITE_PROTECTED, 0);
return STATUS_MEDIA_WRITE_PROTECTED;
}
}
switch (irpSp->MajorFunction) {
case IRP_MJ_CREATE:
return DokanDispatchCreate(DeviceObject, Irp);
case IRP_MJ_CLOSE:
return DokanDispatchClose(DeviceObject, Irp);
case IRP_MJ_READ:
return DokanDispatchRead(DeviceObject, Irp);
case IRP_MJ_WRITE:
return DokanDispatchWrite(DeviceObject, Irp);
case IRP_MJ_FLUSH_BUFFERS:
return DokanDispatchFlush(DeviceObject, Irp);
case IRP_MJ_QUERY_INFORMATION:
return DokanDispatchQueryInformation(DeviceObject, Irp);
case IRP_MJ_SET_INFORMATION:
return DokanDispatchSetInformation(DeviceObject, Irp);
case IRP_MJ_QUERY_VOLUME_INFORMATION:
return DokanDispatchQueryVolumeInformation(DeviceObject, Irp);
case IRP_MJ_SET_VOLUME_INFORMATION:
return DokanDispatchSetVolumeInformation(DeviceObject, Irp);
case IRP_MJ_DIRECTORY_CONTROL:
return DokanDispatchDirectoryControl(DeviceObject, Irp);
case IRP_MJ_FILE_SYSTEM_CONTROL:
return DokanDispatchFileSystemControl(DeviceObject, Irp);
case IRP_MJ_DEVICE_CONTROL:
return DokanDispatchDeviceControl(DeviceObject, Irp);
case IRP_MJ_LOCK_CONTROL:
return DokanDispatchLock(DeviceObject, Irp);
case IRP_MJ_CLEANUP:
return DokanDispatchCleanup(DeviceObject, Irp);
case IRP_MJ_SHUTDOWN:
return DokanDispatchShutdown(DeviceObject, Irp);
case IRP_MJ_QUERY_SECURITY:
return DokanDispatchQuerySecurity(DeviceObject, Irp);
case IRP_MJ_SET_SECURITY:
return DokanDispatchSetSecurity(DeviceObject, Irp);
#if (_WIN32_WINNT >= 0x0500)
case IRP_MJ_PNP:
return DokanDispatchPnp(DeviceObject, Irp);
#endif //(_WIN32_WINNT >= 0x0500)
default:
DDbgPrint("DokanDispatchRequest: Unexpected major function: %xh\n",
irpSp->MajorFunction);
DokanCompleteIrpRequest(Irp, STATUS_DRIVER_INTERNAL_ERROR, 0);
return STATUS_DRIVER_INTERNAL_ERROR;
}
} |
/* =========================================================================
* This file is part of NITRO
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* NITRO 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, If not,
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __NRT_ERROR_H__
#define __NRT_ERROR_H__
#pragma once
#include "nrt/Defines.h"
#include "nrt/Types.h"
#define NRT_MAX_EMESSAGE 1024
#define NRT_CTXT NRT_FILE, NRT_LINE, NRT_FUNC
#if defined(WIN32) || defined(_WIN32)
# define NRT_ERRNO ((int) GetLastError())
#else
# define NRT_ERRNO errno
#endif
# define NRT_STRERROR(E) nrt_strerror(E)
NRT_CXX_GUARD
/*
*
* An error level can be low, medium, high, or critical.
*
*/
enum
{
NRT_NO_ERR = 0,
NRT_ERR_MEMORY,
NRT_ERR_OPENING_FILE,
NRT_ERR_READING_FROM_FILE,
NRT_ERR_SEEKING_IN_FILE,
NRT_ERR_WRITING_TO_FILE,
NRT_ERR_STAT_FILE,
NRT_ERR_LOADING_DLL,
NRT_ERR_UNLOADING_DLL,
NRT_ERR_RETRIEVING_DLL_HOOK,
NRT_ERR_UNINITIALIZED_DLL_READ,
NRT_ERR_INVALID_PARAMETER,
NRT_ERR_INVALID_OBJECT,
NRT_ERR_INVALID_FILE,
NRT_ERR_COMPRESSION,
NRT_ERR_DECOMPRESSION,
NRT_ERR_PARSING_FILE,
NRT_ERR_INT_STACK_OVERFLOW,
NRT_ERR_UNK
};
/*!
* \struct nrt_Error
* \brief This structure contains nitf information
*
* The important components of an error are stored here
*/
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4820) // '...': '...' bytes padding added after data member '...'
#endif
typedef struct _NRT_Error
{
char message[NRT_MAX_EMESSAGE + 1];
char file[NRT_MAX_PATH + 1];
int line;
char func[NRT_MAX_PATH + 1];
int level;
} nrt_Error;
#if _MSC_VER
#pragma warning(pop)
#endif
/*!
* \fn nrt_Error_init
* \brief Initialize an error object (since these arent malloc'ed)
*
* This method sets up an error by initializing it with the
* context information, and the error level (which is defineds as
* one of these enum values below) and a message.
*
* \param error The error to init
* \param message The error message to init (a string)
* \param file Context info from NRT_CTXT
* \param line Context info from NRT_CTXT
* \param func Context info from NRT_CTXT (if C99)
& \param level The level of error (This is an enum value)
*/
NRTPROT(void) nrt_Error_init(nrt_Error * error, const char *message,
const char *file, int line, const char *func,
int level);
/*!
* \fn nrt_Error_flogf
* \brief Print an existing error to a file handle
* \param error An existing error
* \param file An open file stream (could be stderr/stdout)
* \param level Not necessary [REMOVE ME]
* \param format The format string
*/
NRTAPI(void) nrt_Error_flogf(nrt_Error * error, FILE * file, int level,
const char *format, ...);
/*!
* \fn nrt_Error_printf
* \brief Print an existing error to a file handle
* \param error An existing error
* \param file An open file stream (could be stderr/stdout)
* \param format The format string
*/
NRTAPI(void) nrt_Error_fprintf(nrt_Error * error, FILE * file,
const char *format, ...);
/*!
* \fn nrt_Error_initf
* \brief Initialize an error using a format string. This should only be
* done by library functions.
* \param file The file nane
* \param line The line number
* \param func The function (if identifiable)
* \param level The type of error (an enum value)
* \param format A format string
*/
NRTPROT(void) nrt_Error_initf(nrt_Error * error, const char *file, int line,
const char *func, int level, const char *format,
...);
/*!
* \fn nrt_Error_print
* \brief Print the error to a file stream
*
* \param error The error to print out
* \param file An open file stream to write to
* \param userMessage Any user message data to be displayed
*/
NRTAPI(void) nrt_Error_print(nrt_Error * error, FILE * file,
const char *userMessage);
/*!
* \fn nrt_strerror
* \brief Our own version of C's strerror() (to avoid warnings about using strerror())
*/
NRTAPI(char*) nrt_strerror(int errnum);
NRT_CXX_ENDGUARD
#endif
|
// HeeksPython.h
extern void Message(const char*);
void PythonInit();
void PythonFinish();
|
/* $NetBSD: powerd_hostops.c,v 1.1 2010/12/19 22:52:08 pgoyette Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: powerd_hostops.c,v 1.1 2010/12/19 22:52:08 pgoyette Exp $");
#endif /* !lint */
#include <sys/types.h>
#include <sys/event.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include "prog_ops.h"
const struct prog_ops prog_ops = {
.op_open = open,
.op_close = close,
.op_read = read,
.op_fcntl = fcntl,
.op_ioctl = ioctl,
.op_kevent = kevent,
.op_kqueue = kqueue,
};
|
/*
* Copyright (C) 2009-2011 Texas Instruments, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <sosal/sosal.h>
#include <dvp_ll.h>
#include <dvp/dvp_debug.h>
#ifdef DVP_USE_IMGFILTER
#include <imgfilter/imgFilter_armv7.h>
#endif
void DVP_imgFilter(DVP_Image_t *pLuma,
DVP_ImageFilter_e type,
DVP_Image_t *pOut)
{
int limit = 255;
#ifdef DVP_USE_IMGFILTER
if (type == DVP_IMGFILTER_SOBEL)
{
int sobel_3[3] = {1,2,1};
int range = SOBEL_RANGE;
__planar_edge_filter_3x3(pLuma->width,
pLuma->height,
pLuma->pData[0],
pLuma->y_stride,
sobel_3,
pOut->pData[0],
pOut->y_stride,
range, limit);
}
else if (type == DVP_IMGFILTER_SCHARR)
{
int scharr_3[3] = {3,10,3};
int range = SCHARR_RANGE;
__planar_edge_filter_3x3(pLuma->width,
pLuma->height,
pLuma->pData[0],
pLuma->y_stride,
scharr_3,
pOut->pData[0],
pOut->y_stride,
range, limit);
}
else if (type == DVP_IMGFILTER_KROON)
{
int kroon_3[3] = {17,61,17};
int range = KROON_RANGE;
__planar_edge_filter_3x3(pLuma->width,
pLuma->height,
pLuma->pData[0],
pLuma->y_stride,
kroon_3,
pOut->pData[0],
pOut->y_stride,
range, limit);
}
else if (type == DVP_IMGFILTER_PREWITT)
{
int prewitt_3[3] = {1,1,1};
int range = PREWITT_RANGE;
__planar_edge_filter_3x3(pLuma->width,
pLuma->height,
pLuma->pData[0],
pLuma->y_stride,
prewitt_3,
pOut->pData[0],
pOut->y_stride,
range, limit);
}
#endif
}
|
// Copyright 2013-2016 Stanford University
//
// 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 stoke {
bool check(uint64_t a, uint64_t b, const std::string& msg, std::ostream& os) {
if (a == b) {
return false;
}
os << msg << std::endl;
os << " In state 1: 0x" << std::hex << a << std::endl;
os << " In state 2: 0x" << std::hex << b << std::endl;
return true;
}
void report(bool failed, const x64asm::Instruction& instr,
const stoke::CpuState& a, const stoke::CpuState& b,
const stoke::CpuState& fa, const stoke::CpuState& fb,
const std::string& msg) {
if (failed) {
std::cout << std::endl << "SpreadsheetReadWriteSetFuzzTest Failed!" << std::endl << std::endl;
std::cout << "Instruction: " << instr << std::endl;
std::cout << " Maybe read set: " << instr.maybe_read_set() << std::endl;
std::cout << " Must read set: " << instr.must_read_set() << std::endl;
std::cout << " Maybe write set: " << instr.maybe_write_set() << std::endl;
std::cout << " Must write set: " << instr.must_write_set() << std::endl;
std::cout << " Maybe undef set: " << instr.maybe_undef_set() << std::endl;
std::cout << " Must undef set: " << instr.must_undef_set() << std::endl;
cout << std::endl;
std::cout << msg << std::endl;
// std::cout << "State 1:" << std::endl << std::endl;
// std::cout << a << std::endl << std::endl;
// std::cout << "State 2:" << std::endl << std::endl;
// std::cout << b << std::endl << std::endl;
// std::cout << "Final State 1:" << std::endl << std::endl;
// std::cout << fa << std::endl << std::endl;
// std::cout << "Final State 2:" << std::endl << std::endl;
// std::cout << fb << std::endl << std::endl;
ADD_FAILURE();
}
}
/** Returns the correct index to use when looking up a general purpose register in Regs. */
size_t gp_reg_index(x64asm::R r) {
switch (r.type()) {
case x64asm::Type::RH:
return r-4;
default:
return r;
}
}
/** This test generates random instructions, and then performs the following
test: It generates two random states, that agree in all the registers that
the instruction reads (but are both random otherwise), and then executes
the instruction. The two resulting states are then checked to agree on the
values the instruction writes.
For example, this uncovers errors in the must/maybe read/write/undef sets. */
struct SpreadsheetReadWriteSetFuzzCallbackInfo {
// Berkeley deserves eternal punishment for the name of this struct.
size_t success_count;
};
}
|
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ART_RUNTIME_MIRROR_CLASS_LOADER_INL_H_
#define ART_RUNTIME_MIRROR_CLASS_LOADER_INL_H_
#include "class_loader.h"
#include "base/mutex-inl.h"
#include "class_table-inl.h"
namespace art {
namespace mirror {
template <bool kVisitClasses,
VerifyObjectFlags kVerifyFlags,
ReadBarrierOption kReadBarrierOption,
typename Visitor>
inline void ClassLoader::VisitReferences(mirror::Class* klass, const Visitor& visitor) {
// Visit instance fields first.
VisitInstanceFieldsReferences<kVerifyFlags, kReadBarrierOption>(klass, visitor);
if (kVisitClasses) {
// Visit classes loaded after.
ClassTable* const class_table = GetClassTable();
if (class_table != nullptr) {
class_table->VisitRoots(visitor);
}
}
}
} // namespace mirror
} // namespace art
#endif // ART_RUNTIME_MIRROR_CLASS_LOADER_INL_H_
|
/***********************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "regionstr.h"
#include "mistruct.h"
#include "mifpoly.h"
_X_EXPORT void
miStepDash (dist, pDashIndex, pDash, numInDashList, pDashOffset)
int dist; /* distance to step */
int *pDashIndex; /* current dash */
unsigned char *pDash; /* dash list */
int numInDashList; /* total length of dash list */
int *pDashOffset; /* offset into current dash */
{
int dashIndex, dashOffset;
int totallen;
int i;
dashIndex = *pDashIndex;
dashOffset = *pDashOffset;
if (dist < pDash[dashIndex] - dashOffset)
{
*pDashOffset = dashOffset + dist;
return;
}
dist -= pDash[dashIndex] - dashOffset;
if (++dashIndex == numInDashList)
dashIndex = 0;
totallen = 0;
for (i = 0; i < numInDashList; i++)
totallen += pDash[i];
if (totallen <= dist)
dist = dist % totallen;
while (dist >= pDash[dashIndex])
{
dist -= pDash[dashIndex];
if (++dashIndex == numInDashList)
dashIndex = 0;
}
*pDashIndex = dashIndex;
*pDashOffset = dist;
}
|
//
// Copyright (C) 2014 OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#ifndef __INET_BVHOBJECTCACHE_H
#define __INET_BVHOBJECTCACHE_H
#include "inet/common/IVisitor.h"
#include "inet/common/geometry/container/BVHTree.h"
#include "inet/environment/contract/IObjectCache.h"
#include "inet/environment/contract/IPhysicalObject.h"
#include "inet/environment/common/PhysicalEnvironment.h"
namespace inet {
namespace physicalenvironment {
class INET_API BVHObjectCache : public IObjectCache, public cModule
{
protected:
/** @name Parameters */
//@{
PhysicalEnvironment *physicalEnvironment;
unsigned int leafCapacity;
const char *axisOrder;
//@}
/** @name Cache */
//@{
mutable BVHTree *bvhTree;
mutable std::vector<const IPhysicalObject *> objects;
//@}
protected:
virtual int numInitStages() const override { return NUM_INIT_STAGES; }
virtual void initialize(int stage) override;
virtual bool insertObject(const IPhysicalObject *object);
public:
BVHObjectCache();
virtual ~BVHObjectCache();
virtual void visitObjects(const IVisitor *visitor, const LineSegment& lineSegment) const override;
};
} // namespace physicalenvironment
} // namespace inet
#endif // ifndef __INET_BVHOBJECTCACHE_H
|
/*
* Copyright 2008-2012 NVIDIA Corporation
*
* 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 fill 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 <thrust/detail/config.h>
// the purpose of this header is to #include the replace.h header
// of the host and device systems. It should be #included in any
// code which uses adl to dispatch replace
#define __THRUST_HOST_SYSTEM_REPLACE_HEADER <__THRUST_HOST_SYSTEM_ROOT/detail/replace.h>
#include __THRUST_HOST_SYSTEM_REPLACE_HEADER
#undef __THRUST_HOST_SYSTEM_REPLACE_HEADER
#define __THRUST_DEVICE_SYSTEM_REPLACE_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/detail/replace.h>
#include __THRUST_DEVICE_SYSTEM_REPLACE_HEADER
#undef __THRUST_DEVICE_SYSTEM_REPLACE_HEADER
|
#ifndef _map_file_h
#define _map_file_h
#include <stdio.h>
/* given a file name return a pointer to memory which contains a
read-only copy of the contents of the file. this is done with
virtual memory tricks, not by reading the file */
char *map_file(FILE *f, int len, int off);
/* return the size of a file in bytes */
int file_size(FILE *f);
#endif /* _map_file_h */
|
//
// ZRWheelController.h
// 我的网易彩票
//
// Created by 张 锐 on 15/6/16.
// Copyright (c) 2015年 张 锐. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ZRWheelController : UIViewController
@end
|
#include "envoy/config/cluster/redis/redis_cluster.pb.h"
#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h"
#include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h"
#include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h"
#include "envoy/upstream/upstream.h"
#include "source/extensions/clusters/redis/redis_cluster.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace Envoy {
namespace Extensions {
namespace Clusters {
namespace Redis {
class MockClusterSlotUpdateCallBack : public ClusterSlotUpdateCallBack {
public:
MockClusterSlotUpdateCallBack();
~MockClusterSlotUpdateCallBack() override = default;
MOCK_METHOD(bool, onClusterSlotUpdate, (ClusterSlotsPtr&&, Upstream::HostMap));
MOCK_METHOD(void, onHostHealthUpdate, ());
};
} // namespace Redis
} // namespace Clusters
} // namespace Extensions
} // namespace Envoy
|
/*
Copyright 2012 Ostap Cherkashin
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.
*/
/* errors are created using the error_new function. each error must be
released with the mem_free function. */
typedef struct {
char *msg;
} Error;
extern Error *error_new(char *fmt, ...);
|
#include "sigar.h"
static sigar_version_t sigar_version = {
__DATE__,
"edf041dc7a84ba46a3f5a8b808370a884ee3f52b",
"cksigar",
"release",
"darwin",
"DARWIN",
"SIGAR-1.7.0, "
"SCM revision edf041dc7a84ba46a3f5a8b808370a884ee3f52b, "
"built "__DATE__" as DARWIN",
1,
7,
0,
0
};
SIGAR_DECLARE(sigar_version_t *) sigar_version_get(void)
{
return &sigar_version;
}
|
/*!
@header HTTableKit.h
@abstract HTTableKit iOS SDK Source
@copyright Copyright 2013 BPTSoft. All rights reserved.
@version 1.0
*/
#ifndef HTTableKitFramework_HTTableKit_h
#define HTTableKitFramework_HTTableKit_h
#import <HTTableKit/UITableView+Helper.h>
#endif
|
/*
* 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/s3/S3_EXPORTS.h>
#include <aws/s3/model/TransitionStorageClass.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
/**
* <p>Container for the transition rule that describes when noncurrent objects
* transition to the <code>STANDARD_IA</code>, <code>ONEZONE_IA</code>,
* <code>INTELLIGENT_TIERING</code>, <code>GLACIER</code>, or
* <code>DEEP_ARCHIVE</code> storage class. If your bucket is versioning-enabled
* (or versioning is suspended), you can set this action to request that Amazon S3
* transition noncurrent object versions to the <code>STANDARD_IA</code>,
* <code>ONEZONE_IA</code>, <code>INTELLIGENT_TIERING</code>, <code>GLACIER</code>,
* or <code>DEEP_ARCHIVE</code> storage class at a specific period in the object's
* lifetime.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionTransition">AWS
* API Reference</a></p>
*/
class AWS_S3_API NoncurrentVersionTransition
{
public:
NoncurrentVersionTransition();
NoncurrentVersionTransition(const Aws::Utils::Xml::XmlNode& xmlNode);
NoncurrentVersionTransition& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
/**
* <p>Specifies the number of days an object is noncurrent before Amazon S3 can
* perform the associated action. For information about the noncurrent days
* calculations, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations">How
* Amazon S3 Calculates How Long an Object Has Been Noncurrent</a> in the <i>Amazon
* Simple Storage Service Developer Guide</i>.</p>
*/
inline int GetNoncurrentDays() const{ return m_noncurrentDays; }
/**
* <p>Specifies the number of days an object is noncurrent before Amazon S3 can
* perform the associated action. For information about the noncurrent days
* calculations, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations">How
* Amazon S3 Calculates How Long an Object Has Been Noncurrent</a> in the <i>Amazon
* Simple Storage Service Developer Guide</i>.</p>
*/
inline bool NoncurrentDaysHasBeenSet() const { return m_noncurrentDaysHasBeenSet; }
/**
* <p>Specifies the number of days an object is noncurrent before Amazon S3 can
* perform the associated action. For information about the noncurrent days
* calculations, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations">How
* Amazon S3 Calculates How Long an Object Has Been Noncurrent</a> in the <i>Amazon
* Simple Storage Service Developer Guide</i>.</p>
*/
inline void SetNoncurrentDays(int value) { m_noncurrentDaysHasBeenSet = true; m_noncurrentDays = value; }
/**
* <p>Specifies the number of days an object is noncurrent before Amazon S3 can
* perform the associated action. For information about the noncurrent days
* calculations, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations">How
* Amazon S3 Calculates How Long an Object Has Been Noncurrent</a> in the <i>Amazon
* Simple Storage Service Developer Guide</i>.</p>
*/
inline NoncurrentVersionTransition& WithNoncurrentDays(int value) { SetNoncurrentDays(value); return *this;}
/**
* <p>The class of storage used to store the object.</p>
*/
inline const TransitionStorageClass& GetStorageClass() const{ return m_storageClass; }
/**
* <p>The class of storage used to store the object.</p>
*/
inline bool StorageClassHasBeenSet() const { return m_storageClassHasBeenSet; }
/**
* <p>The class of storage used to store the object.</p>
*/
inline void SetStorageClass(const TransitionStorageClass& value) { m_storageClassHasBeenSet = true; m_storageClass = value; }
/**
* <p>The class of storage used to store the object.</p>
*/
inline void SetStorageClass(TransitionStorageClass&& value) { m_storageClassHasBeenSet = true; m_storageClass = std::move(value); }
/**
* <p>The class of storage used to store the object.</p>
*/
inline NoncurrentVersionTransition& WithStorageClass(const TransitionStorageClass& value) { SetStorageClass(value); return *this;}
/**
* <p>The class of storage used to store the object.</p>
*/
inline NoncurrentVersionTransition& WithStorageClass(TransitionStorageClass&& value) { SetStorageClass(std::move(value)); return *this;}
private:
int m_noncurrentDays;
bool m_noncurrentDaysHasBeenSet;
TransitionStorageClass m_storageClass;
bool m_storageClassHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
/*
* Copyright 2008-2013 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <cusp/detail/config.h>
#include <cusp/system/cuda/detail/execution_policy.h>
#include <cusp/copy.h>
namespace cusp
{
namespace system
{
namespace cuda
{
namespace detail
{
template <typename System1,
typename System2,
typename SourceType,
typename DestinationType>
void convert(
#if THRUST_VERSION >= 100900
thrust::cuda_cub::cross_system<System1,System2>& exec,
#else
thrust::system::cuda::detail::cross_system<System1,System2>& exec,
#endif
const SourceType& src,
DestinationType& dst)
{
typedef typename DestinationType::container Container;
typedef typename Container::template rebind<System1>::type DestinationType2;
DestinationType2 tmp;
cusp::convert(src, tmp);
cusp::copy(tmp, dst);
}
} // end namespace detail
} // end namespace cuda
} // end namespace system
} // end namespace cusp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.