text stringlengths 4 6.14k |
|---|
#ifndef org_apache_lucene_search_PrefixFilter_H
#define org_apache_lucene_search_PrefixFilter_H
#include "org/apache/lucene/search/MultiTermQueryWrapperFilter.h"
namespace org {
namespace apache {
namespace lucene {
namespace index {
class Term;
}
namespace search {
class PrefixQuery;
}
}
}
}
namespace java {
namespace lang {
class String;
class Class;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace search {
class PrefixFilter : public ::org::apache::lucene::search::MultiTermQueryWrapperFilter {
public:
enum {
mid_init$_7eca6a81,
mid_getPrefix_0f71f314,
mid_toString_14c7b5c5,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit PrefixFilter(jobject obj) : ::org::apache::lucene::search::MultiTermQueryWrapperFilter(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
PrefixFilter(const PrefixFilter& obj) : ::org::apache::lucene::search::MultiTermQueryWrapperFilter(obj) {}
PrefixFilter(const ::org::apache::lucene::index::Term &);
::org::apache::lucene::index::Term getPrefix() const;
::java::lang::String toString() const;
};
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace search {
extern PyTypeObject PY_TYPE(PrefixFilter);
class t_PrefixFilter {
public:
PyObject_HEAD
PrefixFilter object;
PyTypeObject *parameters[1];
static PyTypeObject **parameters_(t_PrefixFilter *self)
{
return (PyTypeObject **) &(self->parameters);
}
static PyObject *wrap_Object(const PrefixFilter&);
static PyObject *wrap_jobject(const jobject&);
static PyObject *wrap_Object(const PrefixFilter&, PyTypeObject *);
static PyObject *wrap_jobject(const jobject&, PyTypeObject *);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
#endif
|
#import <Foundation/Foundation.h>
@interface Event : NSObject {
}
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *date;
@property (nonatomic, copy) NSString *location;
@property (nonatomic, retain) UIImage *image;
@property (nonatomic, retain) NSURL *imageURL;
@property (nonatomic, readonly) NSURL *url;
- (id)initWithDictionary:(NSDictionary *)dictionary;
+ (NSArray *)fetchEvents;
@end
|
#ifndef _MODEL_H_
#define _MODEL_H_
#include <map>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include "mesh.h"
#include "texture.h"
/*
* ´ú±íÒ»¸öÄ£ÐÍ Ä£ÐÍ¿ÉÒÔ°üº¬Ò»¸ö»ò¶à¸öMesh
*/
class Model
{
public:
void draw(const Shader& shader) const
{
for (std::vector<Mesh>::const_iterator it = this->meshes.begin(); this->meshes.end() != it; ++it)
{
it->draw(shader);
}
}
bool loadModel(const std::string& filePath)
{
Assimp::Importer importer;
if (filePath.empty())
{
std::cerr << "Error:Model::loadModel, empty model file path." << std::endl;
return false;
}
const aiScene* sceneObjPtr = importer.ReadFile(filePath,
aiProcess_Triangulate | aiProcess_FlipUVs);
if (!sceneObjPtr
|| sceneObjPtr->mFlags == AI_SCENE_FLAGS_INCOMPLETE
|| !sceneObjPtr->mRootNode)
{
std::cerr << "Error:Model::loadModel, description: "
<< importer.GetErrorString() << std::endl;
return false;
}
this->modelFileDir = filePath.substr(0, filePath.find_last_of('/'));
if (!this->processNode(sceneObjPtr->mRootNode, sceneObjPtr))
{
std::cerr << "Error:Model::loadModel, process node failed."<< std::endl;
return false;
}
return true;
}
~Model()
{
for (std::vector<Mesh>::const_iterator it = this->meshes.begin(); this->meshes.end() != it; ++it)
{
it->final();
}
}
const std::vector<Mesh>& getMeshes() const { return this->meshes; }
private:
/*
* µÝ¹é´¦ÀíÄ£Ð͵Ľáµã
*/
bool processNode(const aiNode* node, const aiScene* sceneObjPtr)
{
if (!node || !sceneObjPtr)
{
return false;
}
// ÏÈ´¦Àí×ÔÉí½áµã
for (size_t i = 0; i < node->mNumMeshes; ++i)
{
// ×¢ÒânodeÖеÄmeshÊǶÔsceneObjectÖÐmeshµÄË÷Òý
const aiMesh* meshPtr = sceneObjPtr->mMeshes[node->mMeshes[i]];
if (meshPtr)
{
Mesh meshObj;
if (this->processMesh(meshPtr, sceneObjPtr, meshObj))
{
this->meshes.push_back(meshObj);
}
}
}
// ´¦Àíº¢×Ó½áµã
for (size_t i = 0; i < node->mNumChildren; ++i)
{
this->processNode(node->mChildren[i], sceneObjPtr);
}
return true;
}
bool processMesh(const aiMesh* meshPtr, const aiScene* sceneObjPtr, Mesh& meshObj)
{
if (!meshPtr || !sceneObjPtr)
{
return false;
}
std::vector<Vertex> vertData;
std::vector<Texture> textures;
std::vector<GLuint> indices;
// ´ÓMeshµÃµ½¶¥µãÊý¾Ý¡¢·¨ÏòÁ¿¡¢ÎÆÀíÊý¾Ý
for (size_t i = 0; i < meshPtr->mNumVertices; ++i)
{
Vertex vertex;
// »ñÈ¡¶¥µãλÖÃ
if (meshPtr->HasPositions())
{
vertex.position.x = meshPtr->mVertices[i].x;
vertex.position.y = meshPtr->mVertices[i].y;
vertex.position.z = meshPtr->mVertices[i].z;
}
// »ñÈ¡ÎÆÀíÊý¾Ý Ŀǰֻ´¦Àí0ºÅÎÆÀí
if (meshPtr->HasTextureCoords(0))
{
vertex.texCoords.x = meshPtr->mTextureCoords[0][i].x;
vertex.texCoords.y = meshPtr->mTextureCoords[0][i].y;
}
else
{
vertex.texCoords = glm::vec2(0.0f, 0.0f);
}
// »ñÈ¡·¨ÏòÁ¿Êý¾Ý
if (meshPtr->HasNormals())
{
vertex.normal.x = meshPtr->mNormals[i].x;
vertex.normal.y = meshPtr->mNormals[i].y;
vertex.normal.z = meshPtr->mNormals[i].z;
}
vertData.push_back(vertex);
}
// »ñÈ¡Ë÷ÒýÊý¾Ý
for (size_t i = 0; i < meshPtr->mNumFaces; ++i)
{
aiFace face = meshPtr->mFaces[i];
if (face.mNumIndices != 3)
{
std::cerr << "Error:Model::processMesh, mesh not transformed to triangle mesh." << std::endl;
return false;
}
for (size_t j = 0; j < face.mNumIndices; ++j)
{
indices.push_back(face.mIndices[j]);
}
}
// »ñÈ¡ÎÆÀíÊý¾Ý
if (meshPtr->mMaterialIndex >= 0)
{
const aiMaterial* materialPtr = sceneObjPtr->mMaterials[meshPtr->mMaterialIndex];
// »ñÈ¡diffuseÀàÐÍ
std::vector<Texture> diffuseTexture;
this->processMaterial(materialPtr, sceneObjPtr, aiTextureType_DIFFUSE, diffuseTexture);
textures.insert(textures.end(), diffuseTexture.begin(), diffuseTexture.end());
// »ñÈ¡specularÀàÐÍ
std::vector<Texture> specularTexture;
this->processMaterial(materialPtr, sceneObjPtr, aiTextureType_SPECULAR, specularTexture);
textures.insert(textures.end(), specularTexture.begin(), specularTexture.end());
}
meshObj.setData(vertData, textures, indices);
return true;
}
/*
* »ñȡһ¸ö²ÄÖÊÖеÄÎÆÀí
*/
bool processMaterial(const aiMaterial* matPtr, const aiScene* sceneObjPtr,
const aiTextureType textureType, std::vector<Texture>& textures)
{
textures.clear();
if (!matPtr
|| !sceneObjPtr )
{
return false;
}
if (matPtr->GetTextureCount(textureType) <= 0)
{
return true;
}
for (size_t i = 0; i < matPtr->GetTextureCount(textureType); ++i)
{
Texture text;
aiString textPath;
aiReturn retStatus = matPtr->GetTexture(textureType, i, &textPath);
if (retStatus != aiReturn_SUCCESS
|| textPath.length == 0)
{
std::cerr << "Warning, load texture type=" << textureType
<< "index= " << i << " failed with return value= "
<< retStatus << std::endl;
continue;
}
std::string absolutePath = this->modelFileDir + "/" + textPath.C_Str();
LoadedTextMapType::const_iterator it = this->loadedTextureMap.find(absolutePath);
if (it == this->loadedTextureMap.end()) // ¼ì²éÊÇ·ñÒѾ¼ÓÔØ¹ýÁË
{
GLuint textId = TextureHelper::load2DTexture(absolutePath.c_str());
text.id = textId;
text.path = absolutePath;
text.type = textureType;
textures.push_back(text);
loadedTextureMap[absolutePath] = text;
}
else
{
textures.push_back(it->second);
}
}
return true;
}
private:
std::vector<Mesh> meshes; // ±£´æMesh
std::string modelFileDir; // ±£´æÄ£ÐÍÎļþµÄÎļþ¼Ð·¾¶
typedef std::map<std::string, Texture> LoadedTextMapType; // key = texture file path
LoadedTextMapType loadedTextureMap; // ±£´æÒѾ¼ÓÔØµÄÎÆÀí
};
#endif |
/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <UIKit/UIKit.h>
#ifndef ComponentKit_ASTextKitAttributes_h
#define ComponentKit_ASTextKitAttributes_h
@protocol ASTextKitTruncating;
extern NSString *const ASTextKitTruncationAttributeName;
/**
Use ASTextKitEntityAttribute as the value of this attribute to embed a link or other interactable content inside the
text.
*/
extern NSString *const ASTextKitEntityAttributeName;
static inline BOOL _objectsEqual(id<NSObject> obj1, id<NSObject> obj2)
{
return obj1 == obj2 ? YES : [obj1 isEqual:obj2];
}
/**
All NSObject values in this struct should be copied when passed into the TextComponent.
*/
struct ASTextKitAttributes {
/**
The string to be drawn. ASTextKit will not augment this string with default colors, etc. so this must be complete.
*/
NSAttributedString *attributedString;
/**
The string to use as the truncation string, usually just "...". If you have a range of text you would like to
restrict highlighting to (for instance if you have "... Continue Reading", use the ASTextKitTruncationAttributeName
to mark the specific range of the string that should be highlightable.
*/
NSAttributedString *truncationAttributedString;
/**
This is the character set that ASTextKit should attempt to avoid leaving as a trailing character before your
truncation token. By default this set includes "\s\t\n\r.,!?:;" so you don't end up with ugly looking truncation
text like "Hey, this is some fancy Truncation!\n\n...". Instead it would be truncated as "Hey, this is some fancy
truncation...". This is not always possible.
Set this to the empty charset if you want to just use the "dumb" truncation behavior. A nil value will be
substituted with the default described above.
*/
NSCharacterSet *avoidTailTruncationSet;
/**
The line-break mode to apply to the text. Since this also impacts how TextKit will attempt to truncate the text
in your string, we only support NSLineBreakByWordWrapping and NSLineBreakByCharWrapping.
*/
NSLineBreakMode lineBreakMode;
/**
The maximum number of lines to draw in the drawable region. Leave blank or set to 0 to define no maximum.
*/
NSUInteger maximumNumberOfLines;
/**
An array of UIBezierPath objects representing the exclusion paths inside the receiver's bounding rectangle. Default value: nil.
*/
NSArray *exclusionPaths;
/**
The shadow offset for any shadows applied to the text. The coordinate space for this is the same as UIKit, so a
positive width means towards the right, and a positive height means towards the bottom.
*/
CGSize shadowOffset;
/**
The color to use in drawing the text's shadow.
*/
UIColor *shadowColor;
/**
The opacity of the shadow from 0 to 1.
*/
CGFloat shadowOpacity;
/**
The radius that should be applied to the shadow blur. Larger values mean a larger, more blurred shadow.
*/
CGFloat shadowRadius;
/**
A pointer to a function that that returns a custom layout manager subclass. If nil, defaults to NSLayoutManager.
*/
NSLayoutManager *(*layoutManagerFactory)(void);
/**
We provide an explicit copy function so we can use aggregate initializer syntax while providing copy semantics for
the NSObjects inside.
*/
const ASTextKitAttributes copy() const
{
return {
[attributedString copy],
[truncationAttributedString copy],
[avoidTailTruncationSet copy],
lineBreakMode,
maximumNumberOfLines,
[exclusionPaths copy],
shadowOffset,
[shadowColor copy],
shadowOpacity,
shadowRadius,
layoutManagerFactory
};
};
bool operator==(const ASTextKitAttributes &other) const
{
// These comparisons are in a specific order to reduce the overall cost of this function.
return lineBreakMode == other.lineBreakMode
&& maximumNumberOfLines == other.maximumNumberOfLines
&& shadowOpacity == other.shadowOpacity
&& shadowRadius == other.shadowRadius
&& layoutManagerFactory == other.layoutManagerFactory
&& CGSizeEqualToSize(shadowOffset, other.shadowOffset)
&& _objectsEqual(exclusionPaths, other.exclusionPaths)
&& _objectsEqual(avoidTailTruncationSet, other.avoidTailTruncationSet)
&& _objectsEqual(shadowColor, other.shadowColor)
&& _objectsEqual(attributedString, other.attributedString)
&& _objectsEqual(truncationAttributedString, other.truncationAttributedString);
}
size_t hash() const;
};
#endif
|
#import "UIAlertView+SHAlertViewBlocks.h" |
/*
* Copyright (C) 2010 Gautier Hattenberger, 2013 Tobias Münch
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#include "modules/sonar/sonar_adc.h"
#include "generated/airframe.h"
#include "mcu_periph/adc.h"
#include "subsystems/abi.h"
#ifdef SITL
#include "state.h"
#endif
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
/** Sonar offset.
* Offset value in ADC
* equals to the ADC value so that height is zero
*/
#ifndef SONAR_OFFSET
#define SONAR_OFFSET 0
#endif
/** Sonar scale.
* Sensor sensitivity in m/adc (float)
*/
#ifndef SONAR_SCALE
#define SONAR_SCALE 0.0166
#endif
struct SonarAdc sonar_adc;
#ifndef SITL
static struct adc_buf sonar_adc_buf;
#endif
void sonar_adc_init(void)
{
sonar_adc.meas = 0;
sonar_adc.offset = SONAR_OFFSET;
#ifndef SITL
adc_buf_channel(ADC_CHANNEL_SONAR, &sonar_adc_buf, DEFAULT_AV_NB_SAMPLE);
#endif
}
/** Read ADC value to update sonar measurement
*/
void sonar_adc_read(void)
{
#ifndef SITL
sonar_adc.meas = sonar_adc_buf.sum / sonar_adc_buf.av_nb_sample;
sonar_adc.distance = (float)(sonar_adc.meas - sonar_adc.offset) * SONAR_SCALE;
#else // SITL
sonar_adc.distance = stateGetPositionEnu_f()->z;
Bound(sonar_adc.distance, 0.1f, 7.0f);
#endif // SITL
// Send ABI message
AbiSendMsgAGL(AGL_SONAR_ADC_ID, &sonar_adc.distance);
#ifdef SENSOR_SYNC_SEND_SONAR
// Send Telemetry report
DOWNLINK_SEND_SONAR(DefaultChannel, DefaultDevice, &sonar_adc.meas, &sonar_adc.distance);
#endif
}
|
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
*
* 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.
*
* ----------------------------------------------------------------------- */
/*
* syslinux/adv.c
*
* Access the syslinux auxiliary data vector
*/
#include <syslinux/adv.h>
#include <syslinux/firmware.h>
#include <klibc/compiler.h>
#include <syslinux/adv.h>
void __constructor __syslinux_init(void)
{
firmware->adv_ops->init();
}
|
#ifndef __TEMPNAME_H__
#define __TEMPNAME_H__
#define __need_size_t
#include <stddef.h>
#include <sys/types.h>
/* Disable support for $TMPDIR */
extern int ___path_search (char *tmpl, size_t tmpl_len, const char *dir,
const char *pfx /*, int try_tmpdir */) attribute_hidden;
#define __path_search(tmpl, tmpl_len, dir, pfx, try_tmpdir) ___path_search(tmpl, tmpl_len, dir, pfx)
extern int __gen_tempname (char *__tmpl, int __kind, mode_t mode);
/* The __kind argument to __gen_tempname may be one of: */
#define __GT_FILE 0 /* create a file */
#define __GT_BIGFILE 1 /* create a file, using open64 */
#define __GT_DIR 2 /* create a directory */
#define __GT_NOCREATE 3 /* just find a name not currently in use */
#endif
|
#pragma once
/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include "utils/StdString.h"
namespace dbiplus {
class Database;
class Dataset;
}
#include <memory>
class DatabaseSettings; // forward
class CDbUrl;
class CDatabase
{
public:
class Filter
{
public:
Filter() : fields("*") {};
Filter(const char *w) : fields("*"), where(w) {};
Filter(const std::string &w) : fields("*"), where(w) {};
void AppendField(const std::string &strField);
void AppendJoin(const std::string &strJoin);
void AppendWhere(const std::string &strWhere, bool combineWithAnd = true);
void AppendOrder(const std::string &strOrder);
void AppendGroup(const std::string &strGroup);
std::string fields;
std::string join;
std::string where;
std::string order;
std::string group;
std::string limit;
};
CDatabase(void);
virtual ~CDatabase(void);
bool IsOpen();
void Close();
bool Compress(bool bForce=true);
void Interupt();
bool Open(const DatabaseSettings &db);
void BeginTransaction();
virtual bool CommitTransaction();
void RollbackTransaction();
bool InTransaction();
static CStdString FormatSQL(CStdString strStmt, ...);
CStdString PrepareSQL(CStdString strStmt, ...) const;
/*!
* @brief Get a single value from a table.
* @remarks The values of the strWhereClause and strOrderBy parameters have to be FormatSQL'ed when used.
* @param strTable The table to get the value from.
* @param strColumn The column to get.
* @param strWhereClause If set, use this WHERE clause.
* @param strOrderBy If set, use this ORDER BY clause.
* @return The requested value or an empty string if it wasn't found.
*/
CStdString GetSingleValue(const CStdString &strTable, const CStdString &strColumn, const CStdString &strWhereClause = CStdString(), const CStdString &strOrderBy = CStdString());
/*! \brief Get a single value from a query on a dataset.
\param query the query in question.
\param ds the dataset to use for the query.
\return the value from the query, empty on failure.
*/
std::string GetSingleValue(const std::string &query, std::auto_ptr<dbiplus::Dataset> &ds);
/*!
* @brief Delete values from a table.
* @remarks The value of the strWhereClause parameter has to be FormatSQL'ed when used.
* @param strTable The table to delete the values from.
* @param strWhereClause If set, use this WHERE clause.
* @return True if the query was executed successfully, false otherwise.
*/
bool DeleteValues(const CStdString &strTable, const CStdString &strWhereClause = CStdString());
/*!
* @brief Execute a query that does not return any result.
* @param strQuery The query to execute.
* @return True if the query was executed successfully, false otherwise.
*/
bool ExecuteQuery(const CStdString &strQuery);
/*!
* @brief Execute a query that returns a result.
* @remarks Call m_pDS->close(); to clean up the dataset when done.
* @param strQuery The query to execute.
* @return True if the query was executed successfully, false otherwise.
*/
bool ResultQuery(const CStdString &strQuery);
/*!
* @brief Open a new dataset.
* @return True if the dataset was created successfully, false otherwise.
*/
bool OpenDS();
/*!
* @brief Put an INSERT or REPLACE query in the queue.
* @param strQuery The query to queue.
* @return True if the query was added successfully, false otherwise.
*/
bool QueueInsertQuery(const CStdString &strQuery);
/*!
* @brief Commit all queries in the queue.
* @return True if all queries were executed successfully, false otherwise.
*/
bool CommitInsertQueries();
virtual bool GetFilter(const CDbUrl &dbUrl, Filter &filter) { return true; }
virtual bool BuildSQL(const CStdString &strBaseDir, const CStdString &strQuery, Filter &filter, CStdString &strSQL, CDbUrl &dbUrl);
protected:
friend class CDatabaseManager;
bool Update(const DatabaseSettings &db);
void Split(const CStdString& strFileNameAndPath, CStdString& strPath, CStdString& strFileName);
uint32_t ComputeCRC(const CStdString &text);
virtual bool Open();
virtual bool CreateTables();
virtual void CreateViews() {};
virtual bool UpdateOldVersion(int version) { return true; };
virtual int GetMinVersion() const=0;
virtual const char *GetBaseDBName() const=0;
int GetDBVersion();
bool UpdateVersion(const CStdString &dbName);
bool BuildSQL(const CStdString &strQuery, const Filter &filter, CStdString &strSQL);
bool m_sqlite; ///< \brief whether we use sqlite (defaults to true)
std::auto_ptr<dbiplus::Database> m_pDB;
std::auto_ptr<dbiplus::Dataset> m_pDS;
std::auto_ptr<dbiplus::Dataset> m_pDS2;
private:
void InitSettings(DatabaseSettings &dbSettings);
bool Connect(const CStdString &dbName, const DatabaseSettings &db, bool create);
bool UpdateVersionNumber();
bool m_bMultiWrite; /*!< True if there are any queries in the queue, false otherwise */
unsigned int m_openCount;
};
|
/*
* This file is part of the coreboot project.
*
* Copyright 2015 Google 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; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc.
*/
#include <arch/early_variables.h>
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
#include <imd.h>
#include <rules.h>
#include <stage_cache.h>
#include <string.h>
static struct imd imd_stage_cache CAR_GLOBAL = { };
static inline struct imd *imd_get(void)
{
return car_get_var_ptr(&imd_stage_cache);
}
static void stage_cache_create_empty(void)
{
struct imd *imd;
void *base;
size_t size;
imd = imd_get();
stage_cache_external_region(&base, &size);
imd_handle_init(imd, (void *)(size + (uintptr_t)base));
printk(BIOS_DEBUG, "External stage cache:\n");
imd_create_tiered_empty(imd, 4096, 4096, 1024, 32);
if (imd_limit_size(imd, size))
printk(BIOS_DEBUG, "Could not limit stage cache size.\n");
}
static void stage_cache_recover(void)
{
struct imd *imd;
void *base;
size_t size;
imd = imd_get();
stage_cache_external_region(&base, &size);
imd_handle_init(imd, (void *)(size + (uintptr_t)base));
if (imd_recover(imd))
printk(BIOS_DEBUG, "Unable to recover external stage cache.\n");
}
void stage_cache_add(int stage_id, const struct prog *stage)
{
struct imd *imd;
const struct imd_entry *e;
struct stage_cache *meta;
void *c;
imd = imd_get();
e = imd_entry_add(imd, CBMEM_ID_STAGEx_META + stage_id, sizeof(*meta));
if (e == NULL)
return;
meta = imd_entry_at(imd, e);
meta->load_addr = (uintptr_t)prog_start(stage);
meta->entry_addr = (uintptr_t)prog_entry(stage);
e = imd_entry_add(imd, CBMEM_ID_STAGEx_CACHE + stage_id,
prog_size(stage));
if (e == NULL)
return;
c = imd_entry_at(imd, e);
memcpy(c, prog_start(stage), prog_size(stage));
}
void stage_cache_load_stage(int stage_id, struct prog *stage)
{
struct imd *imd;
struct stage_cache *meta;
const struct imd_entry *e;
void *c;
size_t size;
imd = imd_get();
e = imd_entry_find(imd, CBMEM_ID_STAGEx_META + stage_id);
if (e == NULL)
return;
meta = imd_entry_at(imd, e);
e = imd_entry_find(imd, CBMEM_ID_STAGEx_CACHE + stage_id);
if (e == NULL)
return;
c = imd_entry_at(imd, e);
size = imd_entry_size(imd, e);
memcpy((void *)(uintptr_t)meta->load_addr, c, size);
prog_set_area(stage, (void *)(uintptr_t)meta->load_addr, size);
prog_set_entry(stage, (void *)(uintptr_t)meta->entry_addr, NULL);
}
static void stage_cache_setup(int is_recovery)
{
if (is_recovery)
stage_cache_recover();
else
stage_cache_create_empty();
}
ROMSTAGE_CBMEM_INIT_HOOK(stage_cache_setup)
RAMSTAGE_CBMEM_INIT_HOOK(stage_cache_setup)
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef KYRA_GUI_V2_H
#define KYRA_GUI_V2_H
#include "kyra/gui/gui_v1.h"
namespace Kyra {
#define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t) \
do { \
button.nextButton = 0; \
button.index = a; \
button.keyCode = b; \
button.keyCode2 = c; \
button.data0Val1 = d; \
button.data1Val1 = e; \
button.data2Val1 = f; \
button.flags = h; \
button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \
button.dimTableIndex = i; \
button.x = j; \
button.y = k; \
button.width = l; \
button.height = m; \
button.data0Val2 = n; \
button.data0Val3 = o; \
button.data1Val2 = p; \
button.data1Val3 = q; \
button.data2Val2 = r; \
button.data2Val3 = s; \
button.flags2 = t; \
button.mouseWheel = 0; \
button.arg = 0; \
} while (0)
#define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
do { \
menu.x = a; \
menu.y = b; \
menu.width = c; \
menu.height = d; \
menu.bkgdColor = e; \
menu.color1 = f; \
menu.color2 = g; \
menu.menuNameId = h; \
menu.textColor = i; \
menu.titleX = j; \
menu.titleY = k; \
menu.highlightedItem = l; \
menu.numberOfItems = m; \
menu.scrollUpButtonX = n; \
menu.scrollUpButtonY = o; \
menu.scrollDownButtonX = p; \
menu.scrollDownButtonY = q; \
} while (0)
#define GUI_V2_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
do { \
item.enabled = a; \
item.itemId = b; \
item.x = c; \
item.y = d; \
item.width = e; \
item.height = f; \
item.textColor = g; \
item.highlightColor = h; \
item.titleX = i; \
item.bkgdColor = j; \
item.color1 = k; \
item.color2 = l; \
item.saveSlot = m; \
item.labelId = n; \
item.labelX = o; \
item.labelY = p; \
item.keyCode = q; \
} while (0)
class KyraEngine_v2;
class Screen_v2;
class GUI_v2 : public GUI_v1 {
public:
GUI_v2(KyraEngine_v2 *vm);
virtual void initStaticData() = 0;
Button *addButtonToList(Button *list, Button *newButton);
void processButton(Button *button);
int processButtonList(Button *button, uint16 inputFlag, int8 mouseWheel);
protected:
void updateButton(Button *button);
KyraEngine_v2 *_vm;
Screen_v2 *_screen;
bool _buttonListChanged;
Button *_backUpButtonList;
Button *_specialProcessButton;
uint16 _flagsModifier;
protected:
virtual void setupPalette() {}
virtual void restorePalette() {}
virtual char *getTableString(int id) = 0;
virtual uint8 textFieldColor1() const = 0;
virtual uint8 textFieldColor2() const = 0;
virtual uint8 textFieldColor3() const = 0;
protected:
virtual void getInput();
Button _menuButtons[7];
Button _scrollUpButton;
Button _scrollDownButton;
Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _savenameMenu, _deathMenu;
Button *getButtonListData() { return _menuButtons; }
Button *getScrollUpButton() { return &_scrollUpButton; }
Button *getScrollDownButton() { return &_scrollDownButton; }
int scrollUpButton(Button *button);
int scrollDownButton(Button *button);
Button::Callback _scrollUpFunctor;
Button::Callback _scrollDownFunctor;
Button::Callback getScrollUpButtonHandler() const { return _scrollUpFunctor; }
Button::Callback getScrollDownButtonHandler() const { return _scrollDownFunctor; }
Button _sliderButtons[3][4];
void renewHighlight(Menu &menu);
void backUpPage1(uint8 *buffer);
void restorePage1(const uint8 *buffer);
Menu *_currentMenu;
bool _isLoadMenu;
bool _isDeathMenu;
bool _isSaveMenu;
bool _isDeleteMenu;
bool _isChoiceMenu;
bool _isOptionsMenu;
bool _madeSave;
bool _loadedSave;
bool _restartGame;
bool _reloadTemporarySave;
int _savegameOffset;
void setupSavegameNames(Menu &menu, int num);
// main menu
int resumeGame(Button *caller);
// audio menu
static const int _sliderBarsPosition[];
// load menu
bool _noLoadProcess;
int clickLoadSlot(Button *caller);
int cancelLoadMenu(Button *caller);
// save menu
bool _noSaveProcess;
int _saveSlot;
char _saveDescription[0x51];
int saveMenu(Button *caller);
int clickSaveSlot(Button *caller);
int cancelSaveMenu(Button *caller);
// delete menu
int _slotToDelete;
int deleteMenu(Button *caller);
// options menu
int quitOptionsMenu(Button *caller);
int toggleWalkspeed(Button *caller);
int toggleText(Button *caller);
virtual void setupOptionsButtons() = 0;
// audio options
Button::Callback _sliderHandlerFunctor;
virtual int sliderHandler(Button *caller) = 0;
// savename menu
bool _finishNameInput, _cancelNameInput;
const char *nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8 c2, uint8 c3, int bufferSize);
int finishSavename(Button *caller);
int cancelSavename(Button *caller);
bool checkSavegameDescription(const char *buffer, int size);
int getCharWidth(uint8 c);
void drawTextfieldBlock(int x, int y, uint8 c);
// choice menu
bool _choice;
bool choiceDialog(int name, bool type);
int choiceYes(Button *caller);
int choiceNo(Button *caller);
};
} // End of namespace Kyra
#endif
|
/*
* INTEL CONFIDENTIAL
*
* Copyright 2014
* Intel Corporation All Rights Reserved.
*
* The source code contained or described herein and all documents related to
* the source code ("Material") are owned by Intel Corporation or its suppliers
* or licensors. Title to the Material remains with Intel Corporation or its
* suppliers and licensors. The Material contains trade secrets and proprietary
* and confidential information of Intel or its suppliers and licensors. The
* Material is protected by worldwide copyright and trade secret laws and treaty
* provisions. No part of the Material may be used, copied, reproduced,
* modified, published, uploaded, posted, transmitted, distributed, or disclosed
* in any way without Intels prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel
* or otherwise. Any license under such intellectual property rights must be
* express and approved by Intel in writing.
*
*/
#ifndef INTEL_CUSTOM_FORMATS_H_
#define INTEL_CUSTOM_FORMATS_H_
#include <drm/drm_fourcc.h>
#define DRM_FORMAT_NV12_INTEL fourcc_code('S', 'B', '1', '2')
#endif /* INTEL_CUSTOM_FORMATS_H_ */
|
/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <mqueue.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <sysdep.h>
#ifdef __NR_mq_open
/* Establish connection between a process and a message queue NAME and
return message queue descriptor or (mqd_t) -1 on error. OFLAG determines
the type of access used. If O_CREAT is on OFLAG, the third argument is
taken as a `mode_t', the mode of the created message queue, and the fourth
argument is taken as `struct mq_attr *', pointer to message queue
attributes. If the fourth argument is NULL, default attributes are
used. */
mqd_t
__mq_open (const char *name, int oflag, ...)
{
if (name[0] != '/')
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
mode_t mode = 0;
struct mq_attr *attr = NULL;
if (oflag & O_CREAT)
{
va_list ap;
va_start (ap, oflag);
mode = va_arg (ap, mode_t);
attr = va_arg (ap, struct mq_attr *);
va_end (ap);
}
return INLINE_SYSCALL (mq_open, 4, name + 1, oflag, mode, attr);
}
strong_alias (__mq_open, mq_open);
mqd_t
__mq_open_2 (const char *name, int oflag)
{
if (oflag & O_CREAT)
__fortify_fail ("invalid mq_open call: O_CREAT without mode and attr");
return __mq_open (name, oflag);
}
#else
# include <rt/mq_open.c>
#endif
|
#ifndef _TBSQBOX2CI_H_
#define _TBSQBOX2CI_H_
#define DVB_USB_LOG_PREFIX "tbsqbox2ci"
#include "dvb-usb.h"
#define deb_xfer(args...) dprintk(dvb_usb_tbsqbox2ci_debug, 0x02, args)
#endif
|
#include "f2c.h"
#undef abs
#include <math.h>
double
r_log (real * x)
{
return (log (*x));
}
|
/*******************************************************************************
Intel PRO/1000 Linux driver
Copyright(c) 1999 - 2008 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000_MAC_H_
#define _E1000_MAC_H_
/*
* Functions that should not be called directly from drivers but can be used
* by other files in this 'shared code'
*/
void e1000_init_mac_ops_generic(struct e1000_hw *hw);
void e1000_null_mac_generic(struct e1000_hw *hw);
s32 e1000_null_ops_generic(struct e1000_hw *hw);
s32 e1000_null_link_info(struct e1000_hw *hw, u16 *s, u16 *d);
bool e1000_null_mng_mode(struct e1000_hw *hw);
void e1000_null_update_mc(struct e1000_hw *hw, u8 *h, u32 a, u32 b, u32 c);
void e1000_null_write_vfta(struct e1000_hw *hw, u32 a, u32 b);
void e1000_null_mta_set(struct e1000_hw *hw, u32 a);
void e1000_null_rar_set(struct e1000_hw *hw, u8 *h, u32 a);
s32 e1000_blink_led_generic(struct e1000_hw *hw);
s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw);
s32 e1000_check_for_fiber_link_generic(struct e1000_hw *hw);
s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw);
s32 e1000_cleanup_led_generic(struct e1000_hw *hw);
s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw);
s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw);
s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw);
s32 e1000_force_mac_fc_generic(struct e1000_hw *hw);
s32 e1000_get_auto_rd_done_generic(struct e1000_hw *hw);
s32 e1000_get_bus_info_pci_generic(struct e1000_hw *hw);
s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw);
s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw);
s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
u16 *duplex);
s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw *hw,
u16 *speed, u16 *duplex);
s32 e1000_id_led_init_generic(struct e1000_hw *hw);
s32 e1000_led_on_generic(struct e1000_hw *hw);
s32 e1000_led_off_generic(struct e1000_hw *hw);
void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,
u8 *mc_addr_list, u32 mc_addr_count,
u32 rar_used_count, u32 rar_count);
s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw);
s32 e1000_set_default_fc_generic(struct e1000_hw *hw);
s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw);
s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw);
s32 e1000_setup_led_generic(struct e1000_hw *hw);
s32 e1000_setup_link_generic(struct e1000_hw *hw);
s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw);
s32 e1000_write_8bit_ctrl_reg_generic(struct e1000_hw *hw, u32 reg,
u32 offset, u8 data);
u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr);
void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw);
void e1000_clear_vfta_generic(struct e1000_hw *hw);
void e1000_config_collision_dist_generic(struct e1000_hw *hw);
void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count);
void e1000_mta_set_generic(struct e1000_hw *hw, u32 hash_value);
void e1000_pcix_mmrbc_workaround_generic(struct e1000_hw *hw);
void e1000_put_hw_semaphore_generic(struct e1000_hw *hw);
void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
void e1000_remove_device_generic(struct e1000_hw *hw);
void e1000_reset_adaptive_generic(struct e1000_hw *hw);
void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop);
void e1000_update_adaptive_generic(struct e1000_hw *hw);
void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
#endif
|
/*
* Copyright (c) 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#) $Header: /cvs/sw/new-wave/user/traceroute/ifaddrlist.h,v 1.2 2007-06-26 13:01:51 gerg Exp $ (LBL)
*/
struct ifaddrlist {
u_int32_t addr;
char *device;
};
int ifaddrlist(struct ifaddrlist **, char *);
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_power_h
#define _SDL_power_h
/**
* \file SDL_power.h
*
* Header for the SDL power management routines.
*/
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief The basic state for the system's power supply.
*/
typedef enum
{
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
} SDL_PowerState;
/**
* \brief Get the current power supply details.
*
* \param secs Seconds of battery life left. You can pass a NULL here if
* you don't care. Will return -1 if we can't determine a
* value, or we're not running on a battery.
*
* \param pct Percentage of battery life left, between 0 and 100. You can
* pass a NULL here if you don't care. Will return -1 if we
* can't determine a value, or we're not running on a battery.
*
* \return The state of the battery (if any).
*/
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_power_h */
/* vi: set ts=4 sw=4 expandtab: */
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010,2011,2012 TELEMATICS LAB, Politecnico di Bari
*
* This file is part of LTE-Sim
*
* LTE-Sim is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation;
*
* LTE-Sim 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 LTE-Sim; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Giuseppe Piro <g.piro@poliba.it>
*/
#ifndef FLOWSMANAGER_H_
#define FLOWSMANAGER_H_
#include <iostream>
#include <queue>
#include "../protocolStack/protocols/TransportProtocol.h"
#include "../flows/application/Application.h"
class ClassifierParameters;
class QoSParameters;
class NetworkNode;
class FlowsManager {
public:
private:
FlowsManager();
static FlowsManager *ptr;
public:
virtual ~FlowsManager();
static FlowsManager*
Init (void)
{
if (ptr==NULL)
{
ptr = new FlowsManager;
}
return ptr;
}
Application* CreateApplication (int applicationID,
NetworkNode* src, NetworkNode* dst,
int srcPort, int destPort,
TransportProtocol::TransportProtocolType protocol,
Application::ApplicationType type,
QoSParameters* qos,
double startTime, double duration);
};
#endif /* FLOWSMANAGER_H_ */
|
//
// ID Engine
// ID_IN.h - Header file for Input Manager
// v1.0d1
// By Jason Blochowiak
//
#ifndef __ID_IN__
#define __ID_IN__
#ifdef __DEBUG__
#define __DEBUG_InputMgr__
#endif
#define MaxPlayers 4
#define MaxKbds 2
#define MaxJoys 2
#define NumCodes 128
typedef byte ScanCode;
#define sc_None 0
#define sc_Bad 0xff
#define sc_Return 0x1c
#define sc_Enter sc_Return
#define sc_Escape 0x01
#define sc_Space 0x39
#define sc_BackSpace 0x0e
#define sc_Tab 0x0f
#define sc_Alt 0x38
#define sc_Control 0x1d
#define sc_CapsLock 0x3a
#define sc_LShift 0x2a
#define sc_RShift 0x36
#define sc_UpArrow 0x48
#define sc_DownArrow 0x50
#define sc_LeftArrow 0x4b
#define sc_RightArrow 0x4d
#define sc_Insert 0x52
#define sc_Delete 0x53
#define sc_Home 0x47
#define sc_End 0x4f
#define sc_PgUp 0x49
#define sc_PgDn 0x51
#define sc_F1 0x3b
#define sc_F2 0x3c
#define sc_F3 0x3d
#define sc_F4 0x3e
#define sc_F5 0x3f
#define sc_F6 0x40
#define sc_F7 0x41
#define sc_F8 0x42
#define sc_F9 0x43
#define sc_F10 0x44
#define sc_F11 0x57
#define sc_F12 0x59
#define sc_1 0x02
#define sc_2 0x03
#define sc_3 0x04
#define sc_4 0x05
#define sc_5 0x06
#define sc_6 0x07
#define sc_7 0x08
#define sc_8 0x09
#define sc_9 0x0a
#define sc_0 0x0b
#define sc_A 0x1e
#define sc_B 0x30
#define sc_C 0x2e
#define sc_D 0x20
#define sc_E 0x12
#define sc_F 0x21
#define sc_G 0x22
#define sc_H 0x23
#define sc_I 0x17
#define sc_J 0x24
#define sc_K 0x25
#define sc_L 0x26
#define sc_M 0x32
#define sc_N 0x31
#define sc_O 0x18
#define sc_P 0x19
#define sc_Q 0x10
#define sc_R 0x13
#define sc_S 0x1f
#define sc_T 0x14
#define sc_U 0x16
#define sc_V 0x2f
#define sc_W 0x11
#define sc_X 0x2d
#define sc_Y 0x15
#define sc_Z 0x2c
#define key_None 0
#define key_Return 0x0d
#define key_Enter key_Return
#define key_Escape 0x1b
#define key_Space 0x20
#define key_BackSpace 0x08
#define key_Tab 0x09
#define key_Delete 0x7f
// Stuff for the mouse
#define MReset 0
#define MButtons 3
#define MDelta 11
#define MouseInt 0x33
#define Mouse(x) _AX = x,geninterrupt(MouseInt)
typedef enum {
demo_Off,demo_Record,demo_Playback,demo_PlayDone
} Demo;
typedef enum {
ctrl_Keyboard,
ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
ctrl_Joystick,
ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
ctrl_Mouse
} ControlType;
typedef enum {
motion_Left = -1,motion_Up = -1,
motion_None = 0,
motion_Right = 1,motion_Down = 1
} Motion;
typedef enum {
dir_North,dir_NorthEast,
dir_East,dir_SouthEast,
dir_South,dir_SouthWest,
dir_West,dir_NorthWest,
dir_None
} Direction;
typedef struct {
boolean button0,button1,button2,button3;
int x,y;
Motion xaxis,yaxis;
Direction dir;
} CursorInfo;
typedef CursorInfo ControlInfo;
typedef struct {
ScanCode button0,button1,
upleft, up, upright,
left, right,
downleft, down, downright;
} KeyboardDef;
typedef struct {
word joyMinX,joyMinY,
threshMinX,threshMinY,
threshMaxX,threshMaxY,
joyMaxX,joyMaxY,
joyMultXL,joyMultYL,
joyMultXH,joyMultYH;
} JoystickDef;
// Global variables
extern boolean Keyboard[],
MousePresent,
JoysPresent[];
extern boolean Paused;
extern char LastASCII;
extern ScanCode LastScan;
extern KeyboardDef KbdDefs;
extern JoystickDef JoyDefs[];
extern ControlType Controls[MaxPlayers];
extern Demo DemoMode;
extern byte _seg *DemoBuffer;
extern word DemoOffset,DemoSize;
// Function prototypes
#define IN_KeyDown(code) (Keyboard[(code)])
#define IN_ClearKey(code) {Keyboard[code] = false;\
if (code == LastScan) LastScan = sc_None;}
// DEBUG - put names in prototypes
extern void IN_Startup(void),IN_Shutdown(void),
IN_Default(boolean gotit,ControlType in),
IN_SetKeyHook(void (*)()),
IN_ClearKeysDown(void),
IN_ReadCursor(CursorInfo *),
IN_ReadControl(int,ControlInfo *),
IN_SetControlType(int,ControlType),
IN_GetJoyAbs(word joy,word *xp,word *yp),
IN_SetupJoy(word joy,word minx,word maxx,
word miny,word maxy),
IN_StopDemo(void),IN_FreeDemoBuffer(void),
IN_Ack(void),IN_AckBack(void);
extern boolean IN_UserInput(longword delay);
extern char IN_WaitForASCII(void);
extern ScanCode IN_WaitForKey(void);
extern word IN_GetJoyButtonsDB(word joy);
extern byte *IN_GetScanName(ScanCode);
byte IN_MouseButtons (void);
byte IN_JoyButtons (void);
void INL_GetJoyDelta(word joy,int *dx,int *dy);
void IN_StartAck(void);
boolean IN_CheckAck (void);
#endif
|
/*
* Author:
* Guido Draheim <guidod@gmx.de>
*
* Copyright (c) 2002,2003 Guido Draheim
* All rights reserved
* use under the restrictions of the
* Lesser GNU General Public License
* or alternatively the restrictions
* of the Mozilla Public License 1.1
*
* the interfaces for the plugin_io system
*
* Using the following you can provide your own file I/O functions to
* e.g. read data directly from memory, provide simple
* "encryption"/"decryption" of on-disk .zip-files...
* Note that this currently only provides a subset of the functionality
* in zziplib. It does not attempt to provide any directory functions,
* but if your program 1) only uses ordinary on-disk files and you
* just want this for file obfuscation, or 2) you only access your
* .zip archives using zzip_open & co., this is sufficient.
*
* Currently the default io are the POSIX functions, except
* for 'filesize' that is zziplibs own provided zzip_filesize function,
* using standard POSIX fd's. You are however free to replace this with
* whatever data type you need, so long as you provide implementations
* for all the functions, and the data type fits an int.
*
* all functions receiving ext_io are able to cope with both arguments
* set to zero which will let them default to a ZIP ext and posix io.
*/
#ifndef _ZZIP_PLUGIN_H /* zzip-io.h */
#define _ZZIP_PLUGIN_H 1
#include <zzip.h>
#ifdef __cplusplus
extern "C" {
#endif
/* we have renamed zzip_plugin_io.use_mmap to zzip_plugin_io.sys */
#define ZZIP_PLUGIN_IO_SYS 1
struct zzip_plugin_io { /* use "zzip_plugin_io_handlers" in applications !! */
size_t (*open)(zzip_char_t* name, int flags, ...);
int (*close)(__zzipfd fd);
zzip_ssize_t (*read)(__zzipfd fd, void* buf, zzip_size_t len);
zzip_off_t (*seeks)(__zzipfd fd, zzip_off_t offset, int whence);
zzip_off_t (*filesize)(__zzipfd fd);
long sys;
long type;
zzip_ssize_t (*write)(__zzipfd fd, _zzip_const void* buf, zzip_size_t len);
};
typedef union _zzip_plugin_io
{
struct zzip_plugin_io fd;
struct { void* padding[8]; } ptr;
} zzip_plugin_io_handlers;
#define _zzip_plugin_io_handlers zzip_plugin_io_handlers
/* for backward compatibility, and the following to your application code:
* #ifndef _zzip_plugin_io_handlers
* #define _zzip_plugin_io_handlers struct zzip_plugin_io
*/
typedef zzip_plugin_io_handlers* zzip_plugin_io_handlers_t;
#ifdef ZZIP_LARGEFILE_RENAME
#define zzip_filesize zzip_filesize64
#define zzip_get_default_io zzip_get_default_io64
#define zzip_init_io zzip_init_io64
#endif
_zzip_export zzip_off_t
zzip_filesize(__zzipfd fd);
/* get the default file I/O functions */
_zzip_export zzip_plugin_io_t zzip_get_default_io(void);
/*
* Initializes a zzip_plugin_io_t to the zziplib default io.
* This is useful if you only want to override e.g. the 'read' function.
* all zzip functions that can receive a zzip_plugin_io_t can
* handle a zero pointer in that place and default to posix io.
*/
_zzip_export
int zzip_init_io(zzip_plugin_io_handlers_t io, int flags);
/* zzip_init_io flags : */
# define ZZIP_IO_USE_MMAP 1
#ifdef __cplusplus
};
#endif
#endif
|
/*
*
* D-Bus++ - C++ bindings for D-Bus
*
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __DBUSXX_GLIB_INTEGRATION_H
#define __DBUSXX_GLIB_INTEGRATION_H
#include <glib.h>
#include "api.h"
#include "dispatcher.h"
namespace DBus {
namespace Glib {
class BusDispatcher;
class DXXAPI BusTimeout : public Timeout
{
private:
BusTimeout(Timeout::Internal *, GMainContext *, int);
~BusTimeout();
void toggle();
static gboolean timeout_handler(gpointer);
void _enable();
void _disable();
private:
GMainContext *_ctx;
int _priority;
GSource *_source;
friend class BusDispatcher;
};
class DXXAPI BusWatch : public Watch
{
private:
BusWatch(Watch::Internal *, GMainContext *, int);
~BusWatch();
void toggle();
static gboolean watch_handler(gpointer);
void _enable();
void _disable();
private:
GMainContext *_ctx;
int _priority;
GSource *_source;
friend class BusDispatcher;
};
class DXXAPI BusDispatcher : public Dispatcher
{
public:
BusDispatcher();
~BusDispatcher();
void attach(GMainContext *);
void enter() {}
void leave() {}
Timeout *add_timeout(Timeout::Internal *);
void rem_timeout(Timeout *);
Watch *add_watch(Watch::Internal *);
void rem_watch(Watch *);
void set_priority(int priority);
private:
GMainContext *_ctx;
int _priority;
GSource *_source;
};
} /* namespace Glib */
} /* namespace DBus */
#endif//__DBUSXX_GLIB_INTEGRATION_H
|
/*
* Copyright (C) 2015 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_ezr32wg
* @ingroup drivers_periph_gpio
* @{
*
* @file
* @brief Low-level GPIO driver implementation
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include "cpu.h"
#include "periph/gpio.h"
#include "periph_conf.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
/**
* @brief Number of external interrupt lines
*/
#define NUMOF_IRQS (16U)
/**
* @brief Hold one interrupt context per interrupt line
*/
static gpio_isr_ctx_t isr_ctx[NUMOF_IRQS];
static inline int _port_num(gpio_t pin)
{
return (pin & 0xf0) >> 4;
}
static inline GPIO_P_TypeDef *_port(gpio_t pin)
{
return (GPIO_P_TypeDef *)(&GPIO->P[_port_num(pin)]);
}
static inline int _pin_pos(gpio_t pin)
{
return (pin & 0x0f);
}
static inline int _pin_mask(gpio_t pin)
{
return (1 << _pin_pos(pin));
}
int gpio_init(gpio_t pin, gpio_mode_t mode)
{
GPIO_P_TypeDef *port = _port(pin);
uint32_t pin_pos = _pin_pos(pin);
if (mode == GPIO_IN_PD) {
return -1;
}
/* enable power for the GPIO module */
CMU->HFPERCLKEN0 |= CMU_HFPERCLKEN0_GPIO;
/* configure the mode */
port->MODE[pin_pos >> 3] &= ~(0xf << ((pin_pos & 0x7) * 4));
port->MODE[pin_pos >> 3] |= (mode << ((pin_pos & 0x7) * 4));
/* if input with pull-up, set the data out register */
if (mode == GPIO_IN_PU) {
port->DOUTSET = (1 << pin_pos);
} else if (mode == GPIO_IN) {
port->DOUTCLR = (1 << pin_pos);
}
return 0;
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
gpio_cb_t cb, void *arg)
{
uint32_t pin_pos = _pin_pos(pin);
/* configure as input */
gpio_init(pin, mode);
/* just in case, disable interrupt for this channel */
GPIO->IEN &= ~(1 << pin_pos);
/* save callback */
isr_ctx[pin_pos].cb = cb;
isr_ctx[pin_pos].arg = arg;
/* configure interrupt */
GPIO->EXTIPSEL[pin_pos >> 3] &= (0x7 << ((pin_pos & 0x7) * 4));
GPIO->EXTIPSEL[pin_pos >> 3] |= (_port_num(pin) << ((pin_pos & 0x7) * 4));
GPIO->EXTIRISE &= ~(1 << pin_pos);
GPIO->EXTIRISE |= ((flank & 0x1) << pin_pos);
GPIO->EXTIFALL &= ~(1 << pin_pos);
GPIO->EXTIFALL &= (((flank & 0x2) >> 1) << pin_pos);
/* enable global GPIO IRQ */
NVIC_EnableIRQ(GPIO_EVEN_IRQn);
/* enable the interrupt channel */
GPIO->IEN |= (1 << pin_pos);
return 0;
}
void gpio_irq_enable(gpio_t pin)
{
GPIO->IEN |= _pin_mask(pin);
}
void gpio_irq_disable(gpio_t pin)
{
GPIO->IEN &= ~(_pin_mask(pin));
}
int gpio_read(gpio_t pin)
{
return _port(pin)->DIN & _pin_mask(pin);
}
void gpio_set(gpio_t pin)
{
_port(pin)->DOUTSET = _pin_mask(pin);
}
void gpio_clear(gpio_t pin)
{
_port(pin)->DOUTCLR = _pin_mask(pin);
}
void gpio_toggle(gpio_t pin)
{
_port(pin)->DOUTTGL = _pin_mask(pin);
}
void gpio_write(gpio_t pin, int value)
{
if (value) {
_port(pin)->DOUTSET = _pin_mask(pin);
} else {
_port(pin)->DOUTCLR = _pin_mask(pin);
}
}
/**
* @brief External interrupt handler
*/
void isr_gpio_even(void)
{
for (int i = 0; i < NUMOF_IRQS; i++) {
if (GPIO->IF & (1 << i)) {
isr_ctx[i].cb(isr_ctx[i].arg);
GPIO->IFC = (1 << i);
}
}
cortexm_isr_end();
}
|
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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 JSSVGZoomEvent_h
#define JSSVGZoomEvent_h
#if ENABLE(SVG)
#include "JSUIEvent.h"
#include "SVGElement.h"
namespace WebCore {
class SVGZoomEvent;
class JSSVGZoomEvent : public JSUIEvent {
typedef JSUIEvent Base;
public:
JSSVGZoomEvent(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<SVGZoomEvent>);
static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
};
class JSSVGZoomEventPrototype : public JSC::JSObject {
typedef JSC::JSObject Base;
public:
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
JSSVGZoomEventPrototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
protected:
static const unsigned StructureFlags = Base::StructureFlags;
};
// Attributes
JSC::JSValue jsSVGZoomEventZoomRectScreen(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsSVGZoomEventPreviousScale(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsSVGZoomEventPreviousTranslate(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsSVGZoomEventNewScale(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsSVGZoomEventNewTranslate(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsSVGZoomEventConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
#endif // ENABLE(SVG)
#endif
|
#ifndef _CCB_CCBMEMBERVARIABLEASSIGNER_H_
#define _CCB_CCBMEMBERVARIABLEASSIGNER_H_
#include "cocos2d.h"
#include "CCBValue.h"
NS_CC_EXT_BEGIN
#define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \
if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, (MEMBERVARIABLENAME))) { \
MEMBERVARIABLETYPE pOldVar = MEMBERVARIABLE; \
MEMBERVARIABLE = dynamic_cast<MEMBERVARIABLETYPE>(pNode); \
CC_ASSERT(MEMBERVARIABLE); \
if (pOldVar != MEMBERVARIABLE) { \
CC_SAFE_RELEASE(pOldVar); \
MEMBERVARIABLE->retain(); \
} \
return true; \
}
class CCBMemberVariableAssigner {
public:
virtual ~CCBMemberVariableAssigner() {};
/**
* The callback function of assigning member variable.
* @note The member variable must be CCNode or its subclass.
* @param pTarget The custom class.
* @param pMemberVariableName The name of the member variable.
* @param pNode The member variable.
* @return Whether the assignment was successful.
*/
virtual bool onAssignCCBMemberVariable(CCObject* pTarget, const char* pMemberVariableName, CCNode* pNode) = 0;
/**
* The callback function of assigning custom properties.
* @note The member variable must be Integer, Float, Boolean or String.
* @param pTarget The custom class.
* @param pMemberVariableName The name of the member variable.
* @param pValue The value of the property.
* @return Whether the assignment was successful.
*/
virtual bool onAssignCCBCustomProperty(CCObject* pTarget, const char* pMemberVariableName, CCBValue* pCCBValue) { return false; };
};
NS_CC_EXT_END
#endif
|
/*
* Header for misc.c.
*/
#ifndef PUTTY_MISC_H
#define PUTTY_MISC_H
#include "puttymem.h"
#include <stdio.h> /* for FILE * */
#include <stdarg.h> /* for va_list */
#include <time.h> /* for struct tm */
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
typedef struct Filename Filename;
typedef struct FontSpec FontSpec;
unsigned long parse_blocksize(const char *bs);
char ctrlparse(char *s, char **next);
char *dupstr(const char *s);
char *dupcat(const char *s1, ...);
char *dupprintf(const char *fmt, ...);
char *dupvprintf(const char *fmt, va_list ap);
void burnstr(char *string);
int toint(unsigned);
char *fgetline(FILE *fp);
void base64_encode_atom(unsigned char *data, int n, char *out);
struct bufchain_granule;
typedef struct bufchain_tag {
struct bufchain_granule *head, *tail;
int buffersize; /* current amount of buffered data */
} bufchain;
void bufchain_init(bufchain *ch);
void bufchain_clear(bufchain *ch);
int bufchain_size(bufchain *ch);
void bufchain_add(bufchain *ch, const void *data, int len);
void bufchain_prefix(bufchain *ch, void **data, int *len);
void bufchain_consume(bufchain *ch, int len);
void bufchain_fetch(bufchain *ch, void *data, int len);
struct tm ltime(void);
void smemclr(void *b, size_t len);
/*
* Debugging functions.
*
* Output goes to debug.log
*
* debug(()) (note the double brackets) is like printf().
*
* dmemdump() and dmemdumpl() both do memory dumps. The difference
* is that dmemdumpl() is more suited for when the memory address is
* important (say because you'll be recording pointer values later
* on). dmemdump() is more concise.
*/
#ifdef DEBUG
void debug_printf(char *fmt, ...);
void debug_memdump(void *buf, int len, int L);
#define debug(x) (debug_printf x)
#define dmemdump(buf,len) debug_memdump (buf, len, 0);
#define dmemdumpl(buf,len) debug_memdump (buf, len, 1);
#else
#define debug(x)
#define dmemdump(buf,len)
#define dmemdumpl(buf,len)
#endif
#ifndef lenof
#define lenof(x) ( (sizeof((x))) / (sizeof(*(x))))
#endif
#ifndef min
#define min(x,y) ( (x) < (y) ? (x) : (y) )
#endif
#ifndef max
#define max(x,y) ( (x) > (y) ? (x) : (y) )
#endif
#define GET_32BIT_LSB_FIRST(cp) \
(((unsigned long)(unsigned char)(cp)[0]) | \
((unsigned long)(unsigned char)(cp)[1] << 8) | \
((unsigned long)(unsigned char)(cp)[2] << 16) | \
((unsigned long)(unsigned char)(cp)[3] << 24))
#define PUT_32BIT_LSB_FIRST(cp, value) ( \
(cp)[0] = (unsigned char)(value), \
(cp)[1] = (unsigned char)((value) >> 8), \
(cp)[2] = (unsigned char)((value) >> 16), \
(cp)[3] = (unsigned char)((value) >> 24) )
#define GET_16BIT_LSB_FIRST(cp) \
(((unsigned long)(unsigned char)(cp)[0]) | \
((unsigned long)(unsigned char)(cp)[1] << 8))
#define PUT_16BIT_LSB_FIRST(cp, value) ( \
(cp)[0] = (unsigned char)(value), \
(cp)[1] = (unsigned char)((value) >> 8) )
#define GET_32BIT_MSB_FIRST(cp) \
(((unsigned long)(unsigned char)(cp)[0] << 24) | \
((unsigned long)(unsigned char)(cp)[1] << 16) | \
((unsigned long)(unsigned char)(cp)[2] << 8) | \
((unsigned long)(unsigned char)(cp)[3]))
#define GET_32BIT(cp) GET_32BIT_MSB_FIRST(cp)
#define PUT_32BIT_MSB_FIRST(cp, value) ( \
(cp)[0] = (unsigned char)((value) >> 24), \
(cp)[1] = (unsigned char)((value) >> 16), \
(cp)[2] = (unsigned char)((value) >> 8), \
(cp)[3] = (unsigned char)(value) )
#define PUT_32BIT(cp, value) PUT_32BIT_MSB_FIRST(cp, value)
#define GET_16BIT_MSB_FIRST(cp) \
(((unsigned long)(unsigned char)(cp)[0] << 8) | \
((unsigned long)(unsigned char)(cp)[1]))
#define PUT_16BIT_MSB_FIRST(cp, value) ( \
(cp)[0] = (unsigned char)((value) >> 8), \
(cp)[1] = (unsigned char)(value) )
#endif
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkIntTypes_h
#define __itkIntTypes_h
#include "itkConfigure.h"
#if defined( ITK_HAVE_STDINT_H )
#include <stdint.h>
#else
// the system doesn't have the C or C++ version of stdint so lets use
// itksys's types for fixed widths
#include "itksys/FundamentalType.h"
#ifdef ITK_HAVE_STDDEF_H
#include <stddef.h>
#endif //ITK_HAVE_STDDEF_H
#endif // ITK_HAVE_CSTDINT
#include <limits.h>
namespace itk
{
#if defined( ITK_HAVE_STDINT_H )
// Note: these types are technically optional in C99 stdint.h file. As
// such a try complile for their existance may be needed.
typedef::int8_t int8_t;
typedef::uint8_t uint8_t;
typedef::int16_t int16_t;
typedef::uint16_t uint16_t;
typedef::int32_t int32_t;
typedef::uint32_t uint32_t;
typedef::int64_t int64_t;
typedef::uint64_t uint64_t;
// Note: these types are required for the C99 stdint.h file.
typedef::int_least8_t int_least8_t;
typedef::uint_least8_t uint_least8_t;
typedef::int_least16_t int_least16_t;
typedef::uint_least16_t uint_least16_t;
typedef::int_least32_t int_least32_t;
typedef::uint_least32_t uint_least32_t;
typedef::int_least64_t int_least64_t;
typedef::uint_least64_t uint_least64_t;
// Note: these types are required for the C99 stdint.h file.
typedef::int_fast8_t int_fast8_t;
typedef::uint_fast8_t uint_fast8_t;
typedef::int_fast16_t int_fast16_t;
typedef::uint_fast16_t uint_fast16_t;
typedef::int_fast32_t int_fast32_t;
typedef::uint_fast32_t uint_fast32_t;
typedef::int_fast64_t int_fast64_t;
typedef::uint_fast64_t uint_fast64_t;
typedef::intmax_t intmax_t;
typedef::uintmax_t uintmax_t;
typedef::intptr_t intptr_t;
typedef::uintptr_t uintptr_t;
#else // ITK_HAVE_STDINT_H
/** Fixed width interger types. */
typedef::itksysFundamentalType_Int8 int8_t;
typedef::itksysFundamentalType_UInt8 uint8_t;
typedef::itksysFundamentalType_Int16 int16_t;
typedef::itksysFundamentalType_UInt16 uint16_t;
typedef::itksysFundamentalType_Int32 int32_t;
typedef::itksysFundamentalType_UInt32 uint32_t;
typedef::itksysFundamentalType_Int64 int64_t;
typedef::itksysFundamentalType_UInt64 uint64_t;
/** Types which are at least a certain size, these are prefered over
* fixed width. */
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
/** Types which are at least a certain size but may be greater if
* performace benifits, these are prefered over fixed width. */
typedef int8_t int_fast8_t;
typedef uint8_t uint_fast8_t;
typedef int16_t int_fast16_t;
typedef uint16_t uint_fast16_t;
typedef int32_t int_fast32_t;
typedef uint32_t uint_fast32_t;
typedef int64_t int_fast64_t;
typedef uint64_t uint_fast64_t;
/** Types which contain the largest represetable integer. */
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
typedef::ptrdiff_t intptr_t;
typedef::size_t uintptr_t;
#endif // ITK_HAVE_STDINT_H
#if !defined(ITKV3_COMPATIBILITY) && defined(ITK_USE_64BITS_IDS) && ((ULLONG_MAX != ULONG_MAX) || (LLONG_MAX != LONG_MAX))
/** Any count of number of items (number of pixels in an image, number of
* points) (it is unsigned) */
typedef uint64_t SizeValueType;
/** Same type as SizeValueType but when used as an Id (pointId, cellId,
* labelObjectId..)(it is unsigned) */
typedef SizeValueType IdentifierType;
/** The components of the Index array (they are signed) */
typedef int64_t IndexValueType;
/** Differences between components of indexes, distance from one pointer
* to the origin of a buffer (it is signed) */
typedef int64_t OffsetValueType;
#else
/** Any count of number of items (number of pixels in an image, number of
* points) (it is unsigned) */
typedef unsigned long SizeValueType;
/** Same type as SizeValueType but when used as an Id (pointId, cellId,
* labelObjectId..)(it is unsigned) */
typedef SizeValueType IdentifierType;
/** The components of the Index array (they are signed) */
typedef signed long IndexValueType;
/** Differences between components of indexes, distance from one pointer
* to the origin of a buffer (it is signed) */
typedef signed long OffsetValueType;
#endif
/** Type to count and reference number of threads */
typedef unsigned int ThreadIdType;
}
#endif /* __itkIntTypes_h */
|
// Copyright 2017 The TensorFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
#ifndef TENSORFLOW_CONTRIB_TENSOR_FOREST_KERNELS_V4_INPUT_DATA_H_
#define TENSORFLOW_CONTRIB_TENSOR_FOREST_KERNELS_V4_INPUT_DATA_H_
#include <ctime>
#include <unordered_map>
#include "google/protobuf/any.pb.h"
#include "google/protobuf/wrappers.pb.h"
#include "tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h"
#include "tensorflow/contrib/tensor_forest/kernels/data_spec.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/lib/random/philox_random.h"
#include "tensorflow/core/lib/random/simple_philox.h"
namespace tensorflow {
namespace tensorforest {
typedef TTypes<const float, 2>::ConstTensor DenseStorageType;
typedef TTypes<const int64, 2>::ConstTensor SparseIndicesStorageType;
typedef TTypes<const float, 1>::ConstTensor SparseValuesStorageType;
class TensorDataSet {
public:
TensorDataSet(const tensorforest::TensorForestDataSpec& input_spec,
int32 seed)
: dense_data_(nullptr),
sparse_indices_(nullptr),
sparse_values_(nullptr),
input_spec_(input_spec),
split_sampling_random_seed_(seed) {
int column_count = 0;
for (int i = 0; i < input_spec_.dense_size(); ++i) {
for (int j = 0; j < input_spec_.dense(i).size(); ++j) {
decision_trees::FeatureId id;
id.mutable_id()->set_value(strings::StrCat(column_count));
available_features_.push_back(id);
++column_count;
}
}
// Set up the random number generator.
if (split_sampling_random_seed_ == 0) {
uint64 time_seed = static_cast<uint64>(std::clock());
single_rand_ = std::unique_ptr<random::PhiloxRandom>(
new random::PhiloxRandom(time_seed));
} else {
single_rand_ = std::unique_ptr<random::PhiloxRandom>(
new random::PhiloxRandom(split_sampling_random_seed_));
}
rng_ = std::unique_ptr<random::SimplePhilox>(
new random::SimplePhilox(single_rand_.get()));
}
virtual ~TensorDataSet() {}
void set_input_tensors(const Tensor& dense, const Tensor& sparse_indices,
const Tensor& sparse_values,
const Tensor& sparse_shape);
float get_input_value(int offset, int col) {
return (*dense_data_)(offset, col);
}
int NumItems() const {
if (dense_data_ != nullptr) {
return dense_data_->dimensions()[0];
} else if (sparse_indices_ != nullptr) {
return sparse_batch_size_;
} else {
return 0;
}
}
// This looks up a value by example and int32_id, which is much faster than
// GetFeature.
float GetExampleValue(int example,
const decision_trees::FeatureId& feature_id) const;
// Same as overload with FeatureId, but if you already have the feature as
// an int32 you can avoid the atoi32.
virtual float GetExampleValue(int example, int32 feature_id) const;
int num_features() { return available_features_.size(); }
const Tensor& original_tensor() const { return original_dense_tensor_; }
bool Decide(const decision_trees::BinaryNode& node, int example) const;
// Randomly samples a feature from example, returns its id in feature_name,
// the value in bias, and it's type from input_spec in type.
void RandomSample(int example, decision_trees::FeatureId* feature_name,
float* bias, int* type) const;
private:
std::unique_ptr<DenseStorageType> dense_data_;
std::unique_ptr<SparseIndicesStorageType> sparse_indices_;
std::unique_ptr<SparseValuesStorageType> sparse_values_;
int sparse_batch_size_;
Tensor original_dense_tensor_;
const tensorforest::TensorForestDataSpec input_spec_;
std::vector<decision_trees::FeatureId> available_features_;
int32 split_sampling_random_seed_;
std::unique_ptr<random::PhiloxRandom> single_rand_;
std::unique_ptr<random::SimplePhilox> rng_;
};
} // namespace tensorforest
} // namespace tensorflow
#endif // TENSORFLOW_CONTRIB_TENSOR_FOREST_KERNELS_V4_INPUT_DATA_H_
|
/*++
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciIo.c
Abstract:
EFI PCI I/O Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PciIo)
EFI_GUID gEfiPciIoProtocolGuid = EFI_PCI_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiPciIoProtocolGuid, "PCI IO Protocol", "EFI 1.1 PCI IO Protocol");
|
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* partial get test.
*
* makes sure that the ftp client and control libraries will handle the
* partial transfer of a file using our FTP extensions.
*/
#include "globus_ftp_client.h"
#include "globus_ftp_client_test_common.h"
#include <stdlib.h>
static globus_mutex_t lock;
static globus_cond_t cond;
static globus_bool_t done;
static globus_bool_t error = GLOBUS_FALSE;
#define SIZE 42
static
void
done_cb(
void * user_arg,
globus_ftp_client_handle_t * handle,
globus_object_t * err)
{
char * tmpstr;
if(err) tmpstr = " an";
else tmpstr = "out";
if(err) { printf("done with%s error\n", tmpstr);
error = GLOBUS_TRUE; }
globus_mutex_lock(&lock);
done = GLOBUS_TRUE;
globus_cond_signal(&cond);
globus_mutex_unlock(&lock);
}
static
void
data_cb(
void * user_arg,
globus_ftp_client_handle_t * handle,
globus_object_t * err,
globus_byte_t * buffer,
globus_size_t length,
globus_off_t offset,
globus_bool_t eof)
{
static int first = 1;
fprintf(stdout,
"%s[%"GLOBUS_OFF_T_FORMAT",%"GLOBUS_OFF_T_FORMAT"]\n",
first?"":"\n", offset, offset+length);
first = 0;
fwrite(buffer, 1, length, stdout);
if(!eof)
{
globus_ftp_client_register_read(handle,
buffer,
SIZE,
data_cb,
0);
}
}
int main(int argc,
char *argv[])
{
globus_ftp_client_handle_t handle;
globus_ftp_client_operationattr_t attr;
globus_byte_t buffer[SIZE];
globus_size_t buffer_length = sizeof(buffer);
globus_result_t result;
char * src;
char * dst;
globus_ftp_client_handleattr_t handle_attr;
globus_off_t start_offset=5;
globus_off_t end_offset=15;
int i;
globus_ftp_control_mode_t mode;
LTDL_SET_PRELOADED_SYMBOLS();
globus_module_activate(GLOBUS_FTP_CLIENT_MODULE);
globus_ftp_client_handleattr_init(&handle_attr);
globus_ftp_client_operationattr_init(&attr);
mode = GLOBUS_FTP_CONTROL_MODE_STREAM;
/* Parse local arguments */
for(i = 1; i < argc; i++)
{
if(strcmp(argv[i], "-R") == 0 && i + 2 < argc)
{
globus_libc_scan_off_t(argv[i+1], &start_offset, GLOBUS_NULL);
globus_libc_scan_off_t(argv[i+2], &end_offset, GLOBUS_NULL);
test_remove_arg(&argc, argv, &i, 2);
}
else if(strcmp(argv[i], "-E") == 0 && i < argc)
{
mode = GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK;
test_remove_arg(&argc, argv, &i, 0);
}
}
test_parse_args(argc,
argv,
&handle_attr,
&attr,
&src,
&dst);
if(start_offset < 0) start_offset = 0;
if(end_offset < 0) end_offset = 0;
globus_mutex_init(&lock, GLOBUS_NULL);
globus_cond_init(&cond, GLOBUS_NULL);
globus_ftp_client_handle_init(&handle, &handle_attr);
globus_ftp_client_operationattr_set_mode(&attr,
mode);
done = GLOBUS_FALSE;
result = globus_ftp_client_partial_get(&handle,
src,
&attr,
GLOBUS_NULL,
start_offset,
end_offset,
done_cb,
0);
if(result != GLOBUS_SUCCESS)
{
error = GLOBUS_TRUE;
done = GLOBUS_TRUE;
}
else
{
globus_ftp_client_register_read(
&handle,
buffer,
buffer_length,
data_cb,
0);
}
globus_mutex_lock(&lock);
while(!done)
{
globus_cond_wait(&cond, &lock);
}
globus_mutex_unlock(&lock);
globus_ftp_client_handle_destroy(&handle);
globus_module_deactivate_all();
if(test_abort_count && error)
{
return 0;
}
return error;
}
|
#pragma once
class CGSHandler;
class CGsPacketMetadata;
struct DRAWINGKICK_INFO;
class IFrameDebuggerTab
{
public:
virtual ~IFrameDebuggerTab() {}
virtual void UpdateState(CGSHandler*, CGsPacketMetadata*, DRAWINGKICK_INFO*) = 0;
};
|
/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
/* Get file information about FILE in BUF.
If FILE is a symbolic link, do not follow it. */
int
__lxstat64 (int vers, const char *file, struct stat64 *buf)
{
if (vers != _STAT_VER || file == NULL || buf == NULL)
{
__set_errno (EINVAL);
return -1;
}
__set_errno (ENOSYS);
return -1;
}
hidden_def (__lxstat64)
stub_warning (__lxstat64)
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of Image Engine Design nor the names of any
// other contributors to this software 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.
//
//////////////////////////////////////////////////////////////////////////
#ifndef IE_COREMAYA_FROMMAYAINSTANCECONVERTER_H
#define IE_COREMAYA_FROMMAYAINSTANCECONVERTER_H
#include "IECoreMaya/FromMayaDagNodeConverter.h"
#include "IECore/VectorTypedData.h"
#include "IECore/NumericParameter.h"
#include "IECore/TypedParameter.h"
#include "IECore/Object.h"
#include "IECoreScene/Primitive.h"
#include "maya/MString.h"
class MFnMesh;
namespace IECoreMaya
{
class IECOREMAYA_API FromMayaInstancerConverter : public FromMayaDagNodeConverter
{
public :
IE_CORE_DECLARERUNTIMETYPEDEXTENSION( FromMayaInstancerConverter, FromMayaInstancerConverterTypeId, FromMayaDagNodeConverter );
FromMayaInstancerConverter( const MDagPath &dagPath );
virtual ~FromMayaInstancerConverter();
protected :
IECore::ObjectPtr doConversion( const MDagPath &dagPath, IECore::ConstCompoundObjectPtr operands ) const override;
private :
static FromMayaDagNodeConverter::Description<FromMayaInstancerConverter> m_description;
};
IE_CORE_DECLAREPTR( FromMayaInstancerConverter );
} // namespace IECoreMaya
#endif // IE_COREMAYA_FROMMAYAINSTANCECONVERTER_H
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Feb 20 2016 22:04:40).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <MobileDeviceKit/MDKAFCOperation.h>
@interface MDKAFCRemovePathOperation : MDKAFCOperation
{
}
- (id)initWithPath:(id)arg1 recursive:(BOOL)arg2;
- (id)initWithPath:(id)arg1;
@end
|
/*****************************************************************************
Copyright (c) 2014, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation 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.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function chptrd
* Author: Intel Corporation
* Generated November 2015
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_chptrd( int matrix_layout, char uplo, lapack_int n,
lapack_complex_float* ap, float* d, float* e,
lapack_complex_float* tau )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_chptrd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_chp_nancheck( n, ap ) ) {
return -4;
}
#endif
return LAPACKE_chptrd_work( matrix_layout, uplo, n, ap, d, e, tau );
}
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef QmitkGradientDifferenceMetricViewWidgetHIncluded
#define QmitkGradientDifferenceMetricViewWidgetHIncluded
#include "ui_QmitkGradientDifferenceMetricControls.h"
#include "MitkRigidRegistrationUIExports.h"
#include "QmitkRigidRegistrationMetricsGUIBase.h"
#include <itkArray.h>
#include <itkObject.h>
#include <itkImage.h>
/*!
* \brief Widget for rigid registration
*
* Displays options for rigid registration.
*/
class MITKRIGIDREGISTRATIONUI_EXPORT QmitkGradientDifferenceMetricView : public QmitkRigidRegistrationMetricsGUIBase
{
public:
QmitkGradientDifferenceMetricView( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
~QmitkGradientDifferenceMetricView();
virtual mitk::MetricParameters::MetricType GetMetricType() override;
virtual itk::Object::Pointer GetMetric() override;
virtual itk::Array<double> GetMetricParameters() override;
virtual void SetMetricParameters(itk::Array<double> metricValues) override;
virtual QString GetName() override;
virtual void SetupUI(QWidget* parent) override;
virtual bool Maximize() override;
private:
template < class TPixelType, unsigned int VImageDimension >
itk::Object::Pointer GetMetric2(itk::Image<TPixelType, VImageDimension>* itkImage1);
protected:
Ui::QmitkGradientDifferenceMetricControls m_Controls;
itk::Object::Pointer m_MetricObject;
};
#endif
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file physxCloth.h
* @author enn0x
* @date 2010-03-30
*/
#ifndef PHYSXCLOTH_H
#define PHYSXCLOTH_H
#include "pandabase.h"
#include "luse.h"
#include "physxObject.h"
#include "physxObjectCollection.h"
#include "physxEnums.h"
#include "physx_includes.h"
class PhysxScene;
class PhysxGroupsMask;
class PhysxClothNode;
/**
*
*/
class EXPCL_PANDAPHYSX PhysxCloth : public PhysxObject, public PhysxEnums {
PUBLISHED:
INLINE PhysxCloth();
INLINE ~PhysxCloth();
PhysxScene *get_scene() const;
PhysxClothNode *get_cloth_node() const;
PhysxClothNode *create_cloth_node(const char *name);
void set_name(const char *name);
void set_group(unsigned int group);
void set_groups_mask(const PhysxGroupsMask &mask);
void set_flag(PhysxClothFlag flag, bool value);
void set_thickness(float thickness);
const char *get_name() const;
unsigned int get_num_particles();
unsigned int get_group() const;
PhysxGroupsMask get_groups_mask() const;
bool get_flag(PhysxClothFlag flag) const;
float get_thickness() const;
float get_density() const;
float get_relative_grid_spacing() const;
// Attachment
void attach_vertex_to_global_pos(unsigned int vertexId, LPoint3f const &pos);
void free_vertex(unsigned int vertexId);
void attach_to_shape(PhysxShape *shape);
void attach_to_colliding_shapes();
void detach_from_shape(PhysxShape *shape);
void attach_vertex_to_shape(unsigned int vertexId, PhysxShape *shape, LPoint3f const &localPos);
PhysxVertexAttachmentStatus get_vertex_attachment_status(unsigned int vertexId) const;
PhysxShape *get_vertex_attachment_shape(unsigned int vertexId) const;
LPoint3f get_vertex_attachment_pos(unsigned int vertexId) const;
// Sleeping
bool is_sleeping() const;
void wake_up(float wakeCounterValue=NX_SLEEP_INTERVAL);
void put_to_sleep();
void set_sleep_linear_velocity(float threshold);
float get_sleep_linear_velocity() const;
// Forces
void set_external_acceleration(LVector3f const &acceleration);
LVector3f get_external_acceleration() const;
void set_wind_acceleration(LVector3f const &acceleration);
LVector3f get_wind_acceleration() const;
void add_force_at_vertex(LVector3f const &force, int vertexId,
PhysxForceMode mode=FM_force);
void add_force_at_pos(LPoint3f const &pos, float magnitude, float radius,
PhysxForceMode mode=FM_force);
void add_directed_force_at_pos(LPoint3f const &pos, LVector3f const &force, float radius,
PhysxForceMode mode=FM_force);
INLINE void ls() const;
INLINE void ls(ostream &out, int indent_level=0) const;
public:
void update();
PUBLISHED:
void release();
public:
INLINE NxCloth *ptr() const { return _ptr; };
void link(NxCloth *ptr);
void unlink();
private:
NxCloth *_ptr;
PT(PhysxClothNode) _node;
string _name;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
PhysxObject::init_type();
register_type(_type_handle, "PhysxCloth",
PhysxObject::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {
init_type();
return get_class_type();
}
private:
static TypeHandle _type_handle;
};
#include "physxCloth.I"
#endif // PHYSXCLOTH_H
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SERVICES_CELLULAR_SETUP_CELLULAR_SETUP_IMPL_H_
#define ASH_SERVICES_CELLULAR_SETUP_CELLULAR_SETUP_IMPL_H_
#include <memory>
#include "ash/services/cellular_setup/cellular_setup_base.h"
#include "base/containers/id_map.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
namespace ash::cellular_setup {
class OtaActivator;
// Concrete mojom::CellularSetup implementation. This class creates a new
// OtaActivator instance per each StartActivation() invocation and passes a
// pointer back to the client.
class CellularSetupImpl : public CellularSetupBase {
public:
// Creates an instance with a lifetime that is bound to the connection
// that is supplying |receiver|.
static void CreateAndBindToReciever(
mojo::PendingReceiver<mojom::CellularSetup> receiver);
CellularSetupImpl(const CellularSetupImpl&) = delete;
CellularSetupImpl& operator=(const CellularSetupImpl&) = delete;
~CellularSetupImpl() override;
private:
friend class CellularSetupImplTest;
// For unit tests.
CellularSetupImpl();
// mojom::CellularSetup:
void StartActivation(mojo::PendingRemote<mojom::ActivationDelegate> delegate,
StartActivationCallback callback) override;
void OnActivationAttemptFinished(size_t request_id);
size_t next_request_id_ = 0u;
base::IDMap<std::unique_ptr<OtaActivator>, size_t> ota_activator_map_;
base::WeakPtrFactory<CellularSetupImpl> weak_ptr_factory_{this};
};
} // namespace ash::cellular_setup
#endif // ASH_SERVICES_CELLULAR_SETUP_CELLULAR_SETUP_IMPL_H_
|
#ifndef SSU_H__
#define SSU_H__
#include <inttypes.h>
#include <string.h>
#include <map>
#include <list>
#include <set>
#include <thread>
#include <mutex>
#include <boost/asio.hpp>
#include "crypto/aes.h"
#include "util/I2PEndian.h"
#include "Identity.h"
#include "RouterInfo.h"
#include "I2NPProtocol.h"
#include "SSUSession.h"
namespace i2p
{
namespace transport
{
const int SSU_KEEP_ALIVE_INTERVAL = 30; // 30 seconds
const int SSU_PEER_TEST_TIMEOUT = 60; // 60 seconds
const int SSU_TO_INTRODUCER_SESSION_DURATION = 3600; // 1 hour
const size_t SSU_MAX_NUM_INTRODUCERS = 3;
struct SSUPacket
{
i2p::crypto::AESAlignedBuffer<1500> buf;
boost::asio::ip::udp::endpoint from;
size_t len;
};
class SSUServer
{
public:
SSUServer (int port);
~SSUServer ();
void Start ();
void Stop ();
std::shared_ptr<SSUSession> GetSession (std::shared_ptr<const i2p::data::RouterInfo> router, bool peerTest = false);
std::shared_ptr<SSUSession> FindSession (std::shared_ptr<const i2p::data::RouterInfo> router) const;
std::shared_ptr<SSUSession> FindSession (const boost::asio::ip::udp::endpoint& e) const;
std::shared_ptr<SSUSession> GetRandomEstablishedSession (std::shared_ptr<const SSUSession> excluded);
void DeleteSession (std::shared_ptr<SSUSession> session);
void DeleteAllSessions ();
boost::asio::io_service& GetService () { return m_Service; };
boost::asio::io_service& GetServiceV6 () { return m_ServiceV6; };
const boost::asio::ip::udp::endpoint& GetEndpoint () const { return m_Endpoint; };
void Send (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& to);
void AddRelay (uint32_t tag, const boost::asio::ip::udp::endpoint& relay);
std::shared_ptr<SSUSession> FindRelaySession (uint32_t tag);
void NewPeerTest (uint32_t nonce, PeerTestParticipant role, std::shared_ptr<SSUSession> session = nullptr);
PeerTestParticipant GetPeerTestParticipant (uint32_t nonce);
std::shared_ptr<SSUSession> GetPeerTestSession (uint32_t nonce);
void UpdatePeerTest (uint32_t nonce, PeerTestParticipant role);
void RemovePeerTest (uint32_t nonce);
private:
void Run ();
void RunV6 ();
void RunReceivers ();
void Receive ();
void ReceiveV6 ();
void HandleReceivedFrom (const boost::system::error_code& ecode, std::size_t bytes_transferred, SSUPacket * packet);
void HandleReceivedFromV6 (const boost::system::error_code& ecode, std::size_t bytes_transferred, SSUPacket * packet);
void HandleReceivedPackets (std::vector<SSUPacket *> packets);
template<typename Filter>
std::shared_ptr<SSUSession> GetRandomSession (Filter filter);
std::set<SSUSession *> FindIntroducers (int maxNumIntroducers);
void ScheduleIntroducersUpdateTimer ();
void HandleIntroducersUpdateTimer (const boost::system::error_code& ecode);
void SchedulePeerTestsCleanupTimer ();
void HandlePeerTestsCleanupTimer (const boost::system::error_code& ecode);
private:
struct PeerTest
{
uint64_t creationTime;
PeerTestParticipant role;
std::shared_ptr<SSUSession> session; // for Bob to Alice
};
bool m_IsRunning;
std::thread * m_Thread, * m_ThreadV6, * m_ReceiversThread;
boost::asio::io_service m_Service, m_ServiceV6, m_ReceiversService;
boost::asio::io_service::work m_Work, m_WorkV6, m_ReceiversWork;
boost::asio::ip::udp::endpoint m_Endpoint, m_EndpointV6;
boost::asio::ip::udp::socket m_Socket, m_SocketV6;
boost::asio::deadline_timer m_IntroducersUpdateTimer, m_PeerTestsCleanupTimer;
std::list<boost::asio::ip::udp::endpoint> m_Introducers; // introducers we are connected to
mutable std::mutex m_SessionsMutex;
std::map<boost::asio::ip::udp::endpoint, std::shared_ptr<SSUSession> > m_Sessions;
std::map<uint32_t, boost::asio::ip::udp::endpoint> m_Relays; // we are introducer
std::map<uint32_t, PeerTest> m_PeerTests; // nonce -> creation time in milliseconds
public:
// for HTTP only
const decltype(m_Sessions)& GetSessions () const { return m_Sessions; };
};
}
}
#endif
|
/* -*- mode: C -*- */
/*
IGraph library.
Copyright (C) 2006-2012 Gabor Csardi <csardi.gabor@gmail.com>
334 Harvard st, Cambridge MA, 02139 USA
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include <igraph.h>
int main() {
igraph_t g;
long int i;
igraph_integer_t size;
/* DIRECTED */
igraph_star(&g, 10, IGRAPH_STAR_OUT, 0);
for (i=0; i<100; i++) {
igraph_es_t es;
igraph_eit_t it;
igraph_es_pairs_small(&es, IGRAPH_DIRECTED,
0,1,0,2,0,5,0,2,0,3,0,4,0,7,0,9, -1);
igraph_eit_create(&g, es, &it);
igraph_es_size(&g, &es, &size);
IGRAPH_EIT_RESET(it);
while (!IGRAPH_EIT_END(it)) {
(void) IGRAPH_EIT_GET(it);
IGRAPH_EIT_NEXT(it);
size--;
}
if (size != 0) return 1;
igraph_eit_destroy(&it);
igraph_es_destroy(&es);
}
igraph_destroy(&g);
/* UNDIRECTED */
igraph_star(&g, 10, IGRAPH_STAR_UNDIRECTED, 0);
for (i=0; i<100; i++) {
igraph_es_t es;
igraph_eit_t it;
igraph_es_pairs_small(&es, IGRAPH_DIRECTED,
0,1,2,0,5,0,0,2,3,0,0,4,7,0,0,9, -1);
igraph_eit_create(&g, es, &it);
IGRAPH_EIT_RESET(it);
while (!IGRAPH_EIT_END(it)) {
(void) IGRAPH_EIT_GET(it);
IGRAPH_EIT_NEXT(it);
}
igraph_eit_destroy(&it);
igraph_es_destroy(&es);
}
igraph_destroy(&g);
return 0;
}
|
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebSearchableFormData_h
#define WebSearchableFormData_h
#include "WebInputElement.h"
#include "platform/WebString.h"
#include "platform/WebURL.h"
namespace WebKit {
class WebFormElement;
// SearchableFormData encapsulates a URL and encoding of an INPUT field that
// corresponds to a searchable form request.
class WebSearchableFormData {
public:
// If the provided form is suitable for automated searching, isValid()
// will return false.
WEBKIT_EXPORT WebSearchableFormData(const WebFormElement&, const WebInputElement& selectedInputElement = WebInputElement());
bool isValid() { return m_url.isValid(); }
// URL for the searchable form request.
const WebURL& url() const
{
return m_url;
}
// Encoding used to encode the form parameters; never empty.
const WebString& encoding() const
{
return m_encoding;
}
private:
WebURL m_url;
WebString m_encoding;
};
} // namespace WebKit
#endif
|
/*
Copyright (c) by respective owners including Yahoo!, Microsoft, and
individual contributors. All rights reserved. Released under a BSD (revised)
license as described in the file LICENSE.
*/
#pragma once
#include "vw.h"
#include "vw_clr.h"
#include "vw_prediction.h"
namespace VW
{
ref class VowpalWabbitExample;
/// <summary>
/// Owners of example must implement this interface.
/// </summary>
public interface class IVowpalWabbitExamplePool
{
/// <summary>
/// Puts a native example data structure back into the pool.
/// </summary>
/// <param name="example">The example to be returned.</param>
void ReturnExampleToPool(VowpalWabbitExample^ example);
};
} |
//===--- StringFindStartswithCheck.h - clang-tidy----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
#include "../ClangTidy.h"
#include "../utils/IncludeInserter.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include <memory>
#include <string>
#include <vector>
namespace clang {
namespace tidy {
namespace abseil {
// Find string.find(...) == 0 comparisons and suggest replacing with StartsWith.
// FIXME(niko): Add similar check for EndsWith
// FIXME(niko): Add equivalent modernize checks for C++20's std::starts_With
class StringFindStartswithCheck : public ClangTidyCheck {
public:
using ClangTidyCheck::ClangTidyCheck;
StringFindStartswithCheck(StringRef Name, ClangTidyContext *Context);
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
Preprocessor *ModuleExpanderPP) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
private:
std::unique_ptr<clang::tidy::utils::IncludeInserter> IncludeInserter;
const std::vector<std::string> StringLikeClasses;
const utils::IncludeSorter::IncludeStyle IncludeStyle;
const std::string AbseilStringsMatchHeader;
};
} // namespace abseil
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
|
#include "../../src/corelib/io/qbuffer.h"
|
//-*****************************************************************************
//
// Copyright (c) 2013,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * 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 Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their 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.
//
//-*****************************************************************************
#ifndef _Alembic_AbcCoreOgawa_ReadUtil_h_
#define _Alembic_AbcCoreOgawa_ReadUtil_h_
#include <Alembic/AbcCoreOgawa/Foundation.h>
namespace Alembic {
namespace AbcCoreOgawa {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
//-*****************************************************************************
// UTILITY THING
//-*****************************************************************************
//-*****************************************************************************
void
ReadDimensions( Ogawa::IDataPtr iDims,
Ogawa::IDataPtr iData,
size_t iThreadId,
const AbcA::DataType &iDataType,
Util::Dimensions & oDim );
//-*****************************************************************************
void
ReadData( void * iIntoLocation,
Ogawa::IDataPtr iData,
size_t iThreadId,
const AbcA::DataType &iDataType,
Util::PlainOldDataType iAsPod );
//-*****************************************************************************
void
ReadArraySample( Ogawa::IDataPtr iDims,
Ogawa::IDataPtr iData,
size_t iThreadId,
const AbcA::DataType &iDataType,
AbcA::ArraySamplePtr &oSample );
//-*****************************************************************************
void
ReadTimeSamplesAndMax( Ogawa::IDataPtr iData,
std::vector < AbcA::TimeSamplingPtr > & oTimeSamples,
std::vector < AbcA::index_t > & oMaxSamples );
//-*****************************************************************************
void
ReadObjectHeaders( Ogawa::IGroupPtr iGroup,
size_t iIndex,
size_t iThreadId,
const std::string & iParentName,
const std::vector< AbcA::MetaData > & iMetaDataVec,
std::vector< ObjectHeaderPtr > & oHeaders );
//-*****************************************************************************
void
ReadPropertyHeaders( Ogawa::IGroupPtr iGroup,
size_t iIndex,
size_t iThreadId,
AbcA::ArchiveReader & iArchive,
const std::vector< AbcA::MetaData > & iMetaDataVec,
PropertyHeaderPtrs & oHeaders );
//-*****************************************************************************
void
ReadIndexedMetaData( Ogawa::IDataPtr iData,
std::vector< AbcA::MetaData > & oMetaDataVec );
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcCoreOgawa
} // End namespace Alembic
#endif
|
#ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
class SendCoinsRecipient;
/** Utility functions used by the Bitcoin Qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Some systems do not honor app fonts, so get them here
QFont stealthAppFont();
QFont stealthBoldFont();
// Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "bitcoin:" URI into recipient object, return true on successful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
} // namespace GUIUtil
#endif // GUIUTIL_H
|
/* libs/graphics/svg/SkSVGGroup.h
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef SkSVGGroup_DEFINED
#define SkSVGGroup_DEFINED
#include "SkSVGElements.h"
class SkSVGGroup : public SkSVGElement {
public:
SkSVGGroup();
virtual SkSVGElement* getGradient();
virtual bool isDef();
virtual bool isFlushable();
virtual bool isGroup();
virtual bool isNotDef();
void translate(SkSVGParser& , bool defState);
private:
typedef SkSVGElement INHERITED;
};
#endif // SkSVGGroup_DEFINED
|
/* Hardware ports.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
Contributed by Andrew Cagney and Cygnus Solutions.
This file is part of GDB, the GNU debugger.
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 HW_PORTS_H
#define HW_PORTS_H
/* Initialize a port */
struct hw_port_descriptor
{
const char *name;
int number;
int nr_ports;
port_direction direction;
};
void set_hw_ports (struct hw *hw, const struct hw_port_descriptor ports[]);
typedef void (hw_port_event_method)
(struct hw *me,
int my_port,
struct hw *source,
int source_port,
int level);
void set_hw_port_event (struct hw *hw, hw_port_event_method *to_port_event);
/* Port source
A device drives its output ports using the call
*/
void hw_port_event
(struct hw *me,
int my_port,
int value);
/* This port event will then be propagated to any attached
destination ports.
Any interpretation of PORT and VALUE is model dependent. As a
guideline the following are recommended: PCI interrupts A-D should
correspond to ports 0-3; level sensitive interrupts be requested
with a value of one and withdrawn with a value of 0; edge sensitive
interrupts always have a value of 1, the event its self is treated
as the interrupt.
Port destinations
Attached to each port of a device can be zero or more
destinations. These destinations consist of a device/port pair.
A destination is attached/detached to a device line using the
attach and detach calls. */
void hw_port_attach
(struct hw *me,
int my_port,
struct hw *dest,
int dest_port,
object_disposition disposition);
void hw_port_detach
(struct hw *me,
int my_port,
struct hw *dest,
int dest_port);
/* Iterate over the list of ports attached to a device */
typedef void (hw_port_traverse_function)
(struct hw *me,
int my_port,
struct hw *dest,
int dest_port,
void *data);
void hw_port_traverse
(struct hw *me,
hw_port_traverse_function *handler,
void *data);
/* DESTINATION is attached (detached) to LINE of the device ME
Port conversion
Users refer to port numbers symbolically. For instance a device
may refer to its `INT' signal which is internally represented by
port 3.
To convert to/from the symbolic and internal representation of a
port name/number. The following functions are available. */
int hw_port_decode
(struct hw *me,
const char *symbolic_name,
port_direction direction);
int hw_port_encode
(struct hw *me,
int port_number,
char *buf,
int sizeof_buf,
port_direction direction);
#endif
|
/* Copyright (c) 2007 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GDataQueryCalendar.h
//
#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE
// Calendar-specific query params, per
// http://code.google.com/apis/calendar/reference.html#Parameters
// NOTE: Events for a recurring event with recurrence exceptions (i.e. where
// individual events have been modified) will be returned twice for a query,
// once in the original event and once as a separate event. The separate
// event occurence can be detected by examining its originalEvent; if not nil
// then it will also be reported as part of the original event.
#import "GDataQuery.h"
@interface GDataQueryCalendar : GDataQuery
+ (GDataQueryCalendar *)calendarQueryWithFeedURL:(NSURL *)feedURL;
- (GDataDateTime *)minimumStartTime;
- (void)setMinimumStartTime:(GDataDateTime *)dateTime;
- (GDataDateTime *)maximumStartTime;
- (void)setMaximumStartTime:(GDataDateTime *)dateTime;
- (GDataDateTime *)recurrenceExpansionStartTime;
- (void)setRecurrenceExpansionStartTime:(GDataDateTime *)dateTime;
- (GDataDateTime *)recurrenceExpansionEndTime;
- (void)setRecurrenceExpansionEndTime:(GDataDateTime *)dateTime;
// querying all future events overrides any parameters for
// start-min, start-max, and recurrence expansion start and end times
- (BOOL)shouldQueryAllFutureEvents;
- (void)setShouldQueryAllFutureEvents:(BOOL)dateTime;
- (BOOL)shouldExpandRecurrentEvents;
- (void)setShouldExpandRecurrentEvents:(BOOL)dateTime;
- (BOOL)shouldShowInlineComments;
- (void)setShouldShowInlineComments:(BOOL)flag;
- (BOOL)shouldShowHiddenEvents;
- (void)setShouldShowHiddenEvents:(BOOL)flag;
- (NSString *)currentTimeZoneName;
- (void)setCurrentTimeZoneName:(NSString *)str;
- (NSInteger)maximumAttendees;
- (void)setMaximumAttendees:(NSInteger)val;
@end
#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\FuseCore\0.19.3\Input\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Input.FocusGainedArgs.h>
#include <Fuse.Input.FocusGainedHandler.h>
#include <Fuse.NodeEvent-2.h>
namespace g{namespace Fuse{namespace Input{struct FocusGained;}}}
namespace g{
namespace Fuse{
namespace Input{
// internal sealed class FocusGained :16
// {
::g::Fuse::NodeEvent_type* FocusGained_typeof();
void FocusGained__ctor_1_fn(FocusGained* __this);
void FocusGained__Invoke_fn(FocusGained* __this, uDelegate* handler, uObject* sender, ::g::Fuse::Input::FocusGainedArgs* args);
void FocusGained__New1_fn(FocusGained** __retval);
struct FocusGained : ::g::Fuse::NodeEvent
{
void ctor_1();
static FocusGained* New1();
};
// }
}}} // ::g::Fuse::Input
|
// Copyright 2014-2015 Ben Trask
// MIT licensed (see LICENSE for details)
#include "../../deps/uv/include/uv.h"
#include "../async/async.h"
#include "HTTPServer.h"
struct HTTPServer {
HTTPListener listener;
void *context;
uv_tcp_t socket[1];
struct tls *secure;
};
static void connection_cb(uv_stream_t *const socket, int const status);
HTTPServerRef HTTPServerCreate(HTTPListener const listener, void *const context) {
assertf(listener, "HTTPServer listener required");
HTTPServerRef const server = calloc(1, sizeof(struct HTTPServer));
server->listener = listener;
server->context = context;
return server;
}
void HTTPServerFree(HTTPServerRef *const serverptr) {
HTTPServerRef server = *serverptr;
if(!server) return;
HTTPServerClose(server);
server->listener = NULL;
server->context = NULL;
assert_zeroed(server, 1);
FREE(serverptr); server = NULL;
}
int HTTPServerListen(HTTPServerRef const server, strarg_t const address, strarg_t const port) {
if(!server) return 0;
assertf(!server->socket->data, "HTTPServer already listening");
int rc;
rc = uv_tcp_init(async_loop, server->socket);
if(rc < 0) return rc;
server->socket->data = server;
struct addrinfo const hints = {
.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_NUMERICSERV | AI_PASSIVE,
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM,
.ai_protocol = 0, // ???
};
struct addrinfo *info;
rc = async_getaddrinfo(address, port, &hints, &info);
if(rc < 0) {
HTTPServerClose(server);
return rc;
}
int bound = 0;
rc = 0;
for(struct addrinfo *each = info; each; each = each->ai_next) {
rc = uv_tcp_bind(server->socket, each->ai_addr, 0);
if(rc >= 0) bound++;
}
uv_freeaddrinfo(info);
if(!bound) {
HTTPServerClose(server);
if(rc < 0) return rc;
return UV_EADDRNOTAVAIL;
}
rc = uv_listen((uv_stream_t *)server->socket, 511, connection_cb);
if(rc < 0) {
HTTPServerClose(server);
return rc;
}
return 0;
}
int HTTPServerListenSecure(HTTPServerRef const server, strarg_t const address, strarg_t const port, struct tls **const tlsptr) {
if(!server) return 0;
int rc = HTTPServerListen(server, address, port);
if(rc < 0) return rc;
server->secure = *tlsptr; *tlsptr = NULL;
return 0;
}
void HTTPServerClose(HTTPServerRef const server) {
if(!server) return;
if(!server->socket->data) return;
if(server->secure) tls_close(server->secure);
tls_free(server->secure); server->secure = NULL;
async_close((uv_handle_t *)server->socket);
}
static void connection(uv_stream_t *const socket) {
HTTPServerRef const server = socket->data;
HTTPConnectionRef conn;
int rc = HTTPConnectionCreateIncomingSecure(socket, server->secure, 0, &conn);
if(rc < 0) {
fprintf(stderr, "HTTP server connection error %s\n", uv_strerror(rc));
return;
}
assert(conn);
for(;;) {
server->listener(server->context, server, conn);
rc = HTTPConnectionDrainMessage(conn);
if(rc < 0) break;
}
HTTPConnectionFree(&conn);
}
static void connection_cb(uv_stream_t *const socket, int const status) {
async_spawn(STACK_DEFAULT, (void (*)())connection, socket);
}
|
#ifndef __SIMPLE_LOGGER__
#define __SIMPLE_LOGGER__
/**
* simple_logger
* @license The MIT License (MIT)
* @copyright Copyright (c) 2015 EngineerOfLies
* 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.
*/
/**
@brief initializes the simple logger. Will automatically cleanup at program exit.
@param log_file_path the file to log to
*/
void init_logger(const char *log_file_path);
/**
* @brief commits logs to file
*/
void slog_sync();
/**
@brief logs a message to stdout and to the configured log file
@param msg a string with tokens
@param ... variables to be put into the tokens.
*/
#define slog(...) _slog(__FILE__,__LINE__,__VA_ARGS__)
void _slog(char *f,int l,char *msg,...);
#endif
|
/* $Id: tif_flush.c,v 1.9 2010-03-31 06:40:10 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* TIFF Library.
*/
#include <precomp.h>
int
TIFFFlush(TIFF* tif)
{
if( tif->tif_mode == O_RDONLY )
return 1;
if (!TIFFFlushData(tif))
return (0);
/* In update (r+) mode we try to detect the case where
only the strip/tile map has been altered, and we try to
rewrite only that portion of the directory without
making any other changes */
if( (tif->tif_flags & TIFF_DIRTYSTRIP)
&& !(tif->tif_flags & TIFF_DIRTYDIRECT)
&& tif->tif_mode == O_RDWR )
{
uint64 *offsets=NULL, *sizes=NULL;
if( TIFFIsTiled(tif) )
{
if( TIFFGetField( tif, TIFFTAG_TILEOFFSETS, &offsets )
&& TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &sizes )
&& _TIFFRewriteField( tif, TIFFTAG_TILEOFFSETS, TIFF_LONG8,
tif->tif_dir.td_nstrips, offsets )
&& _TIFFRewriteField( tif, TIFFTAG_TILEBYTECOUNTS, TIFF_LONG8,
tif->tif_dir.td_nstrips, sizes ) )
{
tif->tif_flags &= ~TIFF_DIRTYSTRIP;
tif->tif_flags &= ~TIFF_BEENWRITING;
return 1;
}
}
else
{
if( TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &offsets )
&& TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &sizes )
&& _TIFFRewriteField( tif, TIFFTAG_STRIPOFFSETS, TIFF_LONG8,
tif->tif_dir.td_nstrips, offsets )
&& _TIFFRewriteField( tif, TIFFTAG_STRIPBYTECOUNTS, TIFF_LONG8,
tif->tif_dir.td_nstrips, sizes ) )
{
tif->tif_flags &= ~TIFF_DIRTYSTRIP;
tif->tif_flags &= ~TIFF_BEENWRITING;
return 1;
}
}
}
if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP))
&& !TIFFRewriteDirectory(tif))
return (0);
return (1);
}
/*
* Flush buffered data to the file.
*
* Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING
* is not set, so that TIFFFlush() will proceed to write out the directory.
* The documentation says returning 1 is an error indicator, but not having
* been writing isn't exactly a an error. Hopefully this doesn't cause
* problems for other people.
*/
int
TIFFFlushData(TIFF* tif)
{
if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
return (1);
if (tif->tif_flags & TIFF_POSTENCODE) {
tif->tif_flags &= ~TIFF_POSTENCODE;
if (!(*tif->tif_postencode)(tif))
return (0);
}
return (TIFFFlushData1(tif));
}
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
|
/* drivers/motor/dcmotor.c
* Copyright (C) 2015 Samsung Electronics Co. Ltd. All Rights Reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/hrtimer.h>
#include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <linux/of_gpio.h>
#include <linux/wakelock.h>
#include <linux/workqueue.h>
#include "../staging/android/timed_output.h"
#if defined(CONFIG_IMM_VIB)
#include "imm_vib.h"
#endif
#define SEC_VIB_NAME "sec_vib"
struct sec_vib_pdata {
const char *regulator;
int max_timeout;
};
struct sec_vib_drvdata {
struct regulator *regulator;
struct timed_output_dev dev;
struct hrtimer timer;
struct workqueue_struct *workqueue;
struct work_struct work;
spinlock_t lock;
bool running;
int max_timeout;
int timeout;
};
static enum hrtimer_restart sec_vib_timer_func(struct hrtimer *timer)
{
struct sec_vib_drvdata *ddata =
container_of(timer, struct sec_vib_drvdata, timer);
ddata->timeout = 0;
queue_work(ddata->workqueue, &ddata->work);
return HRTIMER_NORESTART;
}
static int sec_vib_get_time(struct timed_output_dev *dev)
{
struct sec_vib_drvdata *ddata =
container_of(dev, struct sec_vib_drvdata, dev);
if (hrtimer_active(&ddata->timer)) {
ktime_t r = hrtimer_get_remaining(&ddata->timer);
struct timeval t = ktime_to_timeval(r);
return t.tv_sec * 1000 + t.tv_usec / 1000;
} else
return 0;
}
static void sec_vib_enable(struct timed_output_dev *dev, int value)
{
struct sec_vib_drvdata *ddata =
container_of(dev, struct sec_vib_drvdata, dev);
unsigned long flags;
hrtimer_cancel(&ddata->timer);
if (value > 0) {
if (value > ddata->max_timeout)
value = ddata->max_timeout;
ddata->timeout = value;
queue_work(ddata->workqueue, &ddata->work);
spin_lock_irqsave(&ddata->lock, flags);
hrtimer_start(&ddata->timer,
ktime_set(value / 1000, (value % 1000) * 1000000),
HRTIMER_MODE_REL);
spin_unlock_irqrestore(&ddata->lock, flags);
} else {
ddata->timeout = 0;
queue_work(ddata->workqueue, &ddata->work);
}
}
static void sec_vib_work(struct work_struct *work)
{
struct sec_vib_drvdata *ddata =
container_of(work, struct sec_vib_drvdata, work);
int ret = 0;
if (ddata->timeout > 0) {
if (ddata->running)
return;
ret = regulator_enable(ddata->regulator);
ddata->running = true;
} else {
if (!ddata->running)
return;
regulator_disable(ddata->regulator);
ddata->running = false;
}
return;
}
#if defined(CONFIG_OF)
static struct sec_vib_pdata *sec_vib_get_dt(struct device *dev)
{
struct device_node *node, *child_node = NULL;
struct sec_vib_pdata *pdata;
int ret = 0;
node = dev->of_node;
if (!node) {
ret = -ENODEV;
goto err_out;
}
child_node = of_get_next_child(node, child_node);
if (!child_node) {
printk("[VIB] failed to get dt node\n");
ret = -EINVAL;
goto err_out;
}
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
printk("[VIB] failed to alloc\n");
ret = -ENOMEM;
goto err_out;
}
of_property_read_u32(child_node, "sec_vib,max_timeout", &pdata->max_timeout);
of_property_read_string(child_node, "sec_vib,regulator", &pdata->regulator);
return pdata;
err_out:
return ERR_PTR(ret);
}
#endif
static int sec_vib_probe(struct platform_device *pdev)
{
struct sec_vib_pdata *pdata = pdev->dev.platform_data;
struct sec_vib_drvdata *ddata;
int ret = 0;
if (!pdata) {
#if defined(CONFIG_OF)
pdata = sec_vib_get_dt(&pdev->dev);
if (IS_ERR(pdata)) {
printk(KERN_ERR "[VIB] there is no device tree!\n");
ret = -ENODEV;
goto err_out;
}
#else
printk(KERN_ERR "[VIB] there is no platform data!\n");
ret = -ENODEV;
goto err_out;
#endif
}
ddata = kzalloc(sizeof(struct sec_vib_drvdata), GFP_KERNEL);
if (!ddata) {
ret = -ENOMEM;
goto err_free;
}
ddata->regulator = regulator_get(NULL, pdata->regulator);
if (IS_ERR(ddata->regulator)) {
printk(KERN_ERR "[VIB] failed get %s\n", pdata->regulator);
ret = PTR_ERR(ddata->regulator);
goto err_free;
}
hrtimer_init(&ddata->timer, CLOCK_MONOTONIC,
HRTIMER_MODE_REL);
ddata->timer.function = sec_vib_timer_func;
spin_lock_init(&ddata->lock);
ddata->max_timeout = pdata->max_timeout;
ddata->workqueue = create_singlethread_workqueue("sec_vib_work");
INIT_WORK(&(ddata->work), sec_vib_work);
ddata->dev.name = "vibrator";
ddata->dev.get_time = sec_vib_get_time;
ddata->dev.enable = sec_vib_enable;
ret = timed_output_dev_register(&ddata->dev);
if (ret < 0)
goto err_free;
platform_set_drvdata(pdev, ddata);
return 0;
err_free:
kfree(ddata);
err_out:
return ret;
}
static int sec_vib_remove(struct platform_device *pdev)
{
struct sec_vib_drvdata *ddata = platform_get_drvdata(pdev);
timed_output_dev_unregister(&ddata->dev);
kfree(ddata);
return 0;
}
#if defined(CONFIG_OF)
static struct of_device_id sec_vib_dt_ids[] = {
{ .compatible = "sec_vib" },
{ }
};
MODULE_DEVICE_TABLE(of, sec_vib_dt_ids);
#endif /* CONFIG_OF */
static struct platform_driver sec_vib_driver = {
.probe = sec_vib_probe,
.remove = sec_vib_remove,
.driver = {
.name = SEC_VIB_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(sec_vib_dt_ids),
},
};
static int __init sec_vib_init(void)
{
return platform_driver_register(&sec_vib_driver);
}
module_init(sec_vib_init);
static void __exit sec_vib_exit(void)
{
platform_driver_unregister(&sec_vib_driver);
}
module_exit(sec_vib_exit);
MODULE_AUTHOR("Samsung Electronics");
MODULE_DESCRIPTION("dc motor driver");
MODULE_LICENSE("GPL");
|
/*
* Static NHT code.
* Copyright (C) 2018 Cumulus Networks, Inc.
* Donald Sharp
*
* 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; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
#include "prefix.h"
#include "table.h"
#include "vrf.h"
#include "nexthop.h"
#include "srcdest_table.h"
#include "static_vrf.h"
#include "static_routes.h"
#include "static_zebra.h"
#include "static_nht.h"
static void static_nht_update_path(struct static_path *pn, struct prefix *nhp,
uint32_t nh_num, vrf_id_t nh_vrf_id,
struct vrf *vrf)
{
struct static_nexthop *nh;
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
if (nh->nh_vrf_id != nh_vrf_id)
continue;
if (nh->type != STATIC_IPV4_GATEWAY
&& nh->type != STATIC_IPV4_GATEWAY_IFNAME
&& nh->type != STATIC_IPV6_GATEWAY
&& nh->type != STATIC_IPV6_GATEWAY_IFNAME)
continue;
if (nhp->family == AF_INET
&& nhp->u.prefix4.s_addr == nh->addr.ipv4.s_addr)
nh->nh_valid = !!nh_num;
if (nhp->family == AF_INET6
&& memcmp(&nhp->u.prefix6, &nh->addr.ipv6, IPV6_MAX_BYTELEN)
== 0)
nh->nh_valid = !!nh_num;
if (nh->state == STATIC_START)
static_zebra_route_add(pn, true);
}
}
static void static_nht_update_safi(struct prefix *sp, struct prefix *nhp,
uint32_t nh_num, afi_t afi, safi_t safi,
struct vrf *vrf, vrf_id_t nh_vrf_id)
{
struct route_table *stable;
struct static_vrf *svrf;
struct route_node *rn;
struct static_path *pn;
struct static_route_info *si;
svrf = vrf->info;
if (!svrf)
return;
stable = static_vrf_static_table(afi, safi, svrf);
if (!stable)
return;
if (sp) {
rn = srcdest_rnode_lookup(stable, sp, NULL);
if (rn && rn->info) {
si = static_route_info_from_rnode(rn);
frr_each(static_path_list, &si->path_list, pn) {
static_nht_update_path(pn, nhp, nh_num,
nh_vrf_id, vrf);
}
route_unlock_node(rn);
}
return;
}
for (rn = route_top(stable); rn; rn = route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;
frr_each(static_path_list, &si->path_list, pn) {
static_nht_update_path(pn, nhp, nh_num, nh_vrf_id, vrf);
}
}
}
void static_nht_update(struct prefix *sp, struct prefix *nhp,
uint32_t nh_num, afi_t afi, vrf_id_t nh_vrf_id)
{
struct vrf *vrf;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
static_nht_update_safi(sp, nhp, nh_num, afi, SAFI_UNICAST,
vrf, nh_vrf_id);
static_nht_update_safi(sp, nhp, nh_num, afi, SAFI_MULTICAST,
vrf, nh_vrf_id);
}
}
static void static_nht_reset_start_safi(struct prefix *nhp, afi_t afi,
safi_t safi, struct vrf *vrf,
vrf_id_t nh_vrf_id)
{
struct static_vrf *svrf;
struct route_table *stable;
struct static_nexthop *nh;
struct static_path *pn;
struct route_node *rn;
struct static_route_info *si;
svrf = vrf->info;
if (!svrf)
return;
stable = static_vrf_static_table(afi, safi, svrf);
if (!stable)
return;
for (rn = route_top(stable); rn; rn = route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;
frr_each(static_path_list, &si->path_list, pn) {
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
if (nh->nh_vrf_id != nh_vrf_id)
continue;
if (nhp->family == AF_INET
&& nhp->u.prefix4.s_addr
!= nh->addr.ipv4.s_addr)
continue;
if (nhp->family == AF_INET6
&& memcmp(&nhp->u.prefix6, &nh->addr.ipv6,
16)
!= 0)
continue;
/*
* We've been told that a nexthop we
* depend on has changed in some manner,
* so reset the state machine to allow
* us to start over.
*/
nh->state = STATIC_START;
}
}
}
}
void static_nht_reset_start(struct prefix *nhp, afi_t afi, vrf_id_t nh_vrf_id)
{
struct vrf *vrf;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
static_nht_reset_start_safi(nhp, afi, SAFI_UNICAST,
vrf, nh_vrf_id);
static_nht_reset_start_safi(nhp, afi, SAFI_MULTICAST,
vrf, nh_vrf_id);
}
}
static void static_nht_mark_state_safi(struct prefix *sp, afi_t afi,
safi_t safi, struct vrf *vrf,
enum static_install_states state)
{
struct static_vrf *svrf;
struct route_table *stable;
struct route_node *rn;
struct static_nexthop *nh;
struct static_path *pn;
struct static_route_info *si;
svrf = vrf->info;
if (!svrf)
return;
stable = static_vrf_static_table(afi, safi, svrf);
if (!stable)
return;
rn = srcdest_rnode_lookup(stable, sp, NULL);
if (!rn)
return;
si = rn->info;
if (si) {
frr_each(static_path_list, &si->path_list, pn) {
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
nh->state = state;
}
}
}
route_unlock_node(rn);
}
void static_nht_mark_state(struct prefix *sp, vrf_id_t vrf_id,
enum static_install_states state)
{
struct vrf *vrf;
afi_t afi = AFI_IP;
if (sp->family == AF_INET6)
afi = AFI_IP6;
vrf = vrf_lookup_by_id(vrf_id);
if (!vrf || !vrf->info)
return;
static_nht_mark_state_safi(sp, afi, SAFI_UNICAST, vrf, state);
static_nht_mark_state_safi(sp, afi, SAFI_MULTICAST, vrf, state);
}
|
#pragma once
#include <Project64-core/N64System/N64Types.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/Multilanguage.h>
class CN64Rom :
protected CDebugSettings
{
public:
CN64Rom();
~CN64Rom();
bool LoadN64Image(const char * FileLoc, bool LoadBootCodeOnly = false);
bool LoadN64ImageIPL(const char * FileLoc, bool LoadBootCodeOnly = false);
static bool IsValidRomImage(uint8_t Test[4]);
bool IsLoadedRomDDIPL();
void SaveRomSettingID(bool temp);
void ClearRomSettingID();
CICChip CicChipID();
uint8_t * GetRomAddress() { return m_ROMImage; }
uint32_t GetRomSize() const { return m_RomFileSize; }
const std::string & GetRomMD5() const { return m_MD5; }
const std::string & GetRomName() const { return m_RomName; }
const std::string & GetFileName() const { return m_FileName; }
Country GetCountry() const { return m_Country; }
bool IsPal();
void UnallocateRomImage();
// Get a message ID for the reason that you failed to load the ROM
LanguageStringID GetError() const { return m_ErrorMsg; }
static CICChip GetCicChipID(uint8_t * RomData, uint64_t * CRC = nullptr);
static void CleanRomName(char * RomName, bool byteswap = true);
private:
bool AllocateRomImage(uint32_t RomFileSize);
bool AllocateAndLoadN64Image(const char * FileLoc, bool LoadBootCodeOnly);
bool AllocateAndLoadZipImage(const char * FileLoc, bool LoadBootCodeOnly);
void ByteSwapRom();
void SetError(LanguageStringID ErrorMsg);
void CalculateCicChip();
void CalculateRomCrc();
static void NotificationCB(const char * Status, CN64Rom * _this);
// Constant values
enum { ReadFromRomSection = 0x400000 };
// Class variables
CFile m_RomFile;
uint8_t * m_ROMImage;
uint8_t * m_ROMImageBase;
uint32_t m_RomFileSize;
Country m_Country;
CICChip m_CicChip;
LanguageStringID m_ErrorMsg;
std::string m_RomName, m_FileName, m_MD5, m_RomIdent;
};
|
// ---------------------------------------------------------------------------
// This file is part of reSID, a MOS6581 SID emulator engine.
// Copyright (C) 2004 Dag Lem <resid@nimrod.no>
//
// 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 __EXTFILTFP_H__
#define __EXTFILTFP_H__
#include <math.h>
#include "siddefsfp.h"
// ----------------------------------------------------------------------------
// The audio output stage in a Commodore 64 consists of two STC networks,
// a low-pass filter with 3-dB frequency 16kHz followed by a high-pass
// filter with 3-dB frequency 16Hz (the latter provided an audio equipment
// input impedance of 1kOhm).
// The STC networks are connected with a BJT supposedly meant to act as
// a unity gain buffer, which is not really how it works. A more elaborate
// model would include the BJT, however DC circuit analysis yields BJT
// base-emitter and emitter-base impedances sufficiently low to produce
// additional low-pass and high-pass 3dB-frequencies in the order of hundreds
// of kHz. This calls for a sampling frequency of several MHz, which is far
// too high for practical use.
// ----------------------------------------------------------------------------
class ExternalFilterFP
{
public:
ExternalFilterFP();
void set_clock_frequency(float);
inline void clock(float Vi);
void reset();
// Audio output (20 bits).
inline float output();
private:
inline void nuke_denormals();
// State of filters.
float Vlp; // lowpass
float Vhp; // highpass
// Cutoff frequencies.
float w0lp;
float w0hp;
friend class SIDFP;
};
// ----------------------------------------------------------------------------
// SID clocking - 1 cycle.
// ----------------------------------------------------------------------------
inline
void ExternalFilterFP::clock(float Vi)
{
float dVlp = w0lp * (Vi - Vlp);
float dVhp = w0hp * (Vlp - Vhp);
Vlp += dVlp;
Vhp += dVhp;
}
// ----------------------------------------------------------------------------
// Audio output (19.5 bits).
// ----------------------------------------------------------------------------
inline
float ExternalFilterFP::output()
{
return Vlp - Vhp;
}
inline
void ExternalFilterFP::nuke_denormals()
{
if (Vhp > -1e-12f && Vhp < 1e-12f)
Vhp = 0;
if (Vlp > -1e-12f && Vlp < 1e-12f)
Vlp = 0;
}
#endif // not __EXTFILTFP_H__
|
/* $Id: group.h 26450 2014-04-08 21:09:06Z peter1138 $ */
/*
* This file is part of OpenTTD.
* OpenTTD 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.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file group.h Base class for groups and group functions. */
#ifndef GROUP_H
#define GROUP_H
#include "group_type.h"
#include "core/pool_type.hpp"
#include "company_type.h"
#include "vehicle_type.h"
#include "engine_type.h"
typedef Pool<Group, GroupID, 16, 64000> GroupPool;
extern GroupPool _group_pool; ///< Pool of groups.
/** Statistics and caches on the vehicles in a group. */
struct GroupStatistics {
uint16 num_vehicle; ///< Number of vehicles.
uint16 *num_engines; ///< Caches the number of engines of each type the company owns.
bool autoreplace_defined; ///< Are any autoreplace rules set?
bool autoreplace_finished; ///< Have all autoreplacement finished?
uint16 num_profit_vehicle; ///< Number of vehicles considered for profit statistics;
Money profit_last_year; ///< Sum of profits for all vehicles.
GroupStatistics();
~GroupStatistics();
void Clear();
void ClearProfits()
{
this->num_profit_vehicle = 0;
this->profit_last_year = 0;
}
void ClearAutoreplace()
{
this->autoreplace_defined = false;
this->autoreplace_finished = false;
}
static GroupStatistics &Get(CompanyID company, GroupID id_g, VehicleType type);
static GroupStatistics &Get(const Vehicle *v);
static GroupStatistics &GetAllGroup(const Vehicle *v);
static void CountVehicle(const Vehicle *v, int delta);
static void CountEngine(const Vehicle *v, int delta);
static void VehicleReachedProfitAge(const Vehicle *v);
static void UpdateProfits();
static void UpdateAfterLoad();
static void UpdateAutoreplace(CompanyID company);
};
/** Group data. */
struct Group : GroupPool::PoolItem<&_group_pool> {
char *name; ///< Group Name
OwnerByte owner; ///< Group Owner
VehicleTypeByte vehicle_type; ///< Vehicle type of the group
bool replace_protection; ///< If set to true, the global autoreplace have no effect on the group
GroupStatistics statistics; ///< NOSAVE: Statistics and caches on the vehicles in the group.
GroupID parent; ///< Parent group
Group(CompanyID owner = INVALID_COMPANY);
~Group();
};
static inline bool IsDefaultGroupID(GroupID index)
{
return index == DEFAULT_GROUP;
}
/**
* Checks if a GroupID stands for all vehicles of a company
* @param id_g The GroupID to check
* @return true is id_g is identical to ALL_GROUP
*/
static inline bool IsAllGroupID(GroupID id_g)
{
return id_g == ALL_GROUP;
}
#define FOR_ALL_GROUPS_FROM(var, start) FOR_ALL_ITEMS_FROM(Group, group_index, var, start)
#define FOR_ALL_GROUPS(var) FOR_ALL_GROUPS_FROM(var, 0)
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e);
void SetTrainGroupID(Train *v, GroupID grp);
void UpdateTrainGroupID(Train *v);
void RemoveVehicleFromGroup(const Vehicle *v);
void RemoveAllGroupsForCompany(const CompanyID company);
bool GroupIsInGroup(GroupID search, GroupID group);
extern GroupID _new_group_id;
#endif /* GROUP_H */
|
/*
* Copyright (C) 2015 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __DDP_GAMMA_H__
#define __DDP_GAMMA_H__
#include <asm/uaccess.h>
typedef enum {
DISP_GAMMA0 = 0,
DISP_GAMMA_TOTAL
} disp_gamma_id_t;
typedef unsigned int gamma_entry;
#define GAMMA_ENTRY(r10, g10, b10) (((r10) << 20) | ((g10) << 10) | (b10))
#define DISP_GAMMA_LUT_SIZE 512
typedef struct {
disp_gamma_id_t hw_id;
gamma_entry lut[DISP_GAMMA_LUT_SIZE];
} DISP_GAMMA_LUT_T;
typedef enum {
DISP_CCORR0 = 0,
DISP_CCORR_TOTAL
} disp_ccorr_id_t;
typedef struct {
disp_ccorr_id_t hw_id;
unsigned int coef[3][3];
} DISP_CCORR_COEF_T;
extern int corr_dbg_en;
void ccorr_test(const char *cmd, char *debug_output);
int ccorr_interface_for_color(unsigned int ccorr_idx,
unsigned int ccorr_coef[3][3], void *handle);
#endif
|
/* Copyright (C) 1994,1997,1999-2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link the code in this file with
files compiled with a GNU compiler to produce an executable,
that does not cause the resulting executable to be covered by
the GNU Lesser General Public License. This exception does not
however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
This exception applies to code released by its copyright holders
in files containing the exception. */
#include "libioP.h"
#include "strfile.h"
static int _IO_strn_overflow (_IO_FILE *fp, int c) __THROW;
static int
_IO_strn_overflow (fp, c)
_IO_FILE *fp;
int c;
{
/* When we come to here this means the user supplied buffer is
filled. But since we must return the number of characters which
would have been written in total we must provide a buffer for
further use. We can do this by writing on and on in the overflow
buffer in the _IO_strnfile structure. */
_IO_strnfile *snf = (_IO_strnfile *) fp;
if (fp->_IO_buf_base != snf->overflow_buf)
{
/* Terminate the string. We know that there is room for at
least one more character since we initialized the stream with
a size to make this possible. */
*fp->_IO_write_ptr = '\0';
INTUSE(_IO_setb) (fp, snf->overflow_buf,
snf->overflow_buf + sizeof (snf->overflow_buf), 0);
fp->_IO_write_base = snf->overflow_buf;
fp->_IO_read_base = snf->overflow_buf;
fp->_IO_read_ptr = snf->overflow_buf;
fp->_IO_read_end = snf->overflow_buf + sizeof (snf->overflow_buf);
}
fp->_IO_write_ptr = snf->overflow_buf;
fp->_IO_write_end = snf->overflow_buf;
/* Since we are not really interested in storing the characters
which do not fit in the buffer we simply ignore it. */
return c;
}
const struct _IO_jump_t _IO_strn_jumps attribute_hidden =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
JUMP_INIT(overflow, _IO_strn_overflow),
JUMP_INIT(underflow, INTUSE(_IO_str_underflow)),
JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)),
JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)),
JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
JUMP_INIT(close, _IO_default_close),
JUMP_INIT(stat, _IO_default_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
int
_IO_vsnprintf (string, maxlen, format, args)
char *string;
_IO_size_t maxlen;
const char *format;
_IO_va_list args;
{
_IO_strnfile sf;
int ret;
#ifdef _IO_MTSAFE_IO
sf.f._sbf._f._lock = NULL;
#endif
/* We need to handle the special case where MAXLEN is 0. Use the
overflow buffer right from the start. */
if (maxlen == 0)
{
string = sf.overflow_buf;
maxlen = sizeof (sf.overflow_buf);
}
_IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
string[0] = '\0';
_IO_str_init_static_internal (&sf.f, string, maxlen - 1, string);
ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
return ret;
}
ldbl_weak_alias (_IO_vsnprintf, __vsnprintf)
ldbl_weak_alias (_IO_vsnprintf, vsnprintf)
|
// Copyright 2014 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include <list>
#include <SDL.h>
#include "InputCommon/ControllerInterface/Device.h"
#if SDL_VERSION_ATLEAST(1, 3, 0)
#define USE_SDL_HAPTIC
#endif
#ifdef USE_SDL_HAPTIC
#include <SDL_haptic.h>
#endif
namespace ciface
{
namespace SDL
{
void Init( std::vector<Core::Device*>& devices );
class Joystick : public Core::Device
{
private:
class Button : public Core::Device::Input
{
public:
std::string GetName() const override;
Button(u8 index, SDL_Joystick* js) : m_js(js), m_index(index) {}
ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const u8 m_index;
};
class Axis : public Core::Device::Input
{
public:
std::string GetName() const override;
Axis(u8 index, SDL_Joystick* js, Sint16 range) : m_js(js), m_range(range), m_index(index) {}
ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const Sint16 m_range;
const u8 m_index;
};
class Hat : public Input
{
public:
std::string GetName() const override;
Hat(u8 index, SDL_Joystick* js, u8 direction) : m_js(js), m_direction(direction), m_index(index) {}
ControlState GetState() const override;
private:
SDL_Joystick* const m_js;
const u8 m_direction;
const u8 m_index;
};
#ifdef USE_SDL_HAPTIC
class HapticEffect : public Output
{
public:
HapticEffect(SDL_Haptic* haptic) : m_haptic(haptic), m_id(-1) {}
~HapticEffect() { m_effect.type = 0; Update(); }
protected:
void Update();
virtual void SetSDLHapticEffect(ControlState state) = 0;
SDL_HapticEffect m_effect;
SDL_Haptic* m_haptic;
int m_id;
private:
virtual void SetState(ControlState state) override final;
};
class ConstantEffect : public HapticEffect
{
public:
ConstantEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {}
std::string GetName() const override;
private:
void SetSDLHapticEffect(ControlState state) override;
};
class RampEffect : public HapticEffect
{
public:
RampEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {}
std::string GetName() const override;
private:
void SetSDLHapticEffect(ControlState state) override;
};
class SineEffect : public HapticEffect
{
public:
SineEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {}
std::string GetName() const override;
private:
void SetSDLHapticEffect(ControlState state) override;
};
class TriangleEffect : public HapticEffect
{
public:
TriangleEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {}
std::string GetName() const override;
private:
void SetSDLHapticEffect(ControlState state) override;
};
class LeftRightEffect : public HapticEffect
{
public:
LeftRightEffect(SDL_Haptic* haptic) : HapticEffect(haptic) {}
std::string GetName() const override;
private:
void SetSDLHapticEffect(ControlState state) override;
};
#endif
public:
void UpdateInput() override;
Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsigned int index);
~Joystick();
std::string GetName() const override;
int GetId() const override;
std::string GetSource() const override;
private:
SDL_Joystick* const m_joystick;
const int m_sdl_index;
const unsigned int m_index;
#ifdef USE_SDL_HAPTIC
SDL_Haptic* m_haptic;
#endif
};
}
}
|
/*!
* @file coreconfigsimulator.h
* @brief
* @author
* @sa coreconfigsimulator.c
* @date 1 Mar 2012
* @version 1.0
*/
#ifndef CORECONFIGSIMULATOR_H
#define CORECONFIGSIMULATOR_H
extern WILC_Sint32 CoreConfigSimulatorInit (void);
extern WILC_Sint32 CoreConfigSimulatorDeInit (void);
#endif |
#ifndef MTL_BLOCK1D_H
#define MTL_BLOCK1D_H
#include "linalg_vec.h"
#include "fast.h"
#include "dense1D.h"
namespace mtl {
//: Blocked View of a Vector
//
// This presents a vector (must be dense) as if it is a vector of
// subvectors, where each subvector is of equal length (specified
// statically with template arg BN or dynamically in the constructor).
// This could probably be also done with a matrix, setting the ld
// to the block size, but this is less confusing.
//
//!category: containers, adaptors
//!component: type
//!tparam: Vector - the adapted Vector
//!tparam: BN - static blocking size
//!example: blocked_vector.cc
template<class Vector, int BN = 0>
class block1D {
public:
typedef block1D<Vector,BN> self;
typedef typename Vector::value_type T;
typedef external_vec<T,BN> Block;
typedef Block value_type;
typedef Block reference;
typedef const Block const_reference;
typedef Block* pointer;
typedef typename Vector::size_type size_type;
typedef typename Vector::difference_type difference_type;
enum { N = 0 };
typedef dense_tag sparsity;
typedef scaled1D< self > scaled_type;
typedef dense1D< self > partitioned;
typedef external_vec<int> IndexArray;
typedef external_vec<int> IndexArrayRef;
typedef self subrange_type;
typedef twod_tag dimension;
class iterator {
typedef iterator self;
public:
typedef Block reference;
typedef Block value_type;
typedef Block* pointer;
typedef typename Block::size_type size_type;
typedef typename Block::difference_type difference_type;
typedef std::random_access_iterator_tag iterator_category;
inline iterator(T* s, size_type p, size_type bs)
: start(s), pos(p), bsize(bs) { }
inline iterator( ) : start(0), pos(0), bs(0) { }
inline reference operator*() const {
return Block(start + pos*bsize, bsize);
}
inline self& operator++() { ++pos; return *this; }
inline self& operator+=(size_type n) { pos += n; return *this; }
inline self operator++(int) { self t = *this; ++(*this); return t; }
inline self& operator--() { --pos; return *this; }
inline self& operator-=(size_type n) { pos -= n; return *this; }
inline self operator--(int) { self t = *this; --(*this); return t; }
inline bool operator!=(const self& x) const { return pos != x.pos; }
inline bool operator==(const self& x) const { return pos == x.pos; }
inline bool operator<(const self& x) const { return pos < x.pos; }
inline size_type index() const { return pos; }
T* start;
size_type pos;
size_type bsize;
};
class const_iterator {
typedef const_iterator self;
public:
typedef Block reference;
typedef Block value_type;
typedef Block* pointer;
typedef typename Block::size_type size_type;
typedef typename Block::difference_type difference_type;
typedef std::random_access_iterator_tag iterator_category;
inline const_iterator(T* s, size_type p, size_type bs)
: start(s), pos(p), bsize(bs) { }
inline const_iterator( ) : start(0), pos(0), bsize(0) { }
inline reference operator*() const {
return Block(start + pos*bsize, bsize);
}
inline self& operator++() { ++pos; return *this; }
inline self& operator+=(size_type n) { pos += n; return *this; }
inline self operator++(int) { self t = *this; ++(*this); return t; }
inline self& operator--() { --pos; return *this; }
inline self& operator-=(size_type n) { pos -= n; return *this; }
inline self operator--(int) { self t = *this; --(*this); return t; }
inline bool operator!=(const self& x) const { return pos != x.pos; }
inline bool operator==(const self& x) const { return pos == x.pos; }
inline bool operator<(const self& x) const { return pos < x.pos; }
inline size_type index() const { return pos; }
T* start;
size_type pos;
size_type bsize;
};
typedef reverse_iter<iterator> reverse_iterator;
typedef reverse_iter<const_iterator> const_reverse_iterator;
inline block1D( ) : bsize(0) { }
inline block1D(const Vector& v, size_type block_size = BN)
: data((T*)v.data()),
size_(v.size() / block_size),
bsize(block_size) { }
inline block1D(const self& x)
: data(x.data), size_(x.size_), bsize(x.bsize) { }
inline ~block1D() { }
inline iterator begin() { return iterator(data, 0, bsize); }
inline iterator end() { return iterator(data, size_, bsize); }
inline const_iterator begin() const {
return const_iterator(data, 0, bsize); }
inline const_iterator end() const {
return const_iterator(data, size_, bsize); }
inline reverse_iterator rbegin() {
return reverse_iterator(end()); }
inline reverse_iterator rend() {
return reverse_iterator(begin()); }
inline const_reverse_iterator rbegin() const {
return const_reverse_iterator(end()); }
inline const_reverse_iterator rend() const{
return const_reverse_iterator(begin()); }
inline reference operator[](int n) {
return Block(data + n * bsize, bsize);
}
//:
inline const_reference operator[](int n) const {
return Block(data + n * bsize, bsize);
}
inline size_type size() const { return size_; }
protected:
T* data;
size_type size_;
size_type bsize;
};
}
#endif /* MTL_BLOCK1D_H */
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef REGION_CLASS
RegionStyle(cone,RegCone)
#else
#ifndef LMP_REGION_CONE_H
#define LMP_REGION_CONE_H
#include "region.h"
namespace LAMMPS_NS {
class RegCone : public Region {
public:
RegCone(class LAMMPS *, int, char **);
~RegCone();
int inside(double, double, double);
int surface_interior(double *, double);
int surface_exterior(double *, double);
private:
char axis;
double c1,c2;
double radiuslo,radiushi;
double lo,hi;
double maxradius;
void point_on_line_segment(double *, double *, double *, double *);
double closest(double *, double *, double *, double);
void subtract(double *, double *, double *);
double dotproduct(double *, double *);
};
}
#endif
#endif
|
/*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
/*
* Definitions for AP3220 als/ps sensor chip.
*/
#ifndef __AP3220_H__
#define __AP3220_H__
#include <linux/ioctl.h>
/*ap3220 als/ps sensor register related macro*/
#define AP3220_REG_SYS_CONF 0x00
#define AP3220_REG_SYS_ISTATUS 0x01
#define AP3220_REG_SYS_ICLEAR_M 0x02
#define AP3220_REG_SYS_IR_DATA_LOW 0x0A
#define AP3220_REG_SYS_IR_DATA_HIGH 0x0B
#define AP3220_REG_SYS_ALS_DATA_LOW 0x0C
#define AP3220_REG_SYS_ALS_DATA_HIGH 0x0D
#define AP3220_REG_SYS_PS_DATA_LOW 0x0E
#define AP3220_REG_SYS_PS_DATA_HIGH 0x0F
#define AP3220_SYSTEM_PS_IR_OVERFLOW 0x40
#define AP3220_SYSTEM_PS_OBJ_CLOSE 0x80
#define AP3220_REG_ALS_CONF 0x10
#define AP3220_REG_ALS_CAL 0x19
#define AP3220_REG_ALS_THDL_L 0x1A
#define AP3220_REG_ALS_THDL_H 0x1B
#define AP3220_REG_ALS_THDH_L 0x1C
#define AP3220_REG_ALS_THDH_H 0x1D
#define AP3220_REG_PS_CONF 0x20
#define AP3220_REG_PS_LED 0x21
#define AP3220_REG_PS_INT_FORM 0x22
#define AP3220_REG_PS_MEAN_TIME 0x23
#define AP3220_REG_PS_WAIT_TIME 0x24
#define AP3220_REG_PS_CAL_L 0x28
#define AP3220_REG_PS_CAL_H 0x29
#define AP3220_REG_PS_THDL_L 0x2A
#define AP3220_REG_PS_THDL_H 0x2B
#define AP3220_REG_PS_THDH_L 0x2C
#define AP3220_REG_PS_THDH_H 0x2D
//SYSTEM MODE
#define AP3220_SYSTEM_DEVICE_DOWN 0x00
#define AP3220_SYSTEM_PS_ENABLE 0x02
#define AP3220_SYSTEM_ALS_ENABLE 0x01
#define AP3220_SYSTEM_DEVICE_MASK 0x03
#define AP3220_SYSTEM_ALS_INT_TRIGGER 0x01
#define AP3220_SYSTEM_PS_INT_TRIGGER 0x02
#define AP3220_SYSTEM_PS_OBJ 0x80
#define AP3220_SYSTEM_PS_IR_OF 0x40
#define AP3220_SYSTEM_PS_DATA_MASK_L 0x0F
#define AP3220_SYSTEM_PS_DATA_MASK_H 0x3F
#define AP3220_ALS_RANGE_MASK 0x30
#define AP3220_ALS_RANGE_SHIFT 4
#define AP3220_ALS_PERSIST_MASK 0x0F
#define AP3220_ALS_PERSIST_SHIFT 0x00
//ALS Setting
#define AP3220_ALS_SETTING_RANGE_65536 0x00
#define AP3220_ALS_SETTING_RANGE_16383 0x01
#define AP3220_ALS_SETTING_RANGE_4095 0x02
#define AP3220_ALS_SETTING_RANGE_1023 0x03
#define AP3220_ALS_SETTING_PERSIST_1 0x00
#define AP3220_ALS_SETTING_PERSIST_4 0x01
#define AP3220_ALS_SETTING_PERSIST_8 0x02
#define AP3220_ALS_SETTING_PERSIST_12 0x03
#define AP3220_ALS_SETTING_PERSIST_16 0x04
#define AP3220_ALS_SETTING_PERSIST_60 0x0F
#define AP3220_PS_INTEGEATED_TIME_MASK 0xF0
#define AP3220_PS_INTEGEATED_TIME_SHIFT 4
#define AP3220_PS_GAIN_MASK 0x0C
#define AP3220_PS_GAIN_SHIFT 2
#define AP3220_PS_PERSIST_MASK 0x03
#define AP3220_PS_PERSIST_SHIFT 0x00
#define AP3220_PS_GAIN_SHIFT 0
#define AP3220_PS_LED_PULSE_MASK 0x30
#define AP3220_PS_LED_PULSE_SHIFT 4
#define AP3220_PS_LED_RATIO_MASK 0x02
#define AP3220_PS_LED_RATIO_SHIFT 0
//PS Setting
#define AP3220_PS_SETTING_INTG_TIME_1 0x00
#define AP3220_PS_SETTING_INTG_TIME_2 0x01
#define AP3220_PS_SETTING_INTG_TIME_3 0x02
#define AP3220_PS_SETTING_INTG_TIME_4 0x03
#define AP3220_PS_SETTING_INTG_TIME_16 0x0F
#define AP3220_PS_SETTING_GAIN_1 0x00
#define AP3220_PS_SETTING_GAIN_2 0x01
#define AP3220_PS_SETTING_GAIN_4 0x02
#define AP3220_PS_SETTING_GAIN_8 0x03
#define AP3220_PS_SETTING_PERSIST_1 0x00
#define AP3220_PS_SETTING_PERSIST_2 0x01
#define AP3220_PS_SETTING_PERSIST_4 0x02
#define AP3220_PS_SETTING_PERSIST_5 0x03
#define AP3220_PS_SETTING_LED_PULSE_0 0x00
#define AP3220_PS_SETTING_LED_PULSE_1 0x01
#define AP3220_PS_SETTING_LED_PULSE_2 0x02
#define AP3220_PS_SETTING_LED_PULSE_3 0x03
#define AP3220_PS_SETTING_LED_RATIO_16 0x00
#define AP3220_PS_SETTING_LED_RATIO_33 0x01
#define AP3220_PS_SETTING_LED_RATIO_66 0x02
#define AP3220_PS_SETTING_LED_RATIO_100 0x03
#define AP3220_PS_SETTING_PS_ALGO_ZONE 0x00
#define AP3220_PS_SETTING_PS_ALGO_HYST 0x01
#define AP3220_PS_SETTING_PS_MEAN_12 0x00
#define AP3220_PS_SETTING_PS_MEAN_25 0x01
#define AP3220_PS_SETTING_PS_MEAN_37 0x02
#define AP3220_PS_SETTING_PS_MEAN_50 0x03
/*AP3220 related driver tag macro*/
#define AP3220_SUCCESS 0
#define AP3220_ERR_I2C -1
#define AP3220_ERR_STATUS -3
#define AP3220_ERR_SETUP_FAILURE -4
#define AP3220_ERR_GETGSENSORDATA -5
#define AP3220_ERR_IDENTIFICATION -6
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Advanced Micro Devices, 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; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <console/console.h>
#include <string.h>
#include <arch/acpi.h>
#include <arch/acpigen.h>
#include <arch/ioapic.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <cpu/x86/msr.h>
#include <northbridge/amd/agesa/agesawrapper.h>
#include <cpu/amd/mtrr.h>
#include <cpu/amd/amdfam14.h>
unsigned long acpi_fill_madt(unsigned long current)
{
/* create all subtables for processors */
current = acpi_create_madt_lapics(current);
/* Write SB800 IOAPIC, only one */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
CONFIG_MAX_CPUS, IO_APIC_ADDR, 0);
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
current, 0, 0, 2, 0);
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
current, 0, 9, 9, 0xF);
/* 0: mean bus 0--->ISA */
/* 0: PIC 0 */
/* 2: APIC 2 */
/* 5 mean: 0101 --> Edge-triggered, Active high */
/* create all subtables for processors */
/* current = acpi_create_madt_lapic_nmis(current, 5, 1); */
/* 1: LINT1 connect to NMI */
return current;
}
|
/* Copyright: © Copyright 2005 Apple Computer, Inc. All rights reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject
to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
copyrights in this original Apple software (the "Apple Software"), to use,
reproduce, modify and redistribute the Apple Software, with or without
modifications, in source and/or binary forms; provided that if you redistribute
the Apple Software in its entirety and without modifications, you must retain
this notice and the following text and disclaimers in all such redistributions of
the Apple Software. Neither the name, trademarks, service marks or logos of
Apple Computer, Inc. may be used to endorse or promote products derived from the
Apple Software without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or implied,
are granted by Apple herein, including but not limited to any patent rights that
may be infringed by your derivative works or by other works in which the Apple
Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*=============================================================================
CAReferenceCounted.h
=============================================================================*/
#ifndef __CAReferenceCounted_h__
#define __CAReferenceCounted_h__
#if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
#include <CoreServices/CoreServices.h>
#else
#include <CoreServices.h>
#endif
#if TARGET_OS_WIN32
#include "CAWindows.h"
#endif
// base class for reference-counted objects
class CAReferenceCounted {
public:
CAReferenceCounted() : mRefCount(1) {}
void retain() { IncrementAtomic(&mRefCount); }
void release()
{
// this returns the ORIGINAL value, not the new one.
SInt32 rc = DecrementAtomic(&mRefCount);
if (rc == 1) {
delete this;
}
}
protected:
virtual ~CAReferenceCounted() { }
CAReferenceCounted(const CAReferenceCounted &) : mRefCount(0) { }
private:
SInt32 mRefCount;
CAReferenceCounted operator=(const CAReferenceCounted &) { return *this; }
};
#endif // __CAReferenceCounted_h__
|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationthreshold.c
* Copyright (C) 2007 Michael Natterer <mitch@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <cairo.h>
#include <gegl.h>
#include "operations-types.h"
#include "gimpoperationthreshold.h"
#include "gimpthresholdconfig.h"
static gboolean gimp_operation_threshold_process (GeglOperation *operation,
void *in_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationThreshold, gimp_operation_threshold,
GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_threshold_parent_class
static void
gimp_operation_threshold_class_init (GimpOperationThresholdClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
object_class->set_property = gimp_operation_point_filter_set_property;
object_class->get_property = gimp_operation_point_filter_get_property;
gegl_operation_class_set_keys (operation_class,
"name", "gimp:threshold",
"categories", "color",
"description", "GIMP Threshold operation",
NULL);
point_class->process = gimp_operation_threshold_process;
g_object_class_install_property (object_class,
GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
GIMP_TYPE_THRESHOLD_CONFIG,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
}
static void
gimp_operation_threshold_init (GimpOperationThreshold *self)
{
}
static gboolean
gimp_operation_threshold_process (GeglOperation *operation,
void *in_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
if (! config)
return FALSE;
while (samples--)
{
gfloat value;
value = MAX (src[RED], src[GREEN]);
value = MAX (value, src[BLUE]);
value = (value >= config->low && value <= config->high) ? 1.0 : 0.0;
dest[RED] = value;
dest[GREEN] = value;
dest[BLUE] = value;
dest[ALPHA] = src[ALPHA];
src += 4;
dest += 4;
}
return TRUE;
}
|
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUTPCBaseTrackParam.h
/// \author David Rohr, Sergey Gorbunov
#ifndef GPUTPCBASETRACKPARAM_H
#define GPUTPCBASETRACKPARAM_H
#include "GPUTPCDef.h"
namespace GPUCA_NAMESPACE
{
namespace gpu
{
MEM_CLASS_PRE()
class GPUTPCTrackParam;
/**
* @class GPUTPCBaseTrackParam
*
* GPUTPCBaseTrackParam class contains track parameters
* used in output of the GPUTPCTracker slice tracker.
* This class is used for transfer between tracker and merger and does not contain the covariance matrice
*/
MEM_CLASS_PRE()
struct GPUTPCBaseTrackParam {
GPUd() float X() const { return mX; }
GPUd() float Y() const { return mP[0]; }
GPUd() float Z() const { return mP[1]; }
GPUd() float SinPhi() const { return mP[2]; }
GPUd() float DzDs() const { return mP[3]; }
GPUd() float QPt() const { return mP[4]; }
GPUd() float ZOffset() const { return mZOffset; }
GPUd() float Err2Y() const { return mC[0]; }
GPUd() float Err2Z() const { return mC[2]; }
GPUd() float Err2SinPhi() const { return mC[5]; }
GPUd() float Err2DzDs() const { return mC[9]; }
GPUd() float Err2QPt() const { return mC[14]; }
GPUhd() const float* Cov() const { return mC; }
GPUd() float GetCov(int i) const { return mC[i]; }
GPUhd() void SetCov(int i, float v) { mC[i] = v; }
GPUhd() float GetX() const { return mX; }
GPUhd() float GetY() const { return mP[0]; }
GPUhd() float GetZ() const { return mP[1]; }
GPUhd() float GetSinPhi() const { return mP[2]; }
GPUhd() float GetDzDs() const { return mP[3]; }
GPUhd() float GetQPt() const { return mP[4]; }
GPUhd() float GetZOffset() const { return mZOffset; }
GPUd() float GetKappa(float Bz) const { return -mP[4] * Bz; }
GPUhd() MakeType(const float*) Par() const { return mP; }
GPUd() const MakeType(float*) GetPar() const { return mP; }
GPUd() float GetPar(int i) const { return (mP[i]); }
GPUhd() void SetPar(int i, float v) { mP[i] = v; }
GPUd() void SetX(float v) { mX = v; }
GPUd() void SetY(float v) { mP[0] = v; }
GPUd() void SetZ(float v) { mP[1] = v; }
GPUd() void SetSinPhi(float v) { mP[2] = v; }
GPUd() void SetDzDs(float v) { mP[3] = v; }
GPUd() void SetQPt(float v) { mP[4] = v; }
GPUd() void SetZOffset(float v) { mZOffset = v; }
// WARNING, Track Param Data is copied in the GPU Tracklet Constructor element by element instead of using copy constructor!!!
// This is neccessary for performance reasons!!!
// Changes to Elements of this class therefore must also be applied to TrackletConstructor!!!
float mX; // x position
float mC[15]; // the covariance matrix for Y,Z,SinPhi,..
float mZOffset; // z offset
float mP[5]; // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt
};
} // namespace gpu
} // namespace GPUCA_NAMESPACE
#endif
|
#import <UIKit/_UIVisualEffectLayerConfig.h>
@interface _UIVisualEffectTintLayerConfig : _UIVisualEffectLayerConfig
@property (nonatomic,readonly) UIColor *tintColor; //@synthesize tintColor=_tintColor - In the implementation block
+(instancetype)layerWithTintColor:(UIColor *)arg1 filterType:(NSString *)arg2;
+(instancetype)layerWithTintColor:(UIColor *)arg1;
-(UIColor *)tintColor;
-(void)configureLayerView:(id)arg1;
-(void)deconfigureLayerView:(id)arg1;
@end |
//
// dwhciframeschednper.h
//
// USPi - An USB driver for Raspberry Pi written in C
// Copyright (C) 2014 R. Stange <rsta2@o2online.de>
//
// 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 _uspi_dwhciframeschednper_h
#define _uspi_dwhciframeschednper_h
#include <uspi/dwhciframescheduler.h>
#include <uspi/types.h>
typedef struct TDWHCIFrameSchedulerNonPeriodic
{
TDWHCIFrameScheduler m_DWHCIFrameScheduler;
unsigned m_nState;
unsigned m_nTries;
}
TDWHCIFrameSchedulerNonPeriodic;
void DWHCIFrameSchedulerNonPeriodic (TDWHCIFrameSchedulerNonPeriodic *pThis);
void _DWHCIFrameSchedulerNonPeriodic (TDWHCIFrameScheduler *pBase);
void DWHCIFrameSchedulerNonPeriodicStartSplit (TDWHCIFrameScheduler *pBase);
boolean DWHCIFrameSchedulerNonPeriodicCompleteSplit (TDWHCIFrameScheduler *pBase);
void DWHCIFrameSchedulerNonPeriodicTransactionComplete (TDWHCIFrameScheduler *pBase, u32 nStatus);
void DWHCIFrameSchedulerNonPeriodicWaitForFrame (TDWHCIFrameScheduler *pBase);
boolean DWHCIFrameSchedulerNonPeriodicIsOddFrame (TDWHCIFrameScheduler *pBase);
#endif
|
/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/
/* */
/* The LLVM Compiler Infrastructure */
/* */
/* This file is distributed under the University of Illinois Open Source */
/* License. See LICENSE.TXT for details. */
/* */
/*===----------------------------------------------------------------------===*/
/* This file enumerates all of the llvm variables from configure so that
they can be in exported headers and won't override package specific
directives. This is a C file so we can include it in the llvm-c headers. */
/* To avoid multiple inclusions of these variables when we include the exported
headers and config.h, conditionally include these. */
/* TODO: This is a bit of a hack. */
#ifndef CONFIG_H
/* Installation directory for binary executables */
/* #undef LLVM_BINDIR */
/* Time at which LLVM was configured */
/* #undef LLVM_CONFIGTIME */
/* Installation directory for data files */
/* #undef LLVM_DATADIR */
/* Installation directory for documentation */
/* #undef LLVM_DOCSDIR */
/* Installation directory for config files */
/* #undef LLVM_ETCDIR */
/* Host triple we were built on */
#define LLVM_HOSTTRIPLE "i686-pc-win32"
/* Installation directory for include files */
/* #undef LLVM_INCLUDEDIR */
/* Installation directory for .info files */
/* #undef LLVM_INFODIR */
/* Installation directory for libraries */
/* #undef LLVM_LIBDIR */
/* Installation directory for man pages */
/* #undef LLVM_MANDIR */
/* Build multithreading support into LLVM */
#define LLVM_MULTITHREADED 1
/* LLVM architecture name for the native architecture, if available */
#define LLVM_NATIVE_ARCH X86
/* LLVM name for the native Target init function, if available */
#define LLVM_NATIVE_TARGET LLVMInitializeX86Target
/* LLVM name for the native TargetInfo init function, if available */
#define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo
/* LLVM name for the native AsmPrinter init function, if available */
#define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter
/* Define if this is Unixish platform */
/* #undef LLVM_ON_UNIX */
/* Define if this is Win32ish platform */
#define LLVM_ON_WIN32 1
/* Define to path to circo program if found or 'echo circo' otherwise */
/* #undef LLVM_PATH_CIRCO */
/* Define to path to dot program if found or 'echo dot' otherwise */
/* #undef LLVM_PATH_DOT */
/* Define to path to dotty program if found or 'echo dotty' otherwise */
/* #undef LLVM_PATH_DOTTY */
/* Define to path to fdp program if found or 'echo fdp' otherwise */
/* #undef LLVM_PATH_FDP */
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
/* #undef LLVM_PATH_GRAPHVIZ */
/* Define to path to gv program if found or 'echo gv' otherwise */
/* #undef LLVM_PATH_GV */
/* Define to path to neato program if found or 'echo neato' otherwise */
/* #undef LLVM_PATH_NEATO */
/* Define to path to twopi program if found or 'echo twopi' otherwise */
/* #undef LLVM_PATH_TWOPI */
/* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */
/* #undef LLVM_PATH_XDOT_PY */
/* Installation prefix directory */
#define LLVM_PREFIX "C:/Program Files (x86)/LLVM"
#endif
|
/////////////////////////////////////////////////////////////////////////////
// Name: file.h
// Purpose: File protocol
// Author: Guilhem Lavaux
// Modified by:
// Created: 1997
// RCS-ID: $Id: file.h,v 1.10 2004/05/23 20:51:44 JS Exp $
// Copyright: (c) 1997, 1998 Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_PROTO_FILE_H__
#define __WX_PROTO_FILE_H__
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "sckfile.h"
#endif
#include "wx/defs.h"
#if wxUSE_PROTOCOL_FILE
#include "wx/protocol/protocol.h"
#include "wx/url.h"
class WXDLLIMPEXP_NET wxFileProto: public wxProtocol {
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFileProto)
DECLARE_PROTOCOL(wxFileProto)
protected:
wxProtocolError m_error;
public:
wxFileProto();
~wxFileProto();
wxProtocolError GetError() { return m_error; }
bool Abort() { return TRUE; }
wxInputStream *GetInputStream(const wxString& path);
};
#endif // wxUSE_PROTOCOL_FILE
#endif // __WX_PROTO_FILE_H__
|
/* Copyright (c) [2014 Baidu]. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* File Name :
* Author :
* Version : $Revision:$
* Date : $Date:$
* Description :
*
* HISTORY:
* Date | Modification | Author
* 28/03/2014 | Initial Revision |
*/
#ifndef _LED_FLASH_
#define _LED_FLASH_
#include "stdint.h"
#include "config.h"
#define LED_NUMBER (5)
typedef enum {
ALL_FLASH = 0, /*ÆëÉÁ*/
SERIAL_FLASH = 1, /*ÂÖÁ÷µãÁÁ*/
SERIAL_CLOSE = 2, /*ÂÖÁ÷ϨÃð*/
CELEBRATE = 3, /*Çì×£ÌøÉÁ*/
EYE_STYLE = 4, /*ÏñСÑÛ¾¦Ò»ÑùÉÁ¶¯*/
PERCENTAGE_20 = 5, /* < 20%*/
PERCENTAGE_40 = 6, /* < 40%*/
PERCENTAGE_60 = 7, /* < 60%*/
PERCENTAGE_80 = 8, /* < 80%*/
PERCENTAGE_100 = 9, /* < 100%*/
PERCENTAGE_FULL = 100, /* = 100%*/
FIRST_LED_FLASH = 10,
SECOND_LED_FLASH= 11,
THIRD_LED_FLASH = 12,
FORTH_LED_FLASH = 13,
FIFTH_LED_FLASH = 14,
BORDER_TO_CENTRAL= 15,
LED_BLANK = 16,
STEP_PERCENTAGE_20 = 17, /*20%*/
STEP_PERCENTAGE_40 = 18, /*40%*/
STEP_PERCENTAGE_60 = 19, /*60%*/
STEP_PERCENTAGE_80 = 20, /*80%*/
STEP_PERCENTAGE_100 = 21, /*100%*/
ANIMATED_FLASH = 22, /*100%*/
FLASH_NONE = 0xff
}LED_FLASH_TYPE;
uint32_t led_flash_timer_init(void);
uint8_t led_action_control(uint8_t notification_type, LED_FLASH_TYPE flash_type, uint16_t loop);
uint8_t led_action_control_with_interval(uint8_t notification_type, LED_FLASH_TYPE flash_type, uint16_t loop,uint32_t time_interval);
void led_action_stop(void);
uint8_t notification_status(void);
#endif //_LED_FLASH_
|
/*
The OpenTRV project licenses this file to you
under the Apache Licence, Version 2.0 (the "Licence");
you may not use this file except in compliance
with the Licence. You may obtain a copy of the Licence at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the Licence is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the Licence for the
specific language governing permissions and limitations
under the Licence.
Author(s) / Copyright (s): Damon Hart-Davis 2013--2014
*/
/*
Schedule support for TRV.
*/
#ifndef SCHEDULE_H
#define SCHEDULE_H
#include "V0p2_Main.h"
#include "EEPROM_Utils.h"
// Granularity of simple schedule in minutes (values may be rounded/truncated to nearest); strictly positive.
#define SIMPLE_SCHEDULE_GRANULARITY_MINS 6
// Expose number of supported schedules.
// Can be more than the number of buttons, but later schedules will be CLI-only.
#define MAX_SIMPLE_SCHEDULES EE_START_MAX_SIMPLE_SCHEDULES
// Get the simple schedule on time, as minutes after midnight [0,1439]; invalid (eg ~0) if none set.
// Will usually include a pre-warm time before the actual time set.
// Note that unprogrammed EEPROM value will result in invalid time, ie schedule not set.
// * which schedule number, counting from 0
uint_least16_t getSimpleScheduleOn(uint8_t which);
// Get the simple schedule off time, as minutes after midnight [0,1439]; invalid (eg ~0) if none set.
// This is based on specifed start time and some element of the current eco/comfort bias.
// * which schedule number, counting from 0
uint_least16_t getSimpleScheduleOff(uint8_t which);
// Set the simple simple on time.
// * startMinutesSinceMidnightLT is start/on time in minutes after midnight [0,1439]
// * which schedule number, counting from 0
// Invalid parameters will be ignored and false returned,
// else this will return true and isSimpleScheduleSet() will return true after this.
// NOTE: over-use of this routine can prematurely wear out the EEPROM.
bool setSimpleSchedule(uint_least16_t startMinutesSinceMidnightLT, uint8_t which);
// Clear a simple schedule.
// There will be neither on nor off events from the selected simple schedule once this is called.
// * which schedule number, counting from 0
void clearSimpleSchedule(uint8_t which);
// True iff any schedule is 'on'/'WARN' even when schedules overlap.
// Can be used to suppress all 'off' activity except for the final one.
// Can be used to suppress set-backs during on times.
bool isAnyScheduleOnWARMNow();
// True iff any schedule is due 'on'/'WARM' soon even when schedules overlap.
// May be relatively slow/expensive.
// Can be used to allow room to be brought up to at least a set-back temperature
// if very cold when a WARM period is due soon (to help ensure that WARM target is met on time).
bool isAnyScheduleOnWARMSoon();
// True iff any schedule is currently 'on'/'WARM' even when schedules overlap.
// May be relatively slow/expensive.
// Can be used to suppress all 'off' activity except for the final one.
// Can be used to suppress set-backs during on times.
bool isAnySimpleScheduleSet();
#endif
|
//
// LCCKBaseConversationViewController.h
// LeanCloudChatKit-iOS
//
// v0.8.5 Created by ElonChan on 16/3/21.
// Copyright © 2016年 LeanCloud. All rights reserved.
//
#if __has_include(<MJRefresh/MJRefresh.h>)
#import <MJRefresh/MJRefresh.h>
#else
#import "MJRefresh.h"
#endif
@interface LCCKConversationRefreshHeader : MJRefreshHeader
@end
|
/*
* Copyright 2012 Utkin Dmitry
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* This file is part of the WSF Staff project.
* Please, visit http://code.google.com/p/staff for more information.
*/
#ifndef _STAFF_XML_DOCUMENT_H_
#define _STAFF_XML_DOCUMENT_H_
#include "Declaration.h"
#include "Element.h"
#include "staffxmlexport.h"
namespace staff
{
namespace xml
{
//! XML Document
class STAFF_XML_EXPORT Document
{
public:
//! get document declaration
/*! \return document declaration
*/
const Declaration& GetDeclaration() const;
//! get document declaration
/*! \return document declaration
*/
Declaration& GetDeclaration();
//! get root Element
/*! \return root Element
*/
const Element& GetRootElement() const;
//! get root node
/*! \return root node
*/
Element& GetRootElement();
private:
Declaration m_tDeclaration; //!< xml-declaration
Element m_tRootElement; //!< root element
};
} // namespace xml
} // namespace staff
#endif // _STAFF_XML_DOCUMENT_H_
|
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebRTCDataChannelHandler_h
#define WebRTCDataChannelHandler_h
#include "WebCommon.h"
#include "WebPrivatePtr.h"
#include "WebRTCDataChannelHandlerClient.h"
#include "WebString.h"
namespace blink {
class WebRTCDataChannelHandler {
public:
virtual ~WebRTCDataChannelHandler() {}
virtual void setClient(WebRTCDataChannelHandlerClient*) = 0;
virtual WebString label() = 0;
// DEPRECATED
virtual bool isReliable() { return true; }
virtual bool ordered() const = 0;
virtual unsigned short maxRetransmitTime() const = 0;
virtual unsigned short maxRetransmits() const = 0;
virtual WebString protocol() const = 0;
virtual bool negotiated() const = 0;
virtual unsigned short id() const = 0;
virtual WebRTCDataChannelHandlerClient::ReadyState state() const = 0;
virtual unsigned long bufferedAmount() = 0;
virtual bool sendStringData(const WebString&) = 0;
virtual bool sendRawData(const char*, size_t) = 0;
virtual void close() = 0;
};
} // namespace blink
#endif // WebRTCDataChannelHandler_h
|
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) 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.
*
* $FreeBSD: head/lib/libarchive/archive_private.h 201098 2009-12-28 02:58:14Z kientzle $
*/
#ifndef __LIBARCHIVE_BUILD
#error This header is only to be used internally to libarchive.
#endif
#ifndef ARCHIVE_PRIVATE_H_INCLUDED
#define ARCHIVE_PRIVATE_H_INCLUDED
#if HAVE_ICONV_H
#include <iconv.h>
#endif
#include "archive.h"
#include "archive_string.h"
#if defined(__GNUC__) && (__GNUC__ > 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
#define __LA_DEAD __attribute__((__noreturn__))
#else
#define __LA_DEAD
#endif
#define ARCHIVE_WRITE_MAGIC (0xb0c5c0deU)
#define ARCHIVE_READ_MAGIC (0xdeb0c5U)
#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
#define ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
#define ARCHIVE_MATCH_MAGIC (0xcad11c9U)
#define ARCHIVE_STATE_NEW 1U
#define ARCHIVE_STATE_HEADER 2U
#define ARCHIVE_STATE_DATA 4U
#define ARCHIVE_STATE_EOF 0x10U
#define ARCHIVE_STATE_CLOSED 0x20U
#define ARCHIVE_STATE_FATAL 0x8000U
#define ARCHIVE_STATE_ANY (0xFFFFU & ~ARCHIVE_STATE_FATAL)
struct archive_vtable {
int (*archive_close)(struct archive *);
int (*archive_free)(struct archive *);
int (*archive_write_header)(struct archive *,
struct archive_entry *);
int (*archive_write_finish_entry)(struct archive *);
ssize_t (*archive_write_data)(struct archive *,
const void *, size_t);
ssize_t (*archive_write_data_block)(struct archive *,
const void *, size_t, int64_t);
int (*archive_read_next_header)(struct archive *,
struct archive_entry **);
int (*archive_read_next_header2)(struct archive *,
struct archive_entry *);
int (*archive_read_data_block)(struct archive *,
const void **, size_t *, int64_t *);
int (*archive_filter_count)(struct archive *);
int64_t (*archive_filter_bytes)(struct archive *, int);
int (*archive_filter_code)(struct archive *, int);
const char * (*archive_filter_name)(struct archive *, int);
};
struct archive_string_conv;
struct archive {
/*
* The magic/state values are used to sanity-check the
* client's usage. If an API function is called at a
* ridiculous time, or the client passes us an invalid
* pointer, these values allow me to catch that.
*/
unsigned int magic;
unsigned int state;
/*
* Some public API functions depend on the "real" type of the
* archive object.
*/
struct archive_vtable *vtable;
int archive_format;
const char *archive_format_name;
int compression_code; /* Currently active compression. */
const char *compression_name;
/* Number of file entries processed. */
int file_count;
int archive_error_number;
const char *error;
struct archive_string error_string;
char *current_code;
unsigned current_codepage; /* Current ACP(ANSI CodePage). */
unsigned current_oemcp; /* Current OEMCP(OEM CodePage). */
struct archive_string_conv *sconv;
};
/* Check magic value and state; return(ARCHIVE_FATAL) if it isn't valid. */
int __archive_check_magic(struct archive *, unsigned int magic,
unsigned int state, const char *func);
#define archive_check_magic(a, expected_magic, allowed_states, function_name) \
do { \
int magic_test = __archive_check_magic((a), (expected_magic), \
(allowed_states), (function_name)); \
if (magic_test == ARCHIVE_FATAL) \
return ARCHIVE_FATAL; \
} while (0)
void __archive_errx(int retvalue, const char *msg) __LA_DEAD;
void __archive_ensure_cloexec_flag(int fd);
int __archive_mktemp(const char *tmpdir);
int __archive_clean(struct archive *);
#define err_combine(a,b) ((a) < (b) ? (a) : (b))
#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300)
# define ARCHIVE_LITERAL_LL(x) x##i64
# define ARCHIVE_LITERAL_ULL(x) x##ui64
#else
# define ARCHIVE_LITERAL_LL(x) x##ll
# define ARCHIVE_LITERAL_ULL(x) x##ull
#endif
#endif
|
/////////////////////////////////////////////////////////////////////////////
// Name: pile.h
// Purpose: Forty Thieves patience game
// Author: Chris Breeze
// Modified by:
// Created: 21/07/97
// Copyright: (c) 1993-1998 Chris Breeze
// Licence: wxWindows licence
//---------------------------------------------------------------------------
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
/////////////////////////////////////////////////////////////////////////////
//+-------------------------------------------------------------+
//| Description: |
//| The base class for holding piles of playing cards. |
//| This is the basic building block for card games. A pile |
//| has a position on the screen and an offset for each |
//| card placed on it e.g. a pack has no offset, but the |
//| discard pile may be fanned out across the screen. |
//| |
//| The pile knows how to draw itself, though this may be |
//| overridden if the default layout needs to be changed. |
//| One or more cards can be removed from the top of a pile, |
//| and single cards can be added to the top of a pile. |
//| Functions are provided which redraw the screen when |
//| cards are added or removed. |
//| |
//| Cards know which way up they are and how to draw |
//| themselves. Piles are lists of cards. Piles know which |
//| cards they contain and where they are to be drawn. |
//+-------------------------------------------------------------+
#ifndef _PILE_H_
#define _PILE_H_
#include "card.h"
const int NumCards = 2 * PackSize;
//----------------------------------------------------------------//
// A class defining a pile of cards with a position on the screen //
//----------------------------------------------------------------//
class Pile {
public:
Pile(int x, int y, int dx = 0, int dy = 0);
virtual ~Pile(){};
// General functions
virtual void ResetPile() { m_topCard = -1; }
virtual void Redraw(wxDC& pDC);
// Card query functions
virtual Card* GetCard(int x, int y); // Get pointer to card at x, y
Card* GetTopCard(); // Get pointer to top card
virtual void GetCardPos(Card* card, int& x, int& y);
// Get position of a card
virtual void GetTopCardPos(int& x, int& y);
// Get position of the top card
int GetNumCards() { return m_topCard + 1; } // Number of cards in pile
bool Overlap(int x, int y); // does card at x,y overlap the pile?
int CalcDistance(int x, int y); // calculates the square of the distance
// of a card at (x,y) from the top of the pile
// Functions removing one or more cards from the top of a pile
virtual bool CanCardLeave(Card* card);
Card* RemoveTopCard();
virtual Card* RemoveTopCard(wxDC& pDC, int xOffset = 0, int yOffset = 0);
// Functions to add a card to the top of a pile
virtual bool AcceptCard(Card*) { return false; }
virtual void AddCard(Card* card); // Add card to top of pile
virtual void AddCard(wxDC& pDC, Card* card); // Add card + redraw it
void SetPos(int x,int y) {m_x = x;m_y = y;};
protected:
int m_x, m_y; // Position of the pile on the screen
int m_dx, m_dy; // Offset when drawing the pile
Card* m_cards[NumCards]; // Array of cards in this pile
int m_topCard; // Array index of the top card
};
#endif // _PILE_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_
#include "chrome/browser/extensions/extension_function.h"
namespace extensions {
class AppNotifyFunction : public SyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.notify");
protected:
virtual ~AppNotifyFunction() {}
virtual bool RunImpl() OVERRIDE;
};
class AppClearAllNotificationsFunction : public SyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.clearAllNotifications");
protected:
virtual ~AppClearAllNotificationsFunction() {}
virtual bool RunImpl() OVERRIDE;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_BASE_WIN_WIN_CURSOR_H_
#define UI_BASE_WIN_WIN_CURSOR_H_
#include "base/component_export.h"
#include "base/win/windows_types.h"
#include "ui/base/cursor/platform_cursor.h"
template <class T>
class scoped_refptr;
namespace ui {
// Ref counted class to hold a Windows cursor, i.e. an HCURSOR. Clears the
// resources on destruction.
class COMPONENT_EXPORT(UI_BASE) WinCursor : public PlatformCursor {
public:
static scoped_refptr<WinCursor> FromPlatformCursor(
scoped_refptr<PlatformCursor> platform_cursor);
explicit WinCursor(HCURSOR hcursor = nullptr, bool should_destroy = false);
WinCursor(const WinCursor&) = delete;
WinCursor& operator=(const WinCursor&) = delete;
HCURSOR hcursor() const { return hcursor_; }
private:
friend class base::RefCounted<WinCursor>;
~WinCursor() override;
// Release the cursor on deletion. To be used by custom image cursors.
bool should_destroy_;
HCURSOR hcursor_;
};
} // namespace ui
#endif // UI_BASE_WIN_WIN_CURSOR_H_
|
/* 20080614: In a definition ... */
struct c; /* .. is a forward decl. */
struct c { }; /* .. is an empty struct def. */
/* They must not be represented using the same AST */ |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_ASPECT_RATIO_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_ASPECT_RATIO_H_
#include <memory>
#include "third_party/blink/renderer/core/animation/interpolable_value.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/style/style_aspect_ratio.h"
namespace blink {
// Represents a blink::StyleAspectRatio, converted into its logarithm for
// interpolation.
class CORE_EXPORT InterpolableAspectRatio final : public InterpolableValue {
public:
explicit InterpolableAspectRatio(const gfx::SizeF& ratio);
explicit InterpolableAspectRatio(std::unique_ptr<InterpolableValue> value)
: value_(std::move(value)) {}
static std::unique_ptr<InterpolableAspectRatio> MaybeCreate(
const StyleAspectRatio&);
gfx::SizeF GetRatio() const;
// InterpolableValue implementation:
void Interpolate(const InterpolableValue& to,
const double progress,
InterpolableValue& result) const final;
bool IsAspectRatio() const final { return true; }
bool Equals(const InterpolableValue& other) const final {
NOTREACHED();
return false;
}
void Scale(double scale) final;
void Add(const InterpolableValue& other) final;
void AssertCanInterpolateWith(const InterpolableValue& other) const final;
private:
InterpolableAspectRatio* RawClone() const final {
return new InterpolableAspectRatio(value_->Clone());
}
InterpolableAspectRatio* RawCloneAndZero() const final {
return new InterpolableAspectRatio(value_->CloneAndZero());
}
// Interpolable aspect ratio value is stored and interpolated as the log of
// the real aspect ratio.
std::unique_ptr<InterpolableValue> value_;
};
template <>
struct DowncastTraits<InterpolableAspectRatio> {
static bool AllowFrom(const InterpolableValue& interpolable_value) {
return interpolable_value.IsAspectRatio();
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_ASPECT_RATIO_H_
|
#define SHMLBA 4096
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
unsigned long __shm_atime_lo;
unsigned long __shm_dtime_lo;
unsigned long __shm_ctime_lo;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned short __shm_atime_hi;
unsigned short __shm_dtime_hi;
unsigned short __shm_ctime_hi;
unsigned short __pad1;
time_t shm_atime;
time_t shm_dtime;
time_t shm_ctime;
};
struct shminfo {
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
};
struct shm_info {
int __used_ids;
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};
|
/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
* 2020 Evan Nemerson <evan@nemerson.com>
*/
#if !defined(SIMDE_ARM_NEON_MOVN_HIGH_H)
#define SIMDE_ARM_NEON_MOVN_HIGH_H
#include "types.h"
#include "movn.h"
#include "combine.h"
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_int8x16_t
simde_vmovn_high_s16(simde_int8x8_t r, simde_int16x8_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_s16(r, a);
#else
return simde_vcombine_s8(r, simde_vmovn_s16(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_s16
#define vmovn_high_s16(r, a) simde_vmovn_high_s16((r), (a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int16x8_t
simde_vmovn_high_s32(simde_int16x4_t r, simde_int32x4_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_s32(r, a);
#else
return simde_vcombine_s16(r, simde_vmovn_s32(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_s32
#define vmovn_high_s32(r, a) simde_vmovn_high_s32((r), (a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x4_t
simde_vmovn_high_s64(simde_int32x2_t r, simde_int64x2_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_s64(r, a);
#else
return simde_vcombine_s32(r, simde_vmovn_s64(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_s64
#define vmovn_high_s64(r, a) simde_vmovn_high_s64((r), (a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint8x16_t
simde_vmovn_high_u16(simde_uint8x8_t r, simde_uint16x8_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_u16(r, a);
#else
return simde_vcombine_u8(r, simde_vmovn_u16(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_u16
#define vmovn_high_u16(r, a) simde_vmovn_high_u16((r), (a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x8_t
simde_vmovn_high_u32(simde_uint16x4_t r, simde_uint32x4_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_u32(r, a);
#else
return simde_vcombine_u16(r, simde_vmovn_u32(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_u32
#define vmovn_high_u32(r, a) simde_vmovn_high_u32((r), (a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t
simde_vmovn_high_u64(simde_uint32x2_t r, simde_uint64x2_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vmovn_high_u64(r, a);
#else
return simde_vcombine_u32(r, simde_vmovn_u64(a));
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vmovn_high_u64
#define vmovn_high_u64(r, a) simde_vmovn_high_u64((r), (a))
#endif
SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP
#endif /* !defined(SIMDE_ARM_NEON_MOVN_HIGH_H) */
|
//
// FKFlickrGalleriesCreate.h
// FlickrKit
//
// Generated by FKAPIBuilder.
// Copyright (c) 2013 DevedUp Ltd. All rights reserved. http://www.devedup.com
//
// DO NOT MODIFY THIS FILE - IT IS MACHINE GENERATED
#import "FKFlickrAPIMethod.h"
typedef NS_ENUM(NSInteger, FKFlickrGalleriesCreateError) {
FKFlickrGalleriesCreateError_RequiredParameterMissing = 1, /* One or more of the required parameters was missing from your API call. */
FKFlickrGalleriesCreateError_InvalidTitleOrDescription = 2, /* The title or the description could not be validated. */
FKFlickrGalleriesCreateError_FailedToAddGallery = 3, /* There was a problem creating the gallery. */
FKFlickrGalleriesCreateError_SSLIsRequired = 95, /* SSL is required to access the Flickr API. */
FKFlickrGalleriesCreateError_InvalidSignature = 96, /* The passed signature was invalid. */
FKFlickrGalleriesCreateError_MissingSignature = 97, /* The call required signing but no signature was sent. */
FKFlickrGalleriesCreateError_LoginFailedOrInvalidAuthToken = 98, /* The login details or auth token passed were invalid. */
FKFlickrGalleriesCreateError_UserNotLoggedInOrInsufficientPermissions = 99, /* The method requires user authentication but the user was not logged in, or the authenticated method call did not have the required permissions. */
FKFlickrGalleriesCreateError_InvalidAPIKey = 100, /* The API key passed was not valid or has expired. */
FKFlickrGalleriesCreateError_ServiceCurrentlyUnavailable = 105, /* The requested service is temporarily unavailable. */
FKFlickrGalleriesCreateError_WriteOperationFailed = 106, /* The requested operation failed due to a temporary issue. */
FKFlickrGalleriesCreateError_FormatXXXNotFound = 111, /* The requested response format was not found. */
FKFlickrGalleriesCreateError_MethodXXXNotFound = 112, /* The requested method was not found. */
FKFlickrGalleriesCreateError_InvalidSOAPEnvelope = 114, /* The SOAP envelope send in the request could not be parsed. */
FKFlickrGalleriesCreateError_InvalidXMLRPCMethodCall = 115, /* The XML-RPC request document could not be parsed. */
FKFlickrGalleriesCreateError_BadURLFound = 116, /* One or more arguments contained a URL that has been used for abuse on Flickr. */
};
/*
Create a new gallery for the calling user.
The ID of the newly created gallery, and its URL.
Response:
<gallery id="50736-72157623680420409" url="http://www.flickr.com/photos/kellan/galleries/72157623680420409" />
*/
@interface FKFlickrGalleriesCreate : NSObject <FKFlickrAPIMethod>
/* The name of the gallery */
@property (nonatomic, copy) NSString *title; /* (Required) */
/* A short description for the gallery */
@property (copy) NSString *description; /* (Required) */
/* The first photo to add to your gallery */
@property (nonatomic, copy) NSString *primary_photo_id;
/* Get the result in the same format as galleries.getList */
@property (nonatomic, copy) NSString *full_result;
@end
|
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-skip-if "" { powerpc*-*-aix* } } */
/* { dg-options "-mcpu=power8" } */
/* This test should succeed on both 32- and 64-bit configurations. */
#include <altivec.h>
int
test_byte_in_either_range (unsigned char b,
unsigned char first_lo_bound,
unsigned char first_hi_bound,
unsigned char second_lo_bound,
unsigned char second_hi_bound)
{
unsigned int range_encoding;
range_encoding = ((first_hi_bound << 24) | (first_lo_bound << 16)
| (second_hi_bound << 8) | second_lo_bound);
return __builtin_byte_in_either_range (b, range_encoding); /* { dg-error "Builtin function __builtin_scalar_byte_in_either_range requires" } */
}
|
/*
* linux/arch/arm/common/cortexm3.c
*
* (C) Copyright 2011, 2012
* Emcraft Systems, <www.emcraft.com>
* Alexander Potashev <aspotashev@emcraft.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <linux/types.h>
#include <linux/clockchips.h>
#include <asm/hardware/cortexm3.h>
struct cm3_scb {
u32 cpuid;
u32 icsr;
u32 vtor;
u32 aircr;
};
#define CM3_SCB_BASE 0xE000ED00
#define CM3_SCB ((volatile struct cm3_scb *)(CM3_SCB_BASE))
#define CM3_AIRCR_VECTKEY 0x5fa
#define CM3_AIRCR_VECTKEY_SHIFT 16
#define CM3_AIRCR_PRIGROUP_MSK 0x7
#define CM3_AIRCR_PRIGROUP_SHIFT 8
#define CM3_AIRCR_SYSRESET (1<<2)
/*
* SysTick timer
*/
struct cm3_systick {
u32 ctrl; /* Control and Status Register */
u32 load; /* Reload Value Register */
u32 val; /* Current Value Register */
u32 cal; /* Calibration Register */
};
/* SysTick Base Address */
#define CM3_SYSTICK_BASE 0xE000E010
#define CM3_SYSTICK ((volatile struct cm3_systick *) \
CM3_SYSTICK_BASE)
#define CM3_SYSTICK_LOAD_RELOAD_MSK (0x00FFFFFF)
#define CM3_SYSTICK_LOAD_RELOAD_BITWIDTH 24
/* System Tick counter enable */
#define CM3_SYSTICK_CTRL_EN (1 << 0)
/* System Tick clock source selection: 1=CPU, 0=STCLK (external clock pin) */
#define CM3_SYSTICK_CTRL_SYSTICK_CPU (1 << 2)
/*
* Perform the low-level reboot.
*/
void cortex_m3_reboot(void)
{
/*
* Perform reset but keep priority group unchanged.
*/
CM3_SCB->aircr = (CM3_AIRCR_VECTKEY << CM3_AIRCR_VECTKEY_SHIFT) |
(CM3_SCB->aircr &
(CM3_AIRCR_PRIGROUP_MSK << CM3_AIRCR_PRIGROUP_SHIFT))
| CM3_AIRCR_SYSRESET;
}
#if defined(CONFIG_ARCH_KINETIS) || defined(CONFIG_ARCH_STM32) || \
defined(CONFIG_ARCH_LPC178X) || defined(CONFIG_ARCH_LPC18XX)
/*
* The SysTick clocksource is not used on other Cortex-M3 targets,
* they use other timers.
*/
/*
* Get current clock source timer value
*/
static cycle_t clocksource_systick_value_get(struct clocksource *c)
{
/*
* The value should be inverted, because the SysTick timer counts down,
* and we need a value that counts up.
*/
return (cycle_t)(CM3_SYSTICK->val ^ CM3_SYSTICK_LOAD_RELOAD_MSK);
}
/*
* SysTick clock source device
*/
static struct clocksource clocksource_systick = {
.name = "cm3-systick",
.rating = 200,
.read = clocksource_systick_value_get,
.mask = CLOCKSOURCE_MASK(CM3_SYSTICK_LOAD_RELOAD_BITWIDTH),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
/*
* Register the SysTick timer as a clocksource
*/
void cortex_m3_register_systick_clocksource(u32 systick_clk)
{
/*
* Configure and enable the SysTick timer if it was not enabled
* in the bootloader.
*/
CM3_SYSTICK->load = CM3_SYSTICK_LOAD_RELOAD_MSK;
CM3_SYSTICK->val = 0;
CM3_SYSTICK->ctrl |= CM3_SYSTICK_CTRL_EN;
/*
* Finalize clocksource initialization and register it
*/
clocksource_calc_mult_shift(&clocksource_systick, systick_clk, 4);
clocksource_register(&clocksource_systick);
}
#endif /* defined(CONFIG_ARCH_XXX) */
|
/*
This file is part of VK/KittenPHP-DB-Engine Library.
VK/KittenPHP-DB-Engine Library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
VK/KittenPHP-DB-Engine 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 VK/KittenPHP-DB-Engine Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2009-2010 Vkontakte Ltd
2009-2010 Nikolai Durov
2009-2010 Andrei Lopatin
*/
#ifndef __TRANSLIT_H__
#define __TRANSLIT_H__
char *translit_str (char *buffer, int buff_size, char *str, int len);
#endif
|
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017-10-10 Tanek first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include "drv_gpio.h"
/* USER_LED_G,GPIO_IO01,GPIO_AD_B0_10 */
#define LED0_PIN GET_PIN(1,10)
int main(void)
{
/* set LED0 pin mode to output */
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
while (1)
{
rt_pin_write(LED0_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LED0_PIN, PIN_LOW);
rt_thread_mdelay(500);
}
}
|
/* Copyright (C) 1993-2017 Free Software Foundation, Inc.
This file is part of GDB.
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 DLL_H
#define DLL_H
struct dll_info
{
/* This must appear first. See inferiors.h.
The list iterator functions assume it. */
struct inferior_list_entry entry;
char *name;
CORE_ADDR base_addr;
};
extern struct inferior_list all_dlls;
extern int dlls_changed;
extern void clear_dlls (void);
extern void loaded_dll (const char *name, CORE_ADDR base_addr);
extern void unloaded_dll (const char *name, CORE_ADDR base_addr);
#endif /* DLL_H */
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2015 - ROLI Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE 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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#if JUCE_WINDOWS
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#undef STRICT
#define STRICT 1
#include <windows.h>
#include <float.h>
#pragma warning (disable : 4312 4355)
#ifdef __INTEL_COMPILER
#pragma warning (disable : 1899)
#endif
#elif JUCE_LINUX
#include <float.h>
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#undef Font
#undef KeyPress
#undef Drawable
#undef Time
#else
#if ! (defined (JUCE_SUPPORT_CARBON) || defined (__LP64__))
#define JUCE_SUPPORT_CARBON 1
#endif
#if JUCE_SUPPORT_CARBON
#define Point CarbonDummyPointName
#define Component CarbonDummyCompName
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#undef Point
#undef Component
#else
#include <Cocoa/Cocoa.h>
#endif
#include <objc/runtime.h>
#include <objc/objc.h>
#include <objc/message.h>
#endif
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2007-2017 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/>. */
#include <stdio.h>
void shrfunc (void)
{
printf ("in shrfunc\n");
}
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "IDirectory.h"
namespace XFILE
{
class CMusicSearchDirectory : public IDirectory
{
public:
CMusicSearchDirectory(void);
~CMusicSearchDirectory(void) override;
bool GetDirectory(const CURL& url, CFileItemList &items) override;
bool Exists(const CURL& url) override;
bool AllowAll() const override { return true; }
};
}
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "IDirectory.h"
#include <set>
namespace XFILE
{
class CMultiPathDirectory :
public IDirectory
{
public:
CMultiPathDirectory(void);
virtual ~CMultiPathDirectory(void);
virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items);
virtual bool Exists(const char* strPath);
virtual bool Remove(const char* strPath);
static CStdString GetFirstPath(const CStdString &strPath);
static bool SupportsWriteFileOperations(const CStdString &strPath);
static bool GetPaths(const CStdString& strPath, std::vector<CStdString>& vecPaths);
static bool HasPath(const CStdString& strPath, const CStdString& strPathToFind);
static CStdString ConstructMultiPath(const std::vector<CStdString> &vecPaths);
static CStdString ConstructMultiPath(const std::set<CStdString> &setPaths);
private:
void MergeItems(CFileItemList &items);
static void AddToMultiPath(CStdString& strMultiPath, const CStdString& strPath);
CStdString ConstructMultiPath(const CFileItemList& items, const std::vector<int> &stack);
};
}
|
/*
*
* 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
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
// Call this first thing at startup
// Works out if the app is a steam app that is being ran outside of steam,
// and if so, launches steam and tells it to run us as a steam app
//
// if it returns true, then exit
// if it ruturns false, then continue with normal startup
bool ShouldLaunchAppViaSteam(const char *cmdLine, const char *steamFilesystemDllName, const char *stdioFilesystemDllName);
|
#ifndef CGCONTEXT_H_
#define CGCONTEXT_H_
#include "CGGeometry.h"
#include <CoreFoundation/CFBase.h>
BEGIN_EXTERN_C
struct __CGContext;
typedef struct __CGContext *CGContextRef;
CGContextRef CGContextRetain(CGContextRef c);
void CGContextRelease(CGContextRef c);
CFTypeID CGContextGetTypeID(void);
void CGContextSaveGState(CGContextRef c);
void CGContextRestoreGState(CGContextRef c);
void CGContextFlush(CGContextRef c);
END_EXTERN_C
#endif
|
#ifndef AVAHI_H
#define AVAHI_H
#include "zeroconf.h"
class Avahi : public Zeroconf {
protected:
virtual void PublishInternal(
const QString& domain,
const QString& type,
const QByteArray& name,
quint16 port);
};
#endif // AVAHI_H
|
/*
* Copyright (C) 2008-2009 Martin Willi
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "agent_plugin.h"
#include <library.h>
#include "agent_private_key.h"
typedef struct private_agent_plugin_t private_agent_plugin_t;
/**
* private data of agent_plugin
*/
struct private_agent_plugin_t {
/**
* public functions
*/
agent_plugin_t public;
};
METHOD(plugin_t, get_name, char*,
private_agent_plugin_t *this)
{
return "agent";
}
METHOD(plugin_t, get_features, int,
private_agent_plugin_t *this, plugin_feature_t *features[])
{
static plugin_feature_t f[] = {
PLUGIN_REGISTER(PRIVKEY, agent_private_key_open, FALSE),
PLUGIN_PROVIDE(PRIVKEY, KEY_ANY),
PLUGIN_PROVIDE(PRIVKEY, KEY_RSA),
PLUGIN_PROVIDE(PRIVKEY, KEY_ECDSA),
};
*features = f;
return countof(f);
}
METHOD(plugin_t, destroy, void,
private_agent_plugin_t *this)
{
free(this);
}
/*
* see header file
*/
plugin_t *agent_plugin_create()
{
private_agent_plugin_t *this;
/* required to connect to ssh-agent socket */
if (!lib->caps->keep(lib->caps, CAP_DAC_OVERRIDE))
{
DBG1(DBG_DMN, "agent plugin requires CAP_DAC_OVERRIDE capability");
return NULL;
}
INIT(this,
.public = {
.plugin = {
.get_name = _get_name,
.get_features = _get_features,
.destroy = _destroy,
},
},
);
return &this->public.plugin;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.