text
stringlengths 4
6.14k
|
|---|
#ifndef Func_meanPositive_H
#define Func_meanPositive_H
#include "RealPos.h"
#include "RlTypedFunction.h"
#include <string>
namespace RevLanguage {
/**
* The RevLanguage wrapper of the arithmetic meanPositive function.
*
* The RevLanguage wrapper of the meanPositive function connects
* the variables/parameters of the function and creates the internal MeanFunction object.
*
* @copybrief RevBayesCore::MeanFunction
* @see RevBayesCore::MeanFunction for the internal object
*/
class Func_meanPositive : public TypedFunction<RealPos> {
public:
Func_meanPositive( void );
// Basic utility functions
Func_meanPositive* clone(void) const; //!< Clone the object
static const std::string& getClassType(void); //!< Get Rev type
static const TypeSpec& getClassTypeSpec(void); //!< Get class type spec
std::string getFunctionName(void) const; //!< Get the primary name of the function in Rev
const TypeSpec& getTypeSpec(void) const; //!< Get the type spec of the instance
// Function functions you have to override
RevBayesCore::TypedFunction<double>* createFunction(void) const; //!< Create internal function object
const ArgumentRules& getArgumentRules(void) const; //!< Get argument rules
};
}
#endif
|
//============== IV: Multiplayer - http://code.iv-multiplayer.com ==============
//
// File: CBlipManager.h
// Project: Server.Core
// Author(s): jenksta
// Sebihunter
// License: See LICENSE in root directory
//
//==============================================================================
#pragma once
#include "CServer.h"
#include "Interfaces/InterfaceCommon.h"
struct _Blip
{
CVector3 vecSpawnPos;
int iSprite;
unsigned int uiColor;
float fSize;
bool bShortRange;
bool bRouteBlip;
bool bShow;
String strName;
};
struct _PlayerBlip
{
EntityId playerId;
int iSprite;
bool bShortRange;
bool bShow;
};
class CBlipManager : public CBlipManagerInterface
{
private:
bool m_bActive[MAX_BLIPS];
_Blip m_Blips[MAX_BLIPS];
bool m_bPlayerActive[MAX_PLAYERS];
_PlayerBlip m_PlayerBlips[MAX_PLAYERS];
public:
CBlipManager();
~CBlipManager();
EntityId Create(int iSprite, CVector3 vecPosition, bool bShow);
void Delete(EntityId blipId);
void SetPosition(EntityId blipId, CVector3 vecPosition);
CVector3 GetPosition(EntityId blipId);
void SetColor(EntityId blipId, unsigned int color);
unsigned int GetColor(EntityId blipId);
void SetSize(EntityId blipId, float size);
float GetSize(EntityId blipId);
void ToggleShortRange(EntityId blipId, bool bShortRange);
void ToggleRoute(EntityId blipId, bool bRoute);
void SetName(EntityId blipId, String strName);
String GetName(EntityId blipId);
void HandleClientJoin(EntityId playerId);
bool DoesExist(EntityId blipId);
EntityId GetBlipCount();
void SwitchIcon(EntityId blipId, bool bShow, EntityId playerId);
void CreateForPlayer(EntityId playerId, int iSprite, bool bShow);
void DeleteForPlayer(EntityId playerId);
void TogglePlayerShortRange(EntityId playerId, bool bToggle);
void TogglePlayerDisplay(EntityId playerId, bool bToggle);
void TogglePlayerShortRangeForPlayer(EntityId playerId, EntityId toPlayerId, bool bToggle);
void SetSpriteForPlayer(EntityId playerId, int iSprite);
void TogglePlayerDisplayForPlayer(EntityId playerId, EntityId toPlayerId, bool bToggle);
bool DoesPlayerBlipExist(EntityId playerId) { return m_bPlayerActive[playerId]; }
int GetPlayerBlipSprite(EntityId playerId) { return m_PlayerBlips[playerId].iSprite; }
bool GetPlayerBlipShow(EntityId playerId) { return m_PlayerBlips[playerId].bShow; }
};
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "Lightweight-Directory-Access-Protocol-V3"
* found in "simple_ldap_asn1.asn"
*/
#ifndef _SearchControlValue_H_
#define _SearchControlValue_H_
#include <asn_application.h>
/* Including external dependencies */
#include <INTEGER.h>
#include <OCTET_STRING.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* SearchControlValue */
typedef struct SearchControlValue {
INTEGER_t size;
OCTET_STRING_t cookie;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SearchControlValue_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SearchControlValue;
#ifdef __cplusplus
}
#endif
#endif /* _SearchControlValue_H_ */
#include <asn_internal.h>
|
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Serializer/GenericPayloadSerializer.h>
#include <Swiften/Elements/VCardUpdate.h>
namespace Swift {
class VCardUpdateSerializer : public GenericPayloadSerializer<VCardUpdate> {
public:
VCardUpdateSerializer();
virtual std::string serializePayload(boost::shared_ptr<VCardUpdate>) const;
};
}
|
#pragma message("bigreqstr.h is obsolete and may be removed in the future.")
#pragma message("include <X11/extensions/bigreqsproto.h> for the protocol defines.")
#include <X11/extensions/bigreqsproto.h>
|
/* Copyright (c) 2012-2015 Todd Freed <todd.freed@gmail.com>
This file is part of fab.
fab 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.
fab 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 fab. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _ARRAY_INTERNAL_H
#define _ARRAY_INTERNAL_H
/*
MODULE
array.internal
*/
#include "types.h"
#include "xapi.h"
#include "array.h"
#include "macros.h"
struct array_t;
typedef struct ar_operations {
/// compare_items
//
// SUMMARY
// compare items
//
int (*compare_items)(const struct array_t * ht, const void * a, const void * b, int (*cmp_fn)(const void *, size_t, const void *, size_t))
__attribute__((nonnull(1, 2, 3)));
/// destroy_item
//
// SUMMARY
// called when an item is destroyed (in array_destroy)
//
// PARAMETRS
// ht - array
// item - item
//
xapi (*destroy_item)(const struct array_t * ht, void * item);
/// store_item
//
// SUMMARY
// called when an item is stored in a bucket
//
// PARAMETRS
// ht - array
// dst - pointer to storage within a bucket of size ht->esz
// item - pointer to the item to store
//
xapi (*store_items)(const struct array_t * ht, void * dst, void * items, size_t len);
} ar_operations;
typedef struct array_t {
union {
array arx;
struct {
size_t size;
};
};
char * v; // storage
size_t a; // allocated size in items
size_t esz; // item size, for primary storage
// implementation
ar_operations * ops;
// user operations
int (*cmp_fn)(const void * A, size_t Asz, const void * B, size_t Bsz);
void (*init_fn)(void * item);
xapi (*xinit_fn)(void * item);
void (*destroy_fn)(void * item);
xapi (*xdestroy_fn)(void * item);
} array_t;
STATIC_ASSERT(offsetof(array, size) == offsetof(array_t, size));
/// array_init
//
// SUMMARY
// initialize an already allocated array
//
xapi array_init(
array_t * restrict ar
, size_t esz
, size_t capacity
, ar_operations * restrict ops
, int (*cmp_fn)(const void * A, size_t Asz, const void * B, size_t Bsz)
)
__attribute__((nonnull(1, 4)));
/// array_destroy
//
// SUMMARY
//
//
xapi array_xdestroy(array_t * restrict ar)
__attribute__((nonnull));
/// array_put
//
// SUMMARY
// add elements to the array
//
// PARAMETERS
// li - array
// index - 0 <= index <= array_size(li)
// len - number of elements to add
// [rv] - (returns) pointers to elements
//
xapi array_put(array * const restrict li, size_t index, size_t len, void * restrict rv)
__attribute__((nonnull(1)));
/// array_destroy_range
//
// SUMMARY
// free a range of elements in a array
//
// PARAMETERS
// ar - pointer to array
// start - index of the first element
// len - number of elements
//
xapi array_destroy_range(array_t * const restrict ar, size_t start, size_t len)
__attribute__((nonnull(1)));
/// array_store
//
// SUMMARY
// overwrite elements in the array
//
void array_store(array_t * const restrict ar, size_t index, size_t len, void * restrict items, void ** const restrict rv)
__attribute__((nonnull(1)));
#endif
|
/*
Copyright 2012, Bas Fagginger Auer.
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
#include <string>
#include <vector>
#include <tiny/math/vec.h>
namespace tiny
{
namespace mesh
{
struct StaticMeshVertex
{
StaticMeshVertex() :
textureCoordinate(0.0f, 0.0f),
tangent(1.0f, 0.0f, 0.0f),
normal(0.0f, 0.0f, 1.0f),
position(0.0f, 0.0f, 0.0f)
{
}
StaticMeshVertex(const vec2 &a_textureCoordinate,
const vec3 &a_tangent,
const vec3 &a_normal,
const vec3 &a_position) :
textureCoordinate(a_textureCoordinate),
tangent(a_tangent),
normal(a_normal),
position(a_position)
{
}
vec2 textureCoordinate;
vec3 tangent;
vec3 normal;
vec3 position;
};
class StaticMesh
{
public:
StaticMesh();
~StaticMesh();
static StaticMesh createCubeMesh(const float & = 1.0f);
static StaticMesh createCylinderMesh(const float & = 1.0f, const float & = 1.0f);
float getSize(const vec3 & = vec3(1.0f, 1.0f, 1.0f)) const;
std::vector<StaticMeshVertex> vertices;
std::vector<unsigned int> indices;
};
}
}
|
/*
* Copyright (C) 2012 Yee Young Han <websearch@naver.com> (http://blog.naver.com/websearch)
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _SIP_UTILITY_H_
#define _SIP_UTILITY_H_
#include <string>
void SipSetSystemId( const char * pszId );
void SipMakeTag( char * pszTag, int iTagSize );
void SipMakeBranch( char * pszBranch, int iBranchSize );
void SipMakeCallIdName( char * pszCallId, int iCallIdSize );
bool SipMakePrintString( const unsigned char * pszInput, int iInputSize, char * pszOutput, int iOutputSize );
void SipMd5String21( char * string, char result[22] );
void SipIpv6Parse( std::string & strHost );
int SipIpv6Print( std::string & strHost, char * pszText, int iTextSize, int iLen );
#endif
|
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef SINGLE_VALUE_PARAMETER_PARSER_H_
#define SINGLE_VALUE_PARAMETER_PARSER_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/System.h"
#include <Poco/DOM/DOMParser.h>
#include <Poco/DOM/Document.h>
#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeFilter.h>
#include <Poco/DOM/NodeIterator.h>
#include <Poco/DOM/NodeList.h>
#include <Poco/File.h>
#include <Poco/Path.h>
#include "MantidAPI/ImplicitFunctionParameterParser.h"
#ifndef Q_MOC_RUN
#include <boost/lexical_cast.hpp>
#endif
namespace Mantid {
namespace API {
/**
XML Parser for single value parameter types
@author Owen Arnold, Tessella plc
@date 01/10/2010
*/
template <class SingleValueParameterType>
class DLLExport SingleValueParameterParser
: public Mantid::API::ImplicitFunctionParameterParser {
public:
Mantid::API::ImplicitFunctionParameter *
createParameter(Poco::XML::Element *parameterElement) override;
SingleValueParameterType *
createWithoutDelegation(Poco::XML::Element *parameterElement);
void setSuccessorParser(
Mantid::API::ImplicitFunctionParameterParser *paramParser) override;
};
//////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
/* Creates a parameter from an xml element, otherwise defers to a successor
parser.
@param parameterElement : xml Element
@return A fully constructed ImplicitFunctionParameter.
*/
template <class SingleValueParameterType>
Mantid::API::ImplicitFunctionParameter *
SingleValueParameterParser<SingleValueParameterType>::createParameter(
Poco::XML::Element *parameterElement) {
using ValType = typename SingleValueParameterType::ValueType;
std::string typeName = parameterElement->getChildElement("Type")->innerText();
if (SingleValueParameterType::parameterName() != typeName) {
return m_successor->createParameter(parameterElement);
} else {
std::string sParameterValue =
parameterElement->getChildElement("Value")->innerText();
ValType value = boost::lexical_cast<ValType>(sParameterValue);
return new SingleValueParameterType(value);
}
}
//------------------------------------------------------------------------------
/* Creates a parameter from an xml element. This is single-shot. Does not defer
to successor if it fails!.
@param parameterElement : xml Element
@return A fully constructed SingleValueParameterType.
*/
template <class SingleValueParameterType>
SingleValueParameterType *
SingleValueParameterParser<SingleValueParameterType>::createWithoutDelegation(
Poco::XML::Element *parameterElement) {
using ValType = typename SingleValueParameterType::ValueType;
std::string typeName = parameterElement->getChildElement("Type")->innerText();
if (SingleValueParameterType::parameterName() != typeName) {
throw std::runtime_error("The attempted ::createWithoutDelegation failed. "
"The type provided does not match this parser.");
} else {
std::string sParameterValue =
parameterElement->getChildElement("Value")->innerText();
ValType value = boost::lexical_cast<ValType>(sParameterValue);
return new SingleValueParameterType(value);
}
}
//------------------------------------------------------------------------------
/* Sets the successor parser
@param parameterParser : the parser to defer to if the current instance can't
handle the parameter type.
*/
template <class SingleValueParameterType>
void SingleValueParameterParser<SingleValueParameterType>::setSuccessorParser(
Mantid::API::ImplicitFunctionParameterParser *paramParser) {
Mantid::API::ImplicitFunctionParameterParser::SuccessorType temp(paramParser);
m_successor.swap(temp);
}
} // namespace API
} // namespace Mantid
#endif
|
/**
* Copyright (C) 2016 Martin Ubl <http://kennny.cz>
*
* This file is part of BubbleWorld MMORPG engine
*
* BubbleWorld 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.
*
* BubbleWorld 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 BubbleWorld. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef BW_GAMEOBJECTSTORAGE_H
#define BW_GAMEOBJECTSTORAGE_H
#include "Singleton.h"
/*
* Structure containing gameobject template database record contents
*/
struct GameobjectTemplateRecord
{
// gameobject ID
uint32_t id;
// gameobject name
std::string name;
// image ID gameobject uses
uint32_t imageId;
};
typedef std::unordered_map<uint32_t, GameobjectTemplateRecord> GameobjectTemplateMap;
/*
* Structure containing gameobject database record (spawn)
*/
struct GameobjectSpawnRecord
{
// gameobject low GUID
uint32_t guid;
// gameobject ID (from gameobject_template)
uint32_t id;
// map ID
uint32_t positionMap;
// X position
float positionX;
// Y position
float positionY;
};
typedef std::list<GameobjectSpawnRecord> GameobjectSpawnList;
/*
* Singleton class maintaining database operations on gameobject template and gameobject records
*/
class GameobjectStorage
{
friend class Singleton<GameobjectStorage>;
public:
~GameobjectStorage();
// loads all necessary information from database
void LoadFromDB();
// retrieves gameobject template record
GameobjectTemplateRecord* GetGameobjectTemplate(uint32_t id);
// retrieves gameobject spawns for specified map
void GetGameobjectSpawnsForMap(uint32_t map, GameobjectSpawnList& targetList);
protected:
// protected singleton constructor
GameobjectStorage();
private:
GameobjectTemplateMap m_gameobjectTemplateMap;
};
#define sGameobjectStorage Singleton<GameobjectStorage>::getInstance()
#endif
|
/*
* FILENAME: uart.h
*
* Copyright 2004 InterNiche Technologies. All rights reserved.
*
* DESCRIPTION: serial communication device support definitions
*
* This file for:
* ALTERA Cyclone Dev board with the ALTERA Nios2 Core.
* SMSC91C11 10/100 Ethernet Controller
* GNU C Compiler provided by ALTERA Quartus Toolset.
* Quartus HAL BSP
* uCOS-II RTOS Rel 2.76 as distributed by Altera/NIOS2
*
* MODULE : nios2gcc
* PORTABLE: no
*
*/
#ifndef UART_H
#define UART_H
/* Until we have the uart drivers for the Altera NIOS2 Cyclone dev board
* this is a place holder file to allow a PPP build with LB_XOVER.
*
* Add more here later -AK-
*/
#endif /* UART_H */
|
/***************************************************************************
* Copyright (C) 2012 by Serge Poltavski *
* serge.poltavski@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 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 MMAPSHAREDMEMORY_H
#define MMAPSHAREDMEMORY_H
#include "sharedmemoryholderprivate.h"
namespace cf {
class MMapSharedMemory : public SharedMemoryHolderPrivate
{
public:
MMapSharedMemory();
void close(void * mem);
void * create(size_t key, size_t size);
void * open(size_t key, size_t size);
bool remove(size_t key);
size_t limit() const;
error_t error() const;
private:
void * mmap_mem_;
size_t mmap_size_;
error_t error_;
};
}
#endif // MMAPSHAREDMEMORY_H
|
#ifndef OSX_AUTHORIZATION_H_ST1ZIKX9
#define OSX_AUTHORIZATION_H_ST1ZIKX9
#include <oak/oak.h>
#include <text/format.h>
namespace osx
{
struct authorization_t
{
authorization_t () : helper(new helper_t) { }
authorization_t (std::string const& hex) : helper(new helper_t(hex)) { }
bool check_right (std::string const& right) const { return helper->copy_right(right, kAuthorizationFlagDefaults); }
bool obtain_right (std::string const& right) const { return helper->copy_right(right, kAuthorizationFlagInteractionAllowed|kAuthorizationFlagExtendRights); }
operator AuthorizationRef () const { return helper->reference(); }
operator std::string () const { return helper->as_string(); }
private:
struct helper_t
{
helper_t (std::string const& hex) : _valid(false)
{
std::vector<char> v;
for(size_t i = 0; i+1 < hex.size(); i += 2)
v.push_back(strtol(hex.substr(i, 2).c_str(), NULL, 16));
if(v.size() == sizeof(AuthorizationExternalForm))
{
AuthorizationExternalForm const* extAuth = (AuthorizationExternalForm const*)&v[0];
if(errAuthorizationSuccess == AuthorizationCreateFromExternalForm(extAuth, &_authorization))
_valid = true;
}
}
helper_t () : _valid(false) { }
~helper_t () { if(_valid) AuthorizationFree(_authorization, kAuthorizationFlagDestroyRights); }
bool copy_right (std::string const& right, AuthorizationFlags flags)
{
setup();
if(!_valid)
return false;
AuthorizationItem rightsItems[] = { { right.c_str(), 0, NULL, 0 }, };
AuthorizationRights const allRights = { sizeofA(rightsItems), rightsItems };
bool res = false;
AuthorizationRights* myAuthorizedRights = NULL;
int myStatus = AuthorizationCopyRights(_authorization, &allRights, kAuthorizationEmptyEnvironment, flags, &myAuthorizedRights);
if(myStatus == errAuthorizationSuccess)
{
res = true;
for(size_t i = 0; i < myAuthorizedRights->count; ++i)
fprintf(stderr, "authorization (pid %d): got ‘%s’\n", getpid(), myAuthorizedRights->items[i].name);
AuthorizationFreeItemSet(myAuthorizedRights);
}
else if(myStatus == errAuthorizationCanceled)
{
fprintf(stderr, "authorization (pid %d): user canceled\n", getpid());
}
else if(myStatus == errAuthorizationDenied)
{
fprintf(stderr, "authorization (pid %d): rights denied\n", getpid());
}
else if(myStatus == errAuthorizationInteractionNotAllowed)
{
fprintf(stderr, "authorization (pid %d): interaction not allowed\n", getpid());
}
else
{
fprintf(stderr, "authorization (pid %d): error %d\n", getpid(), myStatus);
}
return res;
}
AuthorizationRef reference () const { return _authorization; }
std::string as_string () const
{
std::string res;
AuthorizationExternalForm extAuth;
if(AuthorizationMakeExternalForm(_authorization, &extAuth) == errAuthorizationSuccess)
{
foreach(ch, (char*)&extAuth, (char*)(&extAuth + 1))
res += text::format("%02X", *ch);
}
return res;
}
private:
void setup () { _valid = _valid || AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &_authorization) == errAuthorizationSuccess; }
AuthorizationRef _authorization;
bool _valid;
};
std::shared_ptr<helper_t> helper;
};
} /* osx */
#endif /* end of include guard: OSX_AUTHORIZATION_H_ST1ZIKX9 */
|
/* umplayer, GUI front-end for mplayer.
Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
Copyright (C) 2010 Ori Rejwan
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 _TV_SETTINGS_H_
#define _TV_SETTINGS_H_
#include "filesettingsbase.h"
class QSettings;
class TVSettings : public FileSettingsBase
{
public:
TVSettings(QString directory);
virtual ~TVSettings();
virtual bool existSettingsFor(QString filename);
virtual void loadSettingsFor(QString filename, MediaSettings & mset);
virtual void saveSettingsFor(QString filename, MediaSettings & mset);
static QString filenameToGroupname(const QString & filename);
private:
QSettings * my_settings;
};
#endif
|
/*
* This file is part of Simpiler.
* Simpiler 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.
* Simpiler 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 Simpiler. If not, see <http://www.gnu.org/licenses/>.
*/
void ShowHelp() ;
char* ReadAllFile(const char* path);
|
#ifndef _H_AEFX_CHANNELDEPTHTPL
#define _H_AEFX_CHANNELDEPTHTPL
/** AEFX_ChannelDepthTpl.h
(c) 2005 Adobe Systems Incorporated
**/
// Basic pixel traits structure. This structure is never used per se, merely overidden -- see below.
template <typename Pixel>
struct PixelTraits {
typedef int PixType;
typedef int DataType;
static DataType
LutFunc(DataType input, const DataType *map);
enum {max_value = 0 };
};
// 8 bit pixel types, constants, and functions
template <>
struct PixelTraits<PF_Pixel8>{
typedef PF_Pixel8 PixType;
typedef u_char DataType;
static DataType
LutFunc(DataType input, const DataType *map){return map[input];}
enum {max_value = PF_MAX_CHAN8};
};
// 16 bit pixel types, constants, and functions
template <>
struct PixelTraits<PF_Pixel16>{
typedef PF_Pixel16 PixType;
typedef u_short DataType;
static u_short
LutFunc(u_short input, const u_short *map);
enum {max_value = PF_MAX_CHAN16};
};
inline u_short
PixelTraits<PF_Pixel16>::LutFunc(u_short input,
const u_short *map)
{
u_short index = input >> (15 - PF_TABLE_BITS);
uint32_t fract = input & ((1 << (15 - PF_TABLE_BITS)) - 1);
A_long result = map [index];
if (fract) {
result += ((((A_long) map [index + 1] - result) * fract) +
(1 << (14 - PF_TABLE_BITS))) >> (15 - PF_TABLE_BITS);
}
return (u_short) result;
}
#endif //_H_AEFX_CHANNELDEPTHTPL
|
// Copyright (c) 2016 Lorenzo Rossoni
#pragma once
#include <dxgi.h>
#include <dxgi1_2.h>
#include <d2d1_1.h>
#include <d2d1_2.h>
#include <d3d11.h>
#include <d3d11_2.h>
#include <dwrite.h>
#include <wrl\module.h>
#include <wrl\client.h>
#include <DirectXMath.h>
#include <Wincodec.h>
#include <mfobjects.h>
#include <mfapi.h>
#include <windows.ui.xaml.media.dxinterop.h>
#pragma comment(lib, "d2d1.lib")
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "mf.lib")
#pragma comment(lib, "mfplat.lib")
#pragma comment(lib, "mfuuid.lib")
#pragma comment(lib, "mfreadwrite.lib")
using namespace Platform;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Data;
using namespace Microsoft::WRL;
using namespace Windows::UI::Core;
using Windows::Foundation::Metadata::WebHostHiddenAttribute;
using Windows::UI::Xaml::Data::BindableAttribute;
using Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource;
namespace Unigram
{
namespace Native
{
ref class AnimatedImageSourceRenderer;
class VirtualImageSourceRendererCallback WrlSealed : public RuntimeClass<RuntimeClassFlags<ClassicCom>, IVirtualSurfaceUpdatesCallbackNative, IMFAsyncCallback>
{
public:
VirtualImageSourceRendererCallback(_In_ AnimatedImageSourceRenderer^ renderer);
~VirtualImageSourceRendererCallback();
HRESULT StartTimer(LONGLONG duration);
HRESULT StopTimer();
STDMETHODIMP UpdatesNeeded();
STDMETHODIMP Invoke(_In_ IMFAsyncResult* pAsyncResult);
STDMETHODIMP GetParameters(_Out_ DWORD* pdwFlags, _Out_ DWORD* pdwQueue);
inline const bool IsTimerRunning() const
{
return m_timerKey != NULL;
}
private:
MFWORKITEM_KEY m_timerKey;
AnimatedImageSourceRenderer^ m_renderer;
DispatchedHandler^ m_timerDispatchedHandler;
};
}
}
|
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpstringcombobox.h
* Copyright (C) 2007 Sven Neumann <sven@gimp.org>
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_STRING_COMBO_BOX_H__
#define __GIMP_STRING_COMBO_BOX_H__
G_BEGIN_DECLS
#define GIMP_TYPE_STRING_COMBO_BOX (gimp_string_combo_box_get_type ())
#define GIMP_STRING_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBox))
#define GIMP_STRING_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBoxClass))
#define GIMP_IS_STRING_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_STRING_COMBO_BOX))
#define GIMP_IS_STRING_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_STRING_COMBO_BOX))
#define GIMP_STRING_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBoxClass))
typedef struct _GimpStringComboBoxClass GimpStringComboBoxClass;
struct _GimpStringComboBox
{
GtkComboBox parent_instance;
/*< private >*/
gpointer priv;
};
struct _GimpStringComboBoxClass
{
GtkComboBoxClass parent_class;
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};
GType gimp_string_combo_box_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_string_combo_box_new (GtkTreeModel *model,
gint id_column,
gint label_column);
gboolean gimp_string_combo_box_set_active (GimpStringComboBox *combo_box,
const gchar *id);
gchar * gimp_string_combo_box_get_active (GimpStringComboBox *combo_box);
G_END_DECLS
#endif /* __GIMP_STRING_COMBO_BOX_H__ */
|
#ifndef PICTUREVIEWITEM_H
#define PICTUREVIEWITEM_H
#include <QObject>
#include <QGraphicsItem>
#include <QDateTime>
#include <QTimer>
#include "animateditem.h"
#include "abstractmetadata.h"
class PictureViewItem : public AnimatedItem
{
public:
// operator QGraphicsItem* () { return dynamic_cast<QGraphicsItem *> (this); }
// operator QObject* () { return dynamic_cast<QObject *> (this); }
virtual void load () = 0;
virtual void refresh () { }
virtual void resize () = 0;
virtual QDateTime getDate () = 0;
virtual AbstractMetadata *metadata () = 0;
virtual void setShowTime (int time) = 0;
virtual bool rotateLeft () = 0;
virtual bool rotateRight () = 0;
virtual qreal zoom () = 0;
virtual void setZoom (qreal zoomPercent) = 0;
signals:
void itemLoaded ();
void showTimeEnded ();
void zoomChanged (qreal newZoom);
public slots:
virtual void beginRotateAnimation () {}
virtual void endRotateAnimation () {}
private:
};
#endif // PICTUREVIEWITEM_H
|
///
/// WSView.h
/// PowerPlot
///
/// Basic view class which uses the simple versioning mechanism
/// (optional).
///
///
/// Created by Wolfram Schroers on 03/15/10.
/// Copyright 2010 Numerik & Analyse Schroers. All rights reserved.
///
#import <UIKit/UIKit.h>
#import "WSVersion.h"
#import "WSVersionDelegate.h"
#import "NAAmethyst.h"
@interface WSView : UIView <WSVersionDelegate>
@end
|
/*
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/>.
Created by: Matthieu Pinard, Ecole des Mines de Saint-Etienne, matthieu.pinard@etu.emse.fr
15-05-2016: Initial release
*/
#pragma once
/*!
* \file AtomicLock.h
* \brief Thread Synchronization capabilities using C++11 <atomic>
* \author Matthieu Pinard
*/
#include <atomic>
#include <thread>
const bool AtomicLock_UNLOCKED = false, AtomicLock_LOCKED = true;
/*! \class AtomicLock
* \brief Class for locking objects.
*
* The class provides with lock, unlock, try_lock and wait capabilities.
*/
class AtomicLock {
private:
std::atomic<bool> ThisLock; /*!< The atomic variable containing the Lock state (LOCKED or UNLOCKED) */
public:
/*!
* \brief Acquire the AtomicLock.
*
* This methods spins while the AtomicLock is acquired by another thread.
* As soon as it is released, the lock() function tries to acquire it.
*
*/
inline void lock();
/*!
* \brief Immediatly release the AtomicLock.
*
* This methods release the AtomicLock by atomically storing UNLOCKED.
*/
inline void unlock();
/*!
* \brief Wait for the AtomicLock to be released.
*
* This method spins while the AtomicLock is acquired by a thread.
*/
inline void wait();
/*!
* \brief Try acquiring the AtomicLock.
*
* This method does an unique check on the AtomicLock : if
* it is unlocked, it tries to acquire it using CAS.
*
* \return true if the function has acquired the AtomicLock,
* false otherwise. (AtomicLock already acquired, or if another thread
* has locked it during the call)
*/
inline bool try_lock();
/*!
* \brief AtomicLock constructor.
*
* The contructor initializes the AtomicLock as freed.
*/
AtomicLock() : ThisLock(AtomicLock_UNLOCKED) {}
/*!
* \brief AtomicLock destructor.
*
* The destructor unlocks the AtomicLock.
*/
~AtomicLock() {
unlock();
}
};
inline bool AtomicLock::try_lock() {
auto _Unlocked = AtomicLock_UNLOCKED;
// First check the Lock status before trying to acquire it using a CAS operation.
return (!ThisLock.load(std::memory_order::memory_order_acquire) &&
ThisLock.compare_exchange_strong(_Unlocked, AtomicLock_LOCKED, std::memory_order::memory_order_acquire, std::memory_order::memory_order_relaxed));
}
inline void AtomicLock::wait() {
// Spin atomically while the Lock is acquired.
while (ThisLock.load(std::memory_order::memory_order_acquire)) {
// Wait by issuing a yield() call
std::this_thread::yield();
}
}
inline void AtomicLock::lock() {
do {
// Spin on atomic Load, and if the lock is free...
if (!ThisLock.load(std::memory_order::memory_order_acquire)) {
auto _Unlocked = AtomicLock_UNLOCKED;
// Try to lock it using a CAS operation...
if (ThisLock.compare_exchange_strong(_Unlocked, AtomicLock_LOCKED, std::memory_order::memory_order_acquire, std::memory_order::memory_order_relaxed)) {
return;
}
}
// Wait by issuing a yield() call
std::this_thread::yield();
} while (true);
}
inline void AtomicLock::unlock() {
// Simply unlock by storing the value atomically.
ThisLock.store(AtomicLock_UNLOCKED, std::memory_order::memory_order_release);
}
|
/******************************************************************************
* *
* This file is part of Virtual Chess Clock, a chess clock software *
* *
* Copyright (C) 2010-2014 Yoann Le Montagner <yo35(at)melix(dot)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 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 BITIMERWIDGET_H_
#define BITIMERWIDGET_H_
#include <QWidget>
#include <memory>
#include <core/bitimer.h>
QT_BEGIN_NAMESPACE
class QTimer;
class QPainter;
QT_END_NAMESPACE
/**
* Display a BiTimer object.
*/
class BiTimerWidget : public QWidget
{
Q_OBJECT
public:
/**
* Constructor.
*/
BiTimerWidget(QWidget *parent=0);
/**
* Check whether a timer is binded to the widget or not.
*/
bool hasTimerBinded() const { return _biTimer!=nullptr; }
/**
* Return a reference to the binded bi-timer object.
* @throw std::invalid_argument If no timer is binded to the widget.
*/
const BiTimer &biTimer() const { ensureTimerBinded(); return *_biTimer; }
/**
* Bind a timer to the widget.
*/
void bindTimer(const BiTimer &biTimer);
/**
* Unbind the timer currently binded, if any.
*/
void unbindTimer();
/**
* Left or right label (typically the name of the corresponding player).
*/
const QString &label(Side side) const { return _label[side]; }
/**
* Set the left or right label.
*/
void setLabel(Side side, const QString &value);
/**
* Whether the labels are displayed or not.
*/
bool showLabels() const { return _showLabels; }
/**
* Set whether the labels are displayed or not.
*/
void setShowLabels(bool value);
/**
* Minimal remaining time before seconds is displayed.
*/
const TimeDuration &delayBeforeDisplaySeconds() const { return _delayBeforeDisplaySeconds; }
/**
* Set the minimal remaining time before seconds is displayed.
*/
void setDelayBeforeDisplaySeconds(const TimeDuration &value);
/**
* Whether the time should be displayed after timeout.
*/
bool displayTimeAfterTimeout() const { return _displayTimeAfterTimeout; }
/**
* Set whether the time should be displayed after timeout.
*/
void setDisplayTimeAfterTimeout(bool value);
/**
* Whether extra-information is displayed in Bronstein-mode.
*/
bool displayBronsteinExtraInfo() const { return _displayBronsteinExtraInfo; }
/**
* Set whether extra-information is displayed in Bronstein-mode.
*/
void setDisplayBronsteinExtraInfo(bool value);
/**
* Whether extra-information is displayed in byo-yomi-mode.
*/
bool displayByoYomiExtraInfo() const { return _displayByoYomiExtraInfo; }
/**
* Set whether extra-information is displayed in byo-yomi-mode.
*/
void setDisplayByoYomiExtraInfo(bool value);
/**
* @name Size hint methods.
* @{
*/
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
/**@} */
protected:
/**
* Widget rendering method.
*/
void paintEvent(QPaintEvent *event) override;
private:
// Private functions
void ensureTimerBinded() const;
void onTimerStateChanged();
void onTimeoutEvent();
void drawText(double x, double y, double w, double h, Qt::Alignment flags, const QString &text);
void applyFontFactor(double factor);
double computeFontFactor(double w, double h, const QString &text) const;
QString timeDurationAsString(const TimeDuration &value) const;
// Private members
std::unique_ptr<sig::scoped_connection> _connection;
QTimer *_timer ;
const BiTimer *_biTimer ;
Enum::array<Side, QString> _label ;
bool _showLabels ;
TimeDuration _delayBeforeDisplaySeconds;
bool _displayTimeAfterTimeout ;
bool _displayBronsteinExtraInfo;
bool _displayByoYomiExtraInfo ;
// Temporary members used at rendering time
// (should not be used outside the `paintEvent` method).
QPainter *_painter;
};
#endif /* BITIMERWIDGET_H_ */
|
/******************************************************************************
* Filename: hal_spi_rf_trx.h
*
* Description: Implementation file for common spi access with the CCxxxx
* transceiver radios using trxeb. Supports CC1101/CC112X radios
*
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
*
*
* 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 Texas Instruments Incorporated 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.
*
*******************************************************************************/
/******************************************************************************
* INCLUDES
*/
#include "stdint.h"
#if defined (__MSP430G2553__)
#include "hal_spi_rf_exp430g2.h"
#endif
#if defined (__MSP430F5438A__)
#include "hal_spi_rf_trxeb.h"
#endif
#if defined (__MSP430F5529__)
#include "hal_spi_rf_exp5529.h"
#endif
#if defined NRF52810 || NRF52832 || NRF52840
#include "spi_rf_nrf52.h"
#endif
// CC Chip versions
#define DEV_UNKNOWN 10
#define DEV_CC1100 11
#define DEV_CC1101 12
#define DEV_CC2500 13
#define DEV_CC430x 14
#define DEV_CC1120 15
#define DEV_CC1121 16
#define DEV_CC1125 17
#define DEV_CC1200 18
#define DEV_CC1201 19
#define DEV_CC1175 20
#define RADIO_GENERAL_ERROR 0x00
#define RADIO_CRC_OK 0x80
#define RADIO_IDLE 0x81
#define RADIO_RX_MODE 0x82
#define RADIO_TX_MODE 0x83
#define RADIO_RX_ACTIVE 0x84
#define RADIO_TX_ACTIVE 0x85
#define RADIO_SLEEP 0x86
#define RADIO_TX_PACKET_RDY 0x87
#define RADIO_CHANNEL_NOT_CLR 0x88
#define RADIO_CHANNEL_IS_CLR 0x89
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-PDU-Contents"
* found in "../support/s1ap-r16.1.0/36413-g10.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps`
*/
#include "S1AP_DownlinkUEAssociatedLPPaTransport.h"
asn_TYPE_member_t asn_MBR_S1AP_DownlinkUEAssociatedLPPaTransport_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct S1AP_DownlinkUEAssociatedLPPaTransport, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_S1AP_ProtocolIE_Container_7327P73,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"protocolIEs"
},
};
static const ber_tlv_tag_t asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_S1AP_DownlinkUEAssociatedLPPaTransport_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
asn_SEQUENCE_specifics_t asn_SPC_S1AP_DownlinkUEAssociatedLPPaTransport_specs_1 = {
sizeof(struct S1AP_DownlinkUEAssociatedLPPaTransport),
offsetof(struct S1AP_DownlinkUEAssociatedLPPaTransport, _asn_ctx),
asn_MAP_S1AP_DownlinkUEAssociatedLPPaTransport_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport = {
"DownlinkUEAssociatedLPPaTransport",
"DownlinkUEAssociatedLPPaTransport",
&asn_OP_SEQUENCE,
asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1,
sizeof(asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1)
/sizeof(asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1[0]), /* 1 */
asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1, /* Same as above */
sizeof(asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1)
/sizeof(asn_DEF_S1AP_DownlinkUEAssociatedLPPaTransport_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_S1AP_DownlinkUEAssociatedLPPaTransport_1,
1, /* Elements count */
&asn_SPC_S1AP_DownlinkUEAssociatedLPPaTransport_specs_1 /* Additional specs */
};
|
/*
* =====================================================================================
*
* Filename: dict.c
*
* Description: A Dict for me.
*
* Version: 1.0
* Created: 12/23/2015 01:47:17 PM
* Revision: none
* Compiler: gcc
*
* Author: Lee Sheen (leesheen@outlook.com),
* Organization:
*
* =====================================================================================
*/
#define _GNU_SOURCE
#include "dict.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#undef _GNU_SOURCE
static void print_help()
{
printf("Usage: dict [options] [value] ...\n");
printf("<value> has to be either integral(raw mode) or decimal(percent mode) depending on the specified value mode.\n");
printf("<options> can be any of the following:\n\n");
printf("Operations:\n");
printf(" -H -h:\tPrints this help and exits\n");
printf("\n 请输出需要查询的关键字,比如\n\n ~ dict example\n");
printf("\n 如果英文段落中有“'”(单引号)等符号,可以在需要翻译的语句前后加半角双引号,比如\n\n ~ dict \"I'm a programmer.\"\n\n");
return ;
}
static void print_version()
{
printf("--------\n\n\n\n\n");
}
static DICT_BOOL dict_choose_api(DICT_STR *dict_str_tmp, char *optarg)
{
int i;
DICT_BOOL is_print_help = TRUE;
dict_str_tmp->is_vaild = FALSE;
for (i=0; i<DICT_API_NAME_NUM; i++)
{
if (NULL != strcasestr(g_dict_api_name_array[i], optarg))
{
dict_str_tmp->dict_api = i;
dict_str_tmp->is_vaild = TRUE;
is_print_help = FALSE;
}
}
return is_print_help;
}
static DICT_BOOL dict_arg_init(DICT_STR *dict_str_tmp,
int argc, char *argv[])
{
int i = 0;
int opt_res = 0;
int content_len = 0;
DICT_BOOL is_print_version = FALSE;
DICT_BOOL is_print_help = FALSE;
/* 可选参数默认选项 */
dict_str_tmp->is_vaild = TRUE;
dict_str_tmp->dict_api = API_YOUDAO; /* TODO 从配置文件中导入*/
dict_str_tmp->res_in = stdin;
dict_str_tmp->res_out = stdout;
while (-1 != (opt_res = getopt(argc, argv, DICT_OPTSTRING)))
{
switch (opt_res)
{
/* 版本 */
case 'v':
{
dict_str_tmp->is_vaild = FALSE;
is_print_version = TRUE;
break;
}
/* TODO 输入选项 */
case 'i':
{break;}
/* TODO 输出选项 */
case 'o':
{break;}
/* API选择 <baidu> <youdao> etc...*/
case 'a':
{
is_print_help = dict_choose_api(dict_str_tmp, optarg);
break;
}
/* 测试参数 */
case 'V':
{break;}
/* 帮助 */
case 'H':
case 'h':
default:
{
is_print_help = TRUE;
dict_str_tmp->is_vaild = FALSE;
break;
}
}
}
/* 填充content_location */
if ((optind == argc) && (is_print_version != TRUE))
{
is_print_help = TRUE;
dict_str_tmp->is_vaild = FALSE;
}
else
dict_str_tmp->content_location = optind;
/* 填充content_len */
for (i=optind; i<argc; i++)
{
content_len += strlen(argv[i]);
content_len += 1;
}
dict_str_tmp->content_len = content_len;
if (is_print_version == TRUE)
print_version();
if (is_print_help == TRUE)
print_help();
return dict_str_tmp->is_vaild;
}
static DICT_BOOL dict_str_add_content(DICT_STR * dict_str_tmp,
int argc, char *argv[])
{
int i;
int len = dict_str_tmp->content_len;
int location = dict_str_tmp->content_location;
unsigned char *content = (unsigned char *)malloc(len);
if (NULL == content)
return FALSE;
memset(content, 0, len);
/* Strcat what words needs translate */
for (i=location; i<argc; i++)
{
strncat(content, argv[i], strlen(argv[i]));
strncat(content, " ", 1);
}
content[len-1] = '\0';
dict_str_tmp->content = content;
return TRUE;
}
static int dict_init(DICT_STR **dict_str_pp, int argc, char *argv[])
{
int ret = ERRNO_INIT;
int trans_words_len = 0;
DICT_STR dict_str_tmp;
dict_arg_init(&dict_str_tmp, argc, argv);
if (dict_str_tmp.is_vaild == FALSE)
{
printf("[DICT]%s: DICT_STR is vaild.", __func__);
return ret;
}
if (dict_str_add_content(&dict_str_tmp, argc, argv) == FALSE)
{
free(dict_str_tmp.content);
printf("[DICT]%s: DICT_STR add content error.", __func__);
return ret;
}
if ((*dict_str_pp = (DICT_STR *)malloc(sizeof (DICT_STR))) == NULL)
{
free(dict_str_tmp.content);
printf("[DICT]%s: DICT_STR malloc failed.", __func__);
return ret;
}
memcpy(*dict_str_pp, &dict_str_tmp, sizeof (DICT_STR));
return (ret = ERRNO_SUCCESS);
}
static int dict_exec(DICT_STR *dict_str_p)
{
int ret = 0;
//baidu_translate(resout, trans_chars);
// youdao_translate(resout, trans_chars);
return ret;
}
static void dict_free(DICT_STR *dict_str_p)
{
free(dict_str_p->content);
free(dict_str_p);
return ;
}
int main(int argc, char *argv[])
{
int ret = 0;
DICT_STR *my_dict_str = NULL;
ret = dict_init(&my_dict_str, argc, argv);
if (ERRNO_INIT == ret)
{
/* 如果没有初始化此结构体,说明用户执行 --help ,
* 并没有出错,所有此处不打印出错信息,直接返回。
* 而对于程序来说,--help或者错误的参数也是程序
* 没有正确执行的一部分,所以main仍返回错误。*/
if (NULL != my_dict_str)
printf("[DICT]%s: Initialization Failed.", __func__);
return ret;
}
ret = dict_exec(my_dict_str);
if (ERRNO_EXEC == ret)
printf("[DICT]%s: Execution Failed.", __func__);
dict_free(my_dict_str);
return ret;
}
|
#ifndef __ENVIRONMENT_H
#define __ENVIRONMENT_H
#include <string>
#include <map>
#include "Selection.h"
#include "Vec3D.h"
class Environment
{
public:
static Environment* getInstance();
nameEntry get_clipboard();
void set_clipboard(nameEntry* entry);
bool view_holelines;
// values for areaID painting
int selectedAreaID;
std::map<int, Vec3D> areaIDColors; // List of all area IDs to draw them with different colors
// hold keys
bool ShiftDown;
bool AltDown;
bool CtrlDown;
bool SpaceDown;
bool paintMode;
int flagPaintMode;
int screenX;
int screenY;
float Pos3DX;
float Pos3DY;
float Pos3DZ;
float cursorColorR;
float cursorColorG;
float cursorColorB;
float cursorColorA;
int cursorType;
private:
Environment();
static Environment* instance;
nameEntry clipboard;
};
#endif
|
/*******************************************************************************
* Goggles Audio Player Library *
********************************************************************************
* Copyright (C) 2010-2021 by Sander Jansen. All Rights Reserved *
* --- *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 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 MEM_PACKET_H
#define MEM_PACKET_H
#include "ap_buffer.h"
#include "ap_event.h"
#include "ap_signal.h"
#include "ap_format.h"
namespace ap {
class Packet;
/*
class Stream {
FXint id;
FXlong length;
FXlong position;
};
*/
class PacketPool {
protected:
FXLFQueueOf<Packet> packets;
Semaphore semaphore;
public:
/// Constructor
PacketPool();
/// Initialize pool
FXbool init(FXival sz,FXival n);
/// free pool
void free();
/// Block until packet is available or signal is set
Packet * wait(const Signal &);
/// Put event back into pool
void push(Packet*);
/// Destructor
~PacketPool();
};
class Packet : public Event, public MemoryBuffer {
friend class PacketPool;
protected:
PacketPool* pool;
public:
AudioFormat af;
FXuchar flags;
FXlong stream_position;
FXlong stream_length;
protected:
Packet(PacketPool*,FXival sz);
virtual ~Packet();
public:
virtual void unref();
void reset();
FXbool full() const { return (af.framesize() > space()); }
FXint numFrames() const { return size() / af.framesize(); }
FXint availableFrames() const { return space() / af.framesize(); }
void wroteFrames(FXint nframes) { wroteBytes(nframes*af.framesize()); }
void appendFrames(const FXuchar * buf,FXival nframes) { append(buf,af.framesize()*nframes); }
FXint copyFrames(FXuchar *& buf, FXint & nframes) {
FXint n = FXMIN(nframes,availableFrames());
if (n) {
const FXint nbytes = af.framesize()*n;
append(buf,nbytes);
nframes-=n;
buf+=nbytes;
}
return n;
}
};
}
#endif
|
/*
This file is part of Darling.
Copyright (C) 2021 Lubos Dolezel
Darling 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.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@protocol AKWebKitControllerDelegate
@end
|
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
*
* Header file for Descriptors.c.
*/
#ifndef _DESCRIPTORS_H_
#define _DESCRIPTORS_H_
/* Includes: */
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
/** Endpoint number of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPNUM 2
/** Endpoint number of the CDC device-to-host data IN endpoint. */
#define CDC_TX_EPNUM 3
/** Endpoint number of the CDC host-to-device data OUT endpoint. */
#define CDC_RX_EPNUM 4
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 16
/** Endpoint number of the Mouse HID reporting IN endpoint. */
#define MOUSE_EPNUM 1
/** Size in bytes of the Mouse HID reporting IN endpoint. */
#define MOUSE_EPSIZE 8
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which
* vary between devices, and which describe the device's usage to the host.
*/
typedef struct
{
USB_Descriptor_Configuration_Header_t Config;
// CDC Control Interface
USB_Descriptor_Interface_Association_t CDC_IAD;
USB_Descriptor_Interface_t CDC_CCI_Interface;
USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
// CDC Data Interface
USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
// Mouse HID Interface
USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_MouseHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t;
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif
|
/**************************************************************************
* Otter Browser: Web browser controlled by the user, not vice-versa.
* Copyright (C) 2013 - 2022 Michal Dutkiewicz aka Emdek <michal@emdek.pl>
* Copyright (C) 2014 - 2017 Jan Bajer aka bajasoft <jbajer@gmail.com>
* Copyright (C) 2016 - 2017 Piotr Wójcik <chocimier@tlen.pl>
*
* 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 OTTER_INPUTPREFERENCESPAGE_H
#define OTTER_INPUTPREFERENCESPAGE_H
#include "PreferencesPage.h"
#include "../../../core/ActionsManager.h"
#include "../../../ui/ItemDelegate.h"
#include <QtGui/QStandardItemModel>
#include <QtWidgets/QKeySequenceEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QToolButton>
namespace Otter
{
namespace Ui
{
class InputPreferencesPage;
}
class ShortcutWidget final : public QKeySequenceEdit
{
Q_OBJECT
public:
explicit ShortcutWidget(const QKeySequence &shortcut, QWidget *parent = nullptr);
protected:
void changeEvent(QEvent *event) override;
private:
QToolButton *m_clearButton;
signals:
void commitData(QWidget *editor);
};
class ActionDelegate final : public ItemDelegate
{
public:
explicit ActionDelegate(QObject *parent);
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
class ParametersDelegate final : public ItemDelegate
{
public:
explicit ParametersDelegate(QObject *parent);
void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override;
};
class ShortcutDelegate final : public ItemDelegate
{
public:
explicit ShortcutDelegate(QObject *parent);
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
protected:
void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override;
};
class InputPreferencesPage final : public PreferencesPage
{
Q_OBJECT
public:
enum DataRole
{
IdentifierRole = Qt::UserRole,
IsDisabledRole,
NameRole,
ParametersRole,
StatusRole
};
enum EntryStatus
{
ErrorStatus = 0,
WarningStatus,
NormalStatus
};
struct ValidationResult final
{
QString text;
QIcon icon;
bool isError = false;
};
explicit InputPreferencesPage(QWidget *parent);
~InputPreferencesPage();
static QString createParamatersPreview(const QVariantMap &rawParameters, const QString &separator);
static ValidationResult validateShortcut(const QKeySequence &shortcut, const QModelIndex &index);
public slots:
void save() override;
protected:
struct ShortcutsDefinition
{
QVariantMap parameters;
QVector<QKeySequence> shortcuts;
QVector<QKeySequence> disabledShortcuts;
};
void changeEvent(QEvent *event) override;
void loadKeyboardDefinitions(const QString &identifier);
void addKeyboardShortcuts(QStandardItemModel *model, int identifier, const QString &name, const QString &text, const QIcon &icon, const QVariantMap &rawParameters, const QVector<QKeySequence> &shortcuts, bool areShortcutsDisabled);
void addKeyboardShortcut(bool isDisabled);
QString createProfileIdentifier(QStandardItemModel *model, const QString &base = {}) const;
QHash<int, QVector<KeyboardProfile::Action> > getKeyboardDefinitions() const;
protected slots:
void addKeyboardProfile();
void editKeyboardProfile();
void cloneKeyboardProfile();
void removeKeyboardProfile();
void updateKeyboardProfileActions();
void editShortcutParameters();
void updateKeyboardShortcutActions();
private:
QStandardItemModel *m_keyboardShortcutsModel;
QPushButton *m_advancedButton;
QString m_activeKeyboardProfile;
QStringList m_filesToRemove;
QHash<QString, KeyboardProfile> m_keyboardProfiles;
Ui::InputPreferencesPage *m_ui;
static bool m_areSingleKeyShortcutsAllowed;
};
}
#endif
|
#include <3ds.h>
bool touchInBox(touchPosition touch, int x, int y, int w, int h){
int tx=touch.px;
int ty=touch.py;
u32 kDown = hidKeysDown();
if (kDown & KEY_TOUCH && tx > x && tx < x+w && ty > y && ty < y+h){
return true;
}else{
return false;
}
}
|
#ifndef MESSAGEBOX_H
#define MESSAGEBOX_H
#include <QMessageBox>
#include <QtGui>
#include <QSpacerItem>
#include <QGridLayout>
class MsgBox : public QMessageBox
{
Q_OBJECT
public:
explicit MsgBox( QWidget* parent = NULL );
~MsgBox();
void setWindowTitle(const QString &title);
void setStandardButtons(StandardButtons buttons);
QPushButton* addButton ( const QString & text, ButtonRole role );
QPushButton* addButton ( StandardButton button );
void addButton(QAbstractButton* button, ButtonRole role);
void setDefaultButton(StandardButton button);
void setDefaultButton(QPushButton* button);
void setIconPixmap(const QPixmap& pixmap);
void setStyleSheet(const QString& styleSheet);
void setIcon(Icon icon);
void setText(const QString &text);
int exec();
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton);
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton);
private:
QMessageBox* msgBox;
signals:
public slots:
};
#endif // MESSAGEBOX_H
|
/*
* to_base32.c
* convert binary string to base32, Tile impl.
*
* Copyright (c) 2011 Jan Seiffert
*
* This file is part of g2cd.
*
* g2cd 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.
*
* g2cd 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 g2cd.
* If not, see <http://www.gnu.org/licenses/>.
*
* $Id: $
*/
#include "tile.h"
#define ARCH_NAME_SUFFIX tile
#define ONLY_REMAINDER
#include "../generic/to_base32.c"
unsigned char *to_base32(unsigned char *dst, const unsigned char *src, unsigned len)
{
while(len >= sizeof(uint64_t))
{
uint64_t d;
if(IS_ALIGN(src, sizeof(unsigned long)))
d = *(const uint64_t *)src;
else
{
#ifdef __tilegx__
uint64_t t;
d = tile_ldna(src);
t = tile_ldna(src + 8);
d = tile_align(d, t, src);
# if (HOST_IS_BIGENDIAN-0) == 0
d = __insn_revbytes(d);
# endif
#elif defined(__tilepro__)
uint32_t t1,t2,t3;
t1 = tile_ldna(src);
t2 = tile_ldna(src + 4);
t3 = tile_ldna(src + 8);
t1 = tile_align(t1, t2, src);
t2 = tile_align(t2, t3, src + 4);
# if (HOST_IS_BIGENDIAN-0) == 0
t1 = __insn_bytex(t1);
t2 = __insn_bytex(t2);
# endif
d = (((uint64_t)t1) << 32) | t2;
#else
d = get_unaligned_be64(src);
#endif
}
src += 5;
len -= 5;
dst = do_40bit(dst, d);
}
return to_base32_generic(dst, src, len);
}
static char const rcsid_tb32ti[] GCC_ATTR_USED_VAR = "$Id: $";
/* EOF */
|
#if defined(__APPLE__)
#include <CoreServices/CoreServices.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <unistd.h>
unsigned long long currentTimeNano() {
uint64_t t = mach_absolute_time();
Nanoseconds tNano = AbsoluteToNanoseconds(*(AbsoluteTime*)&t);
return *(uint64_t *)&tNano;
}
unsigned long long currentTimeMillis() {
return currentTimeNano()/1000000;
}
#elif defined(__linux)
#include <time.h>
unsigned long long currentTimeNano() {
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
return t.tv_sec*1000000000 + t.tv_nsec;
}
unsigned long long currentTimeMillis() {
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
return t.tv_sec*1000 + t.tv_nsec/1000000;
}
#elif defined(_WIN32)
#error "Not ported to Win32. Can you help?"
#endif
|
#ifndef CANDILDOCKPACKAGE_H
#define CANDILDOCKPACKAGE_H
#include <QObject>
#include <KPackage/PackageStructure>
class CandilDockPackage : public KPackage::PackageStructure {
Q_OBJECT
public:
explicit CandilDockPackage(QObject *parent = 0, const QVariantList &args = QVariantList());
~CandilDockPackage() override;
void initPackage(KPackage::Package *package) override;
void pathChanged(KPackage::Package *package) override;
};
#endif // CANDILDOCKPACKAGE_H
// kate: indent-mode cstyle; indent-width 4; replace-tabs on;
|
/*
* gtr-tab-activatable.h
* This file is part of gtr
*
* Copyright (C) 2010 - Steve Frécinaux
*
* 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 __GTR_TAB_ACTIVATABLE_H__
#define __GTR_TAB_ACTIVATABLE_H__
#include <glib-object.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define GTR_TYPE_TAB_ACTIVATABLE (gtr_tab_activatable_get_type ())
#define GTR_TAB_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTR_TYPE_TAB_ACTIVATABLE, GtrTabActivatable))
#define GTR_TAB_ACTIVATABLE_IFACE(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GTR_TYPE_TAB_ACTIVATABLE, GtrTabActivatableInterface))
#define GTR_IS_TAB_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTR_TYPE_TAB_ACTIVATABLE))
#define GTR_TAB_ACTIVATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTR_TYPE_TAB_ACTIVATABLE, GtrTabActivatableInterface))
typedef struct _GtrTabActivatable GtrTabActivatable; /* dummy typedef */
typedef struct _GtrTabActivatableInterface GtrTabActivatableInterface;
struct _GtrTabActivatableInterface
{
GTypeInterface g_iface;
/* Virtual public methods */
void (*activate) (GtrTabActivatable * activatable);
void (*deactivate) (GtrTabActivatable * activatable);
};
/*
* Public methods
*/
GType
gtr_tab_activatable_get_type (void)
G_GNUC_CONST;
void gtr_tab_activatable_activate (GtrTabActivatable *
activatable);
void gtr_tab_activatable_deactivate (GtrTabActivatable *
activatable);
G_END_DECLS
#endif /* __GTR_TAB_ACTIVATABLE_H__ */
|
#ifndef _FAT12_H
#define _FAT12_H
#include <stdint.h>
#include <fs/vfs.h>
#define __packed
// Directory entry
struct _DIRECTORY{
uint8_t Filename[8];
uint8_t Extension[3];
uint8_t Attribute;
uint8_t Reserved;
uint8_t CreationTimedMS;
uint16_t CreationTime;
uint16_t CreationDate;
uint16_t LastAccesseDate;
uint16_t FirstClusterHiBytes;
uint16_t LastModTime;
uint16_t LastModDate;
uint16_t FirstCluster;
uint32_t FileSize;
}__attribute((packed));
typedef struct _DIRECTORY DIRECTORY, *PDIRECTORY;
#undef __packed
// FS mount infos
typedef struct _MOUNTINFO{
uint32_t numSectors;
uint32_t fatOffset;
uint32_t numRootEntries;
uint32_t rootOffset;
uint32_t rootSize;
uint32_t fatSize;
uint32_t fatEntrySize;
}MOUNTINFO, *PMOUNTINFO;
extern FILE fsysFatDirectory (const char* DirectoryName);
extern void fsysFatRead(PFILE file, unsigned char* buffer, unsigned int length);
extern FILE fsysFatOpen(const char* filename);
extern void fsysFatInit(unsigned char deviceID);
extern void fsysFatMount(unsigned char deviceID);
#endif
|
/*
* Copyright (C) 2008, 2009, 2010 The Collaborative Software Foundation.
*
* This file is part of FeedHandlers (FH).
*
* FH 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.
*
* FH 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 FH. If not, see <http://www.gnu.org/licenses/>.
*/
//
#ifndef __ARCA_PROFILING_H_
#define __ARCA_PROFILING_H_
/*********************************************************************/
/* file: profiling.h */
/* Usage: profiling constants for arca multicast */
/* Author: Wally Matthews of Collaborative Software Initiative */
/* Conception: Jan. 22, 2009 */
/* Inherited from Tervela Itch30 */
/*********************************************************************/
// only one of below should be a value of 1
// otherwise the instrumentation will be a leading cause
// of bad performance
//#define ARCA_LOOP_PROFILE (0) //profile receive loop with select
//#define ARCA_DRAIN_PROFILE (0) //profile receive loop wo select
#define ARCA_MESSAGE_PROFILE (0) //profile parse message
#define ARCA_ADD_ORDER_PROFILE (0) //profile add order msg processing
#define ARCA_MOD_ORDER_PROFILE (0) //profile mod order msg processing
#define ARCA_DEL_ORDER_PROFILE (0) //profile del order msg processing
#define ARCA_IMBALANCE_PROFILE (0) //profile imbalance msg processing
#define ARCA_SYMBOL_MAP_PROFILE (0) //profile symbol map processing
#define ARCA_FIRM_MAP_PROFILE (0) //profile firm map processing
#define ARCA_IMBALANCE_REFRESH_PROFILE (0) //profile imbalance refresh processing
#define ARCA_BOOK_REFRESH_PROFILE (0) //profile book refresh processing
#endif
|
/**
* naken_asm assembler.
* Author: Michael Kohn
* Email: mike@mikekohn.net
* Web: http://www.mikekohn.net/
* License: GPLv3
*
* Copyright 2010-2021 by Michael Kohn
*
*/
#ifndef NAKEN_ASM_ASM_4004_H
#define NAKEN_ASM_ASM_4004_H
#include "common/assembler.h"
int parse_instruction_4004(struct _asm_context *asm_context, char *instr);
#endif
|
/*******************************************************************************
moTrackerGpuKLT.h
****************************************************************************
* *
* This source 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 code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
****************************************************************************
Copyright(C) 2007 Andrés Colubri
Authors:
Based on the GPU_KLT code by Sudipta N. Sinha from the University of North Carolina
at Chapell Hill:
http://cs.unc.edu/~ssinha/Research/GPU_KLT/
Port to libmoldeo: Andrés Colubri
*******************************************************************************/
#include "moTypes.h"
#include "moConfig.h"
#include "moDeviceCode.h"
#include "moEventList.h"
#include "moIODeviceManager.h"
#include "moTypes.h"
#include "moVideoGraph.h"
#include "moArray.h"
#include "GpuVis.h"
#ifndef __MO_TRACKER_GPUKLT_H__
#define __MO_TRACKER_GPUKLT_H__
#define MO_TRACKERGPUKLT_SYTEM_LABELNAME 0
#define MO_TRACKERGPUKLT_LIVE_SYSTEM 1
#define MO_TRACKERGPUKLT_SYSTEM_ON 2
class moTrackerGpuKLTSystemData : public moTrackerSystemData
{
public:
MOint m_NFeatures;
GpuKLT_FeatureList* m_FeatureList;
};
class moTrackerGpuKLTSystem : public moAbstract
{
public:
moTrackerGpuKLTSystem();
virtual ~moTrackerGpuKLTSystem();
void SetName(moText p_name) { m_Name = p_name; }
void SetLive( moText p_livecodestr) { m_Live = p_livecodestr; }
void SetActive( MOboolean p_active) { m_bActive = p_active; }
moText GetName() { return m_Name; }
moText GetLive() { return m_Live; }
MOboolean IsActive() { return m_bActive; }
MOboolean IsInit() { return m_init; }
MOboolean Init(MOint p_nFeatures, MOint p_width, MOint p_height,
moText p_shaders_dir, MOint p_arch,
MOint p_kltmindist = 10, MOfloat p_klteigenthreshold = 0.015);
MOboolean Init(MOint p_nFeatures, moVideoSample* p_pVideoSample,
moText p_shaders_dir, MOint p_arch,
MOint p_kltmindist = 10, MOfloat p_klteigenthreshold = 0.015);
MOboolean Finish();
GpuVis_Options* GetTrackingOptions() { return &gopt; }
GpuKLT_FeatureList* GetFeatureList() { return list; }
MOint GetNFeatures() { return list->_nFeats; }
void GetFeature(MOint p_feature, MOfloat &x, MOfloat &y, MOboolean &v);
void Track(GLubyte *p_pBuffer, MOuint p_RGB_mode);
void StartTracking(GLubyte *p_pBuffer, MOuint p_RGB_mode);
void ContinueTracking(GLubyte *p_pBuffer, MOuint p_RGB_mode);
void NewData( moVideoSample* p_pVideoSample );
moTrackerGpuKLTSystemData* GetData() { return &m_TrackerSystemData; }
private:
moText m_Name;
moText m_Live;
MOboolean m_bActive;
MOboolean m_init;
moTrackerGpuKLTSystemData m_TrackerSystemData;
MOint m_TrackCount;
MOint m_ReinjectRate;
MOint m_width, m_height;
GpuVis_Image image; // GpuVis Image object
GpuKLT_FeatureList *list; // GpuVis Feature List object
GpuVis_Options gopt; // GpuVis Options object
GpuVis *gpuComputor; // GpuVis Computor Object
};
typedef moTrackerGpuKLTSystem* moTrackerGpuKLTSystemPtr;
template class moDynamicArray<moTrackerGpuKLTSystemPtr>;
typedef moDynamicArray<moTrackerGpuKLTSystemPtr> moTrackerGpuKLTSystems;
class moTrackerGpuKLT : public moResource
{
public:
moTrackerGpuKLT();
virtual ~moTrackerGpuKLT();
virtual MOboolean Init();
virtual MOboolean Finish();
MOswitch GetStatus(MOdevcode);
MOswitch SetStatus( MOdevcode,MOswitch);
void SetValue( MOdevcode cd, MOint vl );
void SetValue( MOdevcode cd, MOfloat vl );
MOint GetValue(MOdevcode);
MOpointer GetPointer(MOdevcode devcode );
MOdevcode GetCode( moText);
void Update(moEventList*);
protected:
// Parameters.
MOint num_feat;
MOint num_frames;
MOint min_dist;
MOfloat threshold_eigen;
moText klt_shaders_dir;
MOint gpu_arch;
MOint m_SampleCounter;
MOint m_SampleRate;
moTrackerGpuKLTSystems m_TrackerSystems;
};
class moTrackerGpuKLTFactory : public moResourceFactory {
public:
moTrackerGpuKLTFactory() {}
virtual ~moTrackerGpuKLTFactory() {}
moResource* Create();
void Destroy(moResource* fx);
};
extern "C"
{
MO_PLG_API moResourceFactory* CreateResourceFactory();
MO_PLG_API void DestroyResourceFactory();
}
#endif
|
/*
* DDSTouchStone: a scenario-driven Open Source benchmarking framework
* for evaluating the performance of OMG DDS compliant implementations.
*
* Copyright (C) 2008-2009 PrismTech Ltd.
* ddstouchstone@prismtech.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License Version 3 dated 29 June 2007, as published by the
* Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with DDSTouchStone; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __OPENSPLICE_TOUCHSTONE_OS_ABSTRACTION_H
#define __OPENSPLICE_TOUCHSTONE_OS_ABSTRACTION_H
#include "os.h"
typedef os_threadId _touchstone_os_threadId;
typedef os_timeSec _touchstone_os_timeSec;
struct _touchstone_os_timer_s {
_touchstone_os_timeSec interval_sec;
int interval_nsec;
};
#endif /* __OPENSPLICE_TOUCHSTONE_OS_ABSTRACTION_H */
|
#ifndef PARAMETERPOSITION_H_
#define PARAMETERPOSITION_H_
/*----------------------------------------------------------------------*\
ParameterPosition
\*----------------------------------------------------------------------*/
/* Imports: */
#include "acode.h"
#include "types.h"
#include "params.h"
/* Constants: */
/* Types: */
typedef struct ParameterPosition {
bool endOfList;
bool explicitMultiple;
bool all;
bool them;
bool checked;
Aword flags;
Parameter *parameters;
Parameter *exceptions;
} ParameterPosition;
/* Data: */
/* Functions: */
extern void uncheckAllParameterPositions(ParameterPosition parameterPositions[]);
extern void copyParameterPositions(ParameterPosition originalParameterPositions[], ParameterPosition parameterPositions[]);
extern bool equalParameterPositions(ParameterPosition parameterPositions1[], ParameterPosition parameterPositions2[]);
extern int findMultipleParameterPosition(ParameterPosition parameterPositions[]);
extern void markExplicitMultiple(ParameterPosition parameterPositions[], Parameter parameters[]);
extern void convertPositionsToParameters(ParameterPosition parameterPositions[], Parameter parameters[]);
#endif /* PARAMETERPOSITION_H_ */
|
#ifndef OI_H
#define OI_H
#include "WPILib.h"
#include "Robotmagic.h"
class OI
{
private:
public:
OI();
#define JOYSTICK_main_TYPE xbox
SENSOR_OI_H(joystick,main);
SENSOR_OI_H(gyro,gyro);
SENSOR_OI_H(digitalin,compressor);
SENSOR_OI_H(digitalin,arm_top);
SENSOR_OI_H(digitalin,arm_bot);
SENSOR_OI_H(digitalin,catapult);
SENSOR_OI_H(encoder,drive_left);
SENSOR_OI_H(encoder,drive_right);
};
#endif
|
// artist.h
//
// Project: Ampache Browser
// License: GNU GPLv3
//
// Copyright (C) 2015 - 2016 Róbert Čerňanský
#ifndef ARTIST_H
#define ARTIST_H
#include <string>
namespace domain {
/**
* @brief Represents the artist domain object.
*/
class Artist {
public:
/**
* @brief Constructor.
*
* @param id Identifier.
* @param name Artist's name.
*/
Artist(const std::string& id, const std::string& name);
Artist(const Artist& other) = delete;
Artist& operator=(const Artist& other) = delete;
/**
* @brief Gets the identifier.
*/
const std::string getId() const;
/**
* @brief Gets artist's name.
*/
const std::string getName() const;
private:
// arguments from the constructor
const std::string myId;
const std::string myName;
};
bool operator==(const Artist& lhs, const Artist& rhs);
bool operator!=(const Artist& lhs, const Artist& rhs);
bool operator<(const Artist& lhs, const Artist& rhs);
bool operator>(const Artist& lhs, const Artist& rhs);
bool operator<=(const Artist& lhs, const Artist& rhs);
bool operator>=(const Artist& lhs, const Artist& rhs);
}
namespace std {
template<>
class hash<domain::Artist> {
public:
size_t operator()(const domain::Artist& artist) const;
};
}
#endif // ARTIST_H
|
/*
* anim.h
*
* Animation application
*
* Copyright 2011 - Benjamin Bonny <benjamin.bonny@gmail.com>,
* Cédric Le Ninivin <cedriclen@gmail.com>,
* Guillaume Normand <guillaume.normand.gn@gmail.com>
*
* All rights reserved.
* MB Led
* Telecom ParisTech - ELECINF344/ELECINF381
*
* This file is part of MB Led Project.
*
* MB Led 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.
*
* MB Led Project 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 MB Led Project. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef H_ANIM
#define H_ANIM
void anim_task();
#endif
|
// DisplacementMapFilterMode_as.h: ActionScript 3 "DisplacementMapFilterMode" class, for Gnash.
//
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
#define GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
namespace gnash {
// Forward declarations
class as_object;
class ObjectURI;
/// Initialize the global DisplacementMapFilterMode class
void displacementmapfiltermode_class_init(as_object& where, const ObjectURI& uri);
} // gnash namespace
// GNASH_ASOBJ3_DISPLACEMENTMAPFILTERMODE_H
#endif
// local Variables:
// mode: C++
// indent-tabs-mode: t
// End:
|
#ifndef RGBLIGHT_H
#define RGBLIGHT_H
#ifdef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_MODES 34
#else
#define RGBLIGHT_MODES 1
#endif
#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 9
#endif
#ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH
#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
#endif
#ifndef RGBLIGHT_HUE_STEP
#define RGBLIGHT_HUE_STEP 10
#endif
#ifndef RGBLIGHT_SAT_STEP
#define RGBLIGHT_SAT_STEP 17
#endif
#ifndef RGBLIGHT_VAL_STEP
#define RGBLIGHT_VAL_STEP 17
#endif
#define RGBLED_TIMER_TOP F_CPU/(256*64)
// #define RGBLED_TIMER_TOP 0xFF10
#include <stdint.h>
#include <stdbool.h>
#include "eeconfig.h"
#include "light_ws2812.h"
extern LED_TYPE led[RGBLED_NUM];
extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
typedef union {
uint32_t raw;
struct {
bool enable :1;
uint8_t mode :6;
uint16_t hue :9;
uint8_t sat :8;
uint8_t val :8;
};
} rgblight_config_t;
void rgblight_init(void);
void rgblight_increase(void);
void rgblight_decrease(void);
void rgblight_toggle(void);
void rgblight_enable(void);
void rgblight_step(void);
void rgblight_step_reverse(void);
void rgblight_mode(uint8_t mode);
void rgblight_set(void);
void rgblight_update_dword(uint32_t dword);
void rgblight_increase_hue(void);
void rgblight_decrease_hue(void);
void rgblight_increase_sat(void);
void rgblight_decrease_sat(void);
void rgblight_increase_val(void);
void rgblight_decrease_val(void);
void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
uint32_t eeconfig_read_rgblight(void);
void eeconfig_update_rgblight(uint32_t val);
void eeconfig_update_rgblight_default(void);
void eeconfig_debug_rgblight(void);
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);
void rgblight_task(void);
void rgblight_timer_init(void);
void rgblight_timer_enable(void);
void rgblight_timer_disable(void);
void rgblight_timer_toggle(void);
void rgblight_effect_breathing(uint8_t interval);
void rgblight_effect_rainbow_mood(uint8_t interval);
void rgblight_effect_rainbow_swirl(uint8_t interval);
void rgblight_effect_snake(uint8_t interval);
void rgblight_effect_knight(uint8_t interval);
void rgblight_effect_christmas(void);
#endif
|
/****************************************************************************
**
** 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 Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QGRAPHICSBILLBOARDTRANSFORM_H
#define QGRAPHICSBILLBOARDTRANSFORM_H
#include "qgraphicstransform3d.h"
#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QGraphicsBillboardTransformPrivate;
class Q_QT3D_EXPORT QGraphicsBillboardTransform : public QGraphicsTransform3D
{
Q_OBJECT
Q_PROPERTY(bool preserveUpVector READ preserveUpVector WRITE setPreserveUpVector NOTIFY preserveUpVectorChanged)
public:
QGraphicsBillboardTransform(QObject *parent = 0);
~QGraphicsBillboardTransform();
bool preserveUpVector() const;
void setPreserveUpVector(bool value);
void applyTo(QMatrix4x4 *matrix) const;
QGraphicsTransform3D *clone(QObject *parent) const;
Q_SIGNALS:
void preserveUpVectorChanged();
private:
QScopedPointer<QGraphicsBillboardTransformPrivate> d_ptr;
Q_DISABLE_COPY(QGraphicsBillboardTransform)
Q_DECLARE_PRIVATE(QGraphicsBillboardTransform)
};
QT_END_NAMESPACE
QT_END_HEADER
#endif
|
#ifndef PM_SYSTEM_H_INCLUDED
#define PM_SYSTEM_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* to fake out automatic code indenters */
#endif
void
pm_system2_vp(const char * const progName,
const char ** const argArray,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
int * const termStatusP);
void
pm_system2_lp(const char * const progName,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
int * const termStatusP,
...);
void
pm_system2(void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
const char * const shellCommand,
int * const termStatusP);
void
pm_system_vp(const char * const progName,
const char ** const argArray,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm);
void
pm_system_lp(const char * const progName,
void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
...);
void
pm_system(void stdinFeeder(int, void *),
void * const feederParm,
void stdoutAccepter(int, void *),
void * const accepterParm,
const char * const shellCommand);
const char *
pm_termStatusDesc(int const termStatus);
/* The following are Standard Input feeders and Standard Output accepters
for pm_system() etc.
*/
void
pm_feed_null(int const pipeToFeedFd,
void * const feederParm);
void
pm_accept_null(int const pipetosuckFd,
void * const accepterParm);
struct bufferDesc {
/* This is just a parameter for the routines below */
unsigned int size;
unsigned char * buffer;
unsigned int * bytesTransferredP;
};
/* The struct name "bufferDesc", without the "pm" namespace, is an unfortunate
historical accident.
*/
typedef struct bufferDesc pm_bufferDesc;
void
pm_feed_from_memory(int const pipeToFeedFd,
void * const feederParm);
void
pm_accept_to_memory(int const pipetosuckFd,
void * const accepterParm);
#ifdef __cplusplus
}
#endif
#endif
|
// Copyright © 2008-2016 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef _POLIT_H
#define _POLIT_H
#include "galaxy/Economy.h"
class Galaxy;
class StarSystem;
class SysPolit;
class Ship;
namespace Polit {
enum PolitEcon { // <enum scope='Polit' name=PolitEcon prefix=ECON_ public>
ECON_NONE,
ECON_VERY_CAPITALIST,
ECON_CAPITALIST,
ECON_MIXED,
ECON_PLANNED,
ECON_MAX // <enum skip>
};
enum GovType { // <enum scope='Polit' name=PolitGovType prefix=GOV_ public>
GOV_INVALID, // <enum skip>
GOV_NONE,
GOV_EARTHCOLONIAL,
GOV_EARTHDEMOC,
GOV_EMPIRERULE,
GOV_CISLIBDEM,
GOV_CISSOCDEM,
GOV_LIBDEM,
GOV_CORPORATE,
GOV_SOCDEM,
GOV_EARTHMILDICT,
GOV_MILDICT1,
GOV_MILDICT2,
GOV_EMPIREMILDICT,
GOV_COMMUNIST,
GOV_PLUTOCRATIC,
GOV_DISORDER,
GOV_MAX, // <enum skip>
GOV_RAND_MIN = GOV_NONE+1, // <enum skip>
GOV_RAND_MAX = GOV_MAX-1, // <enum skip>
};
fixed GetBaseLawlessness(GovType gov);
}
class SysPolit {
public:
SysPolit() : govType(Polit::GOV_INVALID) { }
const char *GetGovernmentDesc() const;
const char *GetEconomicDesc() const;
Polit::GovType govType;
fixed lawlessness;
};
#endif /* _POLIT_H */
|
/*
Copyright (C) 2010,2011,2012 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
This file is part of ESPResSo.
ESPResSo 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.
ESPResSo 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 ANGLEDIST_TCL_H
#define ANGLEDIST_TCL_H
/** \file angledist_tcl.h
* Tcl interface for \ref angledist.h
*/
#include "parser.h"
#include "interaction_data.h"
#ifdef BOND_ANGLEDIST
/// parse parameters for the angle potential
int tclcommand_inter_parse_angledist(Tcl_Interp *interp,
int bond_type, int argc, char **argv);
///
int tclprint_to_result_angledistIA(Tcl_Interp *interp,
Bonded_ia_parameters *params);
#endif
#endif
|
// Generated by gencpp from file capra_msgs/AddGoal.msg
// DO NOT EDIT!
#ifndef CAPRA_MSGS_MESSAGE_ADDGOAL_H
#define CAPRA_MSGS_MESSAGE_ADDGOAL_H
#include <ros/service_traits.h>
#include <capra_msgs/AddGoalRequest.h>
#include <capra_msgs/AddGoalResponse.h>
namespace capra_msgs
{
struct AddGoal
{
typedef AddGoalRequest Request;
typedef AddGoalResponse Response;
Request request;
Response response;
typedef Request RequestType;
typedef Response ResponseType;
}; // struct AddGoal
} // namespace capra_msgs
namespace ros
{
namespace service_traits
{
template<>
struct MD5Sum< ::capra_msgs::AddGoal > {
static const char* value()
{
return "ff8d7d66dd3e4b731ef14a45d38888b6";
}
static const char* value(const ::capra_msgs::AddGoal&) { return value(); }
};
template<>
struct DataType< ::capra_msgs::AddGoal > {
static const char* value()
{
return "capra_msgs/AddGoal";
}
static const char* value(const ::capra_msgs::AddGoal&) { return value(); }
};
// service_traits::MD5Sum< ::capra_msgs::AddGoalRequest> should match
// service_traits::MD5Sum< ::capra_msgs::AddGoal >
template<>
struct MD5Sum< ::capra_msgs::AddGoalRequest>
{
static const char* value()
{
return MD5Sum< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalRequest&)
{
return value();
}
};
// service_traits::DataType< ::capra_msgs::AddGoalRequest> should match
// service_traits::DataType< ::capra_msgs::AddGoal >
template<>
struct DataType< ::capra_msgs::AddGoalRequest>
{
static const char* value()
{
return DataType< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalRequest&)
{
return value();
}
};
// service_traits::MD5Sum< ::capra_msgs::AddGoalResponse> should match
// service_traits::MD5Sum< ::capra_msgs::AddGoal >
template<>
struct MD5Sum< ::capra_msgs::AddGoalResponse>
{
static const char* value()
{
return MD5Sum< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalResponse&)
{
return value();
}
};
// service_traits::DataType< ::capra_msgs::AddGoalResponse> should match
// service_traits::DataType< ::capra_msgs::AddGoal >
template<>
struct DataType< ::capra_msgs::AddGoalResponse>
{
static const char* value()
{
return DataType< ::capra_msgs::AddGoal >::value();
}
static const char* value(const ::capra_msgs::AddGoalResponse&)
{
return value();
}
};
} // namespace service_traits
} // namespace ros
#endif // CAPRA_MSGS_MESSAGE_ADDGOAL_H
|
// Copyright 2004, 2005,2006,2007,2008 Koblo http://koblo.com
//
// This file is part of the Koblo SDK.
//
// the Koblo SDK is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// the Koblo SDK is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Koblo Stools. If not, see <http://www.gnu.org/licenses/>.
class CX3DisplayConverter : public virtual de::IDisplayConverter
{
public:
CX3DisplayConverter();
virtual ~CX3DisplayConverter();
virtual void Destroy();
//! IDisplayConverter override
virtual void Value2String(tint32 iValue, tchar* psz);
//! IDisplayConverter override
virtual tint32 String2Value(const tchar* psz) throw (IException*);
//! IDisplayConverter override
virtual void SetPostFix(const tchar* psz);
//! IDisplayConverter override
virtual void AddFixedString(tint32 iValue, const tchar* psz);
protected:
de::IDisplayConverter* mpConverter;
};
|
/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_GR_MULTIPLY_CONJUGATE_CC_H
#define INCLUDED_GR_MULTIPLY_CONJUGATE_CC_H
#include <gr_core_api.h>
#include <gr_sync_block.h>
class gr_multiply_conjugate_cc;
typedef boost::shared_ptr<gr_multiply_conjugate_cc>
gr_multiply_conjugate_cc_sptr;
GR_CORE_API gr_multiply_conjugate_cc_sptr
gr_make_multiply_conjugate_cc (size_t vlen=1);
/*!
* \brief Multiplies a stream by the conjugate of the second stream
* \ingroup math_blk
*/
class GR_CORE_API gr_multiply_conjugate_cc : public gr_sync_block
{
private:
friend GR_CORE_API gr_multiply_conjugate_cc_sptr
gr_make_multiply_conjugate_cc (size_t vlen);
gr_multiply_conjugate_cc (size_t vlen);
size_t d_vlen;
public:
virtual int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
#endif /* INCLUDED_GR_MULTIPLY_CONJUGATE_CC_H */
|
#ifndef SXRMBFOURELEMENTVORTEXDETECTORVIEW_H
#define SXRMBFOURELEMENTVORTEXDETECTORVIEW_H
#include "ui/beamline/AMXRFDetailedDetectorView.h"
#include "beamline/SXRMB/SXRMBFourElementVortexDetector.h"
/// Sublcass that allows for setting the maximum energy and peaking time to the four element vortex detector.
class SXRMBFourElementVortexDetectorView : public AMXRFDetailedDetectorView
{
Q_OBJECT
public:
/// Constructor.
SXRMBFourElementVortexDetectorView(SXRMBFourElementVortexDetector *detector, QWidget *parent = 0);
/// Destructor.
virtual ~SXRMBFourElementVortexDetectorView(){}
/// Re-implementing to add the peaking time spin box.
virtual void buildDetectorView();
protected slots:
/// Handles setting the peaking time.
void onPeakingTimeChanged();
protected:
/// Implementation method for setMaximumEnergy. The view handles all the visuals, but if there is something specific that needs to be passed on to the detector or viewing subclass, you can implement that here.
virtual void setMaximumEnergyImplementation(double energy);
/// Pointer to the actual VESPERSSingleElementVortexDetector for setting the peaking time and maximum energy.
SXRMBFourElementVortexDetector *fourElementVortexDetector_;
/// Spin box for the peaking time.
QDoubleSpinBox *peakingTimeSpinBox_;
};
#endif // SXRMBFOURELEMENTVORTEXDETECTORVIEW_H
|
#include <stdio.h>
enum error { NOT_FOUND = 404, SERVER_ERRO = 500, INVALID_OPERATION = 505 };
int main() {
int i = 3;
switch (i) {
case 0:
puts("Nol");
break;
case 1:
puts("Odin");
break;
case 77:
case 777:
case 7777:
puts("Bingo!");
break;
default:
puts("Error");
break;
}
}
|
/*
* Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
*
* Author: ZouYa <zouya@uniontech.com>
*
* Maintainer: WangYu <wangyu@uniontech.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
* 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 DBUSUTILS_H
#define DBUSUTILS_H
#include <QVariant>
#include <QDBusConnection>
class DBusUtils
{
public:
DBusUtils();
static QVariant readDBusProperty(const QString &service, const QString &path, const QString &interface = QString(), const char *propert = "", QDBusConnection connection = QDBusConnection::sessionBus());
// static QVariant readDBusMethod(const QString &service, const QString &path, const QString &interface, const char *method);
};
#endif // DBUSUTILS_H
|
/*
* include/ioasync.h
*
* 2016-01-01 written by Hoyleeson <hoyleeson@gmail.com>
* Copyright (C) 2015-2016 by Hoyleeson.
*
* 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.
*
*/
#ifndef _ANZZC_IOASYNC_H
#define _ANZZC_IOASYNC_H
#include <sys/socket.h>
#include "types.h"
#include "packet.h"
#include "poller.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct iohandler iohandler_t;
typedef struct ioasync ioasync_t;
#if 0
typedef void (*handle_func) (void *priv, uint8_t *data, int len);
typedef void (*handlefrom_func) (void *priv, uint8_t *data, int len,
void *from);
typedef void (*accept_func) (void *priv, int acceptfd);
typedef void (*close_func) (void *priv);
#endif
pack_buf_t *iohandler_pack_buf_alloc(iohandler_t *ioh);
void iohandler_pack_buf_free(pack_buf_t *pkb);
void iohandler_send(iohandler_t *ioh, const uint8_t *data, int len);
void iohandler_sendto(iohandler_t *ioh, const uint8_t *data, int len,
struct sockaddr *to);
void iohandler_pkt_send(iohandler_t *ioh, pack_buf_t *pkb);
void iohandler_pkt_sendto(iohandler_t *ioh, pack_buf_t *pkb,
struct sockaddr *to);
iohandler_t *iohandler_create(ioasync_t *aio, int fd,
void (*handle)(void *, uint8_t *, int), void (*close)(void *), void *priv);
iohandler_t *iohandler_accept_create(ioasync_t *aio, int fd,
void (*accept)(void *, int), void (*close)(void *), void *priv);
iohandler_t *iohandler_udp_create(ioasync_t *aio, int fd,
void (*handlefrom)(void *, uint8_t *, int, void *),
void (*close)(void *), void *priv);
void iohandler_shutdown(iohandler_t *ioh);
ioasync_t *ioasync_init(void);
//void ioasync_loop(ioasync_t *aio);
void ioasync_release(ioasync_t *aio);
void global_ioasync_init(void);
void global_ioasync_release(void);
ioasync_t *get_global_ioasync(void);
#ifdef __cplusplus
}
#endif
#endif
|
// ******************************************************************************
// Filename: SoundEffectsEnum.h
// Project: Vox
// Author: Steven Ball
//
// Purpose:
// An enum list of all of the sound effects in the game.
//
// Revision History:
// Initial Revision - 13/06/16
//
// Copyright (c) 2005-2016, Steven Ball
// ******************************************************************************
#pragma once
enum eSoundEffect
{
eSoundEffect_None = 0,
eSoundEffect_FootStep01,
eSoundEffect_FootStep02,
eSoundEffect_FootStep03,
eSoundEffect_FootStep04,
eSoundEffect_JumpLand,
eSoundEffect_EquipCloth,
eSoundEffect_EquipSword,
eSoundEffect_EquipMove,
eSoundEffect_ChestOpen,
eSoundEffect_BowDraw,
eSoundEffect_ArrowRelease,
eSoundEffect_FireballCast,
eSoundEffect_MimicJump,
eSoundEffect_MimicDie,
eSoundEffect_NUM,
};
extern string g_soundEffectFilenames[eSoundEffect_NUM];
|
/*
* linux/arch/unicore/include/mach/pm.h
*
* Code specific to PKUnity SoC and UniCore ISA
*
* Copyright (C) 2001-2010 GUAN Xue-tao
*
* 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 __PUV3_PM_H__
#define __PUV3_PM_H__
#include <linux/suspend.h>
struct puv3_cpu_pm_fns
{
int save_count;
void (*save)(unsigned long *);
void (*restore)(unsigned long *);
int (*valid)(suspend_state_t state);
void (*enter)(suspend_state_t state);
int (*prepare)(void);
void (*finish)(void);
};
extern struct puv3_cpu_pm_fns *puv3_cpu_pm_fns;
/* sleep.S */
extern void puv3_cpu_suspend(unsigned int);
extern void puv3_cpu_resume(void);
extern int puv3_pm_enter(suspend_state_t state);
/* Defined in hibernate_asm.S */
extern int restore_image(pgd_t *resume_pg_dir, struct pbe *restore_pblist);
extern struct pbe *restore_pblist;
#endif
|
/**
* \file RMF/internal/SharedData.h
* \brief Handle read/write of Model data from/to files.
*
* Copyright 2007-2017 IMP Inventors. All rights reserved.
*
*/
#ifndef RMF_INTERNAL_BACKWARDS_IO_BASE_H
#define RMF_INTERNAL_BACKWARDS_IO_BASE_H
#include "RMF/config.h"
#include "RMF/ID.h"
#include "RMF/constants.h"
RMF_ENABLE_WARNINGS
namespace RMF {
namespace backends {
class BackwardsIOBase {
std::string path_;
FrameID loaded_frame_;
public:
BackwardsIOBase(std::string path) : path_(path) {}
std::string get_file_path() const { return path_; }
void set_loaded_frame(FrameID frame) { loaded_frame_ = frame; }
FrameID get_loaded_frame() const { return loaded_frame_; }
};
} // namespace internal
} /* namespace RMF */
RMF_DISABLE_WARNINGS
#endif /* RMF_INTERNAL_BACKWARDS_IO_BASE_H */
|
/* banfunc.h -- extension functions for the pta program ban
Rutger van Haasteren 15 August 2007 haasteren@strw.leidenuniv.nl
Copyright (C) 2005-2007 Rutger van Haasteren.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
// Minimum version of the configfile that is compatible with this release
#define CONFIG_VERSION_MIN 0.20
// We want to be able to use the linal classes
#include "linal.h"
#include "config.h"
#ifndef __BANFUNC_H__
#define __BANFUNC_H__
// Check were the definition of pi really is
#ifndef PI
#define PI 3.14159265358979323846264338327950288419716939937510
#endif
#ifndef NSPERYEAR
#define NSPERYEAR 31557600000000000.0
#define SPERYEAR 31557600.0
#endif
// The dispersion constant in seconds
#ifndef DM_K
// #define DM_K 4.15e-3 // Units of Kj's paper (check these)
#define DM_K 241.0 // GHz^-2 cm^-3 pc s^-1
#endif
int KbHit();
bool BANFuncInitialize(int nProcessRank=0); // Initialise some constantes, functions and random numbers
void InitProgressBar(const char *strMsg=NULL);
void DrawProgressBar(int nPercent=0);
void FinishProgressBar();
// For status report
void PrintStatus(const char *str);
void PrintFailed();
void PrintSuccess();
// For (MCMC) updates
void PrintUpdate(const char *str);
void FinishUpdate();
int n_min(int *pnArray, int nLength);
double d_min(double *pdArray, int nLength);
void d_swap(double &x, double &y);
void QuickSort(double *pdBufferX, double *pdBufferY, double *pdBufferZ, double *pdBufferComp, int left, int right);
void QuickSort(double *pdBuffer, int left, int right);
void QuickSort(double **ppdBuffer, double *pdBufferZ, int nDimensions, int left, int right);
// __BANFUNC_H__
#endif
|
/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* 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 version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2011, 2014, Intel Corporation.
*/
#define DEBUG_SUBSYSTEM S_LLITE
#include "../include/lustre/lustre_idl.h"
#include "../include/cl_object.h"
#include "../include/obd.h"
#include "../include/obd_support.h"
#include "llite_internal.h"
#include "vvp_internal.h"
static inline struct vvp_req *cl2vvp_req(const struct cl_req_slice *slice)
{
return container_of0(slice, struct vvp_req, vrq_cl);
}
/**
* Implementation of struct cl_req_operations::cro_attr_set() for VVP
* layer. VVP is responsible for
*
* - o_[mac]time
*
* - o_mode
*
* - o_parent_seq
*
* - o_[ug]id
*
* - o_parent_oid
*
* - o_parent_ver
*
* - o_ioepoch,
*
*/
static void vvp_req_attr_set(const struct lu_env *env,
const struct cl_req_slice *slice,
const struct cl_object *obj,
struct cl_req_attr *attr, u64 flags)
{
struct inode *inode;
struct obdo *oa;
u32 valid_flags;
oa = attr->cra_oa;
inode = vvp_object_inode(obj);
valid_flags = OBD_MD_FLTYPE;
if (slice->crs_req->crq_type == CRT_WRITE)
{
if (flags & OBD_MD_FLEPOCH)
{
oa->o_valid |= OBD_MD_FLEPOCH;
oa->o_ioepoch = ll_i2info(inode)->lli_ioepoch;
valid_flags |= OBD_MD_FLMTIME | OBD_MD_FLCTIME |
OBD_MD_FLUID | OBD_MD_FLGID;
}
}
obdo_from_inode(oa, inode, valid_flags & flags);
obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID))
{
oa->o_parent_oid++;
}
memcpy(attr->cra_jobid, ll_i2info(inode)->lli_jobid,
LUSTRE_JOBID_SIZE);
}
static void vvp_req_completion(const struct lu_env *env,
const struct cl_req_slice *slice, int ioret)
{
struct vvp_req *vrq;
if (ioret > 0)
{
cl_stats_tally(slice->crs_dev, slice->crs_req->crq_type, ioret);
}
vrq = cl2vvp_req(slice);
kmem_cache_free(vvp_req_kmem, vrq);
}
static const struct cl_req_operations vvp_req_ops =
{
.cro_attr_set = vvp_req_attr_set,
.cro_completion = vvp_req_completion
};
int vvp_req_init(const struct lu_env *env, struct cl_device *dev,
struct cl_req *req)
{
struct vvp_req *vrq;
int result;
vrq = kmem_cache_zalloc(vvp_req_kmem, GFP_NOFS);
if (vrq)
{
cl_req_slice_add(req, &vrq->vrq_cl, dev, &vvp_req_ops);
result = 0;
}
else
{
result = -ENOMEM;
}
return result;
}
|
/*Copyright (C) 2012-2014 Carsten Paproth
This file is part of Skat-Konferenz.
Skat-Konferenz 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.
Skat-Konferenz 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 Skat-Konferenz. If not, see <http://www.gnu.org/licenses/>.*/
#ifndef SK_BIDBUTTON_H
#define SK_BIDBUTTON_H
#include <FL/Fl_Button.H>
#include <set>
namespace SK {
class BidButton : public Fl_Button {
std::set<unsigned> bidorder;
std::set<unsigned>::iterator minbid;
std::set<unsigned>::iterator maxbid;
std::set<unsigned>::iterator bid;
bool bidding;
int handle(int);
public:
BidButton(int, int, int, int, const char* = 0);
void reset(unsigned, bool);
};
}
#endif
|
#ifndef MONEWPROJECT_H
#define MONEWPROJECT_H
#include "moDirectorTypes.h"
#include "moIDirectorActions.h"
//(*Headers(moNewProject)
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/dialog.h>
//*)
class moNewProject: public wxDialog
{
public:
moNewProject(wxWindow* parent,wxWindowID id=wxID_ANY);
virtual ~moNewProject();
const moProjectDescriptor& GetProjectDescriptor() {
return m_ProjectDescriptor;
}
//(*Declarations(moNewProject)
wxTextCtrl* DirTextCtrl;
wxStaticText* StaticText2;
wxButton* ButtonBrowse;
wxStaticText* StaticText1;
wxButton* OkButton;
wxTextCtrl* ProjectNameTextCtrl;
wxButton* CancelButton;
//*)
protected:
//(*Identifiers(moNewProject)
static const long ID_DIRTEXTCTRL;
static const long ID_STATICTEXT1;
static const long ID_NEWPROJECT_BROWSE;
static const long ID_STATICTEXT2;
static const long ID_NAMETEXTCTRL;
static const long ID_NEWPROJECT_OK;
static const long ID_NEWPROJECT_CANCEL;
//*)
private:
//(*Handlers(moNewProject)
void OnOkClick(wxCommandEvent& event);
void OnCancelClick(wxCommandEvent& event);
void OnBrowseClick(wxCommandEvent& event);
void OnDirTextCtrlText(wxCommandEvent& event);
void OnProjectNameTextCtrlText(wxCommandEvent& event);
//*)
moProjectDescriptor m_ProjectDescriptor;
DECLARE_EVENT_TABLE()
};
#endif
|
/*
*******************************************************************************
\file belt_lcl.c
\brief STB 34.101.31 (belt): local functions
\project bee2 [cryptographic library]
\author (C) Sergey Agievich [agievich@{bsu.by|gmail.com}]
\created 2012.12.18
\version 2020.03.20
\license This program is released under the GNU General Public License
version 3. See Copyright Notices in bee2/info.h.
*******************************************************************************
*/
#include "bee2/core/mem.h"
#include "bee2/core/u32.h"
#include "bee2/core/util.h"
#include "bee2/crypto/belt.h"
#include "bee2/math/pp.h"
#include "bee2/math/ww.h"
#include "belt_lcl.h"
/*
*******************************************************************************
Арифметика чисел
*******************************************************************************
*/
void beltBlockAddBitSizeU32(u32 block[4], size_t count)
{
// block <- block + 8 * count
register u32 carry = (u32)count << 3;
#if (B_PER_S < 32)
carry = (block[0] += carry) < carry;
carry = (block[1] += carry) < carry;
carry = (block[2] += carry) < carry;
block[3] += carry;
#else
register size_t t = count >> 29;
carry = (block[0] += carry) < carry;
if ((block[1] += carry) < carry)
block[1] = (u32)t;
else
carry = (block[1] += (u32)t) < (u32)t;
t >>= 16, t >>= 16;
if ((block[2] += carry) < carry)
block[2] = (u32)t;
else
carry = (block[2] += (u32)t) < (u32)t;
t >>= 16, t >>= 16;
block[3] += carry;
block[3] += (u32)t;
t = 0;
#endif
carry = 0;
}
void beltHalfBlockAddBitSizeW(word block[W_OF_B(64)], size_t count)
{
// block <- block + 8 * count
register word carry = (word)count << 3;
#if (B_PER_W == 16)
register size_t t = count >> 13;
carry = (block[0] += carry) < carry;
if ((block[1] += carry) < carry)
block[1] = (word)t;
else
carry = (block[1] += (word)t) < (word)t;
t >>= 8, t >>= 8;
if ((block[2] += carry) < carry)
block[2] = (word)t;
else
carry = (block[2] += (word)t) < (word)t;
t >>= 8, t >>= 8;
block[3] += carry;
block[3] += (word)t;
#elif (B_PER_W == 32)
register size_t t = count;
carry = (block[0] += carry) < carry;
t >>= 15, t >>= 14;
block[1] += carry;
block[1] += (u32)t;
t = 0;
#elif (B_PER_W == 64)
block[0] += carry;
#else
#error "Unsupported word size"
#endif // B_PER_W
carry = 0;
}
/*
*******************************************************************************
Арифметика многочленов
*******************************************************************************
*/
void beltPolyMul(word c[], const word a[], const word b[], void* stack)
{
const size_t n = W_OF_B(128);
word* prod = (word*)stack;
stack = prod + 2 * n;
// умножить
ppMul(prod, a, n, b, n, stack);
// привести по модулю
ppRedBelt(prod);
wwCopy(c, prod, n);
}
size_t beltPolyMul_deep()
{
const size_t n = W_OF_B(128);
return O_OF_W(2 * n) + ppMul_deep(n, n);
}
/*
*******************************************************************************
Умножение на многочлен C(x) = x mod (x^128 + x^7 + x^2 + x + 1)
\remark t = (старший бит block ненулевой) ? x^7 + x^2 + x + 1 : 0 [регулярно].
*******************************************************************************
*/
void beltBlockMulC(u32 block[4])
{
register u32 t = ~((block[3] >> 31) - U32_1) & 0x00000087;
block[3] = (block[3] << 1) ^ (block[2] >> 31);
block[2] = (block[2] << 1) ^ (block[1] >> 31);
block[1] = (block[1] << 1) ^ (block[0] >> 31);
block[0] = (block[0] << 1) ^ t;
t = 0;
}
|
#pragma once
#include <opencv2/opencv.hpp>
#include <QtCore/qmutex.h>
#include <libfreenect/libfreenect.hpp>
namespace iez_private {
class ImageSourceFreenectDevice_private:public Freenect::FreenectDevice
{
public:
ImageSourceFreenectDevice_private(freenect_context *_ctx, int _index);
~ImageSourceFreenectDevice_private(void);
// int init(void);
bool isInitialized();
cv::Mat getDepthMat() const;
cv::Mat getColorMat() const;
int getSequence() { return m_sequence; }
int streamInit(freenect_resolution resolution);
protected:
int deviceInit(void);
// Do not call directly even in child
void VideoCallback(void *video, uint32_t timestamp)
{
QMutexLocker lock(&color_mutex);
m_sequence++;
memcpy(m_colorMat.data, video, m_height*m_width*3);
}
// Do not call directly even in child
void DepthCallback(void *depth, uint32_t timestamp)
{
QMutexLocker lock(&depth_mutex);
memcpy(m_depthMat.data, depth, m_width*m_height*2);
}
cv::Mat m_depthMat;
cv::Mat m_colorMat;
mutable QMutex depth_mutex;
mutable QMutex color_mutex;
const int m_fps;
int m_sequence;
int m_width, m_height;
bool m_initialized;
// uint16_t m_t_gamma[2048];
};
}
|
/*
BOMC - Monte Carlo based generator of defect-free amorphous samples of Si and SiO2
If you publish research done using Bomc then you are kindly asked to cite:
S. von Alfthan, A. Kuronen, and K. Kaski, Phys. Rev. B 68, 073203 (2003).
Copyright Sebastian von Alfthan (galfthan at iki dot fi) 2002, 2003, 2014.
This file is part of Bomc.
Bomc 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.
Bomc 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 Bomc. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SHARED
#define SHARED
/*==== MACROS ====*/
/*the PERIODIC macros assume we have par-> */
/*#define MAKEPERIODIC(r,hlength,length) MAKEPERIODIC_DEF_DIM(r,-hlength,hlength,length);*/
/*#define MAKEPERIODIC(r,hlength,length) ( -rint(r/length)*length)*/
/*#define PERIODICXYZ(r,num) if(par->periodic[num]) MAKEPERIODIC(r,par->hBox[num],par->box[num]);*/
#define MAKEPERIODIC_DEF_DIM(r,left,right,delta) (r>right)?r-=delta:( (r<left)?r+=delta:0.0 );
#define MAKEPERIODIC(r,length) (r-=rint(r/length)*length)
//#define SYSTEMISPERIODIC
//#define PERIODICXYZ(r,num) if(par->periodic[num]) { (r+par->hBox[num])/ }
#define PERIODICXYZ(r,num) if(par->periodic[num]) MAKEPERIODIC_DEF_DIM(r,-par->hBox[num],par->hBox[num],par->box[num]);
/*#define PERIODICXYZ(r,num) if(par->periodic[num]) MAKEPERIODIC(r,par->box[num]);*/
#define PERIODIC(rx,ry,rz) PERIODICXYZ(rx,0); PERIODICXYZ(ry,1); PERIODICXYZ(rz,2);
//#define PERIODIC(rx,ry,rz) PERIODICXYZ(rx,0); PERIODICXYZ(ry,1); PERIODICXYZ(rz,2);
#define POW2(x) ((x) * (x))
#define POW3(x) (POW2(x)*(x))
#define POW4(x) (POW2(x)*POW2(x))
#define POW5(x) (POW3(x)*POW2(x))
#define POW6(x) (POW3(x)*POW3(x))
#define POW7(x) (POW3(x)*POW4(x))
#define POW8(x) (POW4(x)*POW4(x))
#define POW9(x) (POW5(x)*POW4(x))
#define POW10(x) (POW5(x)*POW5(x))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define MAX3(x,y,z) (MAX((x),(y))>(z)?MAX((x),(y)):(z))
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MIN3(x,y,z) (MIN((x),(y))<(z)?MIN((x),(y)):(z))
#define LENGTH2(x,y,z) (POW2(x)+POW2(y)+POW2(z))
#define VOLUME (par->box[0]*par->box[1]*par->box[2])
#define DEBUG 0
//#define FLAG(f,i) (( (f) >> (i))&1)
//#define ATOM_IN_SI(f) FLAG(f,0)
/*======UNITS========*/
/*=1ps, in seconds */
#define UNITTIME 1.0e-12
/*=1Å in meters */
#define UNITDIST 1.0e-10
/*=1u, in kg*/
#define UNITMASS 1.66053873e-27
//#define UNITCHARGE 4.074972637944948e-17 /*in coulomb, =sqrt(mass*length)*length/time */
/*with this unitcharge the energy in the coulomb interactions will be in the correct units*/
//#define ETOUNITCHARGE 3.93175005663e-3 /*ECHARGE/UNITCHARGE*/
/*=1e, in coulomb*/
#define ECHARGE 1.60217739e-19
#define UNITCHARGE ECHARGE
#define ETOUNITCHARGE 1.0
#define TOEV 1.036426266132741e-04
/*= mass*(length/time)^2/echarge */
/*this is the value of the energy in EV when the energy is 1 in the UNITS defined above*/
/*based on the UNITS defined above, make sure it is correct!!!*/
#define EV 9.648539724213475e+03
/*TOEV^-1.0 */
/*this is the value EV in the UNITS defined above, */
/*based on the UNITS defined above, make sure it is correct!!!*/
#define PASCAL 6.022141982800968e-08/*=U_time^2*U_dist/U_mass*/
#define TOPASCAL 16.605387e6
#define JOULETOEV 6.2415097e+18
#define EVTOJOULE ECHARGE
#define TOJOULE 1.66053873e-23
#define JOULE 6.022141982800966e+22
#define KCALTOEV 2.6131953e+22
/*========CONSTANTS ========*/
#define EPSILON0_SI 8.8541878e-12
/*Vs/Am*/
#define KB_JOULE 1.3806503e-23
/*joule/k */
#define KBEV 8.617342239757910e-05
/*in ev/K */
#define AVOGADRO 6.022142e23
#define AMORPH_FLAG 0
#define FIXED_FLAG 1
#define CRYST_FLAG 2
#define INTERFACE_FLAG 3
#define SI_ATYPE 1
#define O_ATYPE 0
#define FALSE 0
#define TRUE 1
#define NUMOFATYPES 13
/*num of possible atomic types, increase if neccessary*/
/*======= STRUCTS =======*/
struct systemPos
{
int nAtoms; /*number of atoms in system*/
double *x,*y,*z; /*position of atoms*/
double *prevx,*prevy,*prevz; /*the positions of the atoms after the last accepted step*/
double *xa,*ya,*za; /*force on each atom*/
int *aType; /*number which tells of which material the atom is
atypes are:
0 1
O Si
*/
double *enPot; /*potential energy of each atom*/
double *prevEnPot; /*contains the potentialEnergy of the system after the last accepted step (corresponding to prevxyz*/
long *aFlag; /*addtitional information about each atom, see
FLAG macro*/
};
typedef struct partStruct{
int n;
int *list;
int *table;
} sysPart;
struct parameters{
int periodic[3]; /*tells if the system is periodic in x,y,z direction */
int varVol[3];
double box[3],hBox[3],minhBox2; /*the size and half the size of the system in A and the min of the hBoxes squared*/
double volume;
double skin; /*skin (used by potentials) in A*/
char aName[NUMOFATYPES][4]; /*tells the name of a certain atype*/
double aMass[NUMOFATYPES]; /*tells the mass of a certain atype (in internal units)*/
double kTrand;
double kT;
double pressure;
long *seed; /*seed number for random number generator*/
int interfaceSys; /* tells if we have a system with a interface between si/siO2 . if 1 then bond switches are not performed in Si area and simAnneal is biased towards siO2 */
};
#endif
|
/*
* Synopsys AXS10X SDP I2S PLL clock driver
*
* Copyright (C) 2016 Synopsys
*
* 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/platform_device.h>
#include <linux/module.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/device.h>
#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/of.h>
/* PLL registers addresses */
#define PLL_IDIV_REG 0x0
#define PLL_FBDIV_REG 0x4
#define PLL_ODIV0_REG 0x8
#define PLL_ODIV1_REG 0xC
struct i2s_pll_cfg
{
unsigned int rate;
unsigned int idiv;
unsigned int fbdiv;
unsigned int odiv0;
unsigned int odiv1;
};
static const struct i2s_pll_cfg i2s_pll_cfg_27m[] =
{
/* 27 Mhz */
{ 1024000, 0x104, 0x451, 0x10E38, 0x2000 },
{ 1411200, 0x104, 0x596, 0x10D35, 0x2000 },
{ 1536000, 0x208, 0xA28, 0x10B2C, 0x2000 },
{ 2048000, 0x82, 0x451, 0x10E38, 0x2000 },
{ 2822400, 0x82, 0x596, 0x10D35, 0x2000 },
{ 3072000, 0x104, 0xA28, 0x10B2C, 0x2000 },
{ 2116800, 0x82, 0x3CF, 0x10C30, 0x2000 },
{ 2304000, 0x104, 0x79E, 0x10B2C, 0x2000 },
{ 0, 0, 0, 0, 0 },
};
static const struct i2s_pll_cfg i2s_pll_cfg_28m[] =
{
/* 28.224 Mhz */
{ 1024000, 0x82, 0x105, 0x107DF, 0x2000 },
{ 1411200, 0x28A, 0x1, 0x10001, 0x2000 },
{ 1536000, 0xA28, 0x187, 0x10042, 0x2000 },
{ 2048000, 0x41, 0x105, 0x107DF, 0x2000 },
{ 2822400, 0x145, 0x1, 0x10001, 0x2000 },
{ 3072000, 0x514, 0x187, 0x10042, 0x2000 },
{ 2116800, 0x514, 0x42, 0x10001, 0x2000 },
{ 2304000, 0x619, 0x82, 0x10001, 0x2000 },
{ 0, 0, 0, 0, 0 },
};
struct i2s_pll_clk
{
void __iomem *base;
struct clk_hw hw;
struct device *dev;
};
static inline void i2s_pll_write(struct i2s_pll_clk *clk, unsigned int reg,
unsigned int val)
{
writel_relaxed(val, clk->base + reg);
}
static inline unsigned int i2s_pll_read(struct i2s_pll_clk *clk,
unsigned int reg)
{
return readl_relaxed(clk->base + reg);
}
static inline struct i2s_pll_clk *to_i2s_pll_clk(struct clk_hw *hw)
{
return container_of(hw, struct i2s_pll_clk, hw);
}
static inline unsigned int i2s_pll_get_value(unsigned int val)
{
return (val & 0x3F) + ((val >> 6) & 0x3F);
}
static const struct i2s_pll_cfg *i2s_pll_get_cfg(unsigned long prate)
{
switch (prate)
{
case 27000000:
return i2s_pll_cfg_27m;
case 28224000:
return i2s_pll_cfg_28m;
default:
return NULL;
}
}
static unsigned long i2s_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct i2s_pll_clk *clk = to_i2s_pll_clk(hw);
unsigned int idiv, fbdiv, odiv;
idiv = i2s_pll_get_value(i2s_pll_read(clk, PLL_IDIV_REG));
fbdiv = i2s_pll_get_value(i2s_pll_read(clk, PLL_FBDIV_REG));
odiv = i2s_pll_get_value(i2s_pll_read(clk, PLL_ODIV0_REG));
return ((parent_rate / idiv) * fbdiv) / odiv;
}
static long i2s_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{
struct i2s_pll_clk *clk = to_i2s_pll_clk(hw);
const struct i2s_pll_cfg *pll_cfg = i2s_pll_get_cfg(*prate);
int i;
if (!pll_cfg)
{
dev_err(clk->dev, "invalid parent rate=%ld\n", *prate);
return -EINVAL;
}
for (i = 0; pll_cfg[i].rate != 0; i++)
if (pll_cfg[i].rate == rate)
{
return rate;
}
return -EINVAL;
}
static int i2s_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct i2s_pll_clk *clk = to_i2s_pll_clk(hw);
const struct i2s_pll_cfg *pll_cfg = i2s_pll_get_cfg(parent_rate);
int i;
if (!pll_cfg)
{
dev_err(clk->dev, "invalid parent rate=%ld\n", parent_rate);
return -EINVAL;
}
for (i = 0; pll_cfg[i].rate != 0; i++)
{
if (pll_cfg[i].rate == rate)
{
i2s_pll_write(clk, PLL_IDIV_REG, pll_cfg[i].idiv);
i2s_pll_write(clk, PLL_FBDIV_REG, pll_cfg[i].fbdiv);
i2s_pll_write(clk, PLL_ODIV0_REG, pll_cfg[i].odiv0);
i2s_pll_write(clk, PLL_ODIV1_REG, pll_cfg[i].odiv1);
return 0;
}
}
dev_err(clk->dev, "invalid rate=%ld, parent_rate=%ld\n", rate,
parent_rate);
return -EINVAL;
}
static const struct clk_ops i2s_pll_ops =
{
.recalc_rate = i2s_pll_recalc_rate,
.round_rate = i2s_pll_round_rate,
.set_rate = i2s_pll_set_rate,
};
static int i2s_pll_clk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
const char *clk_name;
const char *parent_name;
struct clk *clk;
struct i2s_pll_clk *pll_clk;
struct clk_init_data init;
struct resource *mem;
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
if (!pll_clk)
{
return -ENOMEM;
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pll_clk->base = devm_ioremap_resource(dev, mem);
if (IS_ERR(pll_clk->base))
{
return PTR_ERR(pll_clk->base);
}
clk_name = node->name;
init.name = clk_name;
init.ops = &i2s_pll_ops;
parent_name = of_clk_get_parent_name(node, 0);
init.parent_names = &parent_name;
init.num_parents = 1;
pll_clk->hw.init = &init;
pll_clk->dev = dev;
clk = devm_clk_register(dev, &pll_clk->hw);
if (IS_ERR(clk))
{
dev_err(dev, "failed to register %s clock (%ld)\n",
clk_name, PTR_ERR(clk));
return PTR_ERR(clk);
}
return of_clk_add_provider(node, of_clk_src_simple_get, clk);
}
static int i2s_pll_clk_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
return 0;
}
static const struct of_device_id i2s_pll_clk_id[] =
{
{ .compatible = "snps,axs10x-i2s-pll-clock", },
{ },
};
MODULE_DEVICE_TABLE(of, i2s_pll_clk_id);
static struct platform_driver i2s_pll_clk_driver =
{
.driver = {
.name = "axs10x-i2s-pll-clock",
.of_match_table = i2s_pll_clk_id,
},
.probe = i2s_pll_clk_probe,
.remove = i2s_pll_clk_remove,
};
module_platform_driver(i2s_pll_clk_driver);
MODULE_AUTHOR("Jose Abreu <joabreu@synopsys.com>");
MODULE_DESCRIPTION("Synopsys AXS10X SDP I2S PLL Clock Driver");
MODULE_LICENSE("GPL v2");
|
//
// Created by Lorenzo Nuti and Paolo Valcepina on 11/07/17.
//
#ifndef CATULA_BADGESTARSKULL_H
#define CATULA_BADGESTARSKULL_H
#include "ModelGame.h"
#include "MainCharacter.h"
#include "Badge.h"
class BadgeStarSkull : public Badge {
public:
BadgeStarSkull(const std::string &className, const std::string &name, const std::string &description, float goal,
bool memorize);
virtual void update() override;
virtual void detach() override;
private:
virtual void attach() override;
int previousScore;
};
#endif //CATULA_BADGESTARSKULL_H
|
//
// Author: Shervin Aflatooni
//
#pragma once
#include <glm/glm.hpp>
struct Vertex
{
glm::vec3 position;
glm::vec2 texCoord;
glm::vec3 normal;
glm::vec3 tangent;
Vertex(const glm::vec3& position, const glm::vec2& texCoord = glm::vec2(0, 0), const glm::vec3& normal = glm::vec3(0, 0, 0), const glm::vec3& tangent = glm::vec3(0, 0, 0))
{
this->position = position;
this->texCoord = texCoord;
this->normal = normal;
this->tangent = tangent;
}
};
|
#include "appDrawer.h"
#include "clock.h"
#include "fileManager.h"
#include "game.h"
#include "homeMenu.h"
#include "language.h"
#include "lockScreen.h"
#include "powerMenu.h"
#include "screenshot.h"
#include "settingsMenu.h"
#include "utils.h"
void appDrawerUnload()
{
sf2d_free_texture(backdrop);
sf2d_free_texture(ic_launcher_clock);
sf2d_free_texture(ic_launcher_filemanager);
sf2d_free_texture(ic_launcher_gallery);
sf2d_free_texture(ic_launcher_game);
}
int appDrawer()
{
struct appDrawerFontColor fontColor2;
FILE * file = fopen(appDrawerFontColorPath, "r");
fscanf(file, "%d %d %d", &fontColor2.r, &fontColor2.g, &fontColor2.b);
fclose(file);
if (DARK == 1)
{
load_PNG(backdrop, "/3ds/Cyanogen3DS/system/settings/Dark/backdropDark.png");
fontColor = WHITE;
}
else
{
load_PNG(backdrop, backdropPath);
fontColor = RGBA8(fontColor2.r, fontColor2.g, fontColor2.b, 255);
}
load_PNG(ic_launcher_clock, clockPath);
load_PNG(ic_launcher_filemanager, fmPath);
load_PNG(ic_launcher_gallery, galleryPath);
load_PNG(ic_launcher_game, gamePath);
setBilinearFilter(1, ic_launcher_clock);
setBilinearFilter(1,ic_launcher_filemanager);
setBilinearFilter(1, ic_launcher_gallery);
setBilinearFilter(1, ic_launcher_game);
sf2d_set_clear_color(RGBA8(0, 0, 0, 0));
while (aptMainLoop())
{
hidScanInput();
u32 kDown = hidKeysDown();
sf2d_start_frame(switchDisplay(screenDisplay), GFX_LEFT);
sf2d_draw_texture(background, 0, 0);
if (screenDisplay == 1)
sf2d_draw_texture_scale(backdrop, 0, 24, 0.8, 1.0);
else
sf2d_draw_texture(backdrop, 0, 24);
if (cursor(20, 65, 45, 90))
sf2d_draw_texture_scale(ic_launcher_browser, 20, 40, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_browser, 25, 45);
sftd_draw_textf(robotoS12, 23, 100, fontColor, 12, "%s", lang_appDrawer[language][0]);
if (cursor(95, 140, 45, 90))
sf2d_draw_texture_scale(ic_launcher_clock, 95, 40, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_clock, 100, 45);
sftd_draw_textf(robotoS12, 103, 100, fontColor, 12, "%s", lang_appDrawer[language][1]);
if (cursor(170, 215, 45, 90))
sf2d_draw_texture_scale(ic_launcher_filemanager, 170, 40, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_filemanager, 175, 45);
sftd_draw_textf(robotoS12, 172, 100, fontColor, 12, "%s", lang_appDrawer[language][2]);
if (cursor(245, 290, 45, 90))
sf2d_draw_texture_scale(ic_launcher_gallery, 245, 40, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_gallery, 250, 45);
sftd_draw_textf(robotoS12, 252, 100, fontColor, 12, "%s", lang_appDrawer[language][3]);
if (screenDisplay == 0)
{
if (cursor(320, 365, 45, 90))
sf2d_draw_texture_scale(ic_launcher_game, 320, 40, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_game, 325, 45);
sftd_draw_textf(robotoS12, 330, 100, fontColor, 12, "%s", lang_appDrawer[language][4]);
if (cursor(20, 65, 125, 170))
sf2d_draw_texture_scale(ic_launcher_messenger, 20, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_messenger, 25, 125);
sftd_draw_textf(robotoS12, 21, 180, fontColor, 12, "%s", lang_appDrawer[language][5]);
if (cursor(95, 140, 125, 170))
sf2d_draw_texture_scale(ic_launcher_apollo, 95, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_apollo, 100, 125);
sftd_draw_textf(robotoS12, 103, 180, fontColor, 12, "%s", lang_appDrawer[language][6]);
if (cursor(170, 215, 125, 170))
sf2d_draw_texture_scale(ic_launcher_settings, 170, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_settings, 175, 125);
sftd_draw_textf(robotoS12, 172, 180, fontColor, 12, "%s", lang_appDrawer[language][7]);
digitalTime(352, 2, 0);
batteryStatus(300, 2, 0);
//androidQuickSettings();
}
else if (screenDisplay == 1)
{
if (cursor(20, 65, 125, 170))
sf2d_draw_texture_scale(ic_launcher_game, 20, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_game, 25, 125);
sftd_draw_textf(robotoS12, 26, 180, fontColor, 12, "%s", lang_appDrawer[language][4]);
if (cursor(95, 140, 125, 170))
sf2d_draw_texture_scale(ic_launcher_messenger, 95, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_messenger, 100, 125);
sftd_draw_textf(robotoS12, 90, 180, fontColor, 12, "%s", lang_appDrawer[language][5]);
if (cursor(170, 215, 125, 170))
sf2d_draw_texture_scale(ic_launcher_apollo, 170, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_apollo, 175, 125);
sftd_draw_textf(robotoS12, 180, 180, fontColor, 12, "%s", lang_appDrawer[language][6]);
if (cursor(245, 290, 125, 170))
sf2d_draw_texture_scale(ic_launcher_settings, 245, 120, 1.1, 1.1);
else
sf2d_draw_texture(ic_launcher_settings, 250, 125);
sftd_draw_textf(robotoS12, 250, 180, fontColor, 12, "%s", lang_appDrawer[language][7]);
}
cursorController();
sf2d_end_frame();
switchDisplayModeOn(1);
navbarControls(0);
if (kDown & KEY_Y)
powerMenu();
if (kDown & KEY_L)
lockScreen();
if ((cursor(170, 215, 45, 90)) && (kDown & KEY_A))
{
if (experimentalF == 1)
{
appDrawerUnload();
fileManager();
}
}
else if ((cursor(320, 365, 45, 90)) && (kDown & KEY_A))
{
/*if (experimentalF == 1)
{
appDrawerUnload();
launch3DSX("/3ds/killerman_ghost_buster/killerman_ghost_buster.3dsx");
}*/
}
else if ((cursor(170, 215, 125, 170)) && (kDown & KEY_A))
{
appDrawerUnload();
settingsMenu();
}
if (kDown & KEY_B)
{
appDrawerUnload();
home(); //Returns to home screen
}
if (touch(44, 119, 201, 240) && (kDown & KEY_TOUCH))
home();
captureScreenshot();
sf2d_swapbuffers();
}
appDrawerUnload();
return 0;
}
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
*
* 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/>.
*/
#ifndef SHADER_PARSE_H
#define SHADER_PARSE_H
#include <boolean.h>
#include <file/config_file.h>
#include "../state_tracker.h"
#include <retro_miscellaneous.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GFX_MAX_SHADERS
#define GFX_MAX_SHADERS 16
#endif
#ifndef GFX_MAX_TEXTURES
#define GFX_MAX_TEXTURES 8
#endif
#ifndef GFX_MAX_VARIABLES
#define GFX_MAX_VARIABLES 64
#endif
#ifndef GFX_MAX_PARAMETERS
#define GFX_MAX_PARAMETERS 64
#endif
enum rarch_shader_type
{
RARCH_SHADER_NONE = 0,
RARCH_SHADER_CG,
RARCH_SHADER_HLSL,
RARCH_SHADER_GLSL
};
enum gfx_scale_type
{
RARCH_SCALE_INPUT = 0,
RARCH_SCALE_ABSOLUTE,
RARCH_SCALE_VIEWPORT
};
enum
{
RARCH_FILTER_UNSPEC = 0,
RARCH_FILTER_LINEAR,
RARCH_FILTER_NEAREST
};
enum gfx_wrap_type
{
RARCH_WRAP_BORDER = 0, /* Kinda deprecated, but keep as default.
Will be translated to EDGE in GLES. */
RARCH_WRAP_DEFAULT = RARCH_WRAP_BORDER,
RARCH_WRAP_EDGE,
RARCH_WRAP_REPEAT,
RARCH_WRAP_MIRRORED_REPEAT
};
struct gfx_fbo_scale
{
enum gfx_scale_type type_x;
enum gfx_scale_type type_y;
float scale_x;
float scale_y;
unsigned abs_x;
unsigned abs_y;
bool fp_fbo;
bool srgb_fbo;
bool valid;
};
struct gfx_shader_parameter
{
char id[64];
char desc[64];
float current;
float minimum;
float initial;
float maximum;
float step;
};
struct gfx_shader_pass
{
struct
{
char path[PATH_MAX];
struct
{
char *vertex; // Dynamically allocated. Must be free'd.
char *fragment; // Dynamically allocated. Must be free'd.
} string;
} source;
char alias[64];
struct gfx_fbo_scale fbo;
unsigned filter;
enum gfx_wrap_type wrap;
unsigned frame_count_mod;
bool mipmap;
};
struct gfx_shader_lut
{
char id[64];
char path[PATH_MAX];
unsigned filter;
enum gfx_wrap_type wrap;
bool mipmap;
};
/* This is pretty big, shouldn't be put on the stack.
* Avoid lots of allocation for convenience. */
struct gfx_shader
{
enum rarch_shader_type type;
bool modern; /* Only used for XML shaders. */
char prefix[64];
unsigned passes;
struct gfx_shader_pass pass[GFX_MAX_SHADERS];
unsigned luts;
struct gfx_shader_lut lut[GFX_MAX_TEXTURES];
struct gfx_shader_parameter parameters[GFX_MAX_PARAMETERS];
unsigned num_parameters;
unsigned variables;
struct state_tracker_uniform_info variable[GFX_MAX_VARIABLES];
char script_path[PATH_MAX];
char *script; /* Dynamically allocated. Must be free'd. Only used by XML. */
char script_class[512];
};
bool gfx_shader_read_conf_cgp(config_file_t *conf,
struct gfx_shader *shader);
void gfx_shader_write_conf_cgp(config_file_t *conf,
struct gfx_shader *shader);
void gfx_shader_resolve_relative(struct gfx_shader *shader,
const char *ref_path);
bool gfx_shader_resolve_parameters(config_file_t *conf,
struct gfx_shader *shader);
enum rarch_shader_type gfx_shader_parse_type(const char *path,
enum rarch_shader_type fallback);
#ifdef __cplusplus
}
#endif
#endif
|
#pragma once
#include <stdbool.h>
#include <service.h>
/*typedef enum timer_event_type_t
{
SCENE,
COMMAND
} timer_event_type_t;
typedef struct timer_info_t
{
char* name;
char* event_name;
bool singleshot;
timer_event_type_t event_type;
uint32_t timeout;
uint32_t ticks_left;
} timer_info_t;*/
typedef struct timer_info_t
{
char* name;
int timer_id;
int event_id;
} timer_info_t;
extern bool timer_enabled;
extern variant_stack_t* timer_list;
extern int DT_TIMER;
//service_t* self;
void timer_delete_timer(void* arg);
|
/**
System Interrupts Generated Driver File
@Company:
Microchip Technology Inc.
@File Name:
pin_manager.h
@Summary:
This is the generated manager file for the MPLAB(c) Code Configurator device. This manager
configures the pins direction, initial state, analog setting.
The peripheral pin select, PPS, configuration is also handled by this manager.
@Description:
This source file provides implementations for MPLAB(c) Code Configurator interrupts.
Generation Information :
Product Revision : MPLAB(c) Code Configurator - 4.26
Device : PIC24FJ256GA702
The generated drivers are tested against the following:
Compiler : XC16 1.31
MPLAB : MPLAB X 3.60
Copyright (c) 2013 - 2015 released Microchip Technology Inc. All rights reserved.
Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).
You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.
SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*/
#ifndef _PIN_MANAGER_H
#define _PIN_MANAGER_H
/**
Section: Includes
*/
#include <xc.h>
/**
Section: Device Pin Macros
*/
/**
@Summary
Sets the GPIO pin, RA0, high using LATA0.
@Description
Sets the GPIO pin, RA0, high using LATA0.
@Preconditions
The RA0 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RA0 high (1)
POTEN_SetHigh();
</code>
*/
#define POTEN_SetHigh() _LATA0 = 1
/**
@Summary
Sets the GPIO pin, RA0, low using LATA0.
@Description
Sets the GPIO pin, RA0, low using LATA0.
@Preconditions
The RA0 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RA0 low (0)
POTEN_SetLow();
</code>
*/
#define POTEN_SetLow() _LATA0 = 0
/**
@Summary
Toggles the GPIO pin, RA0, using LATA0.
@Description
Toggles the GPIO pin, RA0, using LATA0.
@Preconditions
The RA0 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Toggle RA0
POTEN_Toggle();
</code>
*/
#define POTEN_Toggle() _LATA0 ^= 1
/**
@Summary
Reads the value of the GPIO pin, RA0.
@Description
Reads the value of the GPIO pin, RA0.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
uint16_t portValue;
// Read RA0
postValue = POTEN_GetValue();
</code>
*/
#define POTEN_GetValue() _RA0
/**
@Summary
Configures the GPIO pin, RA0, as an input.
@Description
Configures the GPIO pin, RA0, as an input.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RA0 as an input
POTEN_SetDigitalInput();
</code>
*/
#define POTEN_SetDigitalInput() _TRISA0 = 1
/**
@Summary
Configures the GPIO pin, RA0, as an output.
@Description
Configures the GPIO pin, RA0, as an output.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RA0 as an output
POTEN_SetDigitalOutput();
</code>
*/
#define POTEN_SetDigitalOutput() _TRISA0 = 0
/**
Section: Function Prototypes
*/
/**
@Summary
Configures the pin settings of the PIC24FJ256GA702
The peripheral pin select, PPS, configuration is also handled by this manager.
@Description
This is the generated manager file for the MPLAB(c) Code Configurator device. This manager
configures the pins direction, initial state, analog setting.
The peripheral pin select, PPS, configuration is also handled by this manager.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
void SYSTEM_Initialize(void)
{
// Other initializers are called from this function
PIN_MANAGER_Initialize();
}
</code>
*/
void PIN_MANAGER_Initialize(void);
#endif
|
/* Include these
* #include <stdlib.h> or <stddef.h>
* #include <stdint.h>
* #include <spar/core.h>
* #include <nitlib/list.h>
* #include "../vm/vm.h"
*/
struct nnn_prog {
size_t size;
int parsed;
struct nnn_expr *expr;
struct nnn_expr *stack;
};
struct nnn_expr {
struct nit_list next;
enum ntwt_token type;
size_t size;
size_t line;
union {
uint32_t integer;
double decimal;
char *string;
char op_code;
} dat;
};
struct nnn_expr *
nnn_expr_get(struct nnn_prog *prog, struct spar_lexinfo *info,
struct spar_token *token);
|
/****************************************************************************
**
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QmlLive tool.
**
** $QT_BEGIN_LICENSE:GPL-QTAS$
** Commercial License Usage
** Licensees holding valid commercial Qt Automotive Suite 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 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** 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.
**
** $QT_END_LICENSE$
**
** SPDX-License-Identifier: GPL-3.0
**
****************************************************************************/
#ifndef QMLLIVELIB_H
#define QMLLIVELIB_H
#include "qmllive_global.h"
class QMLLIVESHARED_EXPORT QmlLive
{
public:
QmlLive();
};
#endif // QMLLIVELIB_H
|
/*
* This file is protected by Copyright. Please refer to the COPYRIGHT file
* distributed with this source distribution.
*
* This file is part of GNUHAWK.
*
* GNUHAWK is free software: you can redistribute it and/or modify is 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.
*
* GNUHAWK 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 file_descriptor_sink_s_GH_BLOCK_H
#define file_descriptor_sink_s_GH_BLOCK_H
#include <gr_component.h>
#include <gr_file_descriptor_sink.h>
typedef GHComponent< gr_file_descriptor_sink > GnuHawkBlock;
#endif
|
extern main();
extern flag_data_return[];
extern outport();
ctcss(int fdSer) {
int opcode, n, tx_mode;
float ctcss_user_value;
float ctcss_freq[34] = {67, 71.9, 77.0, 82.5, 88.5, 94.8, 100, 103.5, 107.2, 110.9, 114.8, 118.8, 123, 127.3, 131.8, 136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, 192.8, 203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3, 9};
int ctcss_byte[34] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x31};
rd_flags(fdSer);
tx_mode = (flag_data_return[3] >> 7) && 0x01;
if (tx_mode == 1) {
printf("Cannot change CTCSS tone while transmitting!!!\n");
return;
}
opcode = 0x90;
n = 0;
printf("Enter in Hz, the CTCSS [PL] tone -> ");
scanf("%f",&ctcss_user_value);
while (ctcss_user_value != ctcss_freq[n]) {
n = n+1;
}
/*
* The only way I could figure out how to do this is to have the user
* input the number, read it in as float and traverse an array until
* the numbers match. The corresponding value in ctcss_byte is the
* byte the radio will understand as a valid CTCSS frequency. I put
* an extra, "bogus" number on the end so that any time n = 34 or 33
* (the 34th or 33rd value in ctcss_freq) that means that the while
* statement failed to match the value in the array, thus the value is
* invalid. When the if statement finds n = 34 or n = 33, the function
* returns, indicating a failure.
* Other methods did not work, this one does so it shall be this way.
*/
if (n == 34 || n == 33) {
printf("Invalid value!!!\n");
return;
}
outport(fdSer, ctcss_byte[n], ctcss_byte[n], ctcss_byte[n], ctcss_byte[n], opcode);
printf("n = %d.\n", n);
}
|
/* Test of u16_strnlen() function.
Copyright (C) 2010-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
#include <config.h>
#include "unistr.h"
#include "zerosize-ptr.h"
#include "macros.h"
#define UNIT uint16_t
#define U_STRNLEN u16_strnlen
#include "test-strnlen.h"
int
main ()
{
/* Simple string. */
{ /* "Grüß Gott. Здравствуйте! x=(-b±sqrt(b²-4ac))/(2a) 日本語,中文,한글" */
static const uint16_t input[] =
{ 'G', 'r', 0x00FC, 0x00DF, ' ', 'G', 'o', 't', 't', '.', ' ',
0x0417, 0x0434, 0x0440, 0x0430, 0x0432, 0x0441, 0x0442, 0x0432, 0x0443,
0x0439, 0x0442, 0x0435, '!', ' ',
'x', '=', '(', '-', 'b', 0x00B1, 's', 'q', 'r', 't', '(', 'b', 0x00B2,
'-', '4', 'a', 'c', ')', ')', '/', '(', '2', 'a', ')', ' ', ' ',
0x65E5, 0x672C, 0x8A9E, ',', 0x4E2D, 0x6587, ',', 0xD55C, 0xAE00, 0
};
check (input, SIZEOF (input));
}
/* String with characters outside the BMP. */
{
static const uint16_t input[] =
{ '-', '(', 0xD835, 0xDD1E, 0x00D7, 0xD835, 0xDD1F, ')', '=',
0xD835, 0xDD1F, 0x00D7, 0xD835, 0xDD1E, 0
};
check (input, SIZEOF (input));
}
return 0;
}
|
/* $APPASERVER_HOME/utility/piece_quote_comma.c */
/* --------------------------------------------- */
/* Freely available software: see Appaserver.org */
/* --------------------------------------------- */
#include <stdio.h>
#include <stdlib.h>
#include "piece.h"
#include "timlib.h"
int main( int argc, char **argv )
{
char buffer[ 65536 ];
char offset_str[ 128 ];
char component[ 4096 ];
char *offset_list_string;
int offset, i;
char destination_delimiter = ',';
if ( argc < 2 )
{
fprintf( stderr,
"Usage: %s offset_1[,...,offset_n] [destination_delimiter]\n",
argv[ 0 ] );
exit( 1 );
}
offset_list_string = argv[ 1 ];
if ( argc == 3 ) destination_delimiter = *argv[ 2 ];
while( get_line( buffer, stdin ) )
{
if ( *offset_list_string )
{
for( i = 0; piece( offset_str,
',',
offset_list_string,
i ); i++ )
{
offset = atoi( offset_str );
if ( offset < 0 )
{
fprintf( stderr,
"ERROR in :%s: Offset (%d) is less than zero\n",
argv[ 0 ],
offset );
exit( 1 );
}
if ( !piece_quote_comma(
component,
buffer,
offset ) )
{
fprintf( stderr,
"Warning %s: piece_quote_comma(%d) failed with [%s]\n",
argv[ 0 ],
offset,
buffer );
}
else
{
if ( i == 0 )
printf( "%s", component );
else
printf( "%c%s",
destination_delimiter,
component );
}
}
}
else
{
for( offset = 0 ; ; offset++ )
{
if ( !piece_quote_comma(
component,
buffer,
offset ) )
{
break;
}
else
{
if ( offset == 0 )
printf( "%s", component );
else
printf( "%c%s",
destination_delimiter,
component );
}
}
}
printf( "\n" );
}
return 0;
}
|
/*******************************************************************************
* Author: Nguyen Truong Duy
********************************************************************************/
/* Methodology:
* + The comb can be divided into layers
* + The first layer contains 1 only
* The second layer contains 2 - 7. (6 numbers)
* The third layer contains 8 - 19. (12 numbers) and so on.
*
* + Layer k (except the first layer k = 0) contains 6 * k numbers
* The starting number of layer k (k >= 1) is 6 * (k - 1)
* + Consider a layer [m ... m + 6k - 1] (k >= 1)
* Then m has Maja coordinate (k - 1, 1)
* + There are 4 important points: m + k - 1, m + 3k + 1, m + 4k - 1, m + 6k - 1
* + m + k - 1 has coordinate (0, k)
* m + 4k - 1 has coordinate (0, -k)
* m + 6k - 1 has coordinate (k, 0)
* m + 3k - 1 has coordinate (-k, 0)
*
* + From m to m + 3k - 1,
* - x decreases from k - 1 to -k (1 unit at a time)
* x remains at -k once it reaches -k.
* + From m + 3k - 1 to m + 6k - 1
* - x increases from -k to k (1 unit at a time)
* x remains at k once it reaches k.
* + From m + 6k - 1 down to m + 4k - 1,
* - y decreases from 0 to -k (1 unit at a time)
* y remains at -k once it reaches -k.
* + From m + 4k - 1 down to m + k - 1,
* - y increases -k to k (1 unit at a time)
* y remains at k once it reaches k.
* + From m + k - 1 down to m,
* - y decreases from k to 1 (1 unit at a time)
*
* + So we can have a solution with O(n) pre-processing and O(1) per query
*/
#include <stdio.h>
typedef struct {
int x, y;
} MajaCoord;
const int MAX_NUM_VAL = 100000;
void preComputeMapWiliToMajaCoord(MajaCoord mapWilliToMaja[]);
int main(void)
{
MajaCoord mapWilliToMaja[MAX_NUM_VAL + 1];
preComputeMapWiliToMajaCoord(mapWilliToMaja);
int willi;
while(scanf("%d", &willi) > 0)
{
printf("%d %d\n", mapWilliToMaja[willi].x, mapWilliToMaja[willi].y);
}
return 0;
}
void preComputeMapWiliToMajaCoord(MajaCoord mapWilliToMaja[])
{
mapWilliToMaja[1].x = 0;
mapWilliToMaja[1].y = 0;
int start = 2, layer = 1, numProcess, i, x, y, end;
while(start <= MAX_NUM_VAL)
{
/* Process each layer */
/* Pass 1 */
end = start + 3 * layer - 1;
x = layer;
for(i = start; i <= end; i++)
{
if(x > -layer)
x--;
if(i <= MAX_NUM_VAL)
mapWilliToMaja[i].x = x;
}
/* Pass 2 */
end = start + 6 * layer - 1;
x = -layer - 1;
for(i = start + 3 * layer - 1; i <= end; i++)
{
if(x < layer)
x++;
if(i <= MAX_NUM_VAL)
mapWilliToMaja[i].x = x;
}
/* Pass 3 */
end = start + 4 * layer - 1;
y = 1;
for(i = start + 6 * layer - 1; i >= end; i--)
{
if(y > -layer)
y--;
if(i <= MAX_NUM_VAL)
mapWilliToMaja[i].y = y;
}
/* Pass 4 */
end = start + layer - 1;
y = -layer - 1;
for(i = start + 4 * layer - 1; i >= end; i--)
{
if(y < layer)
y++;
if(i <= MAX_NUM_VAL)
mapWilliToMaja[i].y = y;
}
/* Pass 5 */
end = start;
y = layer + 1;
for(i = start + layer - 1; i >= end; i--)
{
if(y > 1)
y--;
if(i <= MAX_NUM_VAL)
mapWilliToMaja[i].y = y;
}
/* Go to the next layer */
start += 6 * layer;
layer++;
}
}
|
#ifndef INCOMINGDATAPARSER_H
#define INCOMINGDATAPARSER_H
#include "core/player.h"
#include "core/application.h"
#include "remotecontrolmessages.pb.h"
#include "remoteclient.h"
class IncomingDataParser : public QObject {
Q_OBJECT
public:
IncomingDataParser(Application* app);
~IncomingDataParser();
bool close_connection();
public slots:
void Parse(const pb::remote::Message& msg);
signals:
void SendClementineInfo();
void SendFirstData(bool send_playlist_songs);
void SendAllPlaylists();
void SendAllActivePlaylists();
void SendPlaylistSongs(int id);
void Open(int id);
void Close(int id);
void GetLyrics();
void Love();
void Ban();
void Play();
void PlayPause();
void Pause();
void Stop();
void StopAfterCurrent();
void Next();
void Previous();
void SetVolume(int volume);
void PlayAt(int i, Engine::TrackChangeFlags change, bool reshuffle);
void SetActivePlaylist(int id);
void ShuffleCurrent();
void SetRepeatMode(PlaylistSequence::RepeatMode mode);
void SetShuffleMode(PlaylistSequence::ShuffleMode mode);
void InsertUrls(int id, const QList<QUrl>& urls, int pos, bool play_now,
bool enqueue);
void RemoveSongs(int id, const QList<int>& indices);
void SeekTo(int seconds);
void SendSongs(const pb::remote::RequestDownloadSongs& request,
RemoteClient* client);
void ResponseSongOffer(RemoteClient* client, bool accepted);
void SendLibrary(RemoteClient* client);
void RateCurrentSong(double);
private:
Application* app_;
bool close_connection_;
void GetPlaylistSongs(const pb::remote::Message& msg);
void ChangeSong(const pb::remote::Message& msg);
void SetRepeatMode(const pb::remote::Repeat& repeat);
void SetShuffleMode(const pb::remote::Shuffle& shuffle);
void InsertUrls(const pb::remote::Message& msg);
void RemoveSongs(const pb::remote::Message& msg);
void ClientConnect(const pb::remote::Message& msg);
void SendPlaylists(const pb::remote::Message& msg);
void OpenPlaylist(const pb::remote::Message& msg);
void ClosePlaylist(const pb::remote::Message& msg);
void RateSong(const pb::remote::Message& msg);
};
#endif // INCOMINGDATAPARSER_H
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __UAPI_LINUX_FILTER_H__
#define __UAPI_LINUX_FILTER_H__
#include <lyos/types.h>
#include <linux/bpf_common.h>
struct sock_filter {
__u16 code;
__u8 jt;
__u8 jf;
__u32 k;
};
struct sock_fprog {
unsigned short len;
struct sock_filter* filter;
};
#endif
|
/*
This file is part of MGEAN library.
MGEAN 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.
MGEAN 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 General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with MGEAN library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2010-2011 Pavel Procházka
*/
#ifndef COLLISION_H
#define COLLISION_H
int intersect_p_rect (SDL_Rect * rct1, SDL_Rect * rct2);
#endif
|
/*
Copyright (c) 2015 Colum Paget <colums.projects@googlemail.com>
* SPDX-License-Identifier: GPL-3.0
*/
#ifndef USBAUTH_COMMON_H
#define USBAUTH_COMMON_H
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#define VERSION "1.9"
#define FALSE 0
#define TRUE 1
#define MATCH_NO 0
#define MATCH_WRONG_USER 1
#define MATCH_YES 3
#define MATCH_VALID 4
#define FLAG_SYSLOG 1
#define FLAG_DENY 4
#define FLAG_DENYALL 8
#define FLAG_LOGPASS 16
#define FLAG_FAILS 32
#define FLAG_NOTUSER 64
#define FLAG_NOTHOST 128
#define FLAG_IGNORE_BLANK 256
#define FLAG_LOGFOUND 512
typedef struct
{
int Flags;
char *Prompt;
char *CredsFiles;
char *SortedFiles;
char *User;
char *Host;
char *PamUser;
char *PamHost;
char *PamTTY;
char *Script;
} TSettings;
typedef struct
{
int Flags;
char *User;
char *Pass;
char *Salt;
} THoneyCred;
#endif
|
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ai.h"
#include "controller.h"
#include "tools/misc.h"
#include "tools/rng.h"
#include "tools/str_ops.h"
//Settings that change the program's behaviour
//If you change one, remember to re-compile
#define COUNTER_CHAR 'O'
#define MIN_PILES 2
#define MAX_PILES 5
#define MIN_COUNTERS_PER_PILE 1
#define MAX_COUNTERS_PER_PILE 20
struct player_output getUserInput(struct game_data gameState)
{
bool inputValid = false;
char inputBuffer[4096];
char chosenPile[4096];
char countersToRemove[4096];
int chosenPileInt;
int countersToRemoveInt;
int *chosenPileCounters;
do {
printf("Which pile would you like to remove counters from? ");
fgets(inputBuffer, sizeof inputBuffer / sizeof(char), stdin);
strcpy(chosenPile, stripNewline(inputBuffer));
//Data validation
if (isStrInt(chosenPile) && !isStrEmpty(chosenPile)) {
chosenPileInt = atoi(chosenPile) - 1;
chosenPileCounters = &gameState.piles[chosenPileInt];
if (chosenPileInt < 0 || chosenPileInt > gameState.numPiles) {
putchar('\n');
puts("The pile you selected does not exist. Try again.");
} else if (*chosenPileCounters == 0) {
putchar('\n');
puts("You must choose a non-empty pile. Try again.");
} else
inputValid = true;
} else {
putchar('\n');
puts("That is not a valid number. Please try again.");
}
} while(!inputValid);
inputValid = false;
putchar('\n');
do {
printf("How many counters would you like to remove? ");
fgets(inputBuffer, sizeof inputBuffer / sizeof(char), stdin);
strcpy(countersToRemove, stripNewline(inputBuffer));
//Data validation
if (isStrInt(countersToRemove) && !isStrEmpty(countersToRemove)) {
countersToRemoveInt = atoi(countersToRemove);
if (countersToRemoveInt < 1) {
putchar('\n');
puts("Please remove at least one counter. Try again.");
} else if (countersToRemoveInt > *chosenPileCounters) {
countersToRemoveInt = *chosenPileCounters;
inputValid = true;
} else
inputValid = true;
} else {
putchar('\n');
puts("That is not a valid number. Please try again.");
}
} while(!inputValid);
struct player_output output;
output.pile = chosenPileInt;
output.countersToRemove = countersToRemoveInt;
return output;
}
void controller(player_type player1, player_type player2)
{
initRand(); //Seed random number generator with current time
const int numPiles = randNum(MIN_PILES - 1, MAX_PILES - 1);
int piles[numPiles];
//Initialize piles with counters
for (int i = 0; i <= numPiles; i++)
piles[i] = randNum(MIN_COUNTERS_PER_PILE, MAX_COUNTERS_PER_PILE);
//Control variables
int currPlayer = 1;
player_type currPlayerType;
bool isGameOver = false;
//Game loop
while (!isGameOver) {
printf("Player %d's turn\n\n", currPlayer);
//Display the piles
for (int i = 0; i <= numPiles; i++) {
printf("Pile %d: ", i + 1);
for (int j = 0; j < piles[i]; j++)
putchar(COUNTER_CHAR);
for (int j = piles[i]; j <= MAX_COUNTERS_PER_PILE; j++)
putchar(' ');
printf("%d\n", piles[i]);
}
putchar('\n');
currPlayerType = (currPlayer - 1) ? player2 : player1;
struct game_data game;
game.numPiles = numPiles;
game.pilesSize = sizeof piles;
game.piles = piles;
struct player_output output;
if (currPlayerType == HUMAN_PLAYER)
output = getUserInput(game);
else if (currPlayerType == AI_PLAYER) {
output = ai(game);
} else {
fputs("Unknown player type detected.", stderr);
exit(-1);
}
//Remove counters from pile
int beforeCounters = piles[output.pile];
piles[output.pile] -= output.countersToRemove;
putchar('\n');
printf(
"Player %d removed %d counters from pile %d.\n"
"Counters: %d -> %d\n\n"
"%s\n",
currPlayer, output.countersToRemove, output.pile + 1,
beforeCounters, piles[output.pile], hl()
);
if (piles[output.pile] < 0)
piles[output.pile] = 0;
//Check if player won
bool existsNonEmptyPile = false;
for (int i = 0; i <= numPiles; i++)
if (piles[i] != 0)
existsNonEmptyPile = true;
if (!existsNonEmptyPile)
isGameOver = true;
if (!isGameOver)
currPlayer = !(currPlayer - 1) + 1; //Toggle active player
}
printf("Congratulations, Player %d! You won the game!\n", currPlayer);
};
|
/*
TiMidity++ -- MIDI to WAVE converter and player
Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
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 SYSDEP_H_INCLUDED
#define SYSDEP_H_INCLUDED 1
#include <limits.h>
#define DEFAULT_AUDIO_BUFFER_BITS 12
#define SAMPLE_LENGTH_BITS 32
#include <stdint.h> // int types are defined here
#include "t_swap.h"
namespace TimidityPlus
{
/* Instrument files are little-endian, MIDI files big-endian, so we
need to do some conversions. */
#define XCHG_SHORT(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
#define LE_SHORT(x) LittleShort(x)
#define LE_LONG(x) LittleLong(x)
#define BE_SHORT(x) BigShort(x)
#define BE_LONG(x) BigLong(x)
/* max_channels is defined in "timidity.h" */
typedef struct _ChannelBitMask
{
uint32_t b; /* 32-bit bitvector */
} ChannelBitMask;
#define CLEAR_CHANNELMASK(bits) ((bits).b = 0)
#define FILL_CHANNELMASK(bits) ((bits).b = ~0)
#define IS_SET_CHANNELMASK(bits, c) ((bits).b & (1u << (c)))
#define SET_CHANNELMASK(bits, c) ((bits).b |= (1u << (c)))
#define UNSET_CHANNELMASK(bits, c) ((bits).b &= ~(1u << (c)))
#define TOGGLE_CHANNELMASK(bits, c) ((bits).b ^= (1u << (c)))
#define COPY_CHANNELMASK(dest, src) ((dest).b = (src).b)
#define REVERSE_CHANNELMASK(bits) ((bits).b = ~(bits).b)
#define COMPARE_CHANNELMASK(bitsA, bitsB) ((bitsA).b == (bitsB).b)
typedef int16_t sample_t;
typedef int32_t final_volume_t;
# define FINAL_VOLUME(v) (v)
# define MAX_AMP_VALUE ((1<<(AMP_BITS+1))-1)
#define MIN_AMP_VALUE (MAX_AMP_VALUE >> 9)
typedef uint32_t splen_t;
#define SPLEN_T_MAX (splen_t)((uint32_t)0xFFFFFFFF)
# define TIM_FSCALE(a,b) ((a) * (double)(1<<(b)))
# define TIM_FSCALENEG(a,b) ((a) * (1.0 / (double)(1<<(b))))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#if defined(_MSC_VER)
#define strncasecmp(a,b,c) _strnicmp((a),(b),(c))
#define strcasecmp(a,b) _stricmp((a),(b))
#endif /* _MSC_VER */
#define SAFE_CONVERT_LENGTH(len) (6 * (len) + 1)
}
#endif /* SYSDEP_H_INCUDED */
|
/*
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2008 Rob Buis <buis@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGGlyphElement_h
#define SVGGlyphElement_h
#if ENABLE(SVG_FONTS)
#include "SVGGlyph.h"
#include "SVGStyledElement.h"
namespace WebCore {
class SVGFontData;
class SVGGlyphElement : public SVGStyledElement {
public:
static PassRefPtr<SVGGlyphElement> create(const QualifiedName&, Document*);
SVGGlyph buildGlyphIdentifier() const;
// Helper function used by SVGFont
static void inheritUnspecifiedAttributes(SVGGlyph&, const SVGFontData*);
static String querySVGFontLanguage(const SVGElement*);
// Helper function shared between SVGGlyphElement & SVGMissingGlyphElement
static SVGGlyph buildGenericGlyphIdentifier(const SVGElement*);
private:
SVGGlyphElement(const QualifiedName&, Document*);
// FIXME: svgAttributeChanged missing.
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void removedFrom(Node*) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
void invalidateGlyphCache();
};
} // namespace WebCore
#endif // ENABLE(SVG_FONTS)
#endif
|
/*
* Copyright (c) 2014-2015, Julien Bernard
*
* 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.
*/
#ifndef GAME_WINDOW_GEOMETRY_H
#define GAME_WINDOW_GEOMETRY_H
#include <SFML/Graphics.hpp>
namespace game {
class WindowGeometry {
public:
WindowGeometry(float width, float height)
: m_width(width)
, m_height(height)
{
}
void update(sf::Event& event);
float getXCentered(float width);
float getXFromRight(float width);
float getXRatio(float r, float width);
float getYCentered(float height);
float getYFromBottom(float height);
float getYRatio(float r, float height);
sf::Vector2f getCornerPosition(const sf::Vector2f& pos);
private:
float m_width;
float m_height;
};
}
#endif // GAME_WINDOW_GEOMETRY_H
|
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Some macro definitions necessary
* @authors Ratnadip Choudhury, Pradeep Kadoor
* @copyright Copyright (c) 2011, Robert Bosch Engineering and Business Solutions. All rights reserved.
*
* Some macro definitions necessary
*/
#pragma once
#define LOG_ERR_MSG() sg_pIlog->logMessage(A2T(__FILE__), __LINE__, A2T((LPSTR) (sg_acErrStr.c_str())))
#define VALIDATE_POINTER_RETURN_VAL(Ptr, RetVal) if (Ptr == NULL) {return RetVal;}
#define VALIDATE_VALUE_RETURN_VAL(Val1, Val2, RetVal) if (Val1 != Val2) {return RetVal;}
#define VALIDATE_POINTER_RETURN_VOID(Ptr) if (Ptr == NULL) {return;}
#define VALIDATE_POINTER_NO_RETURN_LOG(Ptr) if (Ptr == NULL) {LOG_ERR_MSG();}
#define VALIDATE_POINTER_RETURN_VOID_LOG(Ptr) if (Ptr == NULL) {LOG_ERR_MSG(); return;}
#define VALIDATE_POINTER_RETURN_VALUE_LOG(Ptr, RetVal) if (Ptr == NULL) {LOG_ERR_MSG(); return RetVal;}
|
//
// DetailViewController.h
// OwnCloud Notes
//
// Created by Markus Klepp on 22/03/14.
// Copyright (c) 2014 AyKit. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DetailViewController : UIViewController <UISplitViewControllerDelegate>
@property (strong, nonatomic) NSDictionary *detailItem;
@property (weak, nonatomic) IBOutlet UILabel *detailDateLabel;
@property (weak, nonatomic) IBOutlet UITextView *detailContentTextView;
@property (weak, nonatomic) IBOutlet UIButton *offlineInfoButton;
- (IBAction)showOfflineMessage:(id)sender;
@end
|
/*
Copyright 2016-2017, Guenther Charwat
WWW: <http://dbai.tuwien.ac.at/proj/decodyn/dynqbf>.
This file is part of dynQBF.
dynQBF 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.
dynQBF 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 dynQBF. If not, see <http://www.gnu.org/licenses/>.
*/
#include <htd/main.hpp>
namespace decomposer {
class JoinNodeChildRememberedProductFitnessFunction : public htd::ITreeDecompositionFitnessFunction {
public:
JoinNodeChildRememberedProductFitnessFunction(void);
~JoinNodeChildRememberedProductFitnessFunction();
htd::FitnessEvaluation * fitness(const htd::IMultiHypergraph & graph, const htd::ITreeDecomposition & decomposition) const override;
JoinNodeChildRememberedProductFitnessFunction * clone(void) const override;
};
}
|
/*
* Copyright 2010-2013 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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.
*
* OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_INTERCEPTSTATE_H
#define OPENXCOM_INTERCEPTSTATE_H
#include <vector>
#include "../Engine/State.h"
namespace OpenXcom
{
class TextButton;
class Window;
class Text;
class TextList;
class Base;
class Globe;
class Craft;
class Target;
/**
* Intercept window that lets the player launch
* crafts into missions from the Geoscape.
*/
class InterceptState : public State
{
private:
TextButton *_btnCancel, *_btnGotoBase;
Window *_window;
Text *_txtTitle, *_txtCraft, *_txtStatus, *_txtBase, *_txtWeapons;
TextList *_lstCrafts;
Globe *_globe;
Base *_base;
Target *_target;
std::vector<Craft*> _crafts;
public:
/// Creates the Intercept state.
InterceptState(Game *game, Globe *globe, Base *base = 0, Target *target = 0);
/// Cleans up the Intercept state.
~InterceptState();
/// Handler for clicking the Cancel button.
void btnCancelClick(Action *action);
/// Handler for clicking the Go To Base button.
void btnGotoBaseClick(Action *action);
/// Handler for clicking the Crafts list.
void lstCraftsLeftClick(Action *action);
/// Handler for right clicking the Crafts list.
void lstCraftsRightClick(Action *action);
};
}
#endif
|
/*
* uart.h
*
* Created on: Oct 3, 2015
* Author: lorenzo
*/
#ifndef _UART_H_
#define _UART_H_
void uart_putchar(char c, FILE *stream);
char uart_getchar(FILE *stream);
void uart_init(void);
/* http://www.ermicro.com/blog/?p=325 */
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL, uart_getchar, _FDEV_SETUP_READ);
#endif /* _UART_H_ */
|
/*
This file is part of LS² - the Localization Simulation Engine of FU Berlin.
Copyright 2011-2013 Heiko Will, Marcel Kyas, Thomas Hillebrandt,
Stefan Adler, Malte Rohde, Jonathan Gunthermann
LS² 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.
LS² 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 LS². If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_EQ_NOISE_H
#define INCLUDED_EQ_NOISE_H
extern void eq_noise_setup(const vector2 *, size_t);
#if HAVE_POPT_H
extern struct poptOption eq_arguments[];
#endif
#if defined(STAND_ALONE)
# define ERROR_MODEL_NAME "Uniform noise"
# define ERROR_MODEL_ARGUMENTS eq_arguments
#endif
#endif
|
/*hdr
**
** Copyright Mox Products, Australia
**
** FILE NAME: FileConfigure.c
**
** AUTHOR: Jeff Wang
**
** DATE: 09 - May - 2009
**
** FILE DESCRIPTION:
**
**
** FUNCTIONS:
**
** NOTES:
**
*/
#ifndef FILECONFIGURE_H
#define FILECONFIGURE_H
/************** SYSTEM INCLUDE FILES **************************************************************************/
/************** USER INCLUDE FILES ****************************************************************************/
#include "MXCommon.h"
#include "MXTypes.h"
#include "AccessCommon.h"
/************** DEFINES ***************************************************************************************/
#define PKTFLAG_FIRST 1
#define PKTFLAG_MIDDLE 2
#define PKTFLAG_LAST 3
#define DWNLDFILE_PKTFLAG_OFFSET 0
#define DWNLDFILE_PKTFLAG_LEN 1
#define DWNLDFILE_PKTINDEX_OFFSET (DWNLDFILE_PKTFLAG_OFFSET + DWNLDFILE_PKTFLAG_LEN)
#define DWNLDFILE_PKTINDEX_LEN 2
#define DWNLDFILE_FILELEN_OFFSET (DWNLDFILE_PKTINDEX_OFFSET + DWNLDFILE_PKTINDEX_LEN)
#define DWNLDFILE_FILELEN_LEN 4
#define DWNLDFILE_FILEDATA_OFFSET (DWNLDFILE_FILELEN_OFFSET + DWNLDFILE_FILELEN_LEN)
#define UPLDFILE_INDEX_OFFSET 0
#define UPLDFILE_INDEX_LEN 2
#define UPLDFILE_STAPOS_OFFSET (UPLDFILE_INDEX_OFFSET + UPLDFILE_INDEX_LEN)
#define UPLDFILE_STAPOS_LEN 4
#define UPLDFILE_FILENAMELEN_OFFSET (UPLDFILE_STAPOS_OFFSET + UPLDFILE_STAPOS_LEN)
#define UPLDFILE_FILENAMELEN_LEN 2
#define UPLDFILE_FILENAME_OFFSET (UPLDFILE_FILENAMELEN_OFFSET + UPLDFILE_FILENAMELEN_LEN)
#define UPLDFILE_FILELEN_OFFSET (UPLDFILE_INDEX_OFFSET + UPLDFILE_INDEX_LEN)
#define UPLDFILE_FILELEN_LEN 4
#define UPLDFILE_RESULT_OFFSET (UPLDFILE_FILELEN_OFFSET + UPLDFILE_FILELEN_LEN)
#define UPLDFILE_RESULT_LEN 1
#define UPLDFILE_PKTLEN_OFFSET (UPLDFILE_RESULT_OFFSET + UPLDFILE_RESULT_LEN)
#define UPLDFILE_PKTLEN_LEN 2
#define UPLDFILE_FILEDATA_OFFSET (UPLDFILE_PKTLEN_OFFSET + UPLDFILE_PKTLEN_LEN)
#define PKT_PER_LEN 1024
/////////////////Add one Card Define///////
#define DWNLDOREDITONECARD_VERSION_OFFSET 0
#define DWNLDOREDITONECARD_VERSION_LEN 1
#define DWNLDOREDITONECARD_CSN_OFFSET (DWNLDOREDITONECARD_VERSION_OFFSET+DWNLDOREDITONECARD_VERSION_LEN)
#define DWNLDOREDITONECARD_CSN_LEN 5
#define DWNLDOREDITONECARD_RESIDENTCODE_OFFSET (DWNLDOREDITONECARD_CSN_OFFSET+DWNLDOREDITONECARD_CSN_LEN)
#define DWNLDOREDITONECARD_RESIDENTCODE_LEN 20
//#define DWNLDOREDITONECARD_CARDTYPE_OFFSET (DWNLDOREDITONECARD_RESIDENTCODE_OFFSET+DWNLDOREDITONECARD_RESIDENTCODE_LEN)
#define DWNLDOREDITONECARD_CARDTYPE_LEN 1
#define DWNLDOREDITONECARD_CARDSTATUS_OFFSET (DWNLDOREDITONECARD_RESIDENTCODE_OFFSET+DWNLDOREDITONECARD_RESIDENTCODE_LEN)
#define DWNLDOREDITONECARD_CARDSTATUS_LEN 1
#define DWNLDOREDITONECARD_CARDMODE_OFFSET (DWNLDOREDITONECARD_CARDSTATUS_OFFSET+DWNLDOREDITONECARD_CARDSTATUS_LEN)
#define DWNLDOREDITONECARD_CARDMODE_LEN 1
#define DWNLDOREDITONECARD_GATENUMBER_OFFSET (DWNLDOREDITONECARD_CARDMODE_OFFSET+DWNLDOREDITONECARD_CARDMODE_LEN)
#define DWNLDOREDITONECARD_GATENUMBER_LEN 2
#define DWNLDOREDITONECARD_UNLOCKTIMESLICEID_OFFSET (DWNLDOREDITONECARD_GATENUMBER_OFFSET+DWNLDOREDITONECARD_GATENUMBER_LEN)
#define DWNLDOREDITONECARD_UNLOCKTIMESLICEID_LEN 1
#define DWNLDOREDITONECARD_VALIDSTARTTIME_OFFSET (DWNLDOREDITONECARD_UNLOCKTIMESLICEID_OFFSET+DWNLDOREDITONECARD_UNLOCKTIMESLICEID_LEN)
#define DWNLDOREDITONECARD_VALIDSTARTTIME_LEN 8
#define DWNLDOREDITONECARD_VALIDENDTIME_OFFSET (DWNLDOREDITONECARD_VALIDSTARTTIME_OFFSET+DWNLDOREDITONECARD_VALIDSTARTTIME_LEN)
#define DWNLDOREDITONECARD_VALIDENDTIME_LEN 8
#define DWNLDOREDITONECARD_ISADMIN_OFFSET (DWNLDOREDITONECARD_VALIDENDTIME_OFFSET+DWNLDOREDITONECARD_VALIDENDTIME_LEN)
#define DWNLDOREDITONECARD_ISADMIN_LEN 1
/////////////////////////////////////////////////////////////
#define DELETEONECARD_VERSION_OFFSET 0
#define DELETEONECARD_VERSION_LEN 1
#define DELETEONECARD_CSN_OFFSET (DELETEONECARD_VERSION_OFFSET+DELETEONECARD_VERSION_LEN)
#define DELETEONECARD_CSN_LEN 5
#define FILE_OK 0
#define FILE_NOT_EXIST 1
#define FILE_OPEN_ERROR 2
/************** TYPEDEFS *************************************************************/
/************** STRUCTURES ***********************************************************/
/************** EXTERNAL DECLARATIONS ************************************************/
extern BOOL DwnldFileProc(BYTE* pIn, UINT nInLen);
extern UINT UpldFileProc(BYTE* pInOut);
extern BOOL RemoveFileProc(BYTE* pIn);
extern BOOL DwnldOneCardProc(BYTE* pIn, UINT nInLen ,unsigned short nFunCode);
extern BOOL EditOneCardProc(BYTE* pIn, UINT nInLen,unsigned short nFunCode);
extern UINT UpldOneCardProc(BYTE* pInOut,unsigned short nFunCode);
extern BOOL DeleteOneCardProc(BYTE* pIn, UINT nInLen,unsigned short nFunCode);
/*****************************************************************************/
#endif //FILECONFIGURE_H
|
//
// ImageSlicing.h
// ImageSlicing
//
// Created by Jeremy on 2016-02-13.
// Copyright © 2016 Jeremy W. Sherman. Released with NO WARRANTY.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import <Cocoa/Cocoa.h>
//! Project version number for ImageSlicing.
FOUNDATION_EXPORT double ImageSlicingVersionNumber;
//! Project version string for ImageSlicing.
FOUNDATION_EXPORT const unsigned char ImageSlicingVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ImageSlicing/PublicHeader.h>
|
#pragma once
#include "iobuffer.h"
//
// ioÏÂËùÓжÔÏóµÄÄÚ´æ¹ÜÀí»úÖÆ ¶¼»á¼ÆÊý·½Ê½
//
namespace xhnet
{
typedef std::function<void()> postio;
//
// run Ö»ÄÜÔÚÒ»¸öÏß³ÌÖÐÔËÐÐ one thread one run
//
class IIOServer : virtual public CPPRef
{
public:
// ³õʼ»¯½øÐжþ¶Îʽ³õʼ»¯
static IIOServer* Create(void);
static std::vector<std::string> Resolve_DNS(const std::string& hostname);
public:
virtual ~IIOServer(void) { }
virtual bool Init(void) = 0;
virtual void Fini(void) = 0;
virtual void Run(void) = 0;
virtual bool IsFinshed(void) = 0;
virtual void Post(postio io) = 0;
virtual unsigned int GetIOServerID(void) = 0;
};
};
|
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2008-2015 MonetDB B.V.
*/
#ifndef _SEEN_PROPERTIES_H
#define _SEEN_PROPERTIES_H 1
#include "utils.h"
#define MEROPROPFILE ".merovingian_properties"
confkeyval *getDefaultProps(void);
int writeProps(confkeyval *ckv, const char *path);
void writePropsBuf(confkeyval *ckv, char **buf);
int readProps(confkeyval *ckv, const char *path);
int readAllProps(confkeyval *ckv, const char *path);
void readPropsBuf(confkeyval *ckv, char *buf);
char *setProp(char *path, char *key, char *val);
#endif
/* vim:set ts=4 sw=4 noexpandtab: */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.