text stringlengths 4 6.14k |
|---|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTCONCURRENT_FUNCTIONWRAPPERS_H
#define QTCONCURRENT_FUNCTIONWRAPPERS_H
#include <QtCore/qglobal.h>
#ifndef QT_NO_CONCURRENT
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Core)
#ifndef qdoc
namespace QtConcurrent {
template <typename T>
class FunctionWrapper0
{
public:
typedef T (*FunctionPointerType)();
typedef T result_type;
inline FunctionWrapper0(FunctionPointerType _functionPointer)
:functionPointer(_functionPointer) { }
inline T operator()()
{
return functionPointer();
}
private:
FunctionPointerType functionPointer;
};
template <typename T, typename U>
class FunctionWrapper1
{
public:
typedef T (*FunctionPointerType)(U u);
typedef T result_type;
inline FunctionWrapper1(FunctionPointerType _functionPointer)
:functionPointer(_functionPointer) { }
inline T operator()(U u)
{
return functionPointer(u);
}
private:
FunctionPointerType functionPointer;
};
template <typename T, typename U, typename V>
class FunctionWrapper2
{
public:
typedef T (*FunctionPointerType)(U u, V v);
typedef T result_type;
inline FunctionWrapper2(FunctionPointerType _functionPointer)
:functionPointer(_functionPointer) { }
inline T operator()(U u, V v)
{
return functionPointer(u, v);
}
private:
FunctionPointerType functionPointer;
};
template <typename T, typename C>
class MemberFunctionWrapper
{
public:
typedef T (C::*FunctionPointerType)();
typedef T result_type;
inline MemberFunctionWrapper(FunctionPointerType _functionPointer)
:functionPointer(_functionPointer) { }
inline T operator()(C &c)
{
return (c.*functionPointer)();
}
private:
FunctionPointerType functionPointer;
};
template <typename T, typename C, typename U>
class MemberFunctionWrapper1
{
public:
typedef T (C::*FunctionPointerType)(U);
typedef T result_type;
inline MemberFunctionWrapper1(FunctionPointerType _functionPointer)
: functionPointer(_functionPointer)
{ }
inline T operator()(C &c, U u)
{
return (c.*functionPointer)(u);
}
private:
FunctionPointerType functionPointer;
};
template <typename T, typename C>
class ConstMemberFunctionWrapper
{
public:
typedef T (C::*FunctionPointerType)() const;
typedef T result_type;
inline ConstMemberFunctionWrapper(FunctionPointerType _functionPointer)
:functionPointer(_functionPointer) { }
inline T operator()(const C &c) const
{
return (c.*functionPointer)();
}
private:
FunctionPointerType functionPointer;
};
} // namespace QtConcurrent.
#endif //qdoc
QT_END_NAMESPACE
QT_END_HEADER
#endif // QT_NO_CONCURRENT
#endif
|
char *keywords[] = {
"device",
"default",
"acl",
"slot",
"shelf",
"interface",
"target",
"filename",
"access-list",
"name",
"policy",
"accept",
"reject",
"writecache",
"broadcast",
"log-level",
"syslog-level",
"syslog-facility",
"persistent-cfg",
"write",
"read",
"cfgset",
"cfgread",
"discover",
"logging",
"log",
"type",
"mtu",
"log",
"if",
"=",
"{",
"}",
";",
"include",
"apisocket"
};
#define KMAX (sizeof(keywords)/sizeof(char *))
char *datatype[] = {
"default", "b",
"access-list","b",
"device","b",
"acl", "b",
"logging", "b",
"writecache", "%s;",
"slot","%d;",
"shelf","%d;",
"mtu","%s;",
"target","%s;",
"cfgread","%s;",
"read","%s;",
"type","%s;",
"if","%s;",
"log","%s;",
"write","%s;",
"filename","%s;",
"discover","%s;",
"cfgset","%s;",
"writecache","%s;",
"log-level","%s;",
"syslog-level","%s;",
"syslog-facility","%s;",
"persistent-cfg","%s;",
"broadcast","%s;",
"apisocket","%s;",
"include", "%s;"
};
#define DMAX ((sizeof(datatype)/sizeof(char *)))
char *arglist[] = {
"writecache", "on|off",
"type", "syslog|file",
"broadcast","on|off",
"policy","accept|reject",
"log-level","debug|error|info|none",
"syslog-level","LOG_EMERG|LOG_ALERT|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_NOTICE|LOG_INFO|LOG_DEBUG",
"syslog-facility","LOG_DAEMON|LOG_LOCAL0|LOG_LOCAL1|LOG_LOCAL2|LOG_LOCAL3|LOG_LOCAL4|LOG_LOCAL5|LOG_LOCAL6|LOG_LOCAL7|LOG_USER"
};
#define AMAX ((sizeof(arglist)/sizeof(char *)))
|
/*
Launchy: Application Launcher
Copyright (C) 2007 Josh Karlin
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 CATALOG_H
#define CATALOG_H
#include <QString>
#include <QStringList>
#include <QBitArray>
#include <QIcon>
#include <QHash>
#include <QDataStream>
#include <QDir>
#include <QSet>
/**
\brief CatItem (Catalog Item) stores a single item in the index
*/
class CatItem {
public:
/** The full path of the indexed item */
QString fullPath;
/** The abbreviated name of the indexed item */
QString shortName;
/** The lowercase name of the indexed item */
QString lowName;
/** A path to an icon for the item */
QString icon;
/** How many times this item has been called by the user */
int usage;
/** This is unused, and meant for plugin writers and future extensions */
void* data;
/** The plugin id of the creator of this CatItem */
int id;
CatItem() {}
CatItem(QString full, bool isDir = false)
: fullPath(full) {
int last = fullPath.lastIndexOf("/");
if (last == -1) {
shortName = fullPath;
} else {
shortName = fullPath.mid(last+1);
if (!isDir)
shortName = shortName.mid(0,shortName.lastIndexOf("."));
}
lowName = shortName.toLower();
data = NULL;
usage = 0;
id = 0;
}
CatItem(QString full, QString shortN)
: fullPath(full), shortName(shortN)
{
lowName = shortName.toLower();
data = NULL;
usage = 0;
id = 0;
}
CatItem(QString full, QString shortN, uint i_d)
: id(i_d), fullPath(full), shortName(shortN)
{
lowName = shortName.toLower();
data = NULL;
usage = 0;
}
/** This is the constructor most used by plugins
\param full The full path of the file to execute
\param The abbreviated name for the entry
\param i_d Your plugin id (0 for Launchy itself)
\param iconPath The path to the icon for this entry
\warning It is usually a good idea to append ".your_plugin_name" to the end of the full parameter
so that there are not multiple items in the index with the same full path.
*/
CatItem(QString full, QString shortN, uint i_d, QString iconPath)
: id(i_d), fullPath(full), shortName(shortN), icon(iconPath)
{
lowName = shortName.toLower();
data = NULL;
usage = 0;
}
CatItem(const CatItem &s) {
fullPath = s.fullPath;
shortName = s.shortName;
lowName = s.lowName;
icon = s.icon;
usage = s.usage;
data = s.data;
id = s.id;
}
CatItem& operator=( const CatItem &s ) {
fullPath = s.fullPath;
shortName = s.shortName;
lowName = s.lowName;
icon = s.icon;
usage = s.usage;
data = s.data;
id = s.id;
return *this;
}
bool operator==(const CatItem& other) const{
if (fullPath == other.fullPath)
return true;
return false;
}
};
/** InputData shows one segment (between tabs) of a user's query
A user's query is typically represented by List<InputData>
and each element of the list represents a segment of the query.
E.g. query = "google <tab> this is my search" will have 2 InputData segments
in the list. One for "google" and one for "this is my search"
*/
class InputData
{
private:
/** The user's entry */
QString text;
/** Any assigned labels to this query segment */
QSet<uint> labels;
/** A pointer to the best catalog match for this segment of the query */
CatItem topResult;
/** The plugin id of this query's owner */
uint id;
public:
/** Get the labels applied to this query segment */
QSet<uint> getLabels() { return labels; }
/** Apply a label to this query segment */
void setLabel(uint l) { labels.insert(l); }
/** Check if it has the given label applied to it */
bool hasLabel(uint l) { return labels.contains(l); }
/** Set the id of this query
This can be used to override the owner of the selected catalog item, so that
no matter what item is chosen from the catalog, the given plugin will be the one
to execute it.
\param i The plugin id of the plugin to execute the query's best match from the catalog
*/
void setID(uint i) { id = i; }
/** Returns the current owner id of the query */
uint getID() { return id; }
/** Get the text of the query segment */
QString getText() { return text; }
/** Set the text of the query segment */
void setText(QString t) { text = t; }
/** Get a pointer to the best catalog match for this segment of the query */
CatItem& getTopResult() { return topResult; }
/** Change the best catalog match for this segment */
void setTopResult(CatItem sr) { topResult = sr; }
InputData() { id = 0; }
InputData(QString str) : text(str) { id = 0;}
};
bool CatLess (CatItem* left, CatItem* right);
bool CatLessNoPtr (CatItem & a, CatItem & b);
inline QDataStream &operator<<(QDataStream &out, const CatItem &item) {
out << item.fullPath;
out << item.shortName;
out << item.lowName;
out << item.icon;
out << item.usage;
out << item.id;
return out;
}
inline QDataStream &operator>>(QDataStream &in, CatItem &item) {
in >> item.fullPath;
in >> item.shortName;
in >> item.lowName;
in >> item.icon;
in >> item.usage;
in >> item.id;
return in;
}
#endif
|
/*
* This program is is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* $Id$
* @file trustrouter.h
* @brief Headers for trust router code
*
* @copyright 2014 Network RADIUS SARL
*/
#ifndef TRUSTROUTER_INTEG_H
#define TRUSTROUTER_INTEG_H
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
REALM *tr_query_realm(REQUEST *request, char const *realm,
char const *community,
char const *rp_realm,
char const *trust_router,
unsigned int port);
bool tr_init(void);
#endif
|
#pragma once
#ifndef _ENTITY_H_
#define _ENTITY_H_
#include "rlUtilJM.h"
#include "rlVector2.h"
class Entity {
public:
///<param name="_type">The entity's type. Use CHARACTER, BACKGROUND or WALL</param>
Entity(const int& _type, const int& _x, const int& _y);
///<summary>Empty entity</summary>
Entity();
~Entity();
//Getters
inline int getX() { return pos.getX(); };
inline float getXf() { return pos.getXf(); };
inline int getY() { return pos.getY(); };
inline float getYf(){ return pos.getYf(); };
inline int getAttack() { return attack; };
inline int getSpeed() { return speed; };
inline bool isAlive() { return alive; };
inline int** getSprite() { return sprite; };
inline int getSpriteSizeHor() { return spriteSizeX; };
inline int getSpriteSizeVer() { return spriteSizeY; };
inline int getType() { return type; };
inline int getLife() { return life; };
inline bool isOnCollision() { return isCollisioning; };
inline Entity* collisionOther() { return otherColEntity; };
inline bool getIsStatic() { return isStatic; };
//Setters
inline void setX(const float& _x) { pos.setX(_x); };
inline void setY(const float& _y) { pos.setY( _y); };
///<summary>
///Don't fill if it's a background.
///</summary>
inline void setAttack(const int& _attack) { attack = _attack; };
inline void setLife(const int& _life) { life = _life; };
///<summary>
///Don't fill if it's a background.
///</summary>
inline void setSpeed(const int& _speed) { speed = _speed; };
void setSprite(int** const& _sprite);
void setColors(const int& col1, const int& col2, const int& col3, const int& col4);
///<summary>
///Don't fill if it's a background.
///</summary>
inline void setWeaponColor(const int& _weapon) { weapon = _weapon; };
void setLetters(const char& let1, const char& let2, const char& let3, const char& let4);
///<summary>
///Don't fill if it's a background.
///</summary>
inline void setWeaponLetter(const char& _let) { charWeapon = _let; };
void setBackgrounds(const int& _bg1, const int& _bg2, const int& _bg3, const int& _bg4);
void InitSprite(const int& sizeX, const int& sizeY);
inline void setIsStatic(const bool& _static) { isStatic = _static; };
//Modifiers
void addX(const float& _x);
void addY(const float& _y);
inline void addLife(const int& _life) { life += _life; };
inline void addAttack(const int& _attack) { attack += _attack; };
inline void changeAlive() { alive ^= true; };
inline void addSpeed(const int& _speed) { speed += _speed; };
void draw();
void freeSprite();
///<summary>
///DO NOT CALL THIS METHOD.
///It is used internally to manage layer collisions.
///</summary>
inline void SetCollisionState(const bool& onCol, Entity* const& other) { isCollisioning = onCol; otherColEntity = other; };
private:
void DrawBody();
rlVector2 pos;
int life;
int attack;
int speed;
int** sprite;
bool alive;
int color1;
int color2;
int color3;
int color4;
int weapon;
char letter1;
char letter2;
char letter3;
char letter4;
char charWeapon;
int bg1;
int bg2;
int bg3;
int bg4;
int spriteSizeX;
int spriteSizeY;
int type;
bool isCollisioning;
bool isStatic;
Entity* otherColEntity;
};
#endif // !_ENTITY_H_
|
/*
** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
** See ../LICENSE for license information.
**
*/
# ifndef FUNCTIONCLAUSELIST_H
# define FUNCTIONCLAUSELIST_H
/*:private:*/ typedef /*@only@*/ functionClause o_functionClause;
struct s_functionClauseList
{
int nelements;
int nspace;
/*@reldef@*/ /*@relnull@*/ o_functionClause *elements;
} ;
/*@constant null functionClauseList functionClauseList_undefined;@*/
# define functionClauseList_undefined ((functionClauseList) NULL)
extern /*@falsewhennull@*/ bool functionClauseList_isDefined (functionClauseList p_s) /*@*/ ;
# define functionClauseList_isDefined(s) ((s) != functionClauseList_undefined)
extern /*@nullwhentrue@*/ bool functionClauseList_isUndefined (functionClauseList p_s) /*@*/ ;
# define functionClauseList_isUndefined(s) ((s) == functionClauseList_undefined)
extern int functionClauseList_size (/*@sef@*/ functionClauseList) /*@*/ ;
# define functionClauseList_size(s) (functionClauseList_isDefined (s) ? (s)->nelements : 0)
extern /*@unused@*/ /*@falsewhennull@*/ bool functionClauseList_empty (/*@sef@*/ functionClauseList) /*@*/ ;
# define functionClauseList_empty(s) (functionClauseList_size(s) == 0)
extern cstring functionClauseList_unparseSep (functionClauseList p_s, cstring p_sep) /*@*/ ;
extern /*@unused@*/ /*@only@*/ functionClauseList functionClauseList_new (void) /*@*/ ;
extern /*@only@*/ functionClauseList functionClauseList_single (/*@keep@*/ functionClause p_el) /*@*/ ;
extern /*@unused@*/ functionClauseList
functionClauseList_add (/*@returned@*/ functionClauseList p_s, /*@keep@*/ functionClause p_el)
/*@modifies p_s@*/ ;
extern /*@only@*/ functionClauseList
functionClauseList_prepend (/*@only@*/ functionClauseList p_s, /*@keep@*/ functionClause p_el)
/*@modifies p_s@*/ ;
extern /*@unused@*/ /*@only@*/ cstring functionClauseList_unparse (functionClauseList p_s) ;
extern void functionClauseList_free (/*@only@*/ functionClauseList p_s) ;
functionClauseList
functionClauseList_setImplicitConstraints (/*@returned@*/ functionClauseList p_s);
/*@constant int functionClauseListBASESIZE;@*/
# define functionClauseListBASESIZE MIDBASESIZE
/*@iter functionClauseList_elements (sef functionClauseList x, yield exposed functionClause el); @*/
# define functionClauseList_elements(x, m_el) \
{ if (functionClauseList_isDefined (x)) { \
int m_ind; functionClause *m_elements = &((x)->elements[0]); \
for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
{ functionClause m_el = *(m_elements++);
# define end_functionClauseList_elements }}}
# else
# error "Multiple include"
# endif
|
#import <CoreData/CoreData.h>
#import "AbstractPost.h"
@class Coordinate;
@interface Post : AbstractPost
///-------------------------------
/// @name Specific Post properties
///-------------------------------
@property (nonatomic, strong) Coordinate * geolocation;
@property (nonatomic, strong) NSString * tags;
@property (nonatomic, strong) NSString * postFormat;
@property (nonatomic, strong) NSString * postFormatText;
@property (nonatomic, strong) NSMutableSet * categories;
// We shouldn't need to store this, but if we don't send IDs on edits
// custom fields get duplicated and stop working
@property (nonatomic, retain) NSString *latitudeID;
@property (nonatomic, retain) NSString *longitudeID;
@property (nonatomic, retain) NSString *publicID;
/**
A tag for specific post workflows. Only QuickPhoto for now.
Used for usage stats only.
*/
@property (nonatomic, strong) NSString *specialType;
///---------------------
/// @name Helper methods
///---------------------
/**
Returns categories as a comma-separated list
*/
- (NSString *)categoriesText;
/**
Set the categories for a post
@param categoryNames a `NSArray` with the names of the categories for this post. If a given category name doesn't exist it's ignored.
*/
- (void)setCategoriesFromNames:(NSArray *)categoryNames;
@end |
/*
* arch-tag: Simple test for the RBEntryView widget
*
* Copyright (C) 2003 Colin Walters <walters@verbum.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.
*
* The Rhythmbox authors hereby grant permission for non-GPL compatible
* GStreamer plugins to be used and distributed together with GStreamer
* and Rhythmbox. This permission is above and beyond the permissions granted
* by the GPL license by which Rhythmbox is covered. If you modify this code
* you may extend this exception to your version of the code, but you are not
* obligated to do so. If you do not wish to do so, delete this exception
* statement from your version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include "rb-debug.h"
#include "rb-thread-helpers.h"
#include "rb-file-helpers.h"
#include "rb-stock-icons.h"
#include "rb-entry-view.h"
static RhythmDBEntry *
create_entry (RhythmDB *db,
const char *location, const char *name, const char *album,
const char *artist, const char *genre)
{
RhythmDBEntry *entry;
GValue val = {0, };
entry = rhythmdb_entry_new (db, RHYTHMDB_ENTRY_TYPE_IGNORE, location);
g_assert (entry);
g_value_init (&val, G_TYPE_STRING);
g_value_set_static_string (&val, genre);
rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_GENRE, &val);
g_value_unset (&val);
g_value_init (&val, G_TYPE_STRING);
g_value_set_static_string (&val, artist);
rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_ARTIST, &val);
g_value_unset (&val);
g_value_init (&val, G_TYPE_STRING);
g_value_set_static_string (&val, album);
rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_ALBUM, &val);
g_value_unset (&val);
g_value_init (&val, G_TYPE_STRING);
g_value_set_static_string (&val, name);
rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_TITLE, &val);
g_value_unset (&val);
return entry;
}
static void
completed_cb (RhythmDBQueryModel *model, gboolean *complete)
{
rb_debug ("query complete");
*complete = TRUE;
}
static void
wait_for_model_completion (RhythmDBQueryModel *model)
{
gboolean complete = FALSE;
GTimeVal timeout;
g_signal_connect (G_OBJECT (model), "complete",
G_CALLBACK (completed_cb), &complete);
while (!complete) {
g_get_current_time (&timeout);
g_time_val_add (&timeout, G_USEC_PER_SEC);
rb_debug ("polling model for changes");
rhythmdb_query_model_sync (model, &timeout);
g_usleep (G_USEC_PER_SEC / 10.0);
}
}
int
main (int argc, char **argv)
{
GtkWidget *main_window;
GtkTreeModel *main_model;
GtkTreeIter iter;
RBEntryView *view;
RhythmDB *db;
RhythmDBEntry *entry;
gtk_init (&argc, &argv);
g_thread_init (NULL);
gdk_threads_init ();
rb_thread_helpers_init ();
rb_file_helpers_init (TRUE);
rb_stock_icons_init ();
rb_debug_init (TRUE);
GDK_THREADS_ENTER ();
db = rhythmdb_tree_new ("test");
rhythmdb_write_lock (db);
entry = create_entry (db, "file:///sin.mp3",
"Sin", "Pretty Hate Machine", "Nine Inch Nails", "Rock");
rhythmdb_write_unlock (db);
rhythmdb_read_lock (db);
main_model = GTK_TREE_MODEL (rhythmdb_query_model_new_empty (db));
rhythmdb_do_full_query (db, main_model,
RHYTHMDB_QUERY_PROP_EQUALS,
RHYTHMDB_PROP_TYPE, RHYTHMDB_ENTRY_TYPE_IGNORE,
RHYTHMDB_QUERY_END);
wait_for_model_completion (RHYTHMDB_QUERY_MODEL (main_model));
g_assert (gtk_tree_model_get_iter_first (main_model, &iter));
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
view = rb_entry_view_new (db, rb_file ("rb-entry-view-library.xml"));
rb_entry_view_set_query_model (view, RHYTHMDB_QUERY_MODEL (main_model));
gtk_container_add (GTK_CONTAINER (main_window), GTK_WIDGET (view));
g_signal_connect (G_OBJECT (main_window), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show_all (GTK_WIDGET (main_window));
gtk_main ();
rhythmdb_shutdown (db);
g_object_unref (G_OBJECT (db));
GDK_THREADS_LEAVE ();
exit (0);
}
|
#pragma once
#include <iosfwd>
#include <iostream>
namespace helpers {
namespace syntax {
/// in-class initializable object
template <typename T, const T default_value = 0>
struct zero_inited {
zero_inited(const T& _ = default_value) : value(_) {}
operator T& () { return value; }
operator const T&() const { return value; }
T value;
};
typedef zero_inited<unsigned> zuint;
typedef zero_inited<int> zint;
typedef zero_inited<bool> zbool;
/// just like std::auto_ptr, but invokes free upon destruction
/**
* @brief auto pointer for C arrays.
*
* It behaves like std::auto_ptr (and std::unique_ptr in C++11),
* but cleans its data using free ().
**/
template <typename T>
struct auto_free {
auto_free(T* _) : data(_){}
~auto_free() { cleanup(); }
operator T*() const { return data; }
const T& operator[](size_t _) const { return data[_]; }
T& operator[](size_t _) { return data[_]; }
void reset (T* _new_buffer = NULL) {
if (data == _new_buffer)
return;
cleanup ();
data = _new_buffer;
}
T* release () {
T* ptr = data;
data = NULL;
return ptr;
}
private:
void cleanup() { free (data); }
T* data;
};
/// function to avoid explicit template parameters
template <typename T>
auto_free<T> mk_auto_free(T* _) { return auto_free<T>(_); }
/// Push a variable's value, assign a new value and pop back the original one upon the object destruction.
template <typename T, typename conversible_to_T = T>
struct hide_value {
hide_value(T& _, const conversible_to_T& _new)
: _Target(_), _Old_value(_), _Relax(false) { _Target = _new; }
const T& Release() { _Relax = true; return _Old_value; }
void Reset() { _Target = _Old_value; }
~hide_value() { if (not _Relax) Reset(); }
private:
T& _Target;
const T _Old_value;
bool _Relax;
};
// I'm sorry, but I've read Alexandrescu and cannot help using it...
// This type can be used to overload functions depending on their return type or to partially instantiate template functions via fake overloading
template <typename T> struct Type{};
}
namespace qt {
/// transform «~/» at the beginning to the path to home dir
inline QString expandTilde (QString s) {
if (s.startsWith ("~/"))
s.replace (0, 1, QDir::homePath());
return s;
}
inline std::ostream& operator<< (std::ostream& _str, const QString& _qstr) {
return _str << qPrintable(_qstr);
}
}
}
|
//
// SAToDoTableViewCell.h
// SelfAgile
//
// Created by chen Yuheng on 15/6/9.
// Copyright (c) 2015年 chen Yuheng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SAToDoTableViewCell : UITableViewCell
@property (nonatomic,strong) NSDictionary *event;
@end
|
/*
* ircd-ratbox: A slightly useful ircd.
* m_oquit.c: Allows an oper to quit from IRC with no quit prefix.
*
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
* Copyright (C) 1996-2002 Hybrid Development Team
* Copyright (C) 2002-2005 ircd-ratbox development team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
*/
#include "stdinc.h"
#include "client.h"
#include "ircd.h"
#include "numeric.h"
#include "s_serv.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "s_conf.h"
#include "inline/stringops.h"
static int m_oquit(struct Client *, struct Client *, int, const char **);
struct Message oquit_msgtab = {
"OQUIT", 0, 0, 0, MFLG_SLOW | MFLG_UNREG,
{{m_oquit, 0}, {m_oquit, 0}, mg_ignore, mg_ignore, mg_ignore, {m_oquit, 0}}
};
mapi_clist_av1 oquit_clist[] = { &oquit_msgtab, NULL };
DECLARE_MODULE_AV1(oquit, NULL, NULL, oquit_clist, NULL, NULL, "$Revision: 1333 $");
/*
** m_oquit
** parv[1] = comment
*/
static int
m_oquit(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
char *comment = LOCAL_COPY((parc > 1 && parv[1]) ? parv[1] : client_p->name);
source_p->flags |= FLAGS_NORMALEX;
if(strlen(comment) > (size_t) REASONLEN)
comment[REASONLEN] = '\0';
if(!IsOper(source_p)) {
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "oquit");
return 0;
}
exit_client(client_p, source_p, source_p, comment);
return 0;
}
|
#ifndef __TOMTOM_MEM_H__
#define __TOMTOM_MEM_H__
struct ttmem_info {
void (* allow)(void);
void (* disallow)(void);
};
#endif /* __TOMTOM_MEM_H__ */
|
/*
Copyright (c) 1999 XFree86 Inc
*/
/* $XFree86: xc/include/extensions/xf86dga.h,v 3.20 1999/10/13 04:20:48 dawes Exp $ */
#ifndef _XF86DGA_H_
#define _XF86DGA_H_
#include <nx-X11/Xfuncproto.h>
#include <nx-X11/extensions/xf86dga1.h>
#define X_XDGAQueryVersion 0
/* 1 through 9 are in xf86dga1.h */
/* 10 and 11 are reserved to avoid conflicts with rogue DGA extensions */
#define X_XDGAQueryModes 12
#define X_XDGASetMode 13
#define X_XDGASetViewport 14
#define X_XDGAInstallColormap 15
#define X_XDGASelectInput 16
#define X_XDGAFillRectangle 17
#define X_XDGACopyArea 18
#define X_XDGACopyTransparentArea 19
#define X_XDGAGetViewportStatus 20
#define X_XDGASync 21
#define X_XDGAOpenFramebuffer 22
#define X_XDGACloseFramebuffer 23
#define X_XDGASetClientVersion 24
#define X_XDGAChangePixmapMode 25
#define X_XDGACreateColormap 26
#define XDGAConcurrentAccess 0x00000001
#define XDGASolidFillRect 0x00000002
#define XDGABlitRect 0x00000004
#define XDGABlitTransRect 0x00000008
#define XDGAPixmap 0x00000010
#define XDGAInterlaced 0x00010000
#define XDGADoublescan 0x00020000
#define XDGAFlipImmediate 0x00000001
#define XDGAFlipRetrace 0x00000002
#define XDGANeedRoot 0x00000001
#define XF86DGANumberEvents 7
#define XDGAPixmapModeLarge 0
#define XDGAPixmapModeSmall 1
#define XF86DGAClientNotLocal 0
#define XF86DGANoDirectVideoMode 1
#define XF86DGAScreenNotActive 2
#define XF86DGADirectNotActivated 3
#define XF86DGAOperationNotSupported 4
#define XF86DGANumberErrors (XF86DGAOperationNotSupported + 1)
typedef struct {
int num; /* A unique identifier for the mode (num > 0) */
char *name; /* name of mode given in the XF86Config */
float verticalRefresh;
int flags; /* DGA_CONCURRENT_ACCESS, etc... */
int imageWidth; /* linear accessible portion (pixels) */
int imageHeight;
int pixmapWidth; /* Xlib accessible portion (pixels) */
int pixmapHeight; /* both fields ignored if no concurrent access */
int bytesPerScanline;
int byteOrder; /* MSBFirst, LSBFirst */
int depth;
int bitsPerPixel;
unsigned long redMask;
unsigned long greenMask;
unsigned long blueMask;
short visualClass;
int viewportWidth;
int viewportHeight;
int xViewportStep; /* viewport position granularity */
int yViewportStep;
int maxViewportX; /* max viewport origin */
int maxViewportY;
int viewportFlags; /* types of page flipping possible */
int reserved1;
int reserved2;
} XDGAMode;
typedef struct {
XDGAMode mode;
unsigned char *data;
Pixmap pixmap;
} XDGADevice;
#ifndef _XF86DGA_SERVER_
_XFUNCPROTOBEGIN
typedef struct {
int type;
unsigned long serial;
Display *display;
int screen;
Time time;
unsigned int state;
unsigned int button;
} XDGAButtonEvent;
typedef struct {
int type;
unsigned long serial;
Display *display;
int screen;
Time time;
unsigned int state;
unsigned int keycode;
} XDGAKeyEvent;
typedef struct {
int type;
unsigned long serial;
Display *display;
int screen;
Time time;
unsigned int state;
int dx;
int dy;
} XDGAMotionEvent;
typedef union {
int type;
XDGAButtonEvent xbutton;
XDGAKeyEvent xkey;
XDGAMotionEvent xmotion;
long pad[24];
} XDGAEvent;
Bool XDGAQueryExtension(
Display *dpy,
int *eventBase,
int *erroBase
);
Bool XDGAQueryVersion(
Display *dpy,
int *majorVersion,
int *minorVersion
);
XDGAMode* XDGAQueryModes(
Display *dpy,
int screen,
int *num
);
XDGADevice* XDGASetMode(
Display *dpy,
int screen,
int mode
);
Bool XDGAOpenFramebuffer(
Display *dpy,
int screen
);
void XDGACloseFramebuffer(
Display *dpy,
int screen
);
void XDGASetViewport(
Display *dpy,
int screen,
int x,
int y,
int flags
);
void XDGAInstallColormap(
Display *dpy,
int screen,
Colormap cmap
);
Colormap XDGACreateColormap(
Display *dpy,
int screen,
XDGADevice *device,
int alloc
);
void XDGASelectInput(
Display *dpy,
int screen,
long event_mask
);
void XDGAFillRectangle(
Display *dpy,
int screen,
int x,
int y,
unsigned int width,
unsigned int height,
unsigned long color
);
void XDGACopyArea(
Display *dpy,
int screen,
int srcx,
int srcy,
unsigned int width,
unsigned int height,
int dstx,
int dsty
);
void XDGACopyTransparentArea(
Display *dpy,
int screen,
int srcx,
int srcy,
unsigned int width,
unsigned int height,
int dstx,
int dsty,
unsigned long key
);
int XDGAGetViewportStatus(
Display *dpy,
int screen
);
void XDGASync(
Display *dpy,
int screen
);
Bool XDGASetClientVersion(
Display *dpy
);
void XDGAChangePixmapMode(
Display *dpy,
int screen,
int *x,
int *y,
int mode
);
void XDGAKeyEventToXKeyEvent(XDGAKeyEvent* dk, XKeyEvent* xk);
_XFUNCPROTOEND
#endif /* _XF86DGA_SERVER_ */
#endif /* _XF86DGA_H_ */
|
/*
* QEMU GMCH/ICH9 LPC PM Emulation
*
* Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
* VA Linux Systems Japan K.K.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>
*/
#ifndef HW_ACPI_ICH9_H
#define HW_ACPI_ICH9_H
#include "acpi.h"
typedef struct ICH9LPCPMRegs {
/*
* In ich9 spec says that pm1_cnt register is 32bit width and
* that the upper 16bits are reserved and unused.
* PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
*/
ACPIREGS acpi_regs;
MemoryRegion io;
MemoryRegion io_gpe;
MemoryRegion io_smi;
uint32_t smi_en;
uint32_t smi_sts;
qemu_irq irq; /* SCI */
uint32_t pm_io_base;
Notifier powerdown_notifier;
} ICH9LPCPMRegs;
void ich9_pm_init(ICH9LPCPMRegs *pm,
qemu_irq sci_irq, qemu_irq cmos_s3_resume);
void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
extern const VMStateDescription vmstate_ich9_pm;
#endif /* HW_ACPI_ICH9_H */
|
#ifndef __NETNS_CONNTRACK_H
#define __NETNS_CONNTRACK_H
#include <linux/list.h>
#include <linux/list_nulls.h>
#include <linux/atomic.h>
#include <linux/netfilter/nf_conntrack_tcp.h>
struct ctl_table_header;
struct nf_conntrack_ecache;
struct nf_proto_net {
#ifdef CONFIG_SYSCTL
struct ctl_table_header *ctl_table_header;
struct ctl_table *ctl_table;
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
struct ctl_table_header *ctl_compat_header;
struct ctl_table *ctl_compat_table;
#endif
#endif
unsigned int users;
};
struct nf_generic_net {
struct nf_proto_net pn;
unsigned int timeout;
};
struct nf_tcp_net {
struct nf_proto_net pn;
unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
unsigned int tcp_loose;
unsigned int tcp_be_liberal;
unsigned int tcp_max_retrans;
};
enum udp_conntrack {
UDP_CT_UNREPLIED,
UDP_CT_REPLIED,
UDP_CT_MAX
};
struct nf_udp_net {
struct nf_proto_net pn;
unsigned int timeouts[UDP_CT_MAX];
};
struct nf_icmp_net {
struct nf_proto_net pn;
unsigned int timeout;
};
struct nf_ip_net {
struct nf_generic_net generic;
struct nf_tcp_net tcp;
struct nf_udp_net udp;
struct nf_icmp_net icmp;
struct nf_icmp_net icmpv6;
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
struct ctl_table_header *ctl_table_header;
struct ctl_table *ctl_table;
#endif
};
struct netns_ct {
atomic_t count;
unsigned int expect_count;
#ifdef CONFIG_SYSCTL
struct ctl_table_header *sysctl_header;
struct ctl_table_header *acct_sysctl_header;
struct ctl_table_header *tstamp_sysctl_header;
struct ctl_table_header *event_sysctl_header;
struct ctl_table_header *helper_sysctl_header;
#endif
char *slabname;
int skip_filter;
unsigned int sysctl_log_invalid; /* Log invalid packets */
unsigned int sysctl_events_retry_timeout;
int sysctl_events;
int sysctl_acct;
int sysctl_auto_assign_helper;
bool auto_assign_helper_warned;
int sysctl_tstamp;
int sysctl_checksum;
unsigned int htable_size;
struct kmem_cache *nf_conntrack_cachep;
struct hlist_nulls_head *hash;
struct hlist_head *expect_hash;
struct hlist_nulls_head unconfirmed;
struct hlist_nulls_head dying;
struct hlist_nulls_head tmpl;
struct ip_conntrack_stat __percpu *stat;
#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
struct atomic_notifier_head nf_conntrack_chain;
#else
struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
#endif
struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
struct nf_ip_net nf_ct_proto;
#if defined(CONFIG_NF_CONNTRACK_LABELS)
unsigned int labels_used;
u8 label_words;
#endif
#ifdef CONFIG_NF_NAT_NEEDED
struct hlist_head *nat_bysource;
struct hlist_head *nat_by_modified_source;
unsigned int nat_htable_size;
#endif
};
#endif
|
/*
* Copyright(C) 2011-2012 Alibaba Group Holding Limited
*
* 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 <easy_time.h>
#include <sys/time.h>
/**
* localtime删除tzset,一起调用一次tzset
*/
int easy_localtime (const time_t *t, struct tm *tp)
{
static const unsigned short int mon_yday[2][13] = {
/* Normal years. */
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
/* Leap years. */
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
};
#define SECS_PER_HOUR (60 * 60)
#define SECS_PER_DAY (SECS_PER_HOUR * 24)
#define ISLEAP(year) ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
long int days, rem, y;
const unsigned short int *ip;
days = *t / SECS_PER_DAY;
rem = *t % SECS_PER_DAY;
rem -= timezone;
while (rem < 0) {
rem += SECS_PER_DAY;
--days;
}
while (rem >= SECS_PER_DAY) {
rem -= SECS_PER_DAY;
++days;
}
tp->tm_hour = rem / SECS_PER_HOUR;
rem %= SECS_PER_HOUR;
tp->tm_min = rem / 60;
tp->tm_sec = rem % 60;
/* January 1, 1970 was a Thursday. */
tp->tm_wday = (4 + days) % 7;
if (tp->tm_wday < 0)
tp->tm_wday += 7;
y = 1970;
while (days < 0 || days >= (ISLEAP (y) ? 366 : 365)) {
/* Guess a corrected year, assuming 365 days per year. */
long int yg = y + days / 365 - (days % 365 < 0);
/* Adjust DAYS and Y to match the guessed year. */
days -= ((yg - y) * 365
+ LEAPS_THRU_END_OF (yg - 1)
- LEAPS_THRU_END_OF (y - 1));
y = yg;
}
tp->tm_year = y - 1900;
if (tp->tm_year != y - 1900) {
return 0;
}
tp->tm_yday = days;
ip = mon_yday[ISLEAP(y)];
for (y = 11; days < (long int) ip[y]; --y)
continue;
days -= ip[y];
tp->tm_mon = y;
tp->tm_mday = days + 1;
return 1;
}
void __attribute__((constructor)) easy_time_start_()
{
tzset();
}
int64_t easy_time_now()
{
struct timeval tv;
gettimeofday (&tv, 0);
return __INT64_C(1000000) * tv.tv_sec + tv.tv_usec;
}
|
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2005 Simon Howard
//
// 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.
//
//-----------------------------------------------------------------------------
//
// Parses "Sound" sections in dehacked files
//
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include "doomdef.h"
#include "doomfeatures.h"
#include "doomtype.h"
#include "deh_defs.h"
#include "deh_main.h"
#include "deh_mapping.h"
#include "sounds.h"
DEH_BEGIN_MAPPING(sound_mapping, sfxinfo_t)
DEH_UNSUPPORTED_MAPPING("Offset")
DEH_MAPPING("Zero/One", singularity)
DEH_MAPPING("Value", priority)
DEH_MAPPING("Zero 1", link)
DEH_MAPPING("Zero 2", pitch)
DEH_MAPPING("Zero 3", volume)
DEH_MAPPING("Zero 4", data)
DEH_MAPPING("Neg. One 1", usefulness)
DEH_MAPPING("Neg. One 2", lumpnum)
DEH_END_MAPPING
static void *DEH_SoundStart(deh_context_t *context, char *line)
{
int sound_number = 0;
if (sscanf(line, "Sound %i", &sound_number) != 1)
{
DEH_Warning(context, "Parse error on section start");
return NULL;
}
if (sound_number < 0 || sound_number >= NUMSFX)
{
DEH_Warning(context, "Invalid sound number: %i", sound_number);
return NULL;
}
if (sound_number >= DEH_VANILLA_NUMSFX)
{
DEH_Warning(context, "Attempt to modify SFX %i. This will cause "
"problems in Vanilla dehacked.", sound_number);
}
return &S_sfx[sound_number];
}
static void DEH_SoundParseLine(deh_context_t *context, char *line, void *tag)
{
sfxinfo_t *sfx;
char *variable_name, *value;
int ivalue;
if (tag == NULL)
return;
sfx = (sfxinfo_t *) tag;
// Parse the assignment
if (!DEH_ParseAssignment(line, &variable_name, &value))
{
// Failed to parse
DEH_Warning(context, "Failed to parse assignment");
return;
}
// all values are integers
ivalue = atoi(value);
// Set the field value
DEH_SetMapping(context, &sound_mapping, sfx, variable_name, ivalue);
}
deh_section_t deh_section_sound =
{
"Sound",
NULL,
DEH_SoundStart,
DEH_SoundParseLine,
NULL,
NULL,
};
|
/*
* File: queue.c
* -------------
* This file implements the queue.h abstraction using an array.
*/
#include <stdio.h>
#include "genlib.h"
#include "queue.h"
/*
* Constants:
* ----------
* MaxQueueSize -- Maximum number of elements in the queue
*/
#define MaxQueueSize 10
/*
* Type: queueCDT
* --------------
* This type provides the concrete counterpart to the queueADT.
* The representation used here consists of an array coupled
* with an integer indicating the effective size. This
* representation means that Dequeue must shift the existing
* elements in the queue.
*/
struct queueCDT {
void *array[MaxQueueSize];
int len;
};
/* Exported entries */
/*
* Function: NewQueue
* ------------------
* This function allocates and initializes the storage for a
* new queue.
*/
queueADT NewQueue(void)
{
queueADT queue;
queue = New(queueADT);
queue->len = 0;
return (queue);
}
/*
* Function: FreeQueue
* -------------------
* This function frees the queue storage.
*/
void FreeQueue(queueADT queue)
{
FreeBlock(queue);
}
/*
* Function: Enqueue
* -----------------
* This function adds a new element to the queue.
*/
void Enqueue(queueADT queue, void *obj)
{
if (queue->len == MaxQueueSize) {
Error("Enqueue called on a full queue");
}
queue->array[queue->len++] = obj;
}
/*
* Function: Dequeue
* -----------------
* This function removes and returns the data value at the
* head of the queue.
*/
void *Dequeue(queueADT queue)
{
void *result;
int i;
if (queue->len == 0) Error("Dequeue of empty queue");
result = queue->array[0];
for (i = 1; i < queue->len; i++) {
queue->array[i - 1] = queue->array[i];
}
queue->len--;
return (result);
}
/*
* Function: QueueLength
* ---------------------
* This function returns the number of elements in the queue.
*/
int QueueLength(queueADT queue)
{
return (queue->len);
}
|
/*
* Copyright (c) 2006 Steven Dake (sdake@mvista.com)
* Copyright (c) 2006 Sun Microsystems, Inc.
*
* This software licensed under BSD license, the text of which follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the MontaVista Software, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/uio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <sched.h>
#include <time.h>
#include <pthread.h>
#include <sys/poll.h>
#include <string.h>
#define SERVER_BACKLOG 5
#if defined(OPENAIS_LINUX) || defined(OPENAIS_SOLARIS)
/* SUN_LEN is broken for abstract namespace
*/
#define AIS_SUN_LEN(a) sizeof(*(a))
#else
#define AIS_SUN_LEN(a) SUN_LEN(a)
#endif
#ifdef OPENAIS_LINUX
static char *socketname = "lcr.socket";
#else
static char *socketname = "/var/run/lcr.socket";
#endif
static void uis_lcr_bind (int *server_fd)
{
int fd;
struct sockaddr_un un_addr;
int res;
/*
* Create socket for lcr clients, name socket, listen for connections
*/
fd = socket (PF_UNIX, SOCK_STREAM, 0);
if (fd == -1) {
printf ("lcr_bind failed\n");
};
#if !defined(OPENAIS_LINUX)
unlink(socketname);
#endif
memset (&un_addr, 0, sizeof (struct sockaddr_un));
#if defined(OPENAIS_BSD) || defined(OPENAIS_DARWIN)
un_addr.sun_len = sizeof(struct sockaddr_un);
#endif
un_addr.sun_family = AF_UNIX;
#if defined(OPENAIS_LINUX)
strcpy (un_addr.sun_path + 1, socketname);
#else
strcpy (un_addr.sun_path, socketname);
#endif
res = bind (fd, (struct sockaddr *)&un_addr, AIS_SUN_LEN(&un_addr));
if (res) {
printf ("Could not bind AF_UNIX: %s\n", strerror (errno));
}
listen (fd, SERVER_BACKLOG);
*server_fd = fd;
}
struct uis_commands {
char *command;
void (*cmd_handler) (char *);
};
void cmd1 (char *cmd) {
printf ("cmd1 executed with cmd line %s\n", cmd);
}
struct uis_commands uis_commands[] = {
{
"cmd1", cmd1
}
};
struct req_msg {
int len;
char msg[0];
};
static void lcr_uis_dispatch (int fd)
{
struct req_msg header;
char msg_contents[512];
ssize_t readsize;
/*
* TODO this doesn't handle short reads
*/
readsize = read (fd, &header, sizeof (header));
if (readsize == -1) {
return;
}
readsize = read (fd, msg_contents, sizeof (msg_contents));
if (readsize == -1) {
return;
}
printf ("msg contents %s\n", msg_contents);
}
static void *lcr_uis_server (void *data)
{
struct pollfd ufds[2];
struct sockaddr_un un_addr;
socklen_t addrlen;
int nfds = 1;
#ifdef OPENAIS_LINUX
int on = 1;
#endif
int res;
/*
* Main acceptance and dispatch loop
*/
uis_lcr_bind (&ufds[0].fd);
printf ("UIS server thread started %d\n", ufds[0].fd);
ufds[0].events = POLLIN;
ufds[1].events = POLLOUT;
for (;;) {
res = poll (ufds, nfds, -1);
if (nfds == 1 && ufds[0].revents & POLLIN) {
ufds[1].fd = accept (ufds[0].fd,
(struct sockaddr *)&un_addr, &addrlen);
#ifdef OPENAIS_LINUX
setsockopt(ufds[1].fd, SOL_SOCKET, SO_PASSCRED,
&on, sizeof (on));
#endif
nfds = 2;
}
if (ufds[0].revents & POLLIN) {
lcr_uis_dispatch (ufds[1].fd);
}
}
return 0;
}
__attribute__ ((constructor)) static int lcr_uis_ctors (void)
{
pthread_t thread;
pthread_create (&thread, NULL, lcr_uis_server, NULL);
return (0);
}
|
/**
* (c) 2015 Alexandro Sanchez Bach. All rights reserved.
* Released under GPL v2 license. Read LICENSE for more details.
*/
#pragma once
#include "nucleus/common.h"
#include "nucleus/cpu/frontend/frontend_function.h"
#include <map>
namespace cpu {
namespace frontend {
// Class declarations
template <typename TAddr>
class IFunction;
template <typename TAddr>
class ISegment {
public:
hir::Module module;
// Starting address of this module
TAddr address = 0;
// Number of bytes covered by this module
TAddr size = 0;
// Name of this module
std::string name;
// List of functions
std::map<TAddr, IFunction<TAddr>*> functions;
// Execution engine and global functions
llvm::ExecutionEngine* ee;
// Check whether an address is inside this module
bool contains(TAddr addr) const {
const TAddr from = address;
const TAddr to = address + size;
return from <= addr && addr < to;
}
};
} // namespace frontend
} // namespace cpu
|
/*
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
#ifndef _SQUID_SRC_AUTH_BASIC_USERREQUEST_H
#define _SQUID_SRC_AUTH_BASIC_USERREQUEST_H
#if HAVE_AUTH_MODULE_BASIC
#include "auth/UserRequest.h"
class ConnStateData;
class HttpRequest;
namespace Auth
{
namespace Basic
{
/* follows the http request around */
class UserRequest : public Auth::UserRequest
{
MEMPROXY_CLASS(Auth::Basic::UserRequest);
public:
UserRequest() {}
virtual ~UserRequest() { assert(LockCount()==0); }
virtual int authenticated() const;
virtual void authenticate(HttpRequest * request, ConnStateData *conn, Http::HdrType type);
virtual Auth::Direction module_direction();
virtual void startHelperLookup(HttpRequest * request, AccessLogEntry::Pointer &al, AUTHCB *, void *);
virtual const char *credentialsStr();
private:
static HLPCB HandleReply;
};
} // namespace Basic
} // namespace Auth
#endif /* HAVE_AUTH_MODULE_BASIC */
#endif /* _SQUID_SRC_AUTH_BASIC_USERREQUEST_H */
|
/*+M*************************************************************************
* Adaptec AIC7xxx device driver for Linux.
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: aic7xxx.h,v 3.2 1996/07/23 03:37:26 deang Exp $
*-M*************************************************************************/
#ifndef _aic7xxx_h
#define _aic7xxx_h
#define AIC7XXX_H_VERSION "5.2.0"
#endif /* _aic7xxx_h */
|
// Animation names
#define SHELLS_ANIM_DEFAULT_ANIMATION 0
// Color names
// Patch names
// Names of collision boxes
#define SHELLS_COLLISION_BOX_DEFAULT 0
// Attaching position names
// Sound names
|
/*
* omap-aess -- OMAP4 ABE DSP
*
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _OMAP4_ABE_DSP_H
#define _OMAP4_ABE_DSP_H
struct omap4_abe_dsp_pdata {
bool (*was_context_lost)(struct device *dev);
int (*device_scale)(struct device *req_dev,
struct device *target_dev,
unsigned long rate);
} __no_const;
#endif
|
/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRINITY_OBJECTGRIDLOADER_H
#define TRINITY_OBJECTGRIDLOADER_H
#include "Utilities/TypeList.h"
#include "Platform/Define.h"
#include "GameSystem/GridLoader.h"
#include "GridDefines.h"
#include "Cell.h"
class ObjectWorldLoader;
class TRINITY_DLL_DECL ObjectGridLoader
{
friend class ObjectWorldLoader;
public:
ObjectGridLoader(NGridType &grid, Map* map, const Cell &cell)
: i_cell(cell), i_grid(grid), i_map(map), i_gameObjects(0), i_creatures(0), i_corpses (0)
{}
void Load(GridType &grid);
void Visit(GameObjectMapType &m);
void Visit(CreatureMapType &m);
void Visit(CorpseMapType &) {}
void Visit(DynamicObjectMapType&) { }
void LoadN(void);
private:
Cell i_cell;
NGridType &i_grid;
Map* i_map;
uint32 i_gameObjects;
uint32 i_creatures;
uint32 i_corpses;
};
class TRINITY_DLL_DECL ObjectGridUnloader
{
public:
ObjectGridUnloader(NGridType &grid) : i_grid(grid) {}
void MoveToRespawnN();
void UnloadN()
{
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
{
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
{
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
loader.Unload(i_grid(x, y), *this);
}
}
}
void Unload(GridType &grid);
template<class T> void Visit(GridRefManager<T> &m);
private:
NGridType &i_grid;
};
class TRINITY_DLL_DECL ObjectGridStoper
{
public:
ObjectGridStoper(NGridType &grid) : i_grid(grid) {}
void StopN()
{
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
{
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
{
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
loader.Stop(i_grid(x, y), *this);
}
}
}
void Stop(GridType &grid);
void Visit(CreatureMapType &m);
template<class NONACTIVE> void Visit(GridRefManager<NONACTIVE> &) {}
private:
NGridType &i_grid;
};
class TRINITY_DLL_DECL ObjectGridCleaner
{
public:
ObjectGridCleaner(NGridType &grid) : i_grid(grid) {}
void CleanN()
{
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
{
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
{
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
loader.Stop(i_grid(x, y), *this);
}
}
}
void Stop(GridType &grid);
void Visit(CreatureMapType &m);
template<class T> void Visit(GridRefManager<T> &);
private:
NGridType &i_grid;
};
typedef GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> GridLoaderType;
#endif
|
#ifndef UTILITY_H
#define UTILITY_H
/*
* assumes the memory manager is libmm.a
* - allows malloc(0) or realloc(obj, 0)
* - catches out of memory (and calls MMout_of_memory())
* - catch free(0) and realloc(0, size) in the macros
*/
#define NIL(type) ((type *) 0)
#ifdef BWGC
#define ALLOC(type, num) \
((type *) gc_malloc(sizeof(type) * ((num)==0?1:(num))))
#define REALLOC(type, obj, num) \
(obj) ? ((type *) gc_realloc((char *) obj, sizeof(type) * ((num)==0?1:(num)))) : \
((type *) gc_malloc(sizeof(type) * ((num)==0?1:(num))))
#else
#define ALLOC(type, num) \
((type *) malloc(sizeof(type) * (num)))
#define REALLOC(type, obj, num) \
(obj) ? ((type *) realloc((char *) obj, sizeof(type) * (num))) : \
((type *) malloc(sizeof(type) * (num)))
#endif
#ifdef IGNOREFREE
#define FREE(obj) \
{};
#else
#define FREE(obj) \
if ((obj)) { (void) free((char *) (obj)); (obj) = 0; }
#endif
#include "ansi.h"
EXTERN long util_cpu_time
NULLARGS;
EXTERN char *util_path_search
ARGS((char *program));
EXTERN char *util_file_search
ARGS((char *file, char *path, char *mode));
EXTERN int util_pipefork
ARGS((char **argv, FILE **toCommand, FILE **fromCommand, int *pid));
EXTERN int util_csystem
ARGS((char *command));
EXTERN char *util_print_time
ARGS((long t));
EXTERN char *util_strsav
ARGS((char *ptr));
EXTERN char *util_tilde_expand
ARGS((char *filename));
EXTERN char *util_tilde_compress
ARGS((char *filename));
EXTERN void util_register_user
ARGS((char *user, char *directory));
#ifndef NIL_FN
#define NIL_FN(type) ((type (*)()) 0)
#endif /* NIL_FN */
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif /* MAX */
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
#ifndef ABS
#define ABS(a) ((a) > 0 ? (a) : -(a))
#endif /* ABS */
#ifdef lint
#undef ALLOC /* allow for lint -h flag */
#undef REALLOC
#define ALLOC(type, num) (((type *) 0) + (num))
#define REALLOC(type, obj, num) ((obj) + (num))
#endif /* lint */
#endif
|
/*
* Copyright (C) 2004-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* 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.
*/
#import <WebKitLegacy/DOMCSSRule.h>
@class DOMCSSStyleDeclaration;
@class NSString;
WEBKIT_CLASS_AVAILABLE_MAC(10_4)
@interface DOMCSSStyleRule : DOMCSSRule
@property (copy) NSString *selectorText;
@property (readonly, strong) DOMCSSStyleDeclaration *style;
@end
|
#ifndef CHARSET_H
#define CHARSET_H
int init_charset(char *name);
char *utf2ascii(char *src, char *dest, int size);
char *ascii2utf(char *src, char *dest, int size);
#endif
|
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
/* Parameters derived from machine and compiler architecture */
/* ---------------- Scalar alignments ---------------- */
#define ARCH_ALIGN_SHORT_MOD 2
#define ARCH_ALIGN_INT_MOD 4
#define ARCH_ALIGN_LONG_MOD 4
#define ARCH_ALIGN_PTR_MOD 4
#define ARCH_ALIGN_FLOAT_MOD 4
#define ARCH_ALIGN_DOUBLE_MOD 4
#define ARCH_ALIGN_STRUCT_MOD 4
/* ---------------- Scalar sizes ---------------- */
#define ARCH_LOG2_SIZEOF_SHORT 1
#define ARCH_LOG2_SIZEOF_INT 2
#define ARCH_LOG2_SIZEOF_LONG 2
#define ARCH_LOG2_SIZEOF_LONG_LONG 3
#define ARCH_SIZEOF_PTR 4
#define ARCH_SIZEOF_FLOAT 4
#define ARCH_SIZEOF_DOUBLE 8
#define ARCH_FLOAT_MANTISSA_BITS 24
#define ARCH_DOUBLE_MANTISSA_BITS 53
/* ---------------- Unsigned max values ---------------- */
#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
/* ---------------- Cache sizes ---------------- */
#define ARCH_CACHE1_SIZE 4096
#define ARCH_CACHE2_SIZE 524288
/* ---------------- Miscellaneous ---------------- */
#define ARCH_IS_BIG_ENDIAN 1
#define ARCH_PTRS_ARE_SIGNED 0
#define ARCH_FLOATS_ARE_IEEE 1
#define ARCH_ARITH_RSHIFT 2
#define ARCH_CAN_SHIFT_FULL_LONG 0
#define ARCH_DIV_NEG_POS_TRUNCATES 1
|
//
// SingleLabelCenterCell.h
// OpenPKW
//
// Created by Lukasz Stocki on 16.05.2015.
// Copyright (c) 2015 OpenPKW. All rights reserved.
//
#import "BaseCell.h"
@interface SingleLabelCenterCell : BaseCell
@property (weak, nonatomic) IBOutlet UILabel *label;
@end
|
//
// PhotoBrowserProtocol.h
// CERN
//
// Created by Timur Pocheptsov on 2/12/13.
// Copyright (c) 2013 CERN. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol MWPhoto;
@protocol PhotoBrowserProtocol <NSObject>
- (UIImage *) imageForPhoto : (id<MWPhoto>) photo;
- (void) cancelControlHiding;
- (void) hideControlsAfterDelay;
- (void) toggleControls;
@required
@end
|
/*!
* \file interfaceUdp.h
* \author SBG Systems (Raphael Siryani)
* \date 05 February 2013
*
* \brief This file implements an UDP interface.
*
* \section CodeCopyright Copyright Notice
* Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.
*
* This source code is intended for use only by SBG Systems SAS and
* those that have explicit written permission to use it from
* SBG Systems SAS.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*/
#ifndef __INTERFACE_UDP_H__
#define __INTERFACE_UDP_H__
#include "interface.h"
//----------------------------------------------------------------------//
//- Structure definitions -//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//- Predefinitions -//
//----------------------------------------------------------------------//
#define SBG_INTERFACE_UDP_PACKET_MAX_SIZE (1400)
//----------------------------------------------------------------------//
//- Callbacks definitions -//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//- Structures definitions -//
//----------------------------------------------------------------------//
/*!
* Structure that stores all internal data used by the UDP interface.
*/
typedef struct _SbgInterfaceUdp
{
void *pUdpRecvSocket; /*!< The socket used to receive some UDP data. */
void *pUdpSendSocket; /*!< The socket used to send some UDP data. */
sbgIpAddress outAddress;
uint32 inPort;
uint32 outPort;
} SbgInterfaceUdp;
//----------------------------------------------------------------------//
//- Operations methods declarations -//
//----------------------------------------------------------------------//
/*!
* Initialize an unconnected UDP interface for read and write operations.
* An UDP interface can send some data to an output ip address and port and read all received
* data on a input port.
* \param[in] pHandle Pointer on an allocated interface instance to initialize.
* \param[in] outAdress IP address to send data to.
* \param[in] outPort Ethernet port to send data to.
* \param[in] inPort Ehternet port to read data from.
* \return SBG_NO_ERROR if the interface has been created.
*/
SbgErrorCode sbgInterfaceUdpCreate(SbgInterface *pHandle, sbgIpAddress outAddress, uint32 outPort, uint32 inPort);
/*!
* Destroy an interface initialized using sbgInterfaceUdpCreate.
* \param[in] pInterface Pointer on a valid UDP interface created using sbgInterfaceUdpCreate.
* \return SBG_NO_ERROR if the interface has been closed and released.
*/
SbgErrorCode sbgInterfaceUdpDestroy(SbgInterface *pHandle);
//----------------------------------------------------------------------//
//- Internal interfaces write/read implementations -//
//----------------------------------------------------------------------//
/*!
* Try to write some data to an interface.
* \param[in] pHandle Valid handle on an initialized interface.
* \param[in] pBuffer Pointer on an allocated buffer that contains the data to write
* \param[in] bytesToWrite Number of bytes we would like to write.
* \return SBG_NO_ERROR if all bytes have been written successfully.
*/
SbgErrorCode sbgInterfaceUdpWrite(SbgInterface *pHandle, const void *pBuffer, uint32 bytesToWrite);
/*!
* Try to read some data from an interface.
* \param[in] pHandle Valid handle on an initialized interface.
* \param[in] pBuffer Pointer on an allocated buffer that can hold at least bytesToRead bytes of data.
* \param[out] pReadBytes Pointer on an uint32 used to return the number of read bytes.
* \param[in] bytesToRead Number of bytes we would like to read.
* \return SBG_NO_ERROR if no error occurs, please check the number of received bytes.
*/
SbgErrorCode sbgInterfaceUdpRead(SbgInterface *pHandle, void *pBuffer, uint32 *pReadBytes, uint32 bytesToRead);
#endif /* __INTERFACE_UDP_H__ */
|
/*
* DES & Triple DES EDE Cipher Algorithms.
*/
#ifndef __CRYPTO_DES_H
#define __CRYPTO_DES_H
#define DES_KEY_SIZE 8
#define DES_EXPKEY_WORDS 32
#define DES_BLOCK_SIZE 8
#define DES3_EDE_KEY_SIZE (3 * DES_KEY_SIZE)
#define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS)
#define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE
#endif /* __CRYPTO_DES_H */
|
#ifndef INTL_H
#define INTL_H
#include <glib.h>
#ifdef ENABLE_NLS
# include <glib/gi18n.h>
#else /* NLS is disabled */
# define _(String) (String)
# define N_(String) (String)
# define NC_(Context, String) (String)
# define gettext(String) (String)
# define textdomain(Domain)
# define bindtextdomain(Package, Directory)
#endif
int intl_score_locale (const gchar *locale);
#endif
|
#pragma once
/*
* Copyright (C) 2010-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "cores/AudioEngine/Interfaces/AEEncoder.h"
extern "C" {
#include "libswresample/swresample.h"
}
/* ffmpeg re-defines this, so undef it to squash the warning */
#undef restrict
class CAEEncoderFFmpeg: public IAEEncoder
{
public:
CAEEncoderFFmpeg();
virtual ~CAEEncoderFFmpeg();
virtual bool IsCompatible(const AEAudioFormat& format);
virtual bool Initialize(AEAudioFormat &format, bool allow_planar_input = false);
virtual void Reset();
virtual unsigned int GetBitRate();
virtual AVCodecID GetCodecID();
virtual unsigned int GetFrames();
virtual int Encode(uint8_t *in, int in_size, uint8_t *out, int out_size);
virtual int GetData(uint8_t **data);
virtual double GetDelay(unsigned int bufferSize);
private:
unsigned int BuildChannelLayout(const int64_t ffmap, CAEChannelInfo& layout);
std::string m_CodecName;
AVCodecID m_CodecID;
unsigned int m_BitRate;
AEAudioFormat m_CurrentFormat;
AVCodecContext *m_CodecCtx;
SwrContext *m_SwrCtx;
CAEChannelInfo m_Layout;
AVPacket m_Pkt;
uint8_t m_Buffer[8 + FF_MIN_BUFFER_SIZE];
int m_BufferSize;
double m_SampleRateMul;
unsigned int m_NeededFrames;
bool m_NeedConversion;
};
|
/*
* IPSEC tunneling code
* Copyright (C) 1996, 1997 John Ioannidis.
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Richard Guy Briggs.
*
* 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 "openswan/ipsec_sa.h"
#ifdef CONFIG_KLIPS_OCF
#include <cryptodev.h>
#endif
enum ipsec_xmit_value
{
IPSEC_XMIT_STOLEN=2,
IPSEC_XMIT_PASS=1,
IPSEC_XMIT_OK=0,
IPSEC_XMIT_ERRMEMALLOC=-1,
IPSEC_XMIT_ESP_BADALG=-2,
IPSEC_XMIT_BADPROTO=-3,
IPSEC_XMIT_ESP_PUSHPULLERR=-4,
IPSEC_XMIT_BADLEN=-5,
IPSEC_XMIT_AH_BADALG=-6,
IPSEC_XMIT_SAIDNOTFOUND=-7,
IPSEC_XMIT_SAIDNOTLIVE=-8,
IPSEC_XMIT_REPLAYROLLED=-9,
IPSEC_XMIT_LIFETIMEFAILED=-10,
IPSEC_XMIT_CANNOTFRAG=-11,
IPSEC_XMIT_MSSERR=-12,
IPSEC_XMIT_ERRSKBALLOC=-13,
IPSEC_XMIT_ENCAPFAIL=-14,
IPSEC_XMIT_NODEV=-15,
IPSEC_XMIT_NOPRIVDEV=-16,
IPSEC_XMIT_NOPHYSDEV=-17,
IPSEC_XMIT_NOSKB=-18,
IPSEC_XMIT_NOIPV6=-19,
IPSEC_XMIT_NOIPOPTIONS=-20,
IPSEC_XMIT_TTLEXPIRED=-21,
IPSEC_XMIT_BADHHLEN=-22,
IPSEC_XMIT_PUSHPULLERR=-23,
IPSEC_XMIT_ROUTEERR=-24,
IPSEC_XMIT_RECURSDETECT=-25,
IPSEC_XMIT_IPSENDFAILURE=-26,
IPSEC_XMIT_ESPUDP=-27,
IPSEC_XMIT_ESPUDP_BADTYPE=-28,
IPSEC_XMIT_PENDING=-29,
};
/*
* state machine states
*/
#define IPSEC_XSM_INIT1 0 /* make it easy, starting state is 0 */
#define IPSEC_XSM_INIT2 1
#define IPSEC_XSM_ENCAP_INIT 2
#define IPSEC_XSM_ENCAP_SELECT 3
#define IPSEC_XSM_ESP 4
#define IPSEC_XSM_ESP_AH 5
#define IPSEC_XSM_AH 6
#define IPSEC_XSM_IPIP 7
#define IPSEC_XSM_IPCOMP 8
#define IPSEC_XSM_CONT 9
#define IPSEC_XSM_DONE 100
struct ipsec_xmit_state
{
struct sk_buff *skb; /* working skb pointer */
struct net_device *dev; /* working dev pointer */
struct ipsecpriv *prv; /* Our device' private space */
struct sk_buff *oskb; /* Original skb pointer */
struct net_device_stats *stats; /* This device's statistics */
struct iphdr *iph; /* Our new IP header */
__u32 newdst; /* The other SG's IP address */
__u32 orgdst; /* Original IP destination address */
__u32 orgedst; /* 1st SG's IP address */
__u32 newsrc; /* The new source SG's IP address */
__u32 orgsrc; /* Original IP source address */
__u32 innersrc; /* Innermost IP source address */
int iphlen; /* IP header length */
int pyldsz; /* upper protocol payload size */
int headroom;
int tailroom;
int authlen;
int max_headroom; /* The extra header space needed */
int max_tailroom; /* The extra stuffing needed */
int ll_headroom; /* The extra link layer hard_header space needed */
int tot_headroom; /* The total header space needed */
int tot_tailroom; /* The totalstuffing needed */
__u8 *saved_header; /* saved copy of the hard header */
unsigned short sport, dport;
struct sockaddr_encap matcher; /* eroute search key */
struct eroute *eroute;
struct ipsec_sa *ipsp; /* ipsec_sa pointers */
//struct ipsec_sa *ipsp_outer; /* last SA applied by encap_bundle */
char sa_txt[SATOT_BUF];
size_t sa_len;
int hard_header_stripped; /* has the hard header been removed yet? */
int hard_header_len;
struct net_device *physdev;
/* struct device *virtdev; */
short physmtu;
short cur_mtu; /* copy of prv->mtu, cause prv may == NULL */
short mtudiff;
#ifdef NET_21
struct rtable *route;
#endif /* NET_21 */
ip_said outgoing_said;
#ifdef NET_21
int pass;
#endif /* NET_21 */
uint32_t eroute_pid;
struct ipsec_sa ips;
#ifdef CONFIG_IPSEC_NAT_TRAVERSAL
uint8_t natt_type;
uint8_t natt_head;
uint16_t natt_sport;
uint16_t natt_dport;
#endif
/*
* xmit state machine use
*/
void (*xsm_complete)(struct ipsec_xmit_state *ixs,
enum ipsec_xmit_value stat);
int state;
int next_state;
#ifdef CONFIG_KLIPS_OCF
struct work_struct workq;
#ifdef DECLARE_TASKLET
struct tasklet_struct tasklet;
#endif
#endif
#ifdef CONFIG_KLIPS_ALG
struct ipsec_alg_auth *ixt_a;
struct ipsec_alg_enc *ixt_e;
#endif
#ifdef CONFIG_KLIPS_ESP
struct esphdr *espp;
unsigned char *idat;
#endif /* !CONFIG_KLIPS_ESP */
int blocksize;
int ilen, len;
unsigned char *dat;
__u8 frag_off, tos;
__u16 ttl, check;
};
enum ipsec_xmit_value
ipsec_xmit_sanity_check_dev(struct ipsec_xmit_state *ixs);
enum ipsec_xmit_value
ipsec_xmit_sanity_check_skb(struct ipsec_xmit_state *ixs);
enum ipsec_xmit_value
ipsec_xmit_encap_bundle(struct ipsec_xmit_state *ixs);
extern void ipsec_xsm(struct ipsec_xmit_state *ixs);
#ifdef HAVE_KMEM_CACHE_T
extern kmem_cache_t *ipsec_ixs_cache;
#else
extern struct kmem_cache *ipsec_ixs_cache;
#endif
extern int ipsec_ixs_max;
extern atomic_t ipsec_ixs_cnt;
extern void ipsec_extract_ports(struct iphdr * iph, struct sockaddr_encap * er);
/* avoid forward reference complain on < 2.5 */
struct flowi;
extern enum ipsec_xmit_value
ipsec_xmit_send(struct ipsec_xmit_state*ixs, struct flowi *fl);
extern enum ipsec_xmit_value
ipsec_nat_encap(struct ipsec_xmit_state*ixs);
extern enum ipsec_xmit_value
ipsec_tunnel_send(struct ipsec_xmit_state *ixs);
extern void ipsec_xmit_cleanup(struct ipsec_xmit_state*ixs);
extern int ipsec_xmit_trap_count;
extern int ipsec_xmit_trap_sendcount;
extern int debug_xmit;
extern int debug_mast;
#define ipsec_xmit_dmp(_x,_y, _z) if (debug_xmit && sysctl_ipsec_debug_verbose) ipsec_dmp_block(_x,_y,_z)
extern int sysctl_ipsec_debug_verbose;
extern int sysctl_ipsec_icmp;
extern int sysctl_ipsec_tos;
|
/*
* Copyright (C) 2011 Infineon Technologies
*
* Authors:
* Peter Huewe <huewe.external@infineon.com>
*
* Version: 2.1.1
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef _COMPATIBILITY_H_
#define _COMPATIBILITY_H_
/* all includes from U-Boot */
#include <linux/types.h>
#include <linux/unaligned/be_byteshift.h>
#include <asm-generic/errno.h>
#include <compiler.h>
#include <common.h>
/* extended error numbers from linux (see errno.h) */
#define ECANCELED 125 /* Operation Canceled */
#define msleep(t) udelay((t)*1000)
/* Timer frequency. Corresponds to msec timer resolution*/
#define HZ 1000
#define dev_dbg(dev, format, arg...) debug(format, ##arg)
#define dev_err(dev, format, arg...) printf(format, ##arg)
#define dev_info(dev, format, arg...) debug(format, ##arg)
#define dbg_printf debug
#endif
|
/***************************************************************************
qgsrelationreferencewidgetwrapper.h
--------------------------------------
Date : 20.4.2013
Copyright : (C) 2013 Matthias Kuhn
Email : matthias at opengis dot ch
***************************************************************************
* *
* 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 QGSRELATIONREFERENCEWIDGETWRAPPER_H
#define QGSRELATIONREFERENCEWIDGETWRAPPER_H
#include "qgseditorwidgetwrapper.h"
#include "qgis.h"
#include "qgis_gui.h"
class QgsRelationReferenceWidget;
class QgsMapCanvas;
class QgsMessageBar;
/**
* \ingroup gui
* Wraps a relation reference widget.
*
* Options:
* <ul>
* <li><b>ShowForm</b> <i>If True, an embedded form with the referenced feature will be shown.</i></li>
* <li><b>MapIdentification</b> <i>Will offer a map tool to pick a referenced feature on the map canvas. Only use for layers with geometry.</i></li>
* <li><b>ReadOnly</b> <i>If True, will represent the referenced widget in a read-only line edit. Can speed up loading.</i></li>
* <li><b>AllowNULL</b> <i>Will offer NULL as a value.</i></li>
* <li><b>Relation</b> <i>The ID of the relation that will be used to define this widget.</i></li>
* ReadOnly
* </ul>
*
*/
class GUI_EXPORT QgsRelationReferenceWidgetWrapper : public QgsEditorWidgetWrapper
{
Q_OBJECT
public:
explicit QgsRelationReferenceWidgetWrapper( QgsVectorLayer *vl,
int fieldIdx,
QWidget *editor,
QgsMapCanvas *canvas,
QgsMessageBar *messageBar,
QWidget *parent SIP_TRANSFERTHIS = 0 );
virtual QWidget *createWidget( QWidget *parent ) override;
virtual void initWidget( QWidget *editor ) override;
virtual QVariant value() const override;
bool valid() const override;
void showIndeterminateState() override;
public slots:
virtual void setValue( const QVariant &value ) override;
virtual void setEnabled( bool enabled ) override;
private slots:
void foreignKeyChanged( QVariant value );
protected:
void updateConstraintWidgetStatus() override;
private:
QgsRelationReferenceWidget *mWidget = nullptr;
QgsMapCanvas *mCanvas = nullptr;
QgsMessageBar *mMessageBar = nullptr;
bool mIndeterminateState;
};
#endif // QGSRELATIONREFERENCEWIDGETWRAPPER_H
|
#ifndef __ALGORITHM_BORDER_RESAMPLE_H__
#define __ALGORITHM_BORDER_RESAMPLE_H__
/*LICENSE_START*/
/*
* Copyright (C) 2014 Washington University School of Medicine
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*LICENSE_END*/
#include "AbstractAlgorithm.h"
namespace caret {
class AlgorithmBorderResample : public AbstractAlgorithm
{
AlgorithmBorderResample();
void adjustRadius(const SurfaceFile* in, SurfaceFile& out);
protected:
static float getSubAlgorithmWeight();
static float getAlgorithmInternalWeight();
public:
AlgorithmBorderResample(ProgressObject* myProgObj, const BorderFile* borderIn, const SurfaceFile* curSphere, const SurfaceFile* newSphere, BorderFile* borderOut);
static OperationParameters* getParameters();
static void useParameters(OperationParameters* myParams, ProgressObject* myProgObj);
static AString getCommandSwitch();
static AString getShortDescription();
};
typedef TemplateAutoOperation<AlgorithmBorderResample> AutoAlgorithmBorderResample;
}
#endif //__ALGORITHM_BORDER_RESAMPLE_H__
|
/*
* 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_TARGETEDMOVEMENTGENERATOR_H
#define MANGOS_TARGETEDMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
#include "FollowerReference.h"
#include "PathFinder.h"
#include "Unit.h"
class MANGOS_DLL_SPEC TargetedMovementGeneratorBase
{
public:
TargetedMovementGeneratorBase(Unit &target) { i_target.link(&target, this); }
void stopFollowing() { }
virtual ~TargetedMovementGeneratorBase() {}
protected:
FollowerReference i_target;
};
template<class T, typename D>
class MANGOS_DLL_SPEC TargetedMovementGeneratorMedium
: public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase
{
protected:
TargetedMovementGeneratorMedium(Unit& target, float offset, float angle) :
TargetedMovementGeneratorBase(target),
i_recheckDistance(0), i_targetSearchingTimer(0),
i_offset(offset), i_angle(angle),
m_speedChanged(false), i_targetReached(false),
i_path(NULL)
{
}
virtual ~TargetedMovementGeneratorMedium() { delete i_path; }
public:
bool Update(T &, const uint32 &);
bool IsReachable() const
{
return (i_path) ? (i_path->getPathType() & PATHFIND_NORMAL) : true;
}
Unit* GetTarget() const { return i_target.getTarget(); }
void UnitSpeedChanged() { m_speedChanged = true; }
const char* Name() const { return "<TargetedMedium>"; }
protected:
void _setTargetLocation(T&, bool updateDestination);
ShortTimeTracker i_recheckDistance;
uint32 i_targetSearchingTimer;
float i_offset;
float i_angle;
bool m_speedChanged : 1;
bool i_targetReached : 1;
PathFinder* i_path;
};
template<class T>
class MANGOS_DLL_SPEC ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >
{
public:
ChaseMovementGenerator(Unit &target)
: TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target, 0.f, 0.f) {}
ChaseMovementGenerator(Unit &target, float offset, float angle)
: TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target, offset, angle) {}
~ChaseMovementGenerator() {}
MovementGeneratorType GetMovementGeneratorType() const override { return CHASE_MOTION_TYPE; }
void Initialize(T &);
void Finalize(T &);
void Interrupt(T &);
void Reset(T &);
const char* Name() const { return "<Chase>"; }
static void _clearUnitStateMove(T &u) { u.clearUnitState(UNIT_STAT_CHASE_MOVE); }
static void _addUnitStateMove(T &u) { u.addUnitState(UNIT_STAT_CHASE_MOVE); }
bool EnableWalking() const { return false;}
bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); }
void _reachTarget(T &);
};
template<class T>
class MANGOS_DLL_SPEC FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >
{
public:
FollowMovementGenerator(Unit &target)
: TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >(target){}
FollowMovementGenerator(Unit &target, float offset, float angle)
: TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >(target, offset, angle) {}
~FollowMovementGenerator() {}
MovementGeneratorType GetMovementGeneratorType() const override { return FOLLOW_MOTION_TYPE; }
void Initialize(T &);
void Finalize(T &);
void Interrupt(T &);
void Reset(T &);
const char* Name() const { return "<Follow>"; }
static void _clearUnitStateMove(T &u) { u.clearUnitState(UNIT_STAT_FOLLOW_MOVE); }
static void _addUnitStateMove(T &u) { u.addUnitState(UNIT_STAT_FOLLOW_MOVE); }
bool EnableWalking() const;
bool _lostTarget(T &) const { return false; }
void _reachTarget(T &) {}
private:
void _updateSpeed(T &u);
};
#endif
|
/*
* Copyright (C) ST-Ericsson SA 2010-2011
*
* License Terms: GNU General Public License v2
*
* Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson
*
*/
#ifndef UX500_SUSPEND_DBG_H
#define UX500_SUSPEND_DBG_H
#include <linux/kernel.h>
#include <linux/suspend.h>
#ifdef CONFIG_UX500_SUSPEND_DBG_WAKE_ON_UART
void ux500_suspend_dbg_add_wake_on_uart(void);
void ux500_suspend_dbg_remove_wake_on_uart(void);
#else
static inline void ux500_suspend_dbg_add_wake_on_uart(void) { }
static inline void ux500_suspend_dbg_remove_wake_on_uart(void) { }
#endif
#ifdef CONFIG_UX500_SUSPEND_DBG
bool ux500_suspend_enabled(void);
bool ux500_suspend_sleep_enabled(void);
bool ux500_suspend_deepsleep_enabled(void);
void ux500_suspend_dbg_sleep_status(bool is_deepsleep);
void ux500_suspend_dbg_init(void);
int ux500_suspend_dbg_begin(suspend_state_t state);
#else
static inline bool ux500_suspend_enabled(void)
{
return true;
}
static inline bool ux500_suspend_sleep_enabled(void)
{
#ifdef CONFIG_UX500_SUSPEND_STANDBY
return true;
#else
return false;
#endif
}
static inline bool ux500_suspend_deepsleep_enabled(void)
{
#ifdef CONFIG_UX500_SUSPEND_MEM
return true;
#else
return false;
#endif
}
static inline void ux500_suspend_dbg_sleep_status(bool is_deepsleep) { }
static inline void ux500_suspend_dbg_init(void) { }
static inline int ux500_suspend_dbg_begin(suspend_state_t state)
{
return 0;
}
#endif
#endif
|
#include "templateviewgrid.h"
#include "../config.h"
#include "../libcore/helpers.h"
cTemplateViewGrid::cTemplateViewGrid(void) : cTemplateViewElement() {
}
cTemplateViewGrid::~cTemplateViewGrid(void) {
}
bool cTemplateViewGrid::CalculatePixmapParameters(void) {
bool paramsValid = true;
int gridX = parameters->GetNumericParameter(ptX);
int gridY = parameters->GetNumericParameter(ptY);
int gridWidth = parameters->GetNumericParameter(ptWidth);
int gridHeight = parameters->GetNumericParameter(ptHeight);
for (vector<cTemplatePixmapNode*>::iterator pix = viewPixmapNodes.begin(); pix != viewPixmapNodes.end(); pix++) {
(*pix)->SetContainer(gridX, gridY, gridWidth, gridHeight);
(*pix)->SetGlobals(globals);
paramsValid = paramsValid && (*pix)->CalculateParameters();
}
return paramsValid;
}
void cTemplateViewGrid::Debug(void) {
esyslog("skindesigner: --- Grid: ");
cTemplateViewElement::Debug();
} |
/*
* Copyright 2002, 2009 Seanodes Ltd http://www.seanodes.com. All rights
* reserved and protected by French, UK, U.S. and other countries' copyright laws.
* This file is part of Exanodes project and is subject to the terms
* and conditions defined in the LICENSE file which is present in the root
* directory of the project.
*/
#ifndef __EXA_CLINFO_MONITORING_H
#define __EXA_CLINFO_MONITORING_H
#ifdef WITH_MONITORING
#include <libxml/tree.h>
void local_clinfo_monitoring(int thr_nb, void *msg);
int cluster_clinfo_monitoring(int thr_nb, xmlNodePtr cluster_node);
#endif
#endif
|
/*
-----------------------------------------------------------------------------
$Id: pal_syslog.h,v 1.1 2009/11/20 16:38:53 jasminko Exp $
-----------------------------------------------------------------------------
Copyright (c) 2007 gogo6 Inc. All rights reserved.
For license information refer to CLIENT-LICENSE.TXT
-----------------------------------------------------------------------------
Platform abstraction layer for 'syslog'.
-----------------------------------------------------------------------------
*/
#ifndef __PAL_SYSLOG_H__
#define __PAL_SYSLOG_H__
// syslog API definition.
#include "pal_syslog.def"
#include <syslog.h>
// syslog function already available in this platform.
#undef pal_openlog
#define pal_openlog openlog
#undef pal_syslog
#define pal_syslog syslog
#undef pal_closelog
#define pal_closelog closelog
#endif
|
/*
* Memory allocation unit
*
* $Id: mem.h,v 1.1.1.1 2003/08/18 05:39:50 kaohj Exp $
*
*/
#ifndef LANE_MEM_H
#define LANE_MEM_H
/* System includes needed for types */
#include "sys/types.h"
/* Local includes needed for types */
#include "units.h"
/* Type definitions */
/* Global function prototypes */
void *mem_alloc(const Unit_t *unit, size_t nbytes);
void mem_free(const Unit_t *unit, const void *mem);
/* Dump memory allocation info, NULL == all */
void mem_dump(const Unit_t *unit);
/* Global data */
extern const Unit_t mem_unit;
#endif
|
/** ===========================================================
* @file
*
* This file is a part of KDE project
* <a href="https://projects.kde.org/projects/extragear/libs/libmediawiki">libmediawiki</a>
*
* @date 2011-03-22
* @brief a MediaWiki C++ interface for KDE
*
* @author Copyright (C) 2011-2013 by Gilles Caulier
* <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
* @author Copyright (C) 2009 by Paolo de Vathaire
* <a href="mailto:paolo dot devathaire at gmail dot com">paolo dot devathaire at gmail dot com</a>
*
* 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 MEDIAWIKIJOB_P_H
#define MEDIAWIKIJOB_P_H
#include "mediawiki.h"
namespace mediawiki
{
class JobPrivate
{
public:
explicit JobPrivate(MediaWiki& mediawiki)
: mediawiki(mediawiki),
manager(mediawiki.manager()),
reply(0)
{
}
MediaWiki& mediawiki;
QNetworkAccessManager* const manager;
QNetworkReply* reply;
};
} // namespace mediawiki
#endif // MEDIAWIKIJOB_P_H
|
/**
* @file notification.h generic notification interface
*
* Copyright (C) 2006 Norman Jonas <liferea.sf.net@devport.codepilot.net>
* Copyright (C) 2006-2008 Lars Lindner <lars.lindner@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _NOTIFICATION_H
#define _NOTIFICATION_H
#include <glib.h>
#include <gmodule.h>
#include "node.h"
typedef enum {
NOTIFICATION_TYPE_POPUP,
NOTIFICATION_TYPE_TRAY,
} notificationType;
typedef struct notificationPlugin {
/**
* Notification plugin name
*/
const gchar *name;
/**
* Called once during plugin initialization.
* If the plugin returns FALSE it won't be
* added to the list of the available
* notification plugins.
*/
gboolean (*plugin_init)(void);
/**
* Called upon program shutdown.
*/
void (*plugin_deinit)(void);
/**
* This callback notifies the plugin that the given
* node was updated and contains new items (items
* with newStatus set to TRUE.
*
* @param node the updated node
* @param enforced TRUE if popup is to be enforced
* regardless of global preference
*/
void (*node_has_new_items)(nodePtr node, gboolean enforced);
} *notificationPluginPtr;
extern struct notificationPlugin libnotify_plugin;
#ifdef HAVE_LIBNOTIFY
/**
* "New items" event callback.
*
* @param node the node that has new items
* @param enforced TRUE if notification is to be enforced
* regardless of global preference
*/
void notification_node_has_new_items (nodePtr node, gboolean enforced);
#else
static inline void notification_node_has_new_items (nodePtr node, gboolean enforced) {};
#endif
void notification_plugin_register (notificationPluginPtr plugin);
#endif
|
/*
* render1x1ntsc.h - Implementation of framebuffer to physical screen copy
*
* Written by
* groepaz <groepaz@gmx.net> based on the pal renderers written by
* John Selck <graham@cruise.de>
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* 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 VICE_RENDER1X1NTSC_H
#define VICE_RENDER1X1NTSC_H
#include "types.h"
#include "video.h"
extern void render_UYVY_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
extern void render_YUY2_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
extern void render_YVYU_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
extern void render_16_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
extern void render_24_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
extern void render_32_1x1_ntsc(video_render_color_tables_t *color_tab,
const uint8_t *src, uint8_t *trg,
const unsigned int width, const unsigned int height,
const unsigned int xs, const unsigned int ys,
const unsigned int xt, const unsigned int yt,
const unsigned int pitchs,
const unsigned int pitcht);
#endif
|
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <mach.h>
#define Extern extern
#include "power.h"
void mcrf(ulong);
void bclr(ulong);
void crop(ulong);
void bcctr(ulong);
void call(ulong);
void ret(ulong);
void isync(ulong);
Inst op19[] = {
[0] {mcrf, "mcrf", Ibranch},
[16] {bclr, "bclr", Ibranch},
[33] {crop, "crnor", Ibranch},
[15] {0, "rfi", Ibranch},
[129] {crop, "crandc", Ibranch},
[150] {isync, "isync", Ibranch},
[193] {crop, "crxor", Ibranch},
[225] {crop, "crnand", Ibranch},
[257] {crop, "crand", Ibranch},
[289] {crop, "creqv", Ibranch},
[417] {crop, "crorc", Ibranch},
[449] {crop, "cror", Ibranch},
[528] {bcctr, "bcctr", Ibranch},
{0, 0, 0}
};
Inset ops19 = {op19, nelem(op19)-1};
static char *
boname(int bo)
{
static char buf[8];
switch(bo>>1){
case 0: return "dnzf";
case 1: return "dzf";
case 2: return "f";
case 4: return "dnzt";
case 5: return "dzt";
case 6: return "t";
case 8: return "dnz";
case 9: return "dz";
case 10: return "a";
default:
sprint(buf, "%d?", bo);
return buf;
}
}
static char *
cname(int bo, int bi)
{
int f;
char *p;
static char buf[20];
static char *f0[] = {"lt", "gt", "eq", "so/un"};
if(bo == 0x14){ /* branch always */
sprint(buf,"%d", bi);
return buf;
}
for(f = 0; bi >= 4; bi -= 4)
f++;
p = buf;
p += sprint(buf, "%d[", bi);
if(f)
p += sprint(buf, "cr%d+", f);
strcpy(p, f0[bi&3]);
strcat(p, "]");
return buf;
}
static int
condok(ulong ir, int ctr)
{
int bo, bi, xx;
getbobi(ir);
if(xx)
undef(ir);
if((bo & 0x4) == 0) {
if(!ctr)
undef(ir);
reg.ctr--;
}
if(bo & 0x4 || (reg.ctr!=0)^((bo>>1)&1)) {
if(bo & 0x10 || (((reg.cr & bits[bi])!=0)==((bo>>3)&1)))
return 1;
}
return 0;
}
static void
dobranch(ulong ir, ulong *r, int ctr)
{
int bo, bi, xx;
ulong nia;
getbobi(ir);
USED(xx);
if(condok(ir, ctr)) {
ci->taken++;
nia = *r & ~3;
if(bo & 4) /* assume counting branches aren't returns */
ret(nia);
} else
nia = reg.pc + 4;
if(trace)
itrace("%s%s\t%s,%s,#%.8lux", ci->name, ir&1? "l": "", boname(bo), cname(bo, bi), nia);
if(ir & 1) {
call(nia);
reg.lr = reg.pc + 4;
}
reg.pc = nia-4;
/* branch delays? */
}
void
bcctr(ulong ir)
{
dobranch(ir, ®.ctr, 1);
}
void
bclr(ulong ir)
{
dobranch(ir, ®.lr, 0);
}
void
bcx(ulong ir)
{
int bo, bi, xx;
ulong ea;
long imm;
static char *opc[] = {"bc", "bcl", "bca", "bcla"};
getbobi(ir);
USED(xx);
imm = ir & 0xFFFC;
if(ir & 0x08000)
imm |= 0xFFFF0000;
if((ir & 2) == 0) { /* not absolute address */
ea = reg.pc + imm;
if(trace)
itrace("%s\t%s,%s,.%s%ld\tea = #%.8lux", opc[ir&3], boname(bo), cname(bo, bi), imm<0?"":"+", imm, ea);
} else {
ea = imm;
if(trace)
itrace("%s\t%s,%s,#%.8lux", opc[ir&3], boname(bo), cname(bo, bi), ea);
}
if(condok(ir&0xFFFF0000, 1))
ci->taken++;
else
ea = reg.pc + 4;
if(ir & 1) {
call(ea);
reg.lr = reg.pc+4;
}
reg.pc = ea-4;
/* branch delay? */
}
void
crop(ulong ir)
{
int rd, ra, rb, d;
getarrr(ir);
if(trace)
itrace("%s\tcrb%d,crb%d,crb%d", ci->name, rd, ra, rb);
ra = (reg.cr & bits[ra]) != 0;
rb = (reg.cr & bits[rb]) != 0;
d = 0;
switch(getxo(ir)) {
case 257: d = ra & rb; break;
case 129: d = ra & !rb; break;
case 289: d = ra == rb; break;
case 225: d = !(ra & rb); break;
case 33: d = !(ra | rb); break;
case 449: d = ra | rb; break;
case 417: d = ra | !rb; break;
case 193: d = ra ^ rb; break;
default: undef(ir); break;
}
if(d)
reg.cr |= bits[rd];
}
void
mcrf(ulong ir)
{
int rd, ra, rb;
getarrr(ir);
if(ir & 1 || rd & 3 || ra & 3 || rb)
undef(ir);
ra >>= 2;
rd >>= 2;
reg.cr = (reg.cr & ~mkCR(rd, 0xF)) | mkCR(rd, getCR(ra, reg.cr));
if(trace)
itrace("mcrf\tcrf%d,crf%d", rd, ra);
}
void
call(ulong npc)
{
Symbol s;
if(calltree) {
findsym(npc, CTEXT, &s);
Bprint(bioout, "%8lux %s(", reg.pc, s.name);
printparams(&s, reg.r[1]);
Bprint(bioout, "from ");
printsource(reg.pc);
Bputc(bioout, '\n');
}
}
void
ret(ulong npc)
{
Symbol s;
if(calltree) {
findsym(npc, CTEXT, &s);
Bprint(bioout, "%8lux return to #%lux %s r3=#%lux (%ld)\n",
reg.pc, npc, s.name, reg.r[3], reg.r[3]);
}
}
void
bx(ulong ir)
{
ulong ea;
long imm;
static char *opc[] = {"b", "bl", "ba", "bla"};
imm = ir & 0x03FFFFFC;
if(ir & 0x02000000)
imm |= 0xFC000000;
if((ir & 2) == 0) { /* not absolute address */
ea = reg.pc + imm;
if(trace)
itrace("%s\t.%s%ld\tea = #%.8lux", opc[ir&3], imm<0?"":"+", imm, ea);
} else {
ea = imm;
if(trace)
itrace("%s\t#%.8lux", opc[ir&3], ea);
}
ci->taken++;
if(ir & 1) {
call(ea);
reg.lr = reg.pc+4;
}
reg.pc = ea-4;
/* branch delay? */
}
void
isync(ulong ir)
{
USED(ir);
if(trace)
itrace("isync");
}
|
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
Sequence.h
Qore Programming Language
Copyright (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_SEQUENCE_H
#define _QORE_SEQUENCE_H
#include <qore/QoreThreadLock.h>
class Sequence : public QoreThreadLock {
private:
int val;
public:
DLLLOCAL Sequence(int start = 0);
DLLLOCAL int next();
DLLLOCAL int getCurrent() const;
};
#endif
|
/* The Butterfly Effect
* This file copyright (C) 2010,2012 Klaas van Gend
*
* 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
* applicable version is GPL version 2 only.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA.
*/
#ifndef LINK_H
#define LINK_H
#include "AbstractObject.h"
#include "AbstractJoint.h"
#include "Position.h"
#include <QObject>
/// The Link class is a joint, it links two objects (bodies) together
/// whilst keeping the connection points at a constant distance
///
/// <!-- the x/y/angle in the object tag is ignored and/or recalculated when needed -->
/// <object type="Link" X="2.74" Y="3.44" angle="2.12">
/// <property key="object1">Skyhook@(1,2)</property>
/// <property key="object2">Chain3@(-1,2)</property>
/// <property key="ImageName">flat-chain</property>
/// </object>
class Link : public AbstractJoint
{
public:
Link(void);
virtual ~Link();
/// (overridden from AbstractObject to remove extra sharedptrs)
virtual void clearObjectReferences() override;
/** (overridden from AbstractJoint to fixup aspect ratio and overlap)
* @returns pointer to AbstractObject
*/
ViewObjectPtr createViewObject(float aDefaultDepth = 2.0) override;
/// overridden from AbstractObject
/// (this class does not have a body, only a joint)
virtual void createPhysicsObject(void) override;
/// overridden from AbstractObject
/// returns the Name of the object.
virtual const QString getName ( ) const override
{
return QObject::tr("Link");
}
/** Get the current center position of the object.
* @return the value of theCenter
*/
virtual Position getTempCenter ( ) const override;
/// overridden from AbstractObject
/// returns true if the object can be rotated by the user
virtual bool isRotatable ( ) const override
{
return false;
}
/// overridden from AbstractObject
/// parses all properties that Link understands
virtual void parseProperties(void) override;
/// implemented from BaseJoint
virtual void updateOrigCenter(void) override;
/// updates the ViewLink to still have its line between the underlying b2bodys
/// (it won't update if the object is asleep if sim is running)
/// @param isSimRunning set to true if you want to use position/size from sim
virtual void updateViewObject(bool isSimRunning) const override;
private:
AbstractObjectPtr theFirstPtr;
AbstractObjectPtr theSecondPtr;
Vector *theFirstLocalPosPtr;
Vector *theSecondLocalPosPtr;
};
#endif // LINK_H
|
#ifndef MATERIAL_H
#define MATERIAL_H
#include "../lib/rand48/erand48.h"
#include "vector.h"
#include "ray.h"
#include "texture.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
enum MaterialType { DIFF, SPEC, EMIT };
class Material {
private:
MaterialType m_type;
Vec m_colour;
Vec m_emission;
Texture m_texture;
public:
Material( MaterialType t=DIFF, Vec c=Vec(1,1,1), Vec e=Vec(0,0,0), Texture tex=Texture() );
MaterialType get_type() const;
Vec get_colour() const;
Vec get_colour_at(double u, double v) const;
Vec get_emission() const;
Ray get_reflected_ray( const Ray &r, Vec &p, const Vec &n, unsigned short *Xi ) const;
};
#endif // MATERIAL_H |
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include "VideoBackends/D3D/tiny_obj_loader.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VR.h"
struct ID3D11Texture2D;
struct ID3D11Buffer;
struct ID3D11VertexShader;
struct ID3D11GeometryShader;
struct ID3D11PixelShader;
struct ID3D11InputLayout;
struct ID3D11BlendState;
struct ID3D11DepthStencilState;
struct ID3D11RasterizerState;
struct ID3D11SamplerState;
namespace DX11
{
union VertexShaderParams
{
struct
{
float world[16];
float view[16];
float projection[16];
float color[4];
};
// Constant buffers must be a multiple of 16 bytes in size
};
class AvatarDrawer
{
public:
AvatarDrawer();
void Init();
void Shutdown();
void Draw();
private:
void DrawHydra(float *pos, ControllerStyle cs);
ID3D11Buffer* m_vertex_shader_params;
ID3D11Buffer* m_vertex_buffer;
ID3D11Buffer* m_index_buffer;
ID3D11InputLayout* m_vertex_layout;
ID3D11VertexShader* m_vertex_shader;
ID3D11GeometryShader* m_geometry_shader;
ID3D11PixelShader* m_pixel_shader;
ID3D11BlendState* m_avatar_blend_state;
ID3D11DepthStencilState* m_avatar_depth_state;
ID3D11RasterizerState* m_avatar_rast_state;
ID3D11SamplerState* m_avatar_sampler;
VertexShaderParams params;
float *m_vertices;
u16 *m_indices;
int m_vertex_count, m_index_count;
float hydra_size[3], hydra_mid[3];
};
void GetModelSize(tinyobj::shape_t *shape, float *width, float *height, float *depth, float *x, float *y, float *z);
}
|
/*
* Serial Device Initialisation for Lasi/Asp/Wax/Dino
*
* (c) Copyright Matthew Wilcox <willy@debian.org> 2001-2002
*
* 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.
*/
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/serial_core.h>
#include <linux/signal.h>
#include <linux/types.h>
#include <asm/hardware.h>
#include <asm/parisc-device.h>
#include <asm/io.h>
#include "8250.h"
static int __init serial_init_chip(struct parisc_device *dev)
{
struct uart_port port;
unsigned long address;
int err;
if (!dev->irq) {
/* We find some unattached serial ports by walking native
* busses. These should be silently ignored. Otherwise,
* what we have here is a missing parent device, so tell
* the user what they're missing.
*/
if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
printk(KERN_INFO
"Serial: device 0x%llx not configured.\n"
"Enable support for Wax, Lasi, Asp or Dino.\n",
(unsigned long long)dev->hpa.start);
return -ENODEV;
}
address = dev->hpa.start;
if (dev->id.sversion != 0x8d)
address += 0x800;
memset(&port, 0, sizeof(port));
port.iotype = UPIO_MEM;
/* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */
port.uartclk = 7272727;
port.mapbase = address;
port.membase = ioremap_nocache(address, 16);
port.irq = dev->irq;
port.flags = UPF_BOOT_AUTOCONF;
port.dev = &dev->dev;
err = serial8250_register_port(&port);
if (err < 0) {
printk(KERN_WARNING
"serial8250_register_port returned error %d\n", err);
iounmap(port.membase);
return err;
}
return 0;
}
static struct parisc_device_id serial_tbl[] = {
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 },
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c },
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d },
{ 0 }
};
/* Hack. Some machines have SERIAL_0 attached to Lasi and SERIAL_1
* attached to Dino. Unfortunately, Dino appears before Lasi in the device
* tree. To ensure that ttyS0 == SERIAL_0, we register two drivers; one
* which only knows about Lasi and then a second which will find all the
* other serial ports. HPUX ignores this problem.
*/
static struct parisc_device_id lasi_tbl[] = {
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x03B, 0x0008C }, /* C1xx/C1xxL */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x03C, 0x0008C }, /* B132L */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x03D, 0x0008C }, /* B160L */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x03E, 0x0008C }, /* B132L+ */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x03F, 0x0008C }, /* B180L+ */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x046, 0x0008C }, /* Rocky2 120 */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x047, 0x0008C }, /* Rocky2 150 */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x04E, 0x0008C }, /* Kiji L2 132 */
{ HPHW_FIO, HVERSION_REV_ANY_ID, 0x056, 0x0008C }, /* Raven+ */
{ 0 }
};
MODULE_DEVICE_TABLE(parisc, serial_tbl);
static struct parisc_driver lasi_driver = {
.name = "serial_1",
.id_table = lasi_tbl,
.probe = serial_init_chip,
};
static struct parisc_driver serial_driver = {
.name = "serial",
.id_table = serial_tbl,
.probe = serial_init_chip,
};
static int __init probe_serial_gsc(void)
{
register_parisc_driver(&lasi_driver);
register_parisc_driver(&serial_driver);
return 0;
}
module_init(probe_serial_gsc);
MODULE_LICENSE("GPL");
|
#ifndef USER_MACROS_H
#define USER_MACROS_H
/*generated by SCADE Code Generator*/
#include "libraries/libmathext/macro_libmathext.h"
#include "libraries/libsmlk/macro_libsmlk.h"
#endif /*USER_MACROS_H*/
|
/* Extended Module Player
* Copyright (C) 1996-2000 Claudio Matsuoka and Hipolito Carraro Jr
*
* This file is part of the Extended Module Player and is distributed
* under the terms of the GNU General Public License. See doc/COPYING
* for more information.
*
* $Id: sgi.c,v 1.8 2007/10/22 10:13:49 cmatsuoka Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <dmedia/audio.h>
#include <fcntl.h>
#include "xmpi.h"
#include "driver.h"
#include "mixer.h"
static ALport audio_port;
/* Hack to get 16 bit sound working - 19990706 bdowning */
static int al_sample_16;
static int init (struct xmp_context *);
static int setaudio (struct xmp_options *);
static void bufdump (struct xmp_context *, int);
static void shutdown (void);
static void dummy () { }
/*
* audio port sample rates (these are the only ones supported by the library)
*/
static int srate[] = {
48000,
44100,
32000,
22050,
16000,
11025,
8000,
0
};
static char *help[] = {
"buffer=val", "Audio buffer size",
NULL
};
struct xmp_drv_info drv_sgi = {
"sgi", /* driver ID */
"SGI PCM audio", /* driver description */
help, /* help */
init, /* init */
shutdown, /* shutdown */
xmp_smix_numvoices, /* numvoices */
dummy, /* voicepos */
xmp_smix_echoback, /* echoback */
dummy, /* setpatch */
xmp_smix_setvol, /* setvol */
dummy, /* setnote */
xmp_smix_setpan, /* setpan */
dummy, /* setbend */
xmp_smix_seteffect, /* seteffect */
dummy, /* starttimer */
dummy, /* flush */
dummy, /* reset */
bufdump, /* bufdump */
dummy, /* bufwipe */
dummy, /* clearmem */
dummy, /* sync */
xmp_smix_writepatch,/* writepatch */
xmp_smix_getmsg, /* getmsg */
NULL
};
static int setaudio(struct xmp_options *o)
{
int bsize = 32 * 1024;
ALconfig config;
long pvbuffer[2];
char *token;
char **parm = o->parm;
int i;
parm_init ();
chkparm1 ("buffer", bsize = strtoul (token, NULL, 0));
parm_end ();
if ((config = ALnewconfig ()) == 0)
return XMP_ERR_DINIT;
/*
* Set sampling rate
*/
pvbuffer[0] = AL_OUTPUT_RATE;
#if 0 /* DOESN'T WORK */
for (i = 0; srate[i]; i++) {
if (srate[i] <= o->freq)
pvbuffer[1] = o->freq = srate[i];
}
#endif /* DOESN'T WORK */
/*
* This was flawed as far as I can tell - it just progressively lowered
* the sample rate to the lowest possible!
*
* o->freq = 44100
*
* i = 0 / if (48000 <= 44100)
* i = 1 / if (44100 <= 44100)
* then pvbuffer[1] = o->freq = 44100
* i = 2 / if (32000 <= 44100)
* then pvbuffer[1] = o->freq = 32000
* i = 3 / if (22050 <= 32000)
* then pvbuffer[1] = o->freq = 22050
* etc...
*
* Below is my attempt to write a new one. It picks the next highest
* rate available up to the maximum. This seems a lot more reasonable.
*
* - 19990706 bdowning
*/
for (i = 0; srate[i]; i++)
; /* find the end of the array */
while (i-- > 0) {
if (srate[i] >= o->freq) {
pvbuffer[1] = o->freq = srate[i];
break;
}
}
if (i == 0)
pvbuffer[1] = o->freq = srate[0]; /* 48 kHz. Wow! */
if (ALsetparams(AL_DEFAULT_DEVICE, pvbuffer, 2) < 0)
return XMP_ERR_DINIT;
/*
* Set sample format to signed integer
*/
if (ALsetsampfmt(config, AL_SAMPFMT_TWOSCOMP) < 0)
return XMP_ERR_DINIT;
/*
* Set sample width; 24 bit samples are not currently supported by xmp
*/
if (o->resol > 8) {
if (ALsetwidth (config, AL_SAMPLE_16) < 0) {
if (ALsetwidth (config, AL_SAMPLE_8) < 0)
return XMP_ERR_DINIT;
o->resol = 8;
} else
al_sample_16 = 1;
} else {
if (ALsetwidth (config, AL_SAMPLE_8) < 0) {
if (ALsetwidth (config, AL_SAMPLE_16) < 0)
return XMP_ERR_DINIT;
o->resol = 16;
} else
al_sample_16 = 0;
}
/*
* Set number of channels; 4 channel output is not currently supported
*/
if (o->outfmt & XMP_FMT_MONO) {
if (ALsetchannels (config, AL_MONO) < 0) {
if (ALsetchannels (config, AL_STEREO) < 0)
return XMP_ERR_DINIT;
o->outfmt &= ~XMP_FMT_MONO;
}
} else {
if (ALsetchannels (config, AL_STEREO) < 0) {
if (ALsetchannels (config, AL_MONO) < 0)
return XMP_ERR_DINIT;
o->outfmt |= XMP_FMT_MONO;
}
}
/*
* Set buffer size
*/
if (ALsetqueuesize (config, bsize) < 0)
return XMP_ERR_DINIT;
/*
* Open the audio port
*/
if ((audio_port = ALopenport ("xmp", "w", config)) == 0)
return XMP_ERR_DINIT;
return XMP_OK;
}
static int init(struct xmp_context *ctx)
{
if (setaudio(&ctx->o) != XMP_OK)
return XMP_ERR_DINIT;
return xmp_smix_on(ctx);
}
/* Build and write one tick (one PAL frame or 1/50 s in standard vblank
* timed mods) of audio data to the output device.
*
* Apparently ALwritesamps requires the number of samples instead of
* the number of bytes, which is what I assume i is. This was a
* trial-and-error fix, but it appears to work. - 19990706 bdowning
*/
static void bufdump(struct xmp_context *ctx, int i)
{
if (al_sample_16)
ALwritesamps(audio_port, xmp_smix_buffer(ctx), i / 2);
else
ALwritesamps(audio_port, xmp_smix_buffer(ctx), i);
}
static void shutdown()
{
xmp_smix_off();
ALcloseport(audio_port);
}
|
/**
******************************************************************************
* @file bsp_SysTick.c
* @author fire
* @version V1.0
* @date 2013-xx-xx
* @brief SysTick ϵͳµÎ´ðʱÖÓ10usÖжϺ¯Êý¿â,ÖжÏʱ¼ä¿É×ÔÓÉÅäÖã¬
* ³£ÓõÄÓÐ 1us 10us 1ms Öжϡ£
******************************************************************************
* @attention
*
* ʵÑéÆ½Ì¨:Ò°»ð iSO STM32 ¿ª·¢°å
* ÂÛ̳ :http://www.chuxue123.com
* ÌÔ±¦ :http://firestm32.taobao.com
*
******************************************************************************
*/
#include "bsp_SysTick.h"
static __IO u32 TimingDelay;
/**
* @brief Æô¶¯ÏµÍ³µÎ´ð¶¨Ê±Æ÷ SysTick
* @param ÎÞ
* @retval ÎÞ
*/
void SysTick_Init(void)
{
/* SystemFrequency / 1000 1msÖжÏÒ»´Î
* SystemFrequency / 100000 10usÖжÏÒ»´Î
* SystemFrequency / 1000000 1usÖжÏÒ»´Î
*/
// if (SysTick_Config(SystemFrequency / 100000)) // ST3.0.0¿â°æ±¾
if (SysTick_Config(SystemCoreClock / 1000)) // ST3.5.0¿â°æ±¾
{
/* Capture error */
while (1);
}
// ¹Ø±ÕµÎ´ð¶¨Ê±Æ÷
// SysTick->CTRL &= ~ SysTick_CTRL_ENABLE_Msk;
}
/**
* @brief usÑÓʱ³ÌÐò,10usΪһ¸öµ¥Î»
* @param
* @arg nTime: Delay_us( 1 ) ÔòʵÏÖµÄÑÓʱΪ 1 * 10us = 10us
* @retval ÎÞ
*/
void Delay_us(__IO u32 nTime)
{
TimingDelay = nTime;
// ʹÄܵδð¶¨Ê±Æ÷
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
while(TimingDelay != 0);
}
/**
* @brief »ñÈ¡½ÚÅijÌÐò
* @param ÎÞ
* @retval ÎÞ
* @attention ÔÚ SysTick ÖжϺ¯Êý SysTick_Handler()µ÷ÓÃ
*/
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
/*********************************************END OF FILE**********************/
|
#include <stdio.h>
#include <mpi.h>
#include <unistd.h>
#include "e-hal.h"
#include "e-loader.h"
int main(int argc, char *argv[]) {
MPI_Init(&argc, &argv);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
e_init(NULL);
int primary = !(rank % 2);
int tmp = 0;
int tag = 0;
if (primary) {
e_reset_system();
MPI_Send(&tmp, 0, MPI_INT, rank + 1, tag, MPI_COMM_WORLD);
} else {
MPI_Status status;
MPI_Recv(&tmp, 0, MPI_INT, rank - 1, tag, MPI_COMM_WORLD, &status);
}
e_platform_t platform;
e_get_platform_info(&platform);
int rows = platform.rows / 2;
int cols = platform.cols;
e_epiphany_t dev;
e_open(&dev, (primary ? 0 : rows), 0, rows, cols);
e_reset_group(&dev);
e_load_group((char*) "e-hello.srec", &dev, 0, 0, rows, cols, E_TRUE);
usleep(10000);
int core_id;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
e_read(&dev, i, j, 0x2000, &core_id, sizeof(int));
printf("hello, world from process %d, eCore: 0x%03X (%d, %d)\n", rank, core_id, i, j);
}
}
e_close(&dev);
tag++;
if (!primary) {
MPI_Send(&tmp, 0, MPI_INT, rank - 1, tag, MPI_COMM_WORLD);
} else {
MPI_Status status;
MPI_Recv(&tmp, 0, MPI_INT, rank + 1, tag, MPI_COMM_WORLD, &status);
e_finalize();
}
MPI_Finalize();
return 0;
}
|
#include "../../dist/include/sound/hda_register.h"
|
/*
Copyright (C) 2000 The Exult Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _SIGN_GUMP_H_
#define _SIGN_GUMP_H_
#include <string>
#include "Gump.h"
/*
* A sign showing runes.
*/
class Sign_gump : public Gump
{
UNREPLICATABLE_CLASS(Sign_gump);
protected:
std::string *lines; // Lines of text.
int num_lines;
bool serpentine;
public:
Sign_gump(int shapenum, int nlines);
virtual ~Sign_gump();
// Set a line of text.
void add_text(int line, const std::string &txt);
// Paint it and its contents.
virtual void paint();
};
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Advanced Micro Devices, Inc.
* Copyright (C) 2014 Sage Electronic Engineering, LLC.
* Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.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; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <arch/io.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h>
#include <console/console.h>
#include <cpu/amd/amdfam14.h>
#include <device/pci.h>
#include <drivers/generic/ioapic/chip.h>
#include <stdint.h>
#include <string.h>
#include <southbridge/amd/amd_pci_util.h>
#include <southbridge/amd/cimx/sb800/SBPLATFORM.h>
static void *smp_write_config_table(void *v)
{
struct mp_config_table *mc;
int bus_isa;
/*
* By the time this function gets called, the IOAPIC registers
* have been written so they can be read to get the correct
* APIC ID and Version
*/
u8 ioapic_id = (io_apic_read(VIO_APIC_VADDR, 0x00) >> 24);
u8 ioapic_ver = (io_apic_read(VIO_APIC_VADDR, 0x01) & 0xFF);
/* Intialize the MP_Table */
mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
mptable_init(mc, LOCAL_APIC_ADDR);
/*
* Type 0: Processor Entries:
* LAPIC ID, LAPIC Version, CPU Flags:EN/BP,
* CPU Signature (Stepping, Model, Family),
* Feature Flags
*/
smp_write_processors(mc);
/*
* Type 1: Bus Entries:
* Bus ID, Bus Type
*/
mptable_write_buses(mc, NULL, &bus_isa);
/*
* Type 2: I/O APICs:
* APIC ID, Version, APIC Flags:EN, Address
*/
smp_write_ioapic(mc, ioapic_id, ioapic_ver, VIO_APIC_VADDR);
/*
* Type 3: I/O Interrupt Table Entries:
* Int Type, Int Polarity, Int Level, Source Bus ID,
* Source Bus IRQ, Dest APIC ID, Dest PIN#
*/
mptable_add_isa_interrupts(mc, bus_isa, ioapic_id, 0);
/* PCI interrupts are level triggered, and are
* associated with a specific bus/device/function tuple.
*/
#define PCI_INT(bus, dev, fn, pin) \
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, (bus), (((dev)<<2)|(fn)), ioapic_id, (pin))
/* APU Internal Graphic Device */
PCI_INT(0x0, 0x01, 0x0, intr_data_ptr[PIRQ_C]);
PCI_INT(0x0, 0x01, 0x1, intr_data_ptr[PIRQ_D]);
/* SMBUS / ACPI */
PCI_INT(0x0, 0x14, 0x0, intr_data_ptr[PIRQ_SMBUS]);
/* Southbridge HD Audio */
PCI_INT(0x0, 0x14, 0x2, intr_data_ptr[PIRQ_HDA]);
/* LPC */
PCI_INT(0x0, 0x14, 0x3, intr_data_ptr[PIRQ_C]);
/* USB */
PCI_INT(0x0, 0x12, 0x0, intr_data_ptr[PIRQ_OHCI1]);
PCI_INT(0x0, 0x12, 0x2, intr_data_ptr[PIRQ_EHCI1]);
PCI_INT(0x0, 0x13, 0x0, intr_data_ptr[PIRQ_OHCI2]);
PCI_INT(0x0, 0x13, 0x2, intr_data_ptr[PIRQ_EHCI2]);
PCI_INT(0x0, 0x14, 0x5, intr_data_ptr[PIRQ_OHCI4]);
/* IDE */
PCI_INT(0x0, 0x14, 0x1, intr_data_ptr[PIRQ_IDE]);
/* SATA */
PCI_INT(0x0, 0x11, 0x0, intr_data_ptr[PIRQ_SATA]);
/* On-board NIC & Slot PCIE. */
PCI_INT(0x1, 0x0, 0x0, intr_data_ptr[PIRQ_E]); /* Use INTE */
PCI_INT(0x2, 0x0, 0x0, intr_data_ptr[PIRQ_E]); /* Use INTE */
/* PCI slots */
device_t dev = dev_find_slot(0, PCI_DEVFN(0x14, 4));
if (dev && dev->enabled) {
u8 bus_pci = dev->link_list->secondary;
/* PCI_SLOT 0 */
PCI_INT(bus_pci, 0x5, 0x0, intr_data_ptr[PIRQ_E]); /* INTA -> INTE */
PCI_INT(bus_pci, 0x5, 0x1, intr_data_ptr[PIRQ_F]); /* INTB -> INTF */
PCI_INT(bus_pci, 0x5, 0x2, intr_data_ptr[PIRQ_G]); /* INTC -> INTG */
PCI_INT(bus_pci, 0x5, 0x3, intr_data_ptr[PIRQ_H]); /* INTD -> INTH */
}
/* On-board Realtek NIC 2. (PCIe PortA) */
PCI_INT(0x0, 0x15, 0x0, intr_data_ptr[PIRQ_E]); /* INTA -> INTE */
/* PCIe PortB */
PCI_INT(0x0, 0x15, 0x1, intr_data_ptr[PIRQ_F]); /* INTB -> INTF */
/* PCIe PortC */
PCI_INT(0x0, 0x15, 0x2, intr_data_ptr[PIRQ_G]); /* INTC -> INTG */
/* PCIe PortD */
PCI_INT(0x0, 0x15, 0x3, intr_data_ptr[PIRQ_H]); /* INTD -> INTH */
/*Local Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN# */
#define IO_LOCAL_INT(type, intr, apicid, pin) \
smp_write_lintsrc(mc, (type), MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, bus_isa, (intr), (apicid), (pin));
IO_LOCAL_INT(mp_ExtINT, 0x0, MP_APIC_ALL, 0x0);
IO_LOCAL_INT(mp_NMI, 0x0, MP_APIC_ALL, 0x1);
/* There is no extension information... */
/* Compute the checksums */
return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
{
void *v;
v = smp_write_floating_table(addr, 0); /* ADDR, Enable Virtual Wire */
return (unsigned long)smp_write_config_table(v);
}
|
#include <linux/smp.h>
#include <linux/timex.h>
#include <linux/string.h>
#include <linux/seq_file.h>
#include <linux/cpufreq.h>
/*
* Get CPU information for use by the procfs.
*/
static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
unsigned int cpu)
{
#ifdef CONFIG_SMP
if (c->x86_max_cores * smp_num_siblings > 1) {
seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
seq_printf(m, "siblings\t: %d\n",
cpumask_weight(cpu_core_mask(cpu)));
seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id);
seq_printf(m, "cpu cores\t: %d\n", c->booted_cores);
seq_printf(m, "apicid\t\t: %d\n", c->apicid);
seq_printf(m, "initial apicid\t: %d\n", c->initial_apicid);
}
#endif
}
#ifdef CONFIG_X86_32
static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
{
/*
* We use exception 16 if we have hardware math and we've either seen
* it or the CPU claims it is internal
*/
int fpu_exception = c->hard_math && (ignore_fpu_irq || cpu_has_fpu);
seq_printf(m,
"fdiv_bug\t: %s\n"
"hlt_bug\t\t: %s\n"
"f00f_bug\t: %s\n"
"coma_bug\t: %s\n"
"fpu\t\t: %s\n"
"fpu_exception\t: %s\n"
"cpuid level\t: %d\n"
"wp\t\t: %s\n",
c->fdiv_bug ? "yes" : "no",
c->hlt_works_ok ? "no" : "yes",
c->f00f_bug ? "yes" : "no",
c->coma_bug ? "yes" : "no",
c->hard_math ? "yes" : "no",
fpu_exception ? "yes" : "no",
c->cpuid_level,
c->wp_works_ok ? "yes" : "no");
}
#else
static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
{
seq_printf(m,
"fpu\t\t: yes\n"
"fpu_exception\t: yes\n"
"cpuid level\t: %d\n"
"wp\t\t: yes\n",
c->cpuid_level);
}
#endif
static int show_cpuinfo(struct seq_file *m, void *v)
{
struct cpuinfo_x86 *c = v;
unsigned int cpu;
int i;
cpu = c->cpu_index;
seq_printf(m, "processor\t: %u\n"
"vendor_id\t: %s\n"
"cpu family\t: %d\n"
"model\t\t: %u\n"
"model name\t: %s\n",
cpu,
c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown",
c->x86,
c->x86_model,
c->x86_model_id[0] ? c->x86_model_id : "unknown");
if (c->x86_mask || c->cpuid_level >= 0)
seq_printf(m, "stepping\t: %d\n", c->x86_mask);
else
seq_printf(m, "stepping\t: unknown\n");
if (c->microcode)
seq_printf(m, "microcode\t: 0x%x\n", c->microcode);
if (cpu_has(c, X86_FEATURE_TSC)) {
unsigned int freq = cpufreq_quick_get(cpu);
if (!freq)
freq = cpu_khz;
seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
freq / 1000, (freq % 1000));
}
/* Cache size */
if (c->x86_cache_size >= 0)
seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
show_cpuinfo_core(m, c, cpu);
show_cpuinfo_misc(m, c);
seq_printf(m, "flags\t\t:");
for (i = 0; i < 32*NCAPINTS; i++)
if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
seq_printf(m, " %s", x86_cap_flags[i]);
seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
c->loops_per_jiffy/(500000/HZ),
(c->loops_per_jiffy * 10 /(50000/HZ)) % 100);
#ifdef CONFIG_X86_64
if (c->x86_tlbsize > 0)
seq_printf(m, "TLB size\t: %d 4K pages\n", c->x86_tlbsize);
#endif
seq_printf(m, "clflush size\t: %u\n", c->x86_clflush_size);
seq_printf(m, "cache_alignment\t: %d\n", c->x86_cache_alignment);
seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n",
c->x86_phys_bits, c->x86_virt_bits);
seq_printf(m, "power management:");
for (i = 0; i < 32; i++) {
if (c->x86_power & (1 << i)) {
if (i < ARRAY_SIZE(x86_power_flags) &&
x86_power_flags[i])
seq_printf(m, "%s%s",
x86_power_flags[i][0] ? " " : "",
x86_power_flags[i]);
else
seq_printf(m, " [%d]", i);
}
}
seq_printf(m, "\n\n");
return 0;
}
static void *c_start(struct seq_file *m, loff_t *pos)
{
if (*pos == 0) /* just in case, cpu 0 is not the first */
*pos = cpumask_first(cpu_online_mask);
else
*pos = cpumask_next(*pos - 1, cpu_online_mask);
if ((*pos) < nr_cpu_ids)
return &cpu_data(*pos);
return NULL;
}
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
(*pos)++;
return c_start(m, pos);
}
static void c_stop(struct seq_file *m, void *v)
{
}
const struct seq_operations cpuinfo_op = {
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = show_cpuinfo,
};
|
/*
* Author: MontaVista Software, Inc. <source@mvista.com>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/mvl_patch.h>
static __init int regpatch(void)
{
return mvl_register_patch(1444);
}
module_init(regpatch);
|
/* Copyright 2001 Rien Croonenborghs, Ben Kibbey, Shaun Jackman, Ivan Brozovic
This file is part of lcab.
lcab 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.
lcab 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 lcab; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "cdata.h"
// initialize the cabdata-structure
// set checksum for datablock
// checksums are computed at a later time and added then
void cdata_init( struct cdata *cd, int checksum )
{
cd->checksum = checksum;
}
// set number of compressed bytes in datablock
void cdata_ncbytes( struct cdata *cd, int ncb )
{
cd->ncbytes = ncb;
}
// set number of uncompressed bytes in datablock
void cdata_nubytes( struct cdata *cd, int nub )
{
cd->nubytes = nub;
}
|
/***************************************************************************
* Copyright (C) 2007-2009 by Elad Lahav
* elad_lahav@users.sourceforge.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
***************************************************************************/
#ifndef __EDITOR_CONFIGDIALOG_H__
#define __EDITOR_CONFIGDIALOG_H__
#include <QDialog>
#include <QStandardItemModel>
#include "ui_configdialog.h"
#include "config.h"
namespace KScope
{
namespace Editor
{
class LexerStyleModel;
/**
* A dialogue for configuring a QScintilla editor.
* Unfortunately, QScintilla does not provide such a dialogue
* @author Elad Lahav
*/
class ConfigDialog : public QDialog, public Ui::ConfigDialog
{
Q_OBJECT
public:
ConfigDialog(const Config&, QWidget* parent = NULL);
~ConfigDialog();
void getConfig(Config&);
signals:
/**
* Used to notify the lexer model of a change to the default font.
*/
void defaultFontChanged();
private:
QStandardItemModel* lexerModel_;
LexerStyleModel* styleModel_;
private slots:
void indentLanguageChanged(int);
void resetStyles();
void importStyles();
void exportStyles();
void editStyle(const QModelIndex&);
void editProperty(const QModelIndex&, const QVariant&);
void applyInheritance();
};
} // namespace Editor
} // namespace KScope
#endif // __EDITOR_CONFIGDIALOG_H__
|
/*
* tablemodel.h
*
* Copyright (C) 2011 Christoph Pfister <christophpfister@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef TABLEMODEL_H
#define TABLEMODEL_H
#include <QAbstractTableModel>
template<class T> class TableModel : public QAbstractTableModel
{
typedef typename T::ItemType ItemType;
typedef typename T::LessThanType LessThanType;
typedef typename LessThanType::SortOrder SortOrder;
public:
explicit TableModel(QObject *parent) : QAbstractTableModel(parent), updatingRow(-1) { }
~TableModel() { }
QModelIndex find(const ItemType &item) const
{
if (item.isValid()) {
int row = binaryFind(item);
if (row < items.size()) {
return index(row, 0);
}
}
return QModelIndex();
}
const ItemType &value(int row) const
{
if ((row >= 0) && (row < items.size())) {
return items.at(row);
}
return sharedNull;
}
const ItemType &value(const QModelIndex &index) const
{
if ((index.row() >= 0) && (index.row() < items.size())) {
return items.at(index.row());
}
return sharedNull;
}
int columnCount(const QModelIndex &parent) const
{
if (!parent.isValid()) {
return helper.columnCount();
}
return 0;
}
int rowCount(const QModelIndex &parent) const
{
if (!parent.isValid()) {
return items.size();
}
return 0;
}
protected:
template<class U> void reset(const U &container)
{
beginLayoutChange();
items.clear();
for (typename U::ConstIterator it = container.constBegin();
it != container.constEnd(); ++it) {
const ItemType &item = *it;
if (helper.filterAcceptsItem(item)) {
items.append(item);
}
}
qSort(items.begin(), items.end(), lessThan);
endLayoutChange();
}
template<class U> void resetFromKeys(const U &container)
{
beginLayoutChange();
items.clear();
for (typename U::ConstIterator it = container.constBegin();
it != container.constEnd(); ++it) {
const ItemType &item = it.key();
if (helper.filterAcceptsItem(item)) {
items.append(item);
}
}
qSort(items.begin(), items.end(), lessThan);
endLayoutChange();
}
void insert(const ItemType &item)
{
if (item.isValid() && helper.filterAcceptsItem(item)) {
int row = upperBound(item);
beginInsertRows(QModelIndex(), row, row);
items.insert(row, item);
endInsertRows();
}
}
void aboutToUpdate(const ItemType &item)
{
updatingRow = -1;
if (item.isValid()) {
updatingRow = binaryFind(item);
}
}
void update(const ItemType &item)
{
int row = updatingRow;
updatingRow = -1;
if ((row >= 0) && (row < items.size())) {
if (item.isValid() && helper.filterAcceptsItem(item)) {
items.replace(row, item);
int targetRow = row;
while (((targetRow - 1) >= 0) &&
lessThan(item, items.at(targetRow - 1))) {
--targetRow;
}
while (((targetRow + 1) < items.size()) &&
lessThan(items.at(targetRow + 1), item)) {
++targetRow;
}
if (row == targetRow) {
emit dataChanged(index(row, 0),
index(row, helper.columnCount() - 1));
} else {
beginLayoutChange();
items.move(row, targetRow);
endLayoutChange();
}
} else {
beginRemoveRows(QModelIndex(), row, row);
items.removeAt(row);
endRemoveRows();
}
} else {
insert(item);
}
}
void remove(const ItemType &item)
{
if (item.isValid()) {
int row = binaryFind(item);
beginRemoveRows(QModelIndex(), row, row);
items.removeAt(row);
endRemoveRows();
}
}
void internalSort(SortOrder sortOrder)
{
if (lessThan.getSortOrder() != sortOrder) {
beginLayoutChange();
lessThan.setSortOrder(sortOrder);
qSort(items.begin(), items.end(), lessThan);
endLayoutChange();
}
}
private:
int binaryFind(const ItemType &item) const
{
return (qBinaryFind(items.constBegin(), items.constEnd(), item, lessThan) -
items.constBegin());
}
int upperBound(const ItemType &item) const
{
return (qUpperBound(items.constBegin(), items.constEnd(), item, lessThan) -
items.constBegin());
}
void beginLayoutChange()
{
emit layoutAboutToBeChanged();
oldPersistentIndexes = persistentIndexList();
persistentItems.clear();
foreach (const QModelIndex &index, oldPersistentIndexes) {
if ((index.row() >= 0) && (index.row() < items.size())) {
persistentItems.append(items.at(index.row()));
} else {
persistentItems.append(ItemType());
}
}
}
void endLayoutChange()
{
QModelIndexList newPersistentIndexes;
for (int i = 0; i < oldPersistentIndexes.size(); ++i) {
const QModelIndex &oldIndex = oldPersistentIndexes.at(i);
const ItemType &item = persistentItems.at(i);
if (item.isValid()) {
int row = binaryFind(item);
newPersistentIndexes.append(index(row, oldIndex.column()));
} else {
newPersistentIndexes.append(QModelIndex());
}
}
changePersistentIndexList(oldPersistentIndexes, newPersistentIndexes);
oldPersistentIndexes.clear();
persistentItems.clear();
emit layoutChanged();
}
private:
QList<ItemType> items;
LessThanType lessThan;
ItemType sharedNull;
QModelIndexList oldPersistentIndexes;
QList<ItemType> persistentItems;
int updatingRow;
protected:
T helper;
};
#endif /* TABLEMODEL_H */
|
#ifndef RENDERER_H_
#define RENDERER_H_
#include "system-gl.h"
#include "linalg.h"
#ifdef _MSC_VER // NULL
#include <cstdlib>
#endif
class Renderer
{
public:
virtual ~Renderer() {}
virtual void draw(bool showfaces, bool showedges) const = 0;
enum ColorMode {
COLORMODE_NONE,
COLORMODE_MATERIAL,
COLORMODE_CUTOUT,
COLORMODE_HIGHLIGHT,
COLORMODE_BACKGROUND,
COLORMODE_MATERIAL_EDGES,
COLORMODE_CUTOUT_EDGES,
COLORMODE_HIGHLIGHT_EDGES,
COLORMODE_BACKGROUND_EDGES
};
virtual bool getColor(ColorMode colormode, Color4f &col) const;
virtual void setColor(const float color[4], GLint *shaderinfo = NULL) const;
virtual void setColor(ColorMode colormode, GLint *shaderinfo = NULL) const;
virtual void setColor(ColorMode colormode, const float color[4], GLint *shaderinfo = NULL) const;
};
#endif // RENDERER_H
|
// This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2009 Emweb bv, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef BLOG_LOGIN_WIDGET_H_
#define BLOG_LOGIN_WIDGET_H_
#include <Wt/Auth/AuthWidget.h>
#include <Wt/Auth/RegistrationModel.h>
class BlogSession;
/*
* Displays login, logout and registration options
*/
class BlogLoginWidget : public Wt::Auth::AuthWidget
{
public:
BlogLoginWidget(BlogSession& session, const std::string& basePath);
virtual void createLoginView() override;
virtual void createLoggedInView() override;
};
#endif // BLOG_LOGIN_WIDGET_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: malloc.c /main/3 1995/11/08 11:06:50 rswiston $ */
/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */
/* Interfaces to free and malloc with optional debugging traces */
/**/
#include <stdlib.h>
#include <stdio.h>
#if defined(MSDOS)
#include <process.h>
#endif
#include "basic.h"
extern LOGICAL m_heapchk ;
extern LOGICAL m_malftrace ;
void m_errline(
#if defined(M_PROTO)
char *text
#endif
) ;
void m_exit(
#if defined(M_PROTO)
int status
#endif
) ;
void m_free(
#if defined(M_PROTO)
void *block, char *msg
#endif
) ;
void m_heapdump(
#if defined(M_PROTO)
M_NOPAR
#endif
) ;
void *m_malloc(
#if defined(M_PROTO)
int size, char *msg
#endif
) ;
void *m_realloc(
#if defined(M_PROTO)
void *ptr, int size, char *msg
#endif
) ;
void *m_trace(
#if defined(M_PROTO)
char *text
#endif
) ;
void *m_wctrace(
#if defined(M_PROTO)
M_WCHAR *text
#endif
) ;
void m_free(block, msg)
void *block ;
char *msg ;
{
char buffer[32] ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
free(block) ;
if (m_malftrace) {
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)
snprintf(buffer, 32, "%5x:%5x",
(unsigned int) ((unsigned long) block >> 16),
(unsigned int) block) ;
#else
snprintf(buffer, 32, " %9p", block) ;
#endif
m_trace(buffer) ;
m_trace("- Freed ") ;
m_trace(msg) ;
m_trace("\n") ;
}
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
}
#if defined(MSDOS)
void m_heapdump(M_NOPAR)
{
struct _heapinfo hinfo ;
int heapstatus ;
heapstatus = _heapchk() ;
if (heapstatus == _HEAPOK || heapstatus == _HEAPEMPTY) return ;
printf("\nDumping heap:\n") ;
hinfo._pentry = NULL ;
while ((heapstatus = _heapwalk(&hinfo)) == _HEAPOK)
printf("%6s block at %p of size %4.4X\n",
hinfo._useflag == _USEDENTRY ? "USED" : "FREE",
hinfo._pentry, hinfo._size) ;
switch(heapstatus) {
case _HEAPEMPTY:
printf("OK - empty heap\n\n") ;
break ;
case _HEAPEND:
printf("OK - end of heap\n\n") ;
break ;
case _HEAPBADPTR:
printf("Error - bad pointer to heap\n\n") ;
break ;
case _HEAPBADBEGIN:
printf("Error - bad start of heap\n\n") ;
break ;
case _HEAPBADNODE:
printf("Error - bad node in heap\n\n") ;
break ;
}
m_exit(TRUE) ;
}
#endif
void *m_malloc(size, msg)
int size ;
char *msg ;
{
char buffer[32] ;
void *p ;
size *= sizeof(M_WCHAR);
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! size) return(NULL) ;
p = (void *) malloc(size) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! p) {
m_errline("Unable to allocate space for ") ;
m_errline(msg) ;
m_errline("\n") ;
m_exit(TRUE) ;
}
if (m_malftrace) {
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)
snprintf(buffer, 32, "%5x:%5x",
(unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ;
#else
snprintf(buffer, 32, " %9p", p) ;
#endif
m_trace(buffer) ;
m_trace("- Allocated ") ;
snprintf(buffer, 32, "%6d", size) ;
m_trace(buffer) ;
m_trace(" bytes for ") ;
m_trace(msg) ;
m_trace("\n") ;
}
return(p) ;
}
void *m_realloc(ptr, size, msg)
void *ptr ;
int size ;
char *msg ;
{
char buffer[32] ;
void *p ;
size *= sizeof(M_WCHAR);
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! size) return(NULL) ;
p = (void *) realloc(ptr, size) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! p) {
m_errline("Unable to re-allocate space for ") ;
m_errline(msg) ;
m_errline("\n") ;
m_exit(TRUE) ;
}
if (m_malftrace) {
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)
snprintf(buffer, 32, "%5x:%5x",
(unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ;
#else
snprintf(buffer, 32, " %9p", p) ;
#endif
m_trace(buffer) ;
m_trace("- Re-allocated ") ;
snprintf(buffer, 32, "%6d", size) ;
m_trace(buffer) ;
m_trace(" bytes for ") ;
m_trace(msg) ;
m_trace("\n") ;
}
return(p) ;
}
|
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _GNM_RANGEFUNC_STRINGS_H_
# define _GNM_RANGEFUNC_STRINGS_H_
#include "numbers.h"
G_BEGIN_DECLS
int range_concatenate (GPtrArray *data, char **res);
G_END_DECLS
#endif /* _GNM_RANGEFUNC_STRINGS_H_ */
|
/*
* Copyright (C) 2014-2015 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
struct CB_PeripheralLib;
namespace PERIPHERALS { class CPeripheralAddon; }
namespace ADDON
{
class CAddon;
/*!
* Callbacks for a peripheral add-on to XBMC
*/
class CAddonCallbacksPeripheral
{
public:
CAddonCallbacksPeripheral(CAddon* addon);
~CAddonCallbacksPeripheral(void);
/*!
* @return The callback table
*/
CB_PeripheralLib* GetCallbacks() const { return m_callbacks; }
static void TriggerScan(void* addonData);
static void RefreshButtonMaps(void* addonData, const char* deviceName);
private:
static PERIPHERALS::CPeripheralAddon* GetPeripheralAddon(void* addonData, const char* strFunction);
CB_PeripheralLib* m_callbacks; /*!< callback addresses */
CAddon* m_addon; /*!< the add-on */
};
}; /* namespace ADDON */
|
/*
* Copyright (c) 2003-2004 MontaVista Software, Inc.
*
* All rights reserved.
*
* Author: Steven Dake (sdake@mvista.com)
*
* This software licensed under BSD license, the text of which follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the MontaVista Software, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/poll.h>
#include "../exec/timer.h"
void timer_function (void *data)
{
printf ("timer %p\n", data);
}
int main (void)
{
int msec;
struct timer *timer;
int randomvalue;
int i;
printf ("adding timers\n");
for (i = 0; i < 1000; i++) {
timer = (struct timer *)malloc (sizeof (struct timer));
randomvalue = random()%5000;
timer->function = timer_function;
timer->data = (void *)randomvalue;
timer_add_msec_in_future (timer, randomvalue);
}
printf ("done adding timers\n");
for (;;) {
msec = timer_expire_get_msec();
// printf ("msec to next timer expire %d\n", msec);
if (msec == -1) {
printf ("no more timers\n");
break;
}
poll (0, 0, msec);
timer_expire ();
}
return (0);
}
|
/*
* Copyright (c) 2007 Boudewijn Rempt boud@valdyas.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_FILTER_PROCESSING_INFORMATION_TEST_H
#define KIS_FILTER_PROCESSING_INFORMATION_TEST_H
#include <QtTest>
class KisProcessingInformationTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testCreation();
};
#endif
|
/*
* JMWin / JMPocket - JuggleMaster for Windows and Pocket PC
* Version 1.1
* (C) Per Johan Groland 2002-2008
*
* Using JMLib 2.0(C) Per Johan Groland 2000-2006, Gary Briggs 2003
* Based on JuggleMaster Version 1.60
* Copyright (C) 1995-1996 Ken Matsuoka
*
* JMPocket 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.
*
*/
#pragma once
#include "aboutdlg.h"
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#ifdef POCKETPC2003_UI_MODEL
#include "resource_ppc.h"
#elif defined(SMARTPHONE2003_UI_MODEL)
#include "resource_sp.h"
#else
#include "resource.h"
#endif
class JMApp : public CWinApp {
public:
JMApp();
// Overrides
public:
virtual BOOL InitInstance();
// Implementation
public:
afx_msg void OnAppAbout();
DECLARE_MESSAGE_MAP()
};
extern JMApp theApp;
|
/*
* Emulation of Allwinner EMAC Fast Ethernet controller and
* Realtek RTL8201CP PHY
*
* Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
*
* Allwinner EMAC register definitions from Linux kernel are:
* Copyright 2012 Stefan Roese <sr@denx.de>
* Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
* Copyright 1997 Sten Wang
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef ALLWINNER_EMAC_H
#define ALLWINNER_EMAC_H
#include "qemu/units.h"
#include "net/net.h"
#include "qemu/fifo8.h"
#include "hw/net/mii.h"
#include "hw/sysbus.h"
#include "qom/object.h"
#define TYPE_AW_EMAC "allwinner-emac"
typedef struct AwEmacState AwEmacState;
DECLARE_INSTANCE_CHECKER(AwEmacState, AW_EMAC,
TYPE_AW_EMAC)
/*
* Allwinner EMAC register list
*/
#define EMAC_CTL_REG 0x00
#define EMAC_TX_MODE_REG 0x04
#define EMAC_TX_FLOW_REG 0x08
#define EMAC_TX_CTL0_REG 0x0C
#define EMAC_TX_CTL1_REG 0x10
#define EMAC_TX_INS_REG 0x14
#define EMAC_TX_PL0_REG 0x18
#define EMAC_TX_PL1_REG 0x1C
#define EMAC_TX_STA_REG 0x20
#define EMAC_TX_IO_DATA_REG 0x24
#define EMAC_TX_IO_DATA1_REG 0x28
#define EMAC_TX_TSVL0_REG 0x2C
#define EMAC_TX_TSVH0_REG 0x30
#define EMAC_TX_TSVL1_REG 0x34
#define EMAC_TX_TSVH1_REG 0x38
#define EMAC_RX_CTL_REG 0x3C
#define EMAC_RX_HASH0_REG 0x40
#define EMAC_RX_HASH1_REG 0x44
#define EMAC_RX_STA_REG 0x48
#define EMAC_RX_IO_DATA_REG 0x4C
#define EMAC_RX_FBC_REG 0x50
#define EMAC_INT_CTL_REG 0x54
#define EMAC_INT_STA_REG 0x58
#define EMAC_MAC_CTL0_REG 0x5C
#define EMAC_MAC_CTL1_REG 0x60
#define EMAC_MAC_IPGT_REG 0x64
#define EMAC_MAC_IPGR_REG 0x68
#define EMAC_MAC_CLRT_REG 0x6C
#define EMAC_MAC_MAXF_REG 0x70
#define EMAC_MAC_SUPP_REG 0x74
#define EMAC_MAC_TEST_REG 0x78
#define EMAC_MAC_MCFG_REG 0x7C
#define EMAC_MAC_MCMD_REG 0x80
#define EMAC_MAC_MADR_REG 0x84
#define EMAC_MAC_MWTD_REG 0x88
#define EMAC_MAC_MRDD_REG 0x8C
#define EMAC_MAC_MIND_REG 0x90
#define EMAC_MAC_SSRR_REG 0x94
#define EMAC_MAC_A0_REG 0x98
#define EMAC_MAC_A1_REG 0x9C
#define EMAC_MAC_A2_REG 0xA0
#define EMAC_SAFX_L_REG0 0xA4
#define EMAC_SAFX_H_REG0 0xA8
#define EMAC_SAFX_L_REG1 0xAC
#define EMAC_SAFX_H_REG1 0xB0
#define EMAC_SAFX_L_REG2 0xB4
#define EMAC_SAFX_H_REG2 0xB8
#define EMAC_SAFX_L_REG3 0xBC
#define EMAC_SAFX_H_REG3 0xC0
/* CTL register fields */
#define EMAC_CTL_RESET (1 << 0)
#define EMAC_CTL_TX_EN (1 << 1)
#define EMAC_CTL_RX_EN (1 << 2)
/* TX MODE register fields */
#define EMAC_TX_MODE_ABORTED_FRAME_EN (1 << 0)
#define EMAC_TX_MODE_DMA_EN (1 << 1)
/* RX CTL register fields */
#define EMAC_RX_CTL_AUTO_DRQ_EN (1 << 1)
#define EMAC_RX_CTL_DMA_EN (1 << 2)
#define EMAC_RX_CTL_PASS_ALL_EN (1 << 4)
#define EMAC_RX_CTL_PASS_CTL_EN (1 << 5)
#define EMAC_RX_CTL_PASS_CRC_ERR_EN (1 << 6)
#define EMAC_RX_CTL_PASS_LEN_ERR_EN (1 << 7)
#define EMAC_RX_CTL_PASS_LEN_OOR_EN (1 << 8)
#define EMAC_RX_CTL_ACCEPT_UNICAST_EN (1 << 16)
#define EMAC_RX_CTL_DA_FILTER_EN (1 << 17)
#define EMAC_RX_CTL_ACCEPT_MULTICAST_EN (1 << 20)
#define EMAC_RX_CTL_HASH_FILTER_EN (1 << 21)
#define EMAC_RX_CTL_ACCEPT_BROADCAST_EN (1 << 22)
#define EMAC_RX_CTL_SA_FILTER_EN (1 << 24)
#define EMAC_RX_CTL_SA_FILTER_INVERT_EN (1 << 25)
/* RX IO DATA register fields */
#define EMAC_RX_HEADER(len, status) (((len) & 0xffff) | ((status) << 16))
#define EMAC_RX_IO_DATA_STATUS_CRC_ERR (1 << 4)
#define EMAC_RX_IO_DATA_STATUS_LEN_ERR (3 << 5)
#define EMAC_RX_IO_DATA_STATUS_OK (1 << 7)
#define EMAC_UNDOCUMENTED_MAGIC 0x0143414d /* header for RX frames */
/* INT CTL and INT STA registers fields */
#define EMAC_INT_TX_CHAN(x) (1 << (x))
#define EMAC_INT_RX (1 << 8)
/* Due to lack of specifications, size of fifos is chosen arbitrarily */
#define TX_FIFO_SIZE (4 * KiB)
#define RX_FIFO_SIZE (32 * KiB)
#define NUM_TX_FIFOS 2
#define RX_HDR_SIZE 8
#define CRC_SIZE 4
#define PHY_REG_SHIFT 0
#define PHY_ADDR_SHIFT 8
typedef struct RTL8201CPState {
uint16_t bmcr;
uint16_t bmsr;
uint16_t anar;
uint16_t anlpar;
} RTL8201CPState;
struct AwEmacState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
MemoryRegion iomem;
qemu_irq irq;
NICState *nic;
NICConf conf;
RTL8201CPState mii;
uint8_t phy_addr;
uint32_t ctl;
uint32_t tx_mode;
uint32_t rx_ctl;
uint32_t int_ctl;
uint32_t int_sta;
uint32_t phy_target;
Fifo8 rx_fifo;
uint32_t rx_num_packets;
uint32_t rx_packet_size;
uint32_t rx_packet_pos;
Fifo8 tx_fifo[NUM_TX_FIFOS];
uint32_t tx_length[NUM_TX_FIFOS];
uint32_t tx_channel;
};
#endif
|
/* SPDX-License-Identifier: Intel */
/*
* Copyright (C) 2013, Intel Corporation
* Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
*/
#ifndef _FSP_HEADER_H_
#define _FSP_HEADER_H_
#define FSP_HEADER_OFF 0x94 /* Fixed FSP header offset in the FSP image */
struct __packed fsp_header {
u32 sign; /* 'FSPH' */
u32 hdr_len; /* header length */
u8 reserved1[3];
u8 hdr_rev; /* header rev */
u32 img_rev; /* image rev */
char img_id[8]; /* signature string */
u32 img_size; /* image size */
u32 img_base; /* image base */
u32 img_attr; /* image attribute */
u32 cfg_region_off; /* configuration region offset */
u32 cfg_region_size; /* configuration region size */
u32 api_num; /* number of API entries */
u32 fsp_tempram_init; /* tempram_init offset */
u32 fsp_init; /* fsp_init offset */
u32 fsp_notify; /* fsp_notify offset */
u32 fsp_mem_init; /* fsp_mem_init offset */
u32 fsp_tempram_exit; /* fsp_tempram_exit offset */
u32 fsp_silicon_init; /* fsp_silicon_init offset */
};
#define FSP_HEADER_REVISION_1 1
#define FSP_HEADER_REVISION_2 2
#define FSP_ATTR_GRAPHICS_SUPPORT (1 << 0)
#endif
|
/*
* binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra.
*
* Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@dm.cobaltmicro.com)
* Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz)
*/
#define ELF_ARCH EM_SPARC
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB;
/* For the most part we present code dumps in the format
* Solaris does.
*/
typedef unsigned int elf_greg_t;
#define ELF_NGREG 38
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* Format is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/
#include <asm/psrcompat.h>
#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
do { unsigned int *dest = &(__elf_regs[0]); \
struct pt_regs *src = (__pt_regs); \
unsigned int *sp; \
int i; \
for(i = 0; i < 16; i++) \
dest[i] = (unsigned int) src->u_regs[i];\
/* Don't try this at home kids... */ \
set_fs(USER_DS); \
sp = (unsigned int *) (src->u_regs[14] & \
0x00000000fffffffc); \
for(i = 0; i < 16; i++) \
__get_user(dest[i+16], &sp[i]); \
set_fs(KERNEL_DS); \
dest[32] = tstate_to_psr(src->tstate); \
dest[33] = (unsigned int) src->tpc; \
dest[34] = (unsigned int) src->tnpc; \
dest[35] = src->y; \
dest[36] = dest[37] = 0; /* XXX */ \
} while(0);
typedef struct {
union {
unsigned int pr_regs[32];
unsigned long pr_dregs[16];
} pr_fr;
unsigned int __unused;
unsigned int pr_fsr;
unsigned char pr_qcnt;
unsigned char pr_q_entrysize;
unsigned char pr_en;
unsigned int pr_q[64];
} elf_fpregset_t;
/* UltraSparc extensions. Still unused, but will be eventually. */
typedef struct {
unsigned int pr_type;
unsigned int pr_align;
union {
struct {
union {
unsigned int pr_regs[32];
unsigned long pr_dregs[16];
long double pr_qregs[8];
} pr_xfr;
} pr_v8p;
unsigned int pr_xfsr;
unsigned int pr_fprs;
unsigned int pr_xg[8];
unsigned int pr_xo[8];
unsigned long pr_tstate;
unsigned int pr_filler[8];
} pr_un;
} elf_xregset_t;
#define elf_check_arch(x) (((x) == EM_SPARC) || ((x) == EM_SPARC32PLUS))
#define ELF_ET_DYN_BASE 0x08000000
#include <asm/processor.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/elfcore.h>
struct timeval32
{
int tv_sec, tv_usec;
};
#define elf_prstatus elf_prstatus32
struct elf_prstatus32
{
struct elf_siginfo pr_info; /* Info associated with signal */
short pr_cursig; /* Current signal */
unsigned int pr_sigpend; /* Set of pending signals */
unsigned int pr_sighold; /* Set of held signals */
pid_t pr_pid;
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
struct timeval32 pr_utime; /* User time */
struct timeval32 pr_stime; /* System time */
struct timeval32 pr_cutime; /* Cumulative user time */
struct timeval32 pr_cstime; /* Cumulative system time */
elf_gregset_t pr_reg; /* GP registers */
int pr_fpvalid; /* True if math co-processor being used. */
};
#define elf_prpsinfo elf_prpsinfo32
struct elf_prpsinfo32
{
char pr_state; /* numeric process state */
char pr_sname; /* char for pr_state */
char pr_zomb; /* zombie */
char pr_nice; /* nice val */
unsigned int pr_flag; /* flags */
u16 pr_uid;
u16 pr_gid;
pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* filename of executable */
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
};
#define elf_addr_t u32
#define elf_caddr_t u32
#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
#define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32
#endif
#undef CONFIG_BINFMT_ELF_MODULE
#ifdef CONFIG_BINFMT_ELF32_MODULE
#define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
#define ELF_FLAGS_INIT current->tss.flags |= SPARC_FLAG_32BIT
MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit SparcLinux binaries on the Ultra");
MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
#include "../../../fs/binfmt_elf.c"
|
/*
* ui_overlay.c -- help and status display for hnb
*
* Copyright (C) 2001-2003 Øyvind Kolås <pippin@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2, 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.
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "tree.h"
#include "ui.h"
#include "ui_binding.h"
#include "evilloop.h"
/* ui_overlay
current node
dirtyness
scope_no (and thus name and help texts)
status
status_display_counter,..
*/
static char *ui_helptext[MAX_SCOPES] = { 0 };
static void* ui_helptext_cmd (int argc, char **argv, void *data)
{
if(argc>1)
ui_helptext[ui_current_scope] = strdup (argv[1]);
return data;
}
#define MAX_STATUS_LINES 100
static char status_line[MAX_STATUS_LINES][128] = { "" };
static int status_ttl = 0;
static void status (char *message, int ttl)
{
int i;
for (i = 0; i < MAX_STATUS_LINES - 1; i++)
strncpy (status_line[i], status_line[i + 1], 128);
strncpy (&status_line[MAX_STATUS_LINES - 1][0], message, 128);
status_ttl += ttl;
if (status_ttl >= MAX_STATUS_LINES)
status_ttl = MAX_STATUS_LINES - 1;
if (status_ttl >= LINES - 2)
status_ttl = LINES - 3;
}
void set_status (char *message)
{
char *tbuf, *word, *bp, *dp, *wp;
int width;
if (!COLS)
width = 60;
else
width = COLS + 1 - 2;
bp = tbuf = malloc (width);
wp = word = malloc (width);
dp = message;
*bp = *wp = '\0';
while (1 + 1 == 2) {
if (isspace ((unsigned char)*dp) || *dp == '\0') {
if ((bp - tbuf) + (wp - word) + 1 < width) {
strcpy (bp, word);
bp += (wp - word);
*(bp++) = ' ';
*bp = '\0';
wp = word;
*wp = '\0';
} else {
status (tbuf, 1);
bp = tbuf;
*bp = '\0';
strcpy (bp, word);
bp += (wp - word);
*(bp++) = ' ';
*bp = '\0';
wp = word;
*wp = '\0';
}
if (!*dp)
break;
} else {
if (wp - word >= width - 1) {
status (tbuf, 1);
status (word, 1);
wp = word;
}
*(wp++) = *dp;
*wp = '\0';
}
dp++;
}
status (tbuf, 1);
free (word);
free (tbuf);
}
static void* ui_status_cmd (int argc, char **argv, void *data)
{
if(argc==2 && (!strcmp(argv[1],"-c") || !strcmp(argv[1],"--clear"))){
status_ttl=0;
} else if(argc>1){ /* FIXME: should handle more than one string on commandline */
set_status (argv[1]);
if(!ui_inited)
cli_outfun(argv[1]);
}
return data;
}
void status_draw (void)
{
int j;
for (j = 0; j < status_ttl; j++) {
move (status_ttl - j - 1, 0);
ui_style (ui_style_menuitem);
addstr (" ");
ui_style (ui_style_background);
addstr (" ");
ui_style (ui_style_menutext);
addstr (status_line[MAX_STATUS_LINES - j - 1]);
move (status_ttl - j - 1,
strlen (status_line[MAX_STATUS_LINES - j - 1]) + 2);
clrtoeol ();
}
if (status_ttl > 0)
status_ttl--;
}
void help_draw (int scope)
{
if (!ui_inited)
return;
status_draw ();
move (LINES - 1, 0);
ui_style (ui_style_menuitem);
{
unsigned char *p = (unsigned char *) ui_helptext[scope];
int style_is_menuitem = 1;
while (*p) {
switch (*p) {
case '|':
if (*(p + 1) == '|') {
addch ('|');
p++;
} else {
if (style_is_menuitem) {
ui_style (ui_style_menutext);
} else {
ui_style (ui_style_menuitem);
}
style_is_menuitem = !style_is_menuitem;
}
break;
default:
addch (*p);
break;
}
p++;
}
}
clrtoeol ();
ui_style (ui_style_background);
}
/*
!init_ui_overlay();
*/
void init_ui_overlay ()
{
cli_add_command ("helptext", ui_helptext_cmd, "<help for context>");
cli_add_help ("helptext",
"Defines the helptext for the current context, the character | alternates between the menuitem and the menutext styles, || is the escape sequence for a single pipe.");
cli_add_command ("status", ui_status_cmd, "<-c|--clear|message>");
cli_add_command ("echo", ui_status_cmd, "<-c|--clear|message>");
cli_add_help ("status", "Adds 'message' as the newest status line, if -c or --clear\
is specified, all pending status messages will be cleared off the screen");
cli_add_help("echo","alias for status");
}
|
/****************************************************************************
**
** Copyright (C) 2018 Sergey Morozov
** 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
namespace Cppcheck {
namespace Constants {
const char TEXTMARK_CATEGORY_ID[] = "Cppcheck";
const char OPTIONS_PAGE_ID[] = "Analyzer.Cppcheck.Settings";
const char SETTINGS_ID[] = "Cppcheck";
const char SETTINGS_BINARY[] = "binary";
const char SETTINGS_WARNING[] = "warning";
const char SETTINGS_STYLE[] = "style";
const char SETTINGS_PERFORMANCE[] = "performance";
const char SETTINGS_PORTABILITY[] = "portability";
const char SETTINGS_INFORMATION[] = "information";
const char SETTINGS_UNUSED_FUNCTION[] = "unusedFunction";
const char SETTINGS_MISSING_INCLUDE[] = "missingInclude";
const char SETTINGS_INCONCLUSIVE[] = "inconclusive";
const char SETTINGS_FORCE_DEFINES[] = "forceDefines";
const char SETTINGS_CUSTOM_ARGUMENTS[] = "customArguments";
const char SETTINGS_IGNORE_PATTERNS[] = "ignorePatterns";
const char SETTINGS_SHOW_OUTPUT[] = "showOutput";
const char SETTINGS_ADD_INCLUDE_PATHS[] = "addIncludePaths";
const char SETTINGS_GUESS_ARGUMENTS[] = "guessArguments";
const char CHECK_PROGRESS_ID[] = "Cppcheck.CheckingTask";
const char MANUAL_CHECK_PROGRESS_ID[] = "Cppcheck.ManualCheckingTask";
const char MANUAL_RUN_ACTION[] = "Cppcheck.ManualRun";
const char PERSPECTIVE_ID[] = "Cppcheck.Perspective";
} // namespace Constants
} // namespace Cppcheck
|
/*
** Taiga
** Copyright (C) 2010-2014, Eren Okka
**
** 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 TAIGA_LIBRARY_DISCOVER_H
#define TAIGA_LIBRARY_DISCOVER_H
#include <string>
namespace library {
class SeasonDatabase {
public:
// Loads season data from db\season\<seasonname>.xml, returns false if no such
// file exists.
bool Load(std::wstring file);
// Checkes if a significant portion of season data is empty and requires
// refreshing.
bool IsRefreshRequired();
// Improves season data by excluding invalid items (i.e. postpones series) and
// adding missing ones from the anime database.
void Review(bool hide_nsfw = true);
// Only IDs are stored here, actual info is kept in anime::Database.
std::vector<int> items;
// Season name (e.g. "Spring 2012")
std::wstring name;
};
} // namespace library
extern library::SeasonDatabase SeasonDatabase;
#endif // TAIGA_LIBRARY_DISCOVER_H |
/*
Copyright 2005-2010 Jakub Kruszona-Zawadzki, Gemius SA, 2013-2014 EditShare, 2013-2015 Skytechnology sp. z o.o..
This file was part of MooseFS and is part of LizardFS.
LizardFS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
LizardFS 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 LizardFS If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/platform.h"
#include <inttypes.h>
#include <stdio.h>
int masterconn_init(void);
bool masterconn_is_connected();
|
/*
* Copyright (C) 2006-2016 Christopho, Solarus - http://www.solarus-games.org
*
* Solarus 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.
*
* Solarus 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 SOLARUS_DIALOG_BOX_SYSTEM_H
#define SOLARUS_DIALOG_BOX_SYSTEM_H
#include "solarus/Common.h"
#include "solarus/lowlevel/Point.h"
#include "solarus/lowlevel/SurfacePtr.h"
#include "solarus/lua/ScopedLuaRef.h"
#include "solarus/Dialog.h"
#include "solarus/GameCommand.h"
#include <list>
#include <memory>
#include <string>
namespace Solarus {
class Game;
class TextSurface;
/**
* \brief Manages the dialog box where dialogs can be displayed.
*
* A very basic built-in dialog box is used by default, but the quest
* script can define its own one instead.
* This class handles both cases.
*/
class DialogBoxSystem {
public:
explicit DialogBoxSystem(Game& game);
Game& get_game();
bool is_enabled() const;
void open(
const std::string& dialog_id,
const ScopedLuaRef& info_ref,
const ScopedLuaRef& callback_ref
);
void close(const ScopedLuaRef& status_ref);
bool notify_command_pressed(GameCommand command);
const std::string& get_dialog_id() const;
void draw(const SurfacePtr& dst_surface);
private:
bool has_more_lines() const;
void show_more_lines();
Game& game; /**< The game this dialog box belongs to. */
std::string dialog_id; /**< Id of the current dialog or an empty string. */
Dialog dialog; /**< Current dialog. */
ScopedLuaRef callback_ref; /**< Lua ref of a function to call when the dialog finishes. */
// Fields only used by the built-in dialog box.
bool built_in; /**< Whether we are using the built-in dialog box. */
static constexpr int nb_visible_lines = 3; /**< Maximum number of visible lines. */
std::list<std::string> remaining_lines; /**< Text of each line still to be displayed. */
std::shared_ptr<TextSurface>
line_surfaces[nb_visible_lines]; /**< Text surface of each visible line. */
Point text_position; /**< Destination position of the first line. */
bool is_question; /**< Whether the dialog is a question with two possible answers. */
bool selected_first_answer; /**< If there is a question: whether the first or second answer is selected. */
};
}
#endif
|
//
// SelectBarCell.h
// Groove
//
// Created by C-ty on 2014/11/16.
// Copyright (c) 2014年 Cty. All rights reserved.
//
#import "XibViewInterface.h"
@class SelectBarCell;
@protocol SelectBarCellProtocol <NSObject>
@required
@optional
- (void) CellLongPress: (SelectBarCell *) ThisCell;
- (void) CellShortPress: (SelectBarCell*) ThisCell;
@end
@interface SelectBarCell : XibViewInterface
@property int IndexNumber;
@property (getter = GetText, setter = SetText:) NSString *Text ;
@property (nonatomic, assign) id<SelectBarCellProtocol> delegate;
@end
|
/*--------------------------------------------------------------------
(C) Copyright 2006-2013 Barcelona Supercomputing Center
Centro Nacional de Supercomputacion
This file is part of Mercurium C/C++ source-to-source compiler.
See AUTHORS file in the top level directory for information
regarding developers and contributors.
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.
Mercurium C/C++ source-to-source compiler 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 Mercurium C/C++ source-to-source compiler; if
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
--------------------------------------------------------------------*/
/*
<testinfo>
test_generator=config/mercurium
</testinfo>
*/
void printarrayv(double*a, int aux)
{
int nvar;
double (*ptr)[aux] = (double (*)[aux]) a;
for (nvar = 0; nvar < 1000; nvar++)
{
}
}
|
/*
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
#ifdef ENABLE_SCRIPTING
#include <AP_Common/AP_Common.h>
#include <AP_Param/AP_Param.h>
#include <GCS_MAVLink/GCS.h>
#include <AP_Filesystem/AP_Filesystem.h>
class AP_Scripting
{
public:
AP_Scripting();
/* Do not allow copies */
AP_Scripting(const AP_Scripting &other) = delete;
AP_Scripting &operator=(const AP_Scripting&) = delete;
void init(void);
bool init_failed(void) const { return _init_failed; }
bool enabled(void) const { return _enable != 0; };
static AP_Scripting * get_singleton(void) { return _singleton; }
static const struct AP_Param::GroupInfo var_info[];
MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet);
// User parameters for inputs into scripts
AP_Float _user[4];
struct terminal_s {
int output_fd;
off_t input_offset;
bool session;
} terminal;
enum class SCR_DIR {
ROMFS = 1 << 0,
SCRIPTS = 1 << 1,
};
uint16_t get_disabled_dir() { return uint16_t(_dir_disable.get());}
private:
bool repl_start(void);
void repl_stop(void);
void load_script(const char *filename); // load a script from a file
void thread(void); // main script execution thread
AP_Int8 _enable;
AP_Int32 _script_vm_exec_count;
AP_Int32 _script_heap_size;
AP_Int8 _debug_level;
AP_Int16 _dir_disable;
bool _init_failed; // true if memory allocation failed
static AP_Scripting *_singleton;
};
namespace AP {
AP_Scripting * scripting(void);
};
#endif // ENABLE_SCRIPTING
|
/* Copyright 1997,2000-2002,2009,2011 Alain Knaff.
* This file is part of mtools.
*
* Mtools 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.
*
* Mtools 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 Mtools. If not, see <http://www.gnu.org/licenses/>.
*
* mcopy.c
* Copy an MSDOS files to and from Unix
*
*/
#define LOWERCASE
#include "sysincludes.h"
#include "msdos.h"
#include "mtools.h"
#include "vfat.h"
#include "mainloop.h"
#include "plain_io.h"
#include "nameclash.h"
#include "file.h"
#include "fs.h"
typedef struct Arg_t {
MainParam_t mp;
off_t offset;
} Arg_t;
static int dos_showfat(direntry_t *entry, MainParam_t *mp)
{
Stream_t *File=mp->File;
Arg_t *arg = (Arg_t *) mp->arg;
fprintPwd(stdout, entry,0);
putchar(' ');
if(arg->offset == -1) {
printFat(File);
} else {
printFatWithOffset(File, arg->offset);
}
printf("\n");
return GOT_ONE;
}
static int unix_showfat(MainParam_t *mp)
{
fprintf(stderr,"File does not reside on a Dos fs\n");
return ERROR_ONE;
}
static void usage(int ret) NORETURN;
static void usage(int ret)
{
fprintf(stderr,
"Mtools version %s, dated %s\n", mversion, mdate);
fprintf(stderr,
"Usage: %s files\n", progname);
exit(ret);
}
void mshowfat(int argc, char **argv, int mtype)
{
Arg_t arg;
int c, ret;
/* get command line options */
if(helpFlag(argc, argv))
usage(0);
arg.offset = -1;
while ((c = getopt(argc, argv, "i:ho:")) != EOF) {
switch (c) {
case 'o':
arg.offset = str_to_offset(optarg);
break;
case 'i':
set_cmd_line_image(optarg, 0);
break;
case 'h':
usage(0);
case '?':
usage(1);
break;
}
}
if (argc - optind < 1)
usage(1);
/* only 1 file to handle... */
init_mp(&arg.mp);
arg.mp.arg = (void *) &arg;
arg.mp.callback = dos_showfat;
arg.mp.unixcallback = unix_showfat;
arg.mp.lookupflags = ACCEPT_PLAIN | ACCEPT_DIR | DO_OPEN;
ret=main_loop(&arg.mp, argv + optind, argc - optind);
exit(ret);
}
|
/****************************************************************************
**
** Copyright (C) 2019 Sergey Morozov
** 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 <debugger/analyzer/detailederrorview.h>
namespace Cppcheck {
namespace Internal {
class DiagnosticView : public Debugger::DetailedErrorView
{
Q_OBJECT
public:
explicit DiagnosticView(QWidget *parent = nullptr);
~DiagnosticView() override;
void goNext() override;
void goBack() override;
private:
void openEditorForCurrentIndex();
void mouseDoubleClickEvent(QMouseEvent *event) override;
};
} // namespace Internal
} // namespace Cppcheck
|
/**
This file is part of martink project.
martink firmware project 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.
martink firmware 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 martink firmware. If not, see <http://www.gnu.org/licenses/>.
Author: Martin K. Schröder
Email: info@fortmax.se
Github: https://github.com/mkschreder
*/
#include <inttypes.h>
#include <stdarg.h>
#include <string.h>
#include <arch/soc.h>
#define twi0_wait_for_tx_complete() while(!TWI_ByteSent(TWI0))
#define twi0_wait_for_rx_complete() while(!TWI_ByteReceived(TWI0))
void twi0_init_default(){
pmc_enable_periph_clk(ID_PIOA);
pmc_enable_periph_clk(ID_TWI0);
PIO_Configure(PIOA, PIO_PERIPH_A,
(PIO_PA18A_TWCK0|PIO_PA17A_TWD0), PIO_DEFAULT);
//NVIC_DisableIRQ(TWI0_IRQn);
//NVIC_ClearPendingIRQ(TWI0_IRQn);
//NVIC_SetPriority(TWI0_IRQn, 0);
//NVIC_EnableIRQ(TWI0_IRQn);
TWI_ConfigureMaster(TWI0, 100000L, SystemCoreClock);
}
/// address is the first byte of data
void twi0_start_write(uint8_t addr, uint8_t *data, uint8_t data_sz){
TWI_StartWrite(TWI0, addr, 0, 0, data[0]);
twi0_wait_for_tx_complete();
for(int c = 1; c < data_sz; c++){
TWI_WriteByte(TWI0, data[c]);
twi0_wait_for_tx_complete();
}
}
/// address is the first byte of data
void twi0_start_read(uint8_t addr, uint8_t *data, uint8_t data_sz){
TWI_StartRead(TWI0, addr, 0, 0);
twi0_wait_for_rx_complete();
for(int c = 0; c < data_sz; c++){
data[c] = TWI_ReadByte(TWI0);
twi0_wait_for_rx_complete();
}
}
/// sends stop signal on the bus
void twi0_stop(void){
TWI_SendSTOPCondition(TWI0);
}
/// returns 1 if twi bus is processing another transaction
uint8_t twi0_busy(void){
return TWI_TransferComplete(TWI0);
}
|
/*
extr: Extract attachments from PDF file
Usage: extr /dir/file.pdf pageno
Returns 0 if one or more attachments saved, otherwise returns non-zero.
Prints the number of saved attachments on stdout.
Attachments are saved in /dir directory with the appropriate filenames.
Copyright (C) 2012 Tigran Aivazian <tigran@bibles.org.uk>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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/>.
*/
#include "mupdf-internal.h"
#include <libgen.h>
static pdf_document *doc;
void dump_stream(int i, FILE *fout)
{
fz_stream *stm = pdf_open_stream(doc, i, 0);
static unsigned char buf[8192];
while (1) {
int n = fz_read(stm, buf, sizeof buf);
if (n == 0) break;
fwrite(buf, 1, n, fout);
}
fz_close(stm);
}
/* returns the number of attachments saved */
int save_attachments(int pageno, char *targetdir)
{
pdf_page *page = pdf_load_page(doc, pageno-1);
pdf_annot *annot;
int saved_count = 0;
for (annot = page->annots; annot ; annot = annot->next) {
pdf_obj *fs_obj = pdf_dict_gets(annot->obj, "FS");
if (fs_obj) {
pdf_obj *ef_obj;
char *name = basename(strdup(pdf_to_str_buf(pdf_dict_gets(fs_obj, "F"))));
ef_obj = pdf_dict_gets(fs_obj, "EF");
if (ef_obj) {
pdf_obj *f_obj = pdf_dict_gets(ef_obj, "F");
if (f_obj && pdf_is_indirect(f_obj)) {
static char pathname[PATH_MAX];
sprintf(pathname, "%s/%s", targetdir, name);
FILE *fout = fopen(pathname, "w");
if (!fout) {
fprintf(stderr, "extr: cannot write to file %s\n", pathname);
exit(1);
}
dump_stream(pdf_to_num(f_obj), fout);
fclose(fout);
saved_count++;
}
}
}
}
return saved_count;
}
int main(int argc, char *argv[])
{
int saved = 0;
if (argc != 3) {
printf("Usage: extr file.pdf pageno\n");
exit(1);
}
char *filename = strdup(argv[1]);
char *dir = dirname(strdup(filename));
int pageno = atoi(argv[2]);
fz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);
if (!ctx) {
fprintf(stderr, "extr: cannot create context\n");
exit(1);
}
fz_var(doc);
fz_try(ctx) {
doc = pdf_open_document(ctx, filename);
saved = save_attachments(pageno, dir);
}
fz_catch(ctx)
{
}
printf("%d\n", saved);
return 0;
}
|
#ifndef __ATTACK_TYPE_H__
#define __ATTACK_TYPE_H__
#include <Arduino.h>
class AttackType {
private:
String id;
String name;
String createdAt;
String updatedAt;
void init(char* json);
public:
AttackType();
AttackType(const char* id, const char* name, const char* createdAt, const char* updatedAt);
AttackType(String json);
AttackType(char* json);
String getId();
String getName();
String getCreatedAt();
String getUpdatedAt();
};
#endif
|
/*
* Copyright (C) 2011-2019 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2019 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2019 MaNGOS <https://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 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 DEF_BRD_H
#define DEF_BRD_H
#define FACTION_NEUTRAL 734
#define FACTION_HOSTILE 754
#define FACTION_FRIEND 35
enum eTypes
{
TYPE_RING_OF_LAW = 1,
TYPE_VAULT = 2,
TYPE_BAR = 3,
TYPE_TOMB_OF_SEVEN = 4,
TYPE_LYCEUM = 5,
TYPE_IRON_HALL = 6,
DATA_EMPEROR = 10,
DATA_PHALANX = 11,
DATA_ARENA1 = 12,
DATA_ARENA2 = 13,
DATA_ARENA3 = 14,
DATA_ARENA4 = 15,
DATA_GO_BAR_KEG = 16,
DATA_GO_BAR_KEG_TRAP = 17,
DATA_GO_BAR_DOOR = 18,
DATA_GO_CHALICE = 19,
DATA_GHOSTKILL = 20,
DATA_EVENSTARTER = 21,
DATA_GOLEM_DOOR_N = 22,
DATA_GOLEM_DOOR_S = 23,
DATA_THRONE_DOOR = 24,
DATA_SF_BRAZIER_N = 25,
DATA_SF_BRAZIER_S = 26,
DATA_MOIRA = 27,
};
#endif
|
//
// BAGEL - Brilliantly Advanced General Electronic Structure Library
// Filename: qvec.h
// Copyright (C) 2012 Toru Shiozaki
//
// Author: Toru Shiozaki <shiozaki@northwestern.edu>
// Maintainer: Shiozaki group
//
// This file is part of the BAGEL package.
//
// 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 __BAGEL_SRC_CASSCF_QVEC
#define __BAGEL_SRC_CASSCF_QVEC
// 2RDM and half-transformed integrals
#include <src/ci/fci/distfci.h>
#include <src/ci/fci/fci.h>
#include <src/multi/casscf/rotfile.h>
namespace bagel {
class Qvec : public Matrix {
protected:
public:
Qvec(const int n, const int m, std::shared_ptr<const Matrix> c, const size_t nclosed,
std::shared_ptr<const FCI_base> fci, std::shared_ptr<const RDM<2>> rdm)
: Qvec(n, m, c, nclosed, fci->jop()->mo2e_1ext(), rdm) { }
Qvec(const int n, const int m, std::shared_ptr<const Matrix> c, const size_t nclosed,
std::shared_ptr<const DFHalfDist> half, std::shared_ptr<const RDM<2>> rdm);
Qvec(const Matrix& a) : Matrix(a) {}
};
}
#endif
|
/****************************************************************\
* *
* Library for manipulation of exonerate index files *
* *
* Guy St.C. Slater.. mailto:guy@ebi.ac.uk *
* Copyright (C) 2000-2008. All Rights Reserved. *
* *
* This source code is distributed under the terms of the *
* GNU General Public License, version 3. See the file COPYING *
* or http://www.gnu.org/licenses/gpl.txt for details *
* *
* If you use this code, please keep this notice intact. *
* *
\****************************************************************/
#ifndef INCLUDED_INDEX_H
#define INCLUDED_INDEX_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdio.h>
#include <glib.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef USE_PTHREADS
#include <pthread.h>
#endif /* USE_PTHREADS */
#include "dataset.h"
#include "vfsm.h"
#include "hspset.h"
#include "bitarray.h"
/* File format:
Header
dataset path\n
FW Strand
RV Strand (if translated)
Strand:
Strand header
WordList:
For each word
word_id <MW>
freq_count <MI>
index_offset <TI>
Index:
sequence <NS>
pos <MS> (from dataset)
*/
typedef struct {
guint64 magic;
guint64 version;
guint64 type; /* plain | trans */
guint64 dataset_path_len;
/**/
guint64 word_length;
guint64 word_jump;
guint64 saturate_threshold;
} Index_Header;
typedef struct {
gint max_word_width; /* From vfsm->lrw : MW */
gint number_of_seqs_width; /* From dataset->header->number_of_seqs : NS */
} Index_Width;
typedef struct {
gint sequence_id;
gint position;
} Index_Address;
typedef struct {
gint freq_count;
gint64 index_offset;
} Index_Word;
typedef struct {
guint64 max_index_length; /* Filled by Index_survey_word_list() */
guint64 word_list_length; /* Filled by Index_survey_word_list() */
guint64 total_index_length; /* Filled by Index_find_offsets() */
} Index_Strand_Header;
typedef struct {
gint max_index_len_width; /* From max_index_length : MI */
gint total_index_len_width; /* From total_index_length : TI */
} Index_Strand_Width;
typedef struct {
Index_Strand_Header header;
Index_Strand_Width width;
/**/
gint *word_table; /* VFSM array */
Index_Word *word_list;
off_t strand_offset; /* Offset to strand header */
BitArray *index_cache;
} Index_Strand;
typedef struct {
guint ref_count;
FILE *fp;
gchar *dataset_path;
Dataset *dataset;
Index_Header *header;
VFSM *vfsm;
Index_Width *width;
/**/
Index_Strand *forward;
Index_Strand *revcomp; /* Only used when index is translated */
#ifdef USE_PTHREADS
pthread_mutex_t index_mutex;
#endif /* USE_PTHREADS */
} Index;
/**/
Index *Index_create(Dataset *dataset, gboolean is_translated,
gint word_length, gint word_jump, gint saturate_threshold,
gchar *index_path, gchar *dataset_path, gint memory_limit);
Index *Index_share(Index *index);
void Index_destroy(Index *index);
Index *Index_open(gchar *path);
guint64 Index_memory_usage(Index *index);
void Index_preload_index(Index *index);
gboolean Index_check_filetype(gchar *path);
/* Returns TRUE when magic number is correct for this filetype */
typedef struct {
HSPset *hsp_set;
gint target_id;
} Index_HSPset;
void Index_HSPset_destroy(Index_HSPset *index_hsp_set);
GPtrArray *Index_get_HSPsets(Index *index, HSP_Param *hsp_param,
Sequence *query, gboolean revcomp_target);
/* Returns a GPtrArray containing Index_HSPset structs */
GPtrArray *Index_get_HSPsets_geneseed(Index *index, HSP_Param *hsp_param,
Sequence *query, gboolean revcomp_target,
gint geneseed_threshold, gint geneseed_repeat,
gint max_query_span, gint max_target_span);
/**/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* INCLUDED_DATASET_H */
|
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2014 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba 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/>.
*/
#if !defined(__ABOUTDLG_H)
#define __ABOUTDLG_H
#include "common.h"
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog {
Q_OBJECT
public:
AboutDialog(QWidget *parent);
~AboutDialog();
protected slots:
void onCredits();
protected:
void changeEvent(QEvent *e);
private:
Ui::AboutDialog *ui;
};
#endif // __ABOUTDLG_H
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** 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 "ui_clangprojectsettingswidget.h"
#include "clangprojectsettings.h"
#include <cpptools/clangdiagnosticconfigsmodel.h>
#include <QPointer>
namespace ProjectExplorer { class Project; }
namespace CppTools { class ClangDiagnosticConfigsWidget; }
namespace ClangCodeModel {
namespace Internal {
class ClangProjectSettingsWidget: public QWidget
{
Q_OBJECT
public:
explicit ClangProjectSettingsWidget(ProjectExplorer::Project *project);
private slots:
void onCurrentWarningConfigChanged(const Core::Id ¤tConfigId);
void onCustomWarningConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs);
private:
void refreshDiagnosticConfigsWidgetFromSettings();
void connectToCppCodeModelSettingsChanged();
void disconnectFromCppCodeModelSettingsChanged();
private:
Ui::ClangProjectSettingsWidget m_ui;
ClangProjectSettings m_projectSettings;
QPointer<CppTools::ClangDiagnosticConfigsWidget> m_diagnosticConfigWidget;
};
} // namespace Internal
} // namespace ClangCodeModel
|
/***************************************************************************************************
ExploreEmbedded
****************************************************************************************************
* File: uart.h
* Version: 15.0
* Author: ExploreEmbedded
* Website: http://www.exploreembedded.com/wiki
* Description: Contains the baudrate configurations and function prototypes for UART routines
The libraries have been tested on ExploreEmbedded development boards. We strongly believe that the
library works on any of development boards for respective controllers. However, ExploreEmbedded
disclaims any kind of hardware failure resulting out of usage of libraries, directly or indirectly.
Files may be subject to change without prior notice. The revision history contains the information
related to updates.
GNU GENERAL PUBLIC LICENSE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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/>.
Errors and omissions should be reported to codelibraries@exploreembedded.com
**************************************************************************************************/
/***************************************************************************************************
Revision History
****************************************************************************************************
15.0: Initial version
***************************************************************************************************/
#ifndef _UART_H
#define _UART_H
#include <avr\io.h>
#include "stdutils.h"
/***************************************************************************************************
Baudrate configurations
***************************************************************************************************/
#define C_MinBaudRate_U32 2400
#define C_MaxBaudRate_U32 115200UL
#define M_GetBaudRateGeneratorValue(baudrate) (((F_CPU -((baudrate) * 8L)) / ((baudrate) * 16UL)))
/**************************************************************************************************/
/***************************************************************************************************
PreCompile configurations to enable/disable the functions
****************************************************************************************************
PreCompile configuration to enable or disable the API's.
1.Required interfaces can be enabled/disabled by configuring
its respective macros to 1/0.
2. By default all the API's are enabled except for FLOAT transmission.
3. Transmitting of floating number takes huge controller
resources and need to be enabled only if required.
This implies for other interfaces as well.
***************************************************************************************************/
#define Enable_UART_TxString 0
#define Enable_UART_RxString 0
#define Enable_UART_TxDecimalNumber 0
#define Enable_UART_TxHexNumber 0
#define Enable_UART_TxBinaryNumber 0
#define Enable_UART_TxFloatNumber 0
#define Enable_UART_Printf 0
/**************************************************************************************************/
/***************************************************************************************************
Commonly used UART macros/Constants
***************************************************************************************************/
#define C_DefaultDigitsToTransmit_U8 0xffu // Will transmit the exact digits in the number
#define C_MaxDigitsToTransmit_U8 10u // Max decimal/hexadecimal digits to be transmitted
#define C_NumOfBinDigitsToTransmit_U8 16u // Max bits of a binary number to be transmitted
#define C_MaxDigitsToTransmitUsingPrintf_U8 C_DefaultDigitsToTransmit_U8 /* Max dec/hexadecimal digits to be displayed using printf */
/**************************************************************************************************/
/***************************************************************************************************
Function Prototypes
***************************************************************************************************/
void UART_Init(uint32_t var_baudRate_u32);
void UART_SetBaudRate(uint32_t var_baudRate_u32);
void UART_TxChar(char var_uartData_u8);
char UART_RxChar();
void UART_TxString(char *ptr_stringPointer_u8);
void UART_RxString(char *ptr_stringPointer_u8);
void UART_TxDecimalNumber(uint32_t var_decNumber_u32, uint8_t var_numOfDigitsToTransmit_u8);
void UART_TxHexNumber(uint32_t var_hexNumber_u32,uint8_t var_numOfDigitsToTransmit_u8);
void UART_TxBinaryNumber(uint32_t var_binNumber_u32, uint8_t var_numOfBitsToTransmit_u8);
void UART_TxFloatNumber(float var_floatNumber_f32);
void UART_Printf(const char *argList, ...);
/**************************************************************************************************/
#endif
|
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_SPUDEC_H
#define MPLAYER_SPUDEC_H
#include "libvo/video_out.h"
void spudec_heartbeat(void *this, unsigned long long pts100);
void spudec_assemble(void *this, unsigned char *packet, unsigned int len, long long pts100);
void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
void spudec_update_palette(void *this, unsigned int *palette);
void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height, uint8_t *extradata, int extradata_len);
void *spudec_new(unsigned int *palette);
void spudec_free(void *this);
void spudec_reset(void *this); // called after seek
int spudec_visible(void *this); // check if spu is visible
unsigned long long spu_get_pts(void *this);
unsigned int spu_get_decodeing(void *this);
void spudec_set_font_factor(void * this, double factor); // sets the equivalent to ffactor
void spudec_set_hw_spu(void *this, const vo_functions_t *hw_spu);
int spudec_changed(void *this);
void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox);
void spudec_set_forced_subs_only(void * const this, const unsigned int flag);
#endif /* MPLAYER_SPUDEC_H */
|
/////////////////////////////////////////////////////////////////////////////
/// @file CnCurve.h
///
/// @author Daniel Wilczak
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2000-2012 by the CAPD Group.
//
// This file constitutes a part of the CAPD library,
// distributed under the terms of the GNU General Public License.
// Consult http://capd.ii.uj.edu.pl/ for details.
#ifndef _CAPD_DIFFALGEBRA_CNCURVE_H_
#define _CAPD_DIFFALGEBRA_CNCURVE_H_
#include <stdexcept>
#include "capd/diffAlgebra/Curve.h"
#include "capd/diffAlgebra/Jet.h"
namespace capd{
namespace diffAlgebra{
/// @addtogroup diffAlgebra
/// @{
/**
* This class provides methods for evaluation of the parametric curve
* for a given parameter value.
*
* Template parameter BaseCurveT must provide storage and access for coefficients.
*/
template <class BaseCurveT, bool isInterval = capd::TypeTraits<typename BaseCurveT::ScalarType>::isInterval >
class CnCurve : public Curve<BaseCurveT, isInterval>{
public:
typedef typename BaseCurveT::HessianType HessianType;
typedef typename BaseCurveT::MatrixType MatrixType;
typedef typename MatrixType::RowVectorType VectorType;
typedef typename MatrixType::ScalarType ScalarType;
typedef typename TypeTraits<ScalarType>::Real Real;
typedef capd::diffAlgebra::Jet<MatrixType,0> JetType;
typedef __size_type size_type;
typedef __difference_type difference_type;
CnCurve(Real left, Real right, size_type dimension, size_type order, size_type degree)
: Curve<BaseCurveT>(left,right,dimension,order,degree)
{}
HessianType hessian(const ScalarType& h) const;
JetType jet(const ScalarType& h) const;
void eval(ScalarType h, JetType& v) const;
};
template <class BaseCurveT>
class CnCurve<BaseCurveT,true> : public Curve<BaseCurveT, true>{
public:
typedef typename BaseCurveT::HessianType HessianType;
typedef typename BaseCurveT::MatrixType MatrixType;
typedef typename MatrixType::RowVectorType VectorType;
typedef typename MatrixType::ScalarType ScalarType;
typedef typename TypeTraits<ScalarType>::Real Real;
typedef capd::diffAlgebra::Jet<MatrixType,0> JetType;
typedef __size_type size_type;
typedef __difference_type difference_type;
CnCurve(Real left, Real right, size_type dimension, size_type order, size_type degree)
: Curve<BaseCurveT>(left,right,dimension,order,degree),
initHessian(dimension),
initJet(dimension,degree)
{
initJet.setMatrix(this->initMatrix);
}
HessianType hessian(const ScalarType& h) const;
void setInitHessian(const HessianType& H){
initHessian = H;
}
void setInitJet(const JetType& jet){
initJet = jet;
}
void eval(ScalarType h, JetType& v) const;
JetType jet(const ScalarType& h) const;
HessianType initHessian;
JetType initJet;
};
///@}
}} // namespace capd::diffAlgebra
#endif // _CAPD_DIFFALGEBRA_CNCURVE_H_
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
* RetroArch 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 Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "../../general.h"
#include "../../driver.h"
static void *nullinput_input_init(void)
{
RARCH_ERR("Using the null input driver. RetroArch will ignore you.");
return (void*)-1;
}
static void nullinput_input_poll(void *data)
{
(void)data;
}
static int16_t nullinput_input_state(void *data,
const struct retro_keybind **retro_keybinds, unsigned port,
unsigned device, unsigned idx, unsigned id)
{
(void)data;
(void)retro_keybinds;
(void)port;
(void)device;
(void)idx;
(void)id;
return 0;
}
static bool nullinput_input_key_pressed(void *data, int key)
{
(void)data;
(void)key;
return false;
}
static bool nullinput_input_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
return false;
}
static void nullinput_input_free_input(void *data)
{
(void)data;
}
static uint64_t nullinput_get_capabilities(void *data)
{
uint64_t caps = 0;
caps |= (1 << RETRO_DEVICE_JOYPAD);
return caps;
}
static bool nullinput_set_sensor_state(void *data,
unsigned port, enum retro_sensor_action action, unsigned event_rate)
{
return false;
}
static void nullinput_grab_mouse(void *data, bool state)
{
(void)data;
(void)state;
}
static bool nullinput_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
input_driver_t input_null = {
nullinput_input_init,
nullinput_input_poll,
nullinput_input_state,
nullinput_input_key_pressed,
nullinput_input_meta_key_pressed,
nullinput_input_free_input,
nullinput_set_sensor_state,
NULL,
nullinput_get_capabilities,
"null",
nullinput_grab_mouse,
NULL,
nullinput_set_rumble,
NULL,
NULL,
NULL,
};
|
#ifndef ZPM_VERSION
#define ZPM_VERSION "0.1.0"
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.