text stringlengths 4 6.14k |
|---|
//+**********************************************************************
//
// File: edf_retriever.h
//
// Project: Fable data to NeXus translation
//
// Description: definition of a edf_retriever class. The retriever allows to
// read data from EDF file and store in Nexus file format.
// It is a plugin of NXtranslate program.
//
// Author(s): Jaroslaw Butanowicz
//
// Original: April 2006
//
//+**********************************************************************
#ifndef __EDF_RETRIEVER_GUARD
#define __EDF_RETRIEVER_GUARD
#include "../retriever.h"
#include <fstream>
//
// this is not intended to be inherited from
//
class EdfRetriever: public Retriever{
public:
EdfRetriever(const std::string &);
~EdfRetriever();
void getData(const std::string &, tree<Node> &);
std::string toString() const;
static const std::string MIME_TYPE;
private:
std::string source;
std::ifstream infile;
};
#endif
|
//____________________________________________________________________________
/*!
\namespace genie::utils::rew
\brief Event reweighting utilities
\author Jim Dobson <J.Dobson07 \at imperial.ac.uk>
Imperial College London
Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
STFC, Rutherford Appleton Laboratory
\created Sep 09, 2009
\cpright Copyright (c) 2003-2013, GENIE Neutrino MC Generator Collaboration
For the full text of the license visit http://copyright.genie-mc.org
or see $GENIE/LICENSE
*/
//____________________________________________________________________________
#ifndef _RW_UTILS_H_
#define _RW_UTILS_H_
#include <TLorentzVector.h>
#include "EVGCore/EventRecord.h"
#include "ReWeight/GSyst.h"
namespace genie {
namespace utils {
namespace rew {
// Returns a weight to account for a change in hadron mean free path
double MeanFreePathWeight(
int pdgc, const TLorentzVector & x4, const TLorentzVector & p4,
double A, double Z,
double mfp_scale_factor, bool interacted,
double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4);
double MeanFreePathWeight(
double prob_def, double prob_twk, bool interacted);
// Calculates a weight to account for a change in the formation zone. Is
// only an approximation as impossible to calculate a weight for hadrons
// which were already outside the nucleus with the default formation zone.
double FZoneWeight(
int pdgc, const TLorentzVector & vtx, const TLorentzVector & x4,
const TLorentzVector & p4, double A, double Z, double fz_scale_factor, bool interacted,
double nRpi=0.5, double nRnuc=1.0, double NR=3, double R0=1.4);
// Return the fraction of the hadron rescatering fate described by the input
// systematic enumeration at the input hadron kinetic energy
double FateFraction(genie::rew::GSyst_t syst, double kinE, double frac_scale_factor=1.);
// Return the required fate fraction scaling factor for the fate described by the input
// systematic enumeration, at the input hadron kinetic energy, so that the fate fraction
// becomes the input one.
double WhichFateFractionScaleFactor(genie::rew::GSyst_t syst, double kinE, double fate_frac);
// Check whether the input event is hadronized by AGKY
bool HadronizedByAGKY(const EventRecord & event);
// Check whether the input event is hadronized by AGKY/PYTHIA
bool HadronizedByAGKYPythia(const EventRecord & event);
// Compute the hadronic system 4-momentum @ LAB
TLorentzVector Hadronic4pLAB(const EventRecord & event);
//
double AGKYWeight(int pdgc, double xF, double pT2);
// Get the sign of the tweaking dial so as to correctly pick-p the +err or the -err,
// in case of asymmetric errors
int Sign(double twkdial);
} // rew namespace
} // utils namespace
} // genie namespace
#endif // _RW_UTILS_H_
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui/qaccessible.h>
#ifndef QACCESSIBLEWIDGETFACTORY_H
#define QACCESSIBLEWIDGETFACTORY_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
QT_BEGIN_NAMESPACE
QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object);
QT_END_NAMESPACE
#endif
|
/*
Drawpile - a collaborative drawing program.
Copyright (C) 2019 Calle Laakkonen
Drawpile 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.
Drawpile 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 Drawpile. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WEBMEXPORTER_H
#define WEBMEXPORTER_H
#include "videoexporter.h"
class WebmExporter : public VideoExporter
{
Q_OBJECT
public:
WebmExporter(QObject *parent=nullptr);
~WebmExporter();
void setFilename(const QString &filename);
protected:
void initExporter() override;
void startExporter() override;
void writeFrame(const QImage &image, int repeat) override;
void shutdownExporter() override;
private:
struct Private;
Private *d;
};
#endif
|
#include "defines.h"
#include "includes.h"
#include "Vars.h"
#include "libUseful.h"
/* These functions provide an interface for setting variables that */
/* are used by libUseful itself */
int LibUsefulFlags=0;
static ListNode *LibUsefulSettings=NULL;
ListNode *LibUsefulValuesGetHead()
{
return(LibUsefulSettings);
}
void LibUsefulInitSettings()
{
char *Tempstr=NULL;
LibUsefulSettings=ListCreate();
SetVar(LibUsefulSettings,"LibUseful:Version",__LIBUSEFUL_VERSION__);
Tempstr=MCopyStr(Tempstr,__LIBUSEFUL_BUILD_DATE__," ",__LIBUSEFUL_BUILD_TIME__,NULL);
SetVar(LibUsefulSettings,"LibUseful:BuildTime",Tempstr);
DestroyString(Tempstr);
}
void LibUsefulSetHTTPFlag(int Flag, const char *Value)
{
int Flags;
if (strtobool(Value)) Flags=HTTPGetFlags() | Flag;
else Flags=HTTPGetFlags() & ~Flag;
HTTPSetFlags(Flags);
}
void LibUsefulSetValue(const char *Name, const char *Value)
{
if (! LibUsefulSettings) LibUsefulInitSettings();
if (strcasecmp(Name,"HTTP:Debug")==0) LibUsefulSetHTTPFlag(HTTP_DEBUG, Value);
if (strcasecmp(Name,"HTTP:NoCookies")==0) LibUsefulSetHTTPFlag(HTTP_NOCOOKIES, Value);
if (strcasecmp(Name,"HTTP:NoCompress")==0) LibUsefulSetHTTPFlag(HTTP_NOCOMPRESS, Value);
if (strcasecmp(Name,"HTTP:NoCompression")==0) LibUsefulSetHTTPFlag(HTTP_NOCOMPRESS, Value);
if (strcasecmp(Name,"HTTP:NoRedirect")==0) LibUsefulSetHTTPFlag(HTTP_NOREDIRECT, Value);
if (strcasecmp(Name,"HTTP:NoCache")==0) LibUsefulSetHTTPFlag(HTTP_NOCACHE, Value);
SetVar(LibUsefulSettings,Name,Value);
}
const char *LibUsefulGetValue(const char *Name)
{
if (! LibUsefulSettings) LibUsefulInitSettings();
if (!StrLen(Name)) return("");
return(GetVar(LibUsefulSettings,Name));
}
int LibUsefulGetBool(const char *Name)
{
return(strtobool(LibUsefulGetValue(Name)));
}
void LibUsefulAtExit()
{
if (LibUsefulFlags & LU_CONTAINER) FileSystemUnMount("/","lazy");
}
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM nsISupports.idl
*/
#ifndef __gen_nsISupports_h__
#define __gen_nsISupports_h__
#ifndef __gen_nsrootidl_h__
#include "nsrootidl.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/*
* Start commenting out the C++ versions of the below in the output header
*/
#if 0
/* starting interface: nsISupports */
#define NS_ISUPPORTS_IID_STR "00000000-0000-0000-c000-000000000046"
#define NS_ISUPPORTS_IID \
{0x00000000, 0x0000, 0x0000, \
{ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID)
/* void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_SCRIPTABLE NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result NS_OUTPARAM) = 0;
/* [noscript, notxpcom] nsrefcnt AddRef (); */
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
/* [noscript, notxpcom] nsrefcnt Release (); */
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsISupports, NS_ISUPPORTS_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISUPPORTS \
NS_SCRIPTABLE NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result NS_OUTPARAM); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISUPPORTS(_to) \
NS_SCRIPTABLE NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result NS_OUTPARAM) { return _to QueryInterface(uuid, result); } \
NS_IMETHOD_(nsrefcnt) AddRef(void) { return _to AddRef(); } \
NS_IMETHOD_(nsrefcnt) Release(void) { return _to Release(); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISUPPORTS(_to) \
NS_SCRIPTABLE NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryInterface(uuid, result); } \
NS_IMETHOD_(nsrefcnt) AddRef(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddRef(); } \
NS_IMETHOD_(nsrefcnt) Release(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Release(); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsSupports : public nsISupports
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTS
nsSupports();
private:
~nsSupports();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsSupports, nsISupports)
nsSupports::nsSupports()
{
/* member initializers and constructor code */
}
nsSupports::~nsSupports()
{
/* destructor code */
}
/* void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP nsSupports::QueryInterface(const nsIID & uuid, void * *result NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript, notxpcom] nsrefcnt AddRef (); */
NS_IMETHODIMP_(nsrefcnt) nsSupports::AddRef()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript, notxpcom] nsrefcnt Release (); */
NS_IMETHODIMP_(nsrefcnt) nsSupports::Release()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
/*
* End commenting out the C++ versions of the above in the output header
*/
#endif
#include "nsISupportsBase.h"
#include "nsISupportsUtils.h"
#endif /* __gen_nsISupports_h__ */
|
#ifndef _LIBSTARDICTVERIFY_H_
#define _LIBSTARDICTVERIFY_H_
#include "libcommon.h"
extern int stardict_verify(const char *ifofilename, print_info_t print_info);
#endif
|
#ifndef MANTID_MANTIDWIDGETS_ALGORITHMHINTSTRATEGY_H
#define MANTID_MANTIDWIDGETS_ALGORITHMHINTSTRATEGY_H
#include "MantidAPI/IAlgorithm.h"
#include "MantidQtWidgets/Common/HintStrategy.h"
namespace MantidQt {
namespace MantidWidgets {
/** AlgorithmHintStrategy : Produces hints using a given algorithm's properties.
Copyright © 2014 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid 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.
Mantid 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/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class AlgorithmHintStrategy : public HintStrategy {
public:
AlgorithmHintStrategy(Mantid::API::IAlgorithm_sptr algorithm,
std::set<std::string> blacklist)
: m_algorithm(algorithm), m_blacklist(blacklist) {}
~AlgorithmHintStrategy() override{};
std::map<std::string, std::string> createHints() override {
std::map<std::string, std::string> hints;
auto properties = m_algorithm->getProperties();
for (auto it = properties.begin(); it != properties.end(); ++it) {
const std::string name = (*it)->name();
// If it's not in the blacklist, add the property to our hints
if (m_blacklist.find(name) == m_blacklist.end())
hints[name] = (*it)->briefDocumentation();
}
return hints;
}
private:
Mantid::API::IAlgorithm_sptr m_algorithm;
std::set<std::string> m_blacklist;
};
}
}
#endif /* MANTID_MANTIDWIDGETS_ALGORITHMHINTSTRATEGY_H */
|
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ----------------------------------------------------------------------------
* Platform Specific entry point
* ----------------------------------------------------------------------------
*/
#include "platform_config.h"
#include "jsinteractive.h"
#include "jshardware.h"
int main() {
jshInit();
jsvInit();
jsiInit(false);
while (1)
{
jsiLoop();
}
//jsiKill();
//jsvKill();
//jshKill();
}
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef QMLPROFILERPLUGIN_H
#define QMLPROFILERPLUGIN_H
#include "qmlprofiler_global.h"
#include <extensionsystem/iplugin.h>
namespace QmlProfiler {
namespace Internal {
class QmlProfilerPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProfiler.json")
public:
QmlProfilerPlugin() {}
bool initialize(const QStringList &arguments, QString *errorString);
void extensionsInitialized();
ShutdownFlag aboutToShutdown();
static bool debugOutput;
};
} // namespace Internal
} // namespace QmlProfiler
#endif // QMLPROFILERPLUGIN_H
|
/* **********************************************************
* Copyright (c) 2020 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 GOOGLE, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#ifndef _DRMGR_PRIV_H_
#define _DRMGR_PRIV_H_ 1
/* An internal interface that acts as a beachhead for other extensions, e.g. drbbdup,
* to integrate their functionalities with drmgr. The interface should only be used
* when tight integration with drmgr is required.
*/
/* Don't use doxygen since this is an internal interface. */
#ifdef __cplusplus
extern "C" {
#endif
#include "dr_defines.h"
#include "drmgr.h"
/***************************************************************************
* For DRBBDUP
*/
/* Responsible for duplicating basic blocks. Returns local info
* used to iterate over basic block copies.
*/
typedef bool (*drmgr_bbdup_duplicate_bb_cb_t)(void *drcontext, void *tag, instrlist_t *bb,
bool for_trace, bool translating,
OUT void **local_info);
/* Extracts and returns a pending basic block copy from the main basic block. Returns
* NULL, if no further copies are pending.
*/
typedef instrlist_t *(*drmgr_bbdup_extract_cb_t)(void *drcontext, void *tag,
instrlist_t *bb, bool for_trace,
bool translating, void *local_info);
/* Stitches an extracted basic block copy back to the main basic block. */
typedef void (*drmgr_bbdup_stitch_cb_t)(void *drcontext, void *tag, instrlist_t *bb,
instrlist_t *case_bb, bool for_trace,
bool translating, void *local_dup_info_opaque);
/* Finalises the iteration process and inserts the encoder at the top of the main basic
* block.
*/
typedef void (*drmgr_bbdup_insert_encoding_cb_t)(void *drcontext, void *tag,
instrlist_t *bb, bool for_trace,
bool translating, void *local_info);
DR_EXPORT
/* Used by drbbdup so that drmgr maintains basic block duplication.
* BBDUP events can only be registered once at the same time.
* Returns true on success. Use drmgr_unregister_bbdup_event() to unregister.
*/
bool
drmgr_register_bbdup_event(drmgr_bbdup_duplicate_bb_cb_t bb_dup_func,
drmgr_bbdup_insert_encoding_cb_t insert_encoding,
drmgr_bbdup_extract_cb_t extract_func,
drmgr_bbdup_stitch_cb_t stitch_func);
DR_EXPORT
/* Unregisters drbbdup events set by the prior calling of drmgr_register_bbdup_event().
* Returns true on success.
*/
bool
drmgr_unregister_bbdup_event();
DR_EXPORT
/* Registers a callback that is triggered prior to basic block duplication. This gives
* drbbdup the opportunity to modify and analyse the basic block before proceeding with
* the generation of multiple copies.
*
* Note, we cannot use app2app events, because those are granular to per basic block copy.
*
* Returns true on success.
*/
bool
drmgr_register_bbdup_pre_event(drmgr_xform_cb_t func, drmgr_priority_t *priority);
DR_EXPORT
/* Unregisters a callback function triggered prior basic block duplication.
* \return true if unregistration is successful and false if it is not
* (e.g., \p func was not registered).
*/
bool
drmgr_unregister_bbdup_pre_event(drmgr_xform_cb_t func);
#ifdef __cplusplus
}
#endif
#endif /* _DRMGR_PRIV_H_ */
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef GLSLCOMPLETIONASSIST_H
#define GLSLCOMPLETIONASSIST_H
#include "glsleditor.h"
#include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h>
#include <QIcon>
#include <QScopedPointer>
#include <QSharedPointer>
namespace GLSL {
class Engine;
class Function;
class TranslationUnitAST;
class Scope;
} // namespace GLSL
namespace TextEditor { class AssistProposalItem; }
namespace GlslEditor {
namespace Internal {
class Document
{
public:
typedef QSharedPointer<Document> Ptr;
Document();
~Document();
GLSL::Engine *engine() const { return _engine; }
GLSL::TranslationUnitAST *ast() const { return _ast; }
GLSL::Scope *globalScope() const { return _globalScope; }
GLSL::Scope *scopeAt(int position) const;
void addRange(const QTextCursor &cursor, GLSL::Scope *scope);
private:
struct Range {
QTextCursor cursor;
GLSL::Scope *scope;
};
GLSL::Engine *_engine;
GLSL::TranslationUnitAST *_ast;
GLSL::Scope *_globalScope;
QList<Range> _cursors;
friend class GlslEditorWidget;
};
class GlslCompletionAssistInterface;
class GlslCompletionAssistProvider : public TextEditor::CompletionAssistProvider
{
Q_OBJECT
public:
bool supportsEditor(Core::Id editorId) const Q_DECL_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const Q_DECL_OVERRIDE;
int activationCharSequenceLength() const Q_DECL_OVERRIDE;
bool isActivationCharSequence(const QString &sequence) const Q_DECL_OVERRIDE;
};
class GlslCompletionAssistProcessor : public TextEditor::IAssistProcessor
{
public:
GlslCompletionAssistProcessor();
~GlslCompletionAssistProcessor();
TextEditor::IAssistProposal *perform(const TextEditor::AssistInterface *interface) Q_DECL_OVERRIDE;
private:
TextEditor::IAssistProposal *createHintProposal(const QVector<GLSL::Function *> &symbols);
bool acceptsIdleEditor() const;
int m_startPosition;
QScopedPointer<const GlslCompletionAssistInterface> m_interface;
QIcon m_keywordIcon;
QIcon m_varIcon;
QIcon m_functionIcon;
QIcon m_typeIcon;
QIcon m_constIcon;
QIcon m_attributeIcon;
QIcon m_uniformIcon;
QIcon m_varyingIcon;
QIcon m_otherIcon;
};
class GlslCompletionAssistInterface : public TextEditor::AssistInterface
{
public:
GlslCompletionAssistInterface(QTextDocument *textDocument,
int position, const QString &fileName,
TextEditor::AssistReason reason,
const QString &mimeType,
const Document::Ptr &glslDoc);
const QString &mimeType() const { return m_mimeType; }
const Document::Ptr &glslDocument() const { return m_glslDoc; }
private:
QString m_mimeType;
Document::Ptr m_glslDoc;
};
} // namespace Internal
} // namespace GlslEditor
#endif // GLSLCOMPLETIONASSIST_H
|
/*
* Copyright (C) 2013 Thomas Eichinger <thomas.eichinger@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup boards_redbee-econotag Redbee Econotag
* @ingroup boards
* @brief Support for the Redbee Econotag board
* @{
*
* @file board.h
* @brief Basic definitions for the Redbee Econotag board
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
*/
#ifndef REDBEE_ECONOTAG_BOARD_H
#define REDBEE_ECONOTAG_BOARD_H
#include <stdint.h>
#define F_CPU (24000000) ///< CPU target speed in Hz
#define CTUNE 0xb
#define IBIAS 0x1f
#define FTUNE 0x7
typedef uint8_t radio_packet_length_t;
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef PROTOCOL_H
#define PROTOCOL_H
#include <QObject>
#include <QScopedPointer>
#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
class QNetworkReply;
class QWidget;
QT_END_NAMESPACE
namespace Core {
class IOptionsPage;
}
namespace CodePaster {
class Protocol : public QObject
{
Q_OBJECT
public:
enum ContentType {
Text, C, Cpp, JavaScript, Diff, Xml
};
enum Capabilities {
ListCapability = 0x1,
PostCommentCapability = 0x2,
PostDescriptionCapability = 0x4
};
virtual ~Protocol();
virtual QString name() const = 0;
virtual unsigned capabilities() const = 0;
virtual bool hasSettings() const;
virtual Core::IOptionsPage *settingsPage() const;
virtual bool checkConfiguration(QString *errorMessage = 0);
virtual void fetch(const QString &id) = 0;
virtual void list();
virtual void paste(const QString &text,
ContentType ct = Text,
int expiryDays = 1,
const QString &username = QString(),
const QString &comment = QString(),
const QString &description = QString()) = 0;
// Convenience to determine content type from mime type
static ContentType contentType(const QString &mimeType);
// Show a configuration error and point user to settings.
// Return true when settings changed.
static bool showConfigurationError(const Protocol *p,
const QString &message,
QWidget *parent = 0,
bool showConfig = true);
// Ensure configuration is correct
static bool ensureConfiguration(Protocol *p,
QWidget *parent = 0);
signals:
void pasteDone(const QString &link);
void fetchDone(const QString &titleDescription,
const QString &content,
bool error);
void listDone(const QString &name, const QStringList &result);
protected:
Protocol();
static QString textFromHtml(QString data);
static QString fixNewLines(QString in);
};
/* Network-based protocol: Provides access with delayed
* initialization to a QNetworkAccessManager and conveniences
* for HTTP-requests. */
class NetworkProtocol : public Protocol
{
Q_OBJECT
public:
virtual ~NetworkProtocol();
protected:
QNetworkReply *httpGet(const QString &url);
QNetworkReply *httpPost(const QString &link, const QByteArray &data);
// Check connectivity of host, displaying a message box.
bool httpStatus(QString url, QString *errorMessage);
};
} //namespace CodePaster
#endif // PROTOCOL_H
|
/*
* Twin - A Tiny Window System
* Copyright © 2004 Carl Worth <cworth@cworth.org>
* All rights reserved.
*
* 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 the Twin Library; see the file COPYING. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "twinint.h"
typedef struct _twin_spline {
twin_spoint_t a, b, c, d;
} twin_spline_t;
static void
_lerp_half (twin_spoint_t *a, twin_spoint_t *b, twin_spoint_t *result)
{
result->x = a->x + ((b->x - a->x) >> 1);
result->y = a->y + ((b->y - a->y) >> 1);
}
static void
_de_casteljau (twin_spline_t *spline, twin_spline_t *s1, twin_spline_t *s2)
{
twin_spoint_t ab, bc, cd;
twin_spoint_t abbc, bccd;
twin_spoint_t final;
_lerp_half (&spline->a, &spline->b, &ab);
_lerp_half (&spline->b, &spline->c, &bc);
_lerp_half (&spline->c, &spline->d, &cd);
_lerp_half (&ab, &bc, &abbc);
_lerp_half (&bc, &cd, &bccd);
_lerp_half (&abbc, &bccd, &final);
s1->a = spline->a;
s1->b = ab;
s1->c = abbc;
s1->d = final;
s2->a = final;
s2->b = bccd;
s2->c = cd;
s2->d = spline->d;
}
/*
* Return an upper bound on the error (squared) that could
* result from approximating a spline as a line segment
* connecting the two endpoints
*/
static twin_dfixed_t
_twin_spline_error_squared (twin_spline_t *spline)
{
twin_dfixed_t berr, cerr;
berr = _twin_distance_to_line_squared (&spline->b, &spline->a, &spline->d);
cerr = _twin_distance_to_line_squared (&spline->c, &spline->a, &spline->d);
if (berr > cerr)
return berr;
else
return cerr;
}
/*
* Pure recursive spline decomposition.
*/
static void
_twin_spline_decompose (twin_path_t *path,
twin_spline_t *spline,
twin_dfixed_t tolerance_squared)
{
if (_twin_spline_error_squared (spline) <= tolerance_squared)
{
_twin_path_sdraw (path, spline->a.x, spline->a.y);
}
else
{
twin_spline_t s1, s2;
_de_casteljau (spline, &s1, &s2);
_twin_spline_decompose (path, &s1, tolerance_squared);
_twin_spline_decompose (path, &s2, tolerance_squared);
}
}
void
_twin_path_scurve (twin_path_t *path,
twin_sfixed_t x1, twin_sfixed_t y1,
twin_sfixed_t x2, twin_sfixed_t y2,
twin_sfixed_t x3, twin_sfixed_t y3)
{
twin_spline_t spline;
if (path->npoints == 0)
_twin_path_smove (path, 0, 0);
spline.a = path->points[path->npoints - 1];
spline.b.x = x1;
spline.b.y = y1;
spline.c.x = x2;
spline.c.y = y2;
spline.d.x = x3;
spline.d.y = y3;
_twin_spline_decompose (path, &spline, TWIN_SFIXED_TOLERANCE * TWIN_SFIXED_TOLERANCE);
_twin_path_sdraw (path, x3, y3);
}
void
twin_path_curve (twin_path_t *path,
twin_fixed_t x1, twin_fixed_t y1,
twin_fixed_t x2, twin_fixed_t y2,
twin_fixed_t x3, twin_fixed_t y3)
{
return _twin_path_scurve (path,
_twin_matrix_x (&path->state.matrix, x1, y1),
_twin_matrix_y (&path->state.matrix, x1, y1),
_twin_matrix_x (&path->state.matrix, x2, y2),
_twin_matrix_y (&path->state.matrix, x2, y2),
_twin_matrix_x (&path->state.matrix, x3, y3),
_twin_matrix_y (&path->state.matrix, x3, y3));
}
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/meta/convertible.h
// Purpose: Test if types are convertible
// Author: Arne Steinarson
// Created: 2008-01-10
// Copyright: (c) 2008 Arne Steinarson
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_META_CONVERTIBLE_H_
#define _WX_META_CONVERTIBLE_H_
//
// Introduce an extra class to make this header compilable with g++3.2
//
template <class D, class B>
struct wxConvertibleTo_SizeHelper
{
static char Match(B* pb);
static int Match(...);
};
// Helper to decide if an object of type D is convertible to type B (the test
// succeeds in particular when D derives from B)
template <class D, class B>
struct wxConvertibleTo
{
enum
{
value =
sizeof(wxConvertibleTo_SizeHelper<D,B>::Match(static_cast<D*>(NULL)))
==
sizeof(char)
};
};
#endif // _WX_META_CONVERTIBLE_H_
|
/******************************************************************************
* Copyright (C) 2013 by Jerome Maye *
* jerome.maye@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the Lesser 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 *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
******************************************************************************/
/** \file TypeCreationException.h
\brief This file defines the TypeCreationException class, which
is thrown whenever an exception occured when creating a type
*/
#ifndef TYPECREATIONEXCEPTION_H
#define TYPECREATIONEXCEPTION_H
#include <exception>
#include <string>
/** The class TypeCreationException represents any exceptions occuring when
creating a type.
\brief Type creation exception
*/
template <typename X> class TypeCreationException :
public std::exception {
public:
/** \name Constructors/destructor
@{
*/
/// Constructs exception from argument and string
TypeCreationException(const X& argument, const std::string& msg, const
std::string& filename = " ", size_t line = 0);
/// Copy constructor
TypeCreationException(const TypeCreationException& other) throw ();
/// Assignment operator
TypeCreationException& operator = (const TypeCreationException& other)
throw ();
/// Destructor
virtual ~TypeCreationException() throw ();
/** @}
*/
/** \name Accessors
@{
*/
/// Access the exception string
virtual const char* what() const throw ();
/** @}
*/
protected:
/** \name Protected members
@{
*/
/// Message in the exception
std::string mMsg;
/// Argument that causes the exception
X mArg;
/// Filename where the exception occurs
std::string mFilename;
/// Line number where the exception occurs
size_t mLine;
/** @}
*/
};
#include "exceptions/TypeCreationException.tpp"
#endif // TYPECREATIONEXCEPTION_H
|
/* Copyright 2004,2007,2018 IPB, Universite de Bordeaux, INRIA & CNRS
**
** This file is part of the Scotch software package for static mapping,
** graph partitioning and sparse matrix ordering.
**
** This software is governed by the CeCILL-C license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-C license and that you accept its terms.
*/
/************************************************************/
/** **/
/** NAME : bgraph_bipart_ex.h **/
/** **/
/** AUTHOR : Francois PELLEGRINI **/
/** **/
/** FUNCTION : These lines are the data declarations **/
/** for the exact-balance post-processing **/
/** module. **/
/** **/
/** DATES : # Version 2.0 : from : 25 oct 1994 **/
/** to 26 oct 1994 **/
/** # Version 3.0 : from : 18 nov 1995 **/
/** to 20 nov 1995 **/
/** # Version 3.1 : from : 20 nov 1995 **/
/** to 20 nov 1995 **/
/** # Version 3.2 : from : 15 sep 1996 **/
/** to 13 sep 1998 **/
/** # Version 3.3 : from : 01 oct 1998 **/
/** to 01 oct 1998 **/
/** # Version 4.0 : from : 11 dec 2003 **/
/** to 11 dec 2003 **/
/** # Version 6.0 : from : 05 apr 2018 **/
/** to 05 apr 2018 **/
/** **/
/************************************************************/
/*
** The defines.
*/
/*+ System-defined constants. +*/
#define BGRAPHBIPARTEXGAINTABLSUBBITS 1
#define BGRAPHBIPARTEXSTATEFREE ((GainLink *) 0) /*+ Vertex in initial state (TRICK: must be 0) +*/
#define BGRAPHBIPARTEXSTATEUSED ((GainLink *) 1) /*+ Swapped vertex +*/
#define BGRAPHBIPARTEXSTATELINK ((GainLink *) 2) /*+ Currently in gain table if higher +*/
/*
** The function prototypes.
*/
int bgraphBipartEx (Bgraph * restrict const);
|
#define X
main()
{
for(;;
#ifdef Y
)
#endif
{
}
} |
//
// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef IRESEARCH_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_
#define IRESEARCH_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_
#include <string>
#include "absl/base/config.h"
namespace iresearch_absl {
IRESEARCH_ABSL_NAMESPACE_BEGIN
namespace base_internal {
// Helper functions that allow throwing exceptions consistently from anywhere.
// The main use case is for header-based libraries (eg templates), as they will
// be built by many different targets with their own compiler options.
// In particular, this will allow a safe way to throw exceptions even if the
// caller is compiled with -fno-exceptions. This is intended for implementing
// things like map<>::at(), which the standard documents as throwing an
// exception on error.
//
// Using other techniques like #if tricks could lead to ODR violations.
//
// You shouldn't use it unless you're writing code that you know will be built
// both with and without exceptions and you need to conform to an interface
// that uses exceptions.
[[noreturn]] void ThrowStdLogicError(const std::string& what_arg);
[[noreturn]] void ThrowStdLogicError(const char* what_arg);
[[noreturn]] void ThrowStdInvalidArgument(const std::string& what_arg);
[[noreturn]] void ThrowStdInvalidArgument(const char* what_arg);
[[noreturn]] void ThrowStdDomainError(const std::string& what_arg);
[[noreturn]] void ThrowStdDomainError(const char* what_arg);
[[noreturn]] void ThrowStdLengthError(const std::string& what_arg);
[[noreturn]] void ThrowStdLengthError(const char* what_arg);
[[noreturn]] void ThrowStdOutOfRange(const std::string& what_arg);
[[noreturn]] void ThrowStdOutOfRange(const char* what_arg);
[[noreturn]] void ThrowStdRuntimeError(const std::string& what_arg);
[[noreturn]] void ThrowStdRuntimeError(const char* what_arg);
[[noreturn]] void ThrowStdRangeError(const std::string& what_arg);
[[noreturn]] void ThrowStdRangeError(const char* what_arg);
[[noreturn]] void ThrowStdOverflowError(const std::string& what_arg);
[[noreturn]] void ThrowStdOverflowError(const char* what_arg);
[[noreturn]] void ThrowStdUnderflowError(const std::string& what_arg);
[[noreturn]] void ThrowStdUnderflowError(const char* what_arg);
[[noreturn]] void ThrowStdBadFunctionCall();
[[noreturn]] void ThrowStdBadAlloc();
// ThrowStdBadArrayNewLength() cannot be consistently supported because
// std::bad_array_new_length is missing in libstdc++ until 4.9.0.
// https://gcc.gnu.org/onlinedocs/gcc-4.8.3/libstdc++/api/a01379_source.html
// https://gcc.gnu.org/onlinedocs/gcc-4.9.0/libstdc++/api/a01327_source.html
// libcxx (as of 3.2) and msvc (as of 2015) both have it.
// [[noreturn]] void ThrowStdBadArrayNewLength();
} // namespace base_internal
IRESEARCH_ABSL_NAMESPACE_END
} // namespace absl
#endif // IRESEARCH_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_
|
// RUN: mkdir %T/dir
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s
// RUN: rm -fR %T/dir
// Currently this test mainly checks that the HTML diagnostics doesn't crash
// when handling macros will calls with macros. We should actually validate
// the output, but that requires being able to match against a specifically
// generate HTML file.
#define DEREF(p) *p = 0xDEADBEEF
void has_bug(int *p) {
DEREF(p);
}
#define CALL_HAS_BUG(q) has_bug(q)
void test_call_macro() {
CALL_HAS_BUG(0);
}
|
// Copyright (c) 2006-2008 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 BASE_STRING_UTIL_WIN_H_
#define BASE_STRING_UTIL_WIN_H_
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
namespace base {
inline int strcasecmp(const char* s1, const char* s2) {
return _stricmp(s1, s2);
}
inline int strncasecmp(const char* s1, const char* s2, size_t count) {
return _strnicmp(s1, s2, count);
}
inline int vsnprintf(char* buffer, size_t size,
const char* format, va_list arguments) {
int length = vsnprintf_s(buffer, size, size - 1, format, arguments);
if (length < 0)
return _vscprintf(format, arguments);
return length;
}
inline int vswprintf(wchar_t* buffer, size_t size,
const wchar_t* format, va_list arguments) {
//DCHECK(IsWprintfFormatPortable(format));
int length = _vsnwprintf_s(buffer, size, size - 1, format, arguments);
if (length < 0)
return _vscwprintf(format, arguments);
return length;
}
} // namespace base
#endif // BASE_STRING_UTIL_WIN_H_
|
#ifndef _KINECT_DRIVER_H_
#define _KINECT_DRIVER_H_
#include "Driver\OniDriverAPI.h"
#include "XnHash.h"
#include <Shlobj.h>
#include "NuiApi.h"
namespace kinect_device {
class KinectDriver : public oni::driver::DriverBase
{
public:
KinectDriver(OniDriverServices* pDriverServices);
virtual OniStatus initialize(oni::driver::DeviceConnectedCallback connectedCallback, oni::driver::DeviceDisconnectedCallback disconnectedCallback,
oni::driver::DeviceStateChangedCallback deviceStateChangedCallback, void* pCookie);
virtual ~KinectDriver();
virtual oni::driver::DeviceBase* deviceOpen(const char* uri);
virtual void deviceClose(oni::driver::DeviceBase* pDevice);
virtual void shutdown();
virtual OniStatus tryDevice(const char* uri);
virtual void* enableFrameSync(oni::driver::StreamBase** pStreams, int streamCount);
virtual void disableFrameSync(void* frameSyncGroup);
void StatusUpdate(const OLECHAR* instanceName, bool isConnected);
static void CALLBACK StatusProc( HRESULT hrStatus, const OLECHAR* instanceName, const OLECHAR* uniqueDeviceName , void* pUserData );
private:
xnl::Hash<OniDeviceInfo*, oni::driver::DeviceBase*> m_devices;
};
} // namespace kinect_device
#endif //_KINECT_DRIVER_H_
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pinpoint-email/PinpointEmail_EXPORTS.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace PinpointEmail
{
namespace Model
{
/**
* <p>An HTTP 200 response if the request succeeds, or an error message if the
* request fails.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-email-2018-07-26/PutEmailIdentityMailFromAttributesResponse">AWS
* API Reference</a></p>
*/
class AWS_PINPOINTEMAIL_API PutEmailIdentityMailFromAttributesResult
{
public:
PutEmailIdentityMailFromAttributesResult();
PutEmailIdentityMailFromAttributesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
PutEmailIdentityMailFromAttributesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
};
} // namespace Model
} // namespace PinpointEmail
} // namespace Aws
|
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/clusters/aggregate/v3/cluster.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct envoy_extensions_clusters_aggregate_v3_ClusterConfig;
typedef struct envoy_extensions_clusters_aggregate_v3_ClusterConfig envoy_extensions_clusters_aggregate_v3_ClusterConfig;
extern const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
/* envoy.extensions.clusters.aggregate.v3.ClusterConfig */
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(upb_Arena* arena) {
return (envoy_extensions_clusters_aggregate_v3_ClusterConfig*)_upb_Message_New(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena);
}
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, extreg, options, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, upb_Arena* arena, size_t* len) {
return upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, 0, arena, len);
}
UPB_INLINE char* envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize_ex(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, int options,
upb_Arena* arena, size_t* len) {
return upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, options, arena, len);
}
UPB_INLINE upb_StringView const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) { return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) {
return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t len, upb_Arena *arena) {
return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_StringView val, upb_Arena *arena) {
return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
arena);
}
extern const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_ */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/servicecatalog/ServiceCatalog_EXPORTS.h>
#include <aws/servicecatalog/model/RecordDetail.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace ServiceCatalog
{
namespace Model
{
class AWS_SERVICECATALOG_API ProvisionProductResult
{
public:
ProvisionProductResult();
ProvisionProductResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ProvisionProductResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Information about the result of provisioning the product.</p>
*/
inline const RecordDetail& GetRecordDetail() const{ return m_recordDetail; }
/**
* <p>Information about the result of provisioning the product.</p>
*/
inline void SetRecordDetail(const RecordDetail& value) { m_recordDetail = value; }
/**
* <p>Information about the result of provisioning the product.</p>
*/
inline void SetRecordDetail(RecordDetail&& value) { m_recordDetail = std::move(value); }
/**
* <p>Information about the result of provisioning the product.</p>
*/
inline ProvisionProductResult& WithRecordDetail(const RecordDetail& value) { SetRecordDetail(value); return *this;}
/**
* <p>Information about the result of provisioning the product.</p>
*/
inline ProvisionProductResult& WithRecordDetail(RecordDetail&& value) { SetRecordDetail(std::move(value)); return *this;}
private:
RecordDetail m_recordDetail;
};
} // namespace Model
} // namespace ServiceCatalog
} // namespace Aws
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace EBSEndpoint
{
AWS_EBS_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace EBSEndpoint
} // namespace EBS
} // namespace Aws
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/alexaforbusiness/AlexaForBusiness_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace AlexaForBusiness
{
namespace Model
{
/**
* <p>The S3 location of the output reports.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/alexaforbusiness-2017-11-09/BusinessReportS3Location">AWS
* API Reference</a></p>
*/
class AWS_ALEXAFORBUSINESS_API BusinessReportS3Location
{
public:
BusinessReportS3Location();
BusinessReportS3Location(Aws::Utils::Json::JsonView jsonValue);
BusinessReportS3Location& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The path of the business report.</p>
*/
inline const Aws::String& GetPath() const{ return m_path; }
/**
* <p>The path of the business report.</p>
*/
inline bool PathHasBeenSet() const { return m_pathHasBeenSet; }
/**
* <p>The path of the business report.</p>
*/
inline void SetPath(const Aws::String& value) { m_pathHasBeenSet = true; m_path = value; }
/**
* <p>The path of the business report.</p>
*/
inline void SetPath(Aws::String&& value) { m_pathHasBeenSet = true; m_path = std::move(value); }
/**
* <p>The path of the business report.</p>
*/
inline void SetPath(const char* value) { m_pathHasBeenSet = true; m_path.assign(value); }
/**
* <p>The path of the business report.</p>
*/
inline BusinessReportS3Location& WithPath(const Aws::String& value) { SetPath(value); return *this;}
/**
* <p>The path of the business report.</p>
*/
inline BusinessReportS3Location& WithPath(Aws::String&& value) { SetPath(std::move(value)); return *this;}
/**
* <p>The path of the business report.</p>
*/
inline BusinessReportS3Location& WithPath(const char* value) { SetPath(value); return *this;}
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline const Aws::String& GetBucketName() const{ return m_bucketName; }
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline bool BucketNameHasBeenSet() const { return m_bucketNameHasBeenSet; }
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline void SetBucketName(const Aws::String& value) { m_bucketNameHasBeenSet = true; m_bucketName = value; }
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline void SetBucketName(Aws::String&& value) { m_bucketNameHasBeenSet = true; m_bucketName = std::move(value); }
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline void SetBucketName(const char* value) { m_bucketNameHasBeenSet = true; m_bucketName.assign(value); }
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline BusinessReportS3Location& WithBucketName(const Aws::String& value) { SetBucketName(value); return *this;}
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline BusinessReportS3Location& WithBucketName(Aws::String&& value) { SetBucketName(std::move(value)); return *this;}
/**
* <p>The S3 bucket name of the output reports.</p>
*/
inline BusinessReportS3Location& WithBucketName(const char* value) { SetBucketName(value); return *this;}
private:
Aws::String m_path;
bool m_pathHasBeenSet;
Aws::String m_bucketName;
bool m_bucketNameHasBeenSet;
};
} // namespace Model
} // namespace AlexaForBusiness
} // namespace Aws
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "bsp/bsp.h"
#include "host/ble_hs.h"
#include "bleprph.h"
void
gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
{
char buf[BLE_UUID_STR_LEN];
switch (ctxt->op) {
case BLE_GATT_REGISTER_OP_SVC:
BLEPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
ctxt->svc.handle);
break;
case BLE_GATT_REGISTER_OP_CHR:
BLEPRPH_LOG(DEBUG, "registering characteristic %s with "
"def_handle=%d val_handle=%d\n",
ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
ctxt->chr.def_handle,
ctxt->chr.val_handle);
break;
case BLE_GATT_REGISTER_OP_DSC:
BLEPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
ctxt->dsc.handle);
break;
default:
assert(0);
break;
}
}
|
#ifndef __PM_CFG_H__
#define __PM_CFG_H__
enum pm_module_id
{
PM_NONE_ID = 0,
PM_POWER_ID,
PM_BOARD_ID,
PM_LCD_ID,
PM_KEY_ID,
PM_TP_ID,
PM_OTA_ID,
PM_SPI_ID,
PM_I2C_ID,
PM_ADC_ID,
PM_RTC_ID,
PM_GPIO_ID,
PM_UART_ID,
PM_SENSOR_ID,
PM_ALARM_ID,
PM_BLE_ID,
PM_MODULE_MAX_ID, /* enum must! */
};
#endif
|
#ifndef APP_STAGE_HMD_MODEL_CALIBRATION_H
#define APP_STAGE_HMD_MODEL_CALIBRATION_H
//-- includes -----
#include "AppStage.h"
#include "ClientGeometry_CAPI.h"
#include "PSMoveClient_CAPI.h"
#include <deque>
#include <chrono>
#include <string>
//-- definitions -----
class AppStage_HMDModelCalibration : public AppStage
{
public:
enum eMenuState
{
inactive,
pendingHmdListRequest,
failedHmdListRequest,
pendingHmdStartRequest,
failedHmdStartRequest,
pendingTrackerListRequest,
failedTrackerListRequest,
pendingTrackerStartRequest,
failedTrackerStartRequest,
verifyTrackers,
calibrate,
test
};
AppStage_HMDModelCalibration(class App *app);
virtual ~AppStage_HMDModelCalibration();
static void enterStageAndCalibrate(App *app, int reqeusted_hmd_id);
static void enterStageAndSkipCalibration(App *app, int reqeusted_hmd_id);
virtual void enter() override;
virtual void exit() override;
virtual void update() override;
virtual void render() override;
virtual void renderUI() override;
static const char *APP_STAGE_NAME;
inline void setBypassCalibrationFlag(bool bFlag)
{
m_bBypassCalibration = bFlag;
}
protected:
void setState(eMenuState newState);
void onExitState(eMenuState newState);
void onEnterState(eMenuState newState);
void update_tracker_video();
void render_tracker_video();
void go_next_tracker();
void go_previous_tracker();
int get_tracker_count() const;
int get_render_tracker_index() const;
PSMTracker *get_render_tracker_view() const;
void request_hmd_list();
static void handle_hmd_list_response(
const PSMResponseMessage *response,
void *userdata);
void request_start_hmd_stream(int HmdID);
static void handle_start_hmd_response(
const PSMResponseMessage *response_message,
void *userdata);
void request_tracker_list();
static void handle_tracker_list_response(
const PSMResponseMessage *response_message,
void *userdata);
bool setup_tracker_pair(const PSMTrackerList &tracker_list);
void request_tracker_start_stream(PSMTracker *tracker_view);
static void handle_tracker_start_stream_response(
const PSMResponseMessage *response,
void *userdata);
void request_set_hmd_led_model_calibration();
void handle_all_devices_ready();
void release_devices();
void request_exit_to_app_stage(const char *app_stage_name);
private:
eMenuState m_menuState;
bool m_bBypassCalibration;
struct TrackerPairState *m_trackerPairState;
class HMDModelState *m_hmdModelState;
PSMHeadMountedDisplay *m_hmdView;
int m_overrideHmdId;
std::string m_failureDetails;
};
#endif // APP_STAGE_HMD_MODEL_CALIBRATION_H
|
//
// NSURL+Base.h
// OAuthConsumer
//
// Created by Jon Crosby on 10/19/07.
// Copyright 2007 Kaboomerang LLC. 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.
@interface NSURL (OABaseAdditions)
- (NSString*) URLStringWithoutQuery;
@end
|
//
// _SZLinkDialogViewControllerIOS6.h
// Socialize
//
// Created by David Jedeikin on 1/14/14.
// Copyright (c) 2014 ShareThis. All rights reserved.
//
#import <Socialize/Socialize.h>
@interface _SZLinkDialogViewControllerIOS6 : _SZLinkDialogViewController
@end
|
#include <tommath_private.h>
#ifdef BN_MP_JACOBI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
* LibTomMath is a library that provides multiple-precision
* integer arithmetic as well as number theoretic functionality.
*
* The library was designed directly after the MPI library by
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* computes the jacobi c = (a | n) (or Legendre if n is prime)
* HAC pp. 73 Algorithm 2.149
* HAC is wrong here, as the special case of (0 | 1) is not
* handled correctly.
*/
int mp_jacobi(mp_int *a, mp_int *n, int *c) {
mp_int a1, p1;
int k, s, r, res;
mp_digit residue;
/* if n <= 0 return MP_VAL */
if (mp_cmp_d(n, 0) != MP_GT) {
return MP_VAL;
}
/* step 1. handle case of a == 0 */
if (mp_iszero(a) == MP_YES) {
/* special case of a == 0 and n == 1 */
if (mp_cmp_d(n, 1) == MP_EQ) {
*c = 1;
} else {
*c = 0;
}
return MP_OKAY;
}
/* step 2. if a == 1, return 1 */
if (mp_cmp_d(a, 1) == MP_EQ) {
*c = 1;
return MP_OKAY;
}
/* default */
s = 0;
/* step 3. write a = a1 * 2**k */
if ((res = mp_init_copy(&a1, a)) != MP_OKAY) {
return res;
}
if ((res = mp_init(&p1)) != MP_OKAY) {
goto LBL_A1;
}
/* divide out larger power of two */
k = mp_cnt_lsb(&a1);
if ((res = mp_div_2d(&a1, k, &a1, NULL)) != MP_OKAY) {
goto LBL_P1;
}
/* step 4. if e is even set s=1 */
if ((k & 1) == 0) {
s = 1;
} else {
/* else set s=1 if p = 1/7 (mod 8) or s=-1 if p = 3/5 (mod 8) */
residue = n->dp[0] & 7;
if ((residue == 1) || (residue == 7)) {
s = 1;
} else if ((residue == 3) || (residue == 5)) {
s = -1;
}
}
/* step 5. if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */
if (((n->dp[0] & 3) == 3) && ((a1.dp[0] & 3) == 3)) {
s = -s;
}
/* if a1 == 1 we're done */
if (mp_cmp_d(&a1, 1) == MP_EQ) {
*c = s;
} else {
/* n1 = n mod a1 */
if ((res = mp_mod(n, &a1, &p1)) != MP_OKAY) {
goto LBL_P1;
}
if ((res = mp_jacobi(&p1, &a1, &r)) != MP_OKAY) {
goto LBL_P1;
}
*c = s * r;
}
/* done */
res = MP_OKAY;
LBL_P1: mp_clear(&p1);
LBL_A1: mp_clear(&a1);
return res;
}
#endif
/* $Source$ */
/* $Revision$ */
/* $Date$ */
|
/* e_ubsec_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "e_ubsec_err.h"
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(0,func,0)
#define ERR_REASON(reason) ERR_PACK(0,0,reason)
static ERR_STRING_DATA UBSEC_str_functs[]=
{
{ERR_FUNC(UBSEC_F_UBSEC_CTRL), "UBSEC_CTRL"},
{ERR_FUNC(UBSEC_F_UBSEC_DH_COMPUTE_KEY), "UBSEC_DH_COMPUTE_KEY"},
{ERR_FUNC(UBSEC_F_UBSEC_DH_GENERATE_KEY), "UBSEC_DH_GENERATE_KEY"},
{ERR_FUNC(UBSEC_F_UBSEC_DSA_DO_SIGN), "UBSEC_DSA_DO_SIGN"},
{ERR_FUNC(UBSEC_F_UBSEC_DSA_VERIFY), "UBSEC_DSA_VERIFY"},
{ERR_FUNC(UBSEC_F_UBSEC_FINISH), "UBSEC_FINISH"},
{ERR_FUNC(UBSEC_F_UBSEC_INIT), "UBSEC_INIT"},
{ERR_FUNC(UBSEC_F_UBSEC_MOD_EXP), "UBSEC_MOD_EXP"},
{ERR_FUNC(UBSEC_F_UBSEC_MOD_EXP_CRT), "UBSEC_MOD_EXP_CRT"},
{ERR_FUNC(UBSEC_F_UBSEC_RAND_BYTES), "UBSEC_RAND_BYTES"},
{ERR_FUNC(UBSEC_F_UBSEC_RSA_MOD_EXP), "UBSEC_RSA_MOD_EXP"},
{ERR_FUNC(UBSEC_F_UBSEC_RSA_MOD_EXP_CRT), "UBSEC_RSA_MOD_EXP_CRT"},
{0,NULL}
};
static ERR_STRING_DATA UBSEC_str_reasons[]=
{
{ERR_REASON(UBSEC_R_ALREADY_LOADED) ,"already loaded"},
{ERR_REASON(UBSEC_R_BN_EXPAND_FAIL) ,"bn expand fail"},
{ERR_REASON(UBSEC_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"},
{ERR_REASON(UBSEC_R_DSO_FAILURE) ,"dso failure"},
{ERR_REASON(UBSEC_R_MISSING_KEY_COMPONENTS),"missing key components"},
{ERR_REASON(UBSEC_R_NOT_LOADED) ,"not loaded"},
{ERR_REASON(UBSEC_R_REQUEST_FAILED) ,"request failed"},
{ERR_REASON(UBSEC_R_SIZE_TOO_LARGE_OR_TOO_SMALL),"size too large or too small"},
{ERR_REASON(UBSEC_R_UNIT_FAILURE) ,"unit failure"},
{0,NULL}
};
#endif
#ifdef UBSEC_LIB_NAME
static ERR_STRING_DATA UBSEC_lib_name[]=
{
{0 ,UBSEC_LIB_NAME},
{0,NULL}
};
#endif
static int UBSEC_lib_error_code=0;
static int UBSEC_error_init=1;
static void ERR_load_UBSEC_strings(void)
{
if (UBSEC_lib_error_code == 0)
UBSEC_lib_error_code=ERR_get_next_error_library();
if (UBSEC_error_init)
{
UBSEC_error_init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(UBSEC_lib_error_code,UBSEC_str_functs);
ERR_load_strings(UBSEC_lib_error_code,UBSEC_str_reasons);
#endif
#ifdef UBSEC_LIB_NAME
UBSEC_lib_name->error = ERR_PACK(UBSEC_lib_error_code,0,0);
ERR_load_strings(0,UBSEC_lib_name);
#endif
}
}
static void ERR_unload_UBSEC_strings(void)
{
if (UBSEC_error_init == 0)
{
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(UBSEC_lib_error_code,UBSEC_str_functs);
ERR_unload_strings(UBSEC_lib_error_code,UBSEC_str_reasons);
#endif
#ifdef UBSEC_LIB_NAME
ERR_unload_strings(0,UBSEC_lib_name);
#endif
UBSEC_error_init=1;
}
}
static void ERR_UBSEC_error(int function, int reason, char *file, int line)
{
if (UBSEC_lib_error_code == 0)
UBSEC_lib_error_code=ERR_get_next_error_library();
ERR_PUT_error(UBSEC_lib_error_code,function,reason,file,line);
}
|
// Copyright (c) 2006-2008 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 NET_BASE_PLATFORM_MIME_UTIL_H_
#define NET_BASE_PLATFORM_MIME_UTIL_H_
#include <string>
#include "base/file_path.h"
namespace net {
// Encapsulates the platform-specific functionality in mime_util
class PlatformMimeUtil {
public:
// See documentation for base::GetPreferredExtensionForMimeType [mime_util.h]
bool GetPreferredExtensionForMimeType(const std::string& mime_type,
FilePath::StringType* extension) const;
protected:
// Get the mime type (if any) that is associated with the file extension.
// Returns true if a corresponding mime type exists.
bool GetPlatformMimeTypeFromExtension(const FilePath::StringType& ext,
std::string* mime_type) const;
};
} // namespace net
#endif // NET_BASE_PLATFORM_MIME_UTIL_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_HISTORY_DOWNLOAD_DATABASE_H_
#define CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_
#include <set>
#include <string>
#include "base/threading/platform_thread.h"
#include "chrome/browser/history/history_types.h"
#include "sql/meta_table.h"
class FilePath;
namespace content {
struct DownloadPersistentStoreInfo;
}
namespace sql {
class Connection;
}
namespace history {
// Maintains a table of downloads.
class DownloadDatabase {
public:
// Must call InitDownloadTable before using any other functions.
DownloadDatabase();
virtual ~DownloadDatabase();
int next_download_id() const { return next_id_; }
// Get all the downloads from the database.
void QueryDownloads(
std::vector<content::DownloadPersistentStoreInfo>* results);
// Update the state of one download. Returns true if successful.
// Does not update |url|, |start_time|, |total_bytes|; uses |db_handle| only
// to select the row in the database table to update.
bool UpdateDownload(const content::DownloadPersistentStoreInfo& data);
// Update the path of one download. Returns true if successful.
bool UpdateDownloadPath(const FilePath& path, DownloadID db_handle);
// Fixes state of the download entries. Sometimes entries with IN_PROGRESS
// state are not updated during browser shutdown (particularly when crashing).
// On the next start such entries are considered canceled. This functions
// fixes such entries.
bool CleanUpInProgressEntries();
// Create a new database entry for one download and return its primary db id.
int64 CreateDownload(const content::DownloadPersistentStoreInfo& info);
// Remove a download from the database.
void RemoveDownload(DownloadID db_handle);
// Remove all completed downloads that started after |remove_begin|
// (inclusive) and before |remove_end|. You may use null Time values
// to do an unbounded delete in either direction. This function ignores
// all downloads that are in progress or are waiting to be cancelled.
bool RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end);
protected:
// Returns the database for the functions in this interface.
virtual sql::Connection& GetDB() = 0;
// Returns the meta-table object for the functions in this interface.
virtual sql::MetaTable& GetMetaTable() = 0;
// Returns true if able to successfully rewrite the invalid values for the
// |state| field from 3 to 4. Returns false if there was an error fixing the
// database. See http://crbug.com/140687
bool MigrateDownloadsState();
// Creates the downloads table if needed.
bool InitDownloadTable();
// Used to quickly clear the downloads. First you would drop it, then you
// would re-initialize it.
bool DropDownloadTable();
private:
// TODO(rdsmith): Remove after http://crbug.com/96627 has been resolved.
void CheckThread();
bool EnsureColumnExists(const std::string& name, const std::string& type);
bool owning_thread_set_;
base::PlatformThreadId owning_thread_;
int next_id_;
int next_db_handle_;
DISALLOW_COPY_AND_ASSIGN(DownloadDatabase);
};
} // namespace history
#endif // CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_
|
/*
* Copyright (c) 2007, Kohsuke Ohtani
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
/*
* malloc_r() - this is used with multi-threaded native task.
*/
#include <sys/prex.h>
#include <stdlib.h>
#include "malloc.h"
static mutex_t malloc_r_lock = MUTEX_INITIALIZER;
void *
malloc_r(size_t size)
{
void *p;
mutex_lock(&malloc_r_lock);
p = malloc(size);
mutex_unlock(&malloc_r_lock);
return p;
}
void
free_r(void *addr)
{
mutex_lock(&malloc_r_lock);
free(addr);
mutex_unlock(&malloc_r_lock);
}
|
/*
* This software is distributed under BSD 3-clause license (see LICENSE file).
*
* Authors: Soeren Sonnenburg, Yuyu Zhang, Bjoern Esser, Sergey Lisitsyn
*/
#ifndef _OLIGOSTRINGKERNEL_H_
#define _OLIGOSTRINGKERNEL_H_
#include <shogun/lib/config.h>
#include <shogun/kernel/string/StringKernel.h>
#include <vector>
#include <string>
namespace shogun
{
/**
* @brief This class offers access to the Oligo Kernel introduced
* by Meinicke et al. in 2004
*
* The class has functions to preprocess the data such that the kernel
* computation can be pursued faster. The kernel function is then
* kernelOligoFast or kernelOligo.
*
* Requires significant speedup, should be working but as is might be
* applicable only to academic small scale problems:
*
* - the kernel should only ever see encoded sequences, which however
* requires another OligoFeatures object (using CDenseFeatures of pairs)
*
* Uses CSqrtDiagKernelNormalizer, as the vanilla kernel seems to be very
* diagonally dominant.
*
*/
class COligoStringKernel : public CStringKernel<char>
{
public:
/** default constructor */
COligoStringKernel();
/** Constructor
* @param cache_size cache size for kernel
* @param k k-mer length
* @param width - equivalent to 2*sigma^2
*/
COligoStringKernel(int32_t cache_size, int32_t k, float64_t width);
/** Constructor
* @param l features of left-hand side
* @param r features of right-hand side
* @param k k-mer length
* @param width - equivalent to 2*sigma^2
*/
COligoStringKernel(
CStringFeatures<char>* l, CStringFeatures<char>* r,
int32_t k, float64_t width);
/** Destructor */
virtual ~COligoStringKernel();
/** initialize kernel
*
* @param l features of left-hand side
* @param r features of right-hand side
* @return if initializing was successful
*/
virtual bool init(CFeatures* l, CFeatures* r);
/** return what type of kernel we are
*
* @return kernel type OLIGO
*/
virtual EKernelType get_kernel_type() { return K_OLIGO; }
/** return the kernel's name
*
* @return name Oligo
*/
virtual const char* get_name() const { return "OligoStringKernel"; }
virtual float64_t compute(int32_t x, int32_t y);
/** clean up your kernel
*/
virtual void cleanup();
protected:
/**
* @brief encodes the signals of the sequence
*
* This function stores the oligo function signals in 'values'.
*
* The 'k_mer_length' and the 'allowed_characters' determine,
* which signals are used. Every pair contains the position of the
* signal and a numerical value reflecting the signal. The
* numerical value represents the k_mer to a base
* n = |allowed_characters|.
* Example: The value of k_mer CG for the allowed characters ACGT
* would be 1 * n^1 + 2 * n^0 = 6.
*/
static void encodeOligo(
const std::string& sequence, uint32_t k_mer_length,
const std::string& allowed_characters,
std::vector< std::pair<int32_t, float64_t> >& values);
/**
@brief encodes all sequences with the encodeOligo function and stores
them in 'encoded_sequences'
This function encodes the sequences of 'sequences' via the
function encodeOligo.
*/
static void getSequences(
const std::vector<std::string>& sequences,
uint32_t k_mer_length, const std::string& allowed_characters,
std::vector< std::vector< std::pair<int32_t, float64_t> > >& encoded_sequences);
/**
@brief returns the value of the oligo kernel for sequences 'x' and 'y'
This function computes the kernel value of the oligo kernel,
which was introduced by Meinicke et al. in 2004. 'x' and
'y' are encoded by encodeOligo and 'exp_cache' has to be
constructed by getExpFunctionCache.
'max_distance' can be used to speed up the computation
even further by restricting the maximum distance between a k_mer at
position i in sequence 'x' and a k_mer at position j
in sequence 'y'. If i - j > 'max_distance' the value is not
added to the kernel value. This approximation is switched
off by default (max_distance < 0).
*/
float64_t kernelOligoFast(
const std::vector< std::pair<int32_t, float64_t> >& x,
const std::vector< std::pair<int32_t, float64_t> >& y,
int32_t max_distance = -1);
/**
@brief returns the value of the oligo kernel for sequences 'x' and 'y'
This function computes the kernel value of the oligo kernel,
which was introduced by Meinicke et al. in 2004. 'x' and
'y' have to be encoded by encodeOligo.
*/
float64_t kernelOligo(
const std::vector< std::pair<int32_t, float64_t> >& x,
const std::vector< std::pair<int32_t, float64_t> >& y);
private:
/**
@brief prepares the exp function cache of the oligo kernel
The oligo kernel was introduced for sequences of fixed length.
Let n be the sequence length of sequences x and y. There can
only be n different distances between signals in sequence x
and sequence y (0, 1, ..., n-1). Therefore, we precompute
the corresponding values of the e-function. These values
can then be used in kernelOligoFast.
*/
void getExpFunctionCache(uint32_t sequence_length);
static inline bool cmpOligos_(std::pair<int32_t, float64_t> a,
std::pair<int32_t, float64_t> b )
{
return (a.second < b.second);
}
void init();
protected:
/** k-mer length */
int32_t k;
/** width of kernel */
float64_t width;
/** gauss table cache for exp (see getExpFunctionCache above) */
SGVector<float64_t> gauss_table;
};
}
#endif // _OLIGOSTRINGKERNEL_H_
|
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header: strspn.c,v 1.1 89/05/11 10:09:09 eck Exp $ */
#include <string.h>
size_t
strspn(const char *string, const char *in)
{
register const char *s1, *s2;
for (s1 = string; *s1; s1++) {
for (s2 = in; *s2 && *s2 != *s1; s2++)
/* EMPTY */ ;
if (*s2 == '\0')
break;
}
return s1 - string;
}
|
/* ----------------------------------------------------------------<Prolog>-
Name: sflxml.h
Title: XML (Extensible Markup Language) access functions
Package: Standard Function Library (SFL)
Written: 1998/02/25 iMatix SFL project team <sfl@imatix.com>
Revised: 2000/01/16
Synopsis: Provides functions to read and write XML files, and manipulate
XML data in memory as list structures. XML is the Extensible
Markup Language. Accepts this XML syntax:
<item [attr=["]value["]]...>value [child]</item>
Copyright: Copyright (c) 1991-99 iMatix Corporation
License: This is free software; you can redistribute it and/or modify
it under the terms of the SFL License Agreement as provided
in the file LICENSE.TXT. This software is distributed in
the hope that it will be useful, but without any warranty.
------------------------------------------------------------------</Prolog>-*/
#ifndef SLFXML_INCLUDED /* Allow multiple inclusions */
#define SLFXML_INCLUDED
/* -------------------------------------------------------------------------
An XML tree is built as the following recursive structure:
.---------. .----------.
.-: Attr :<-->: 0..n : Attributes are not sorted.
.----------. : : Head : : attrs :
: Item :-' `---------' `----------'
: node :-. .---------. .----------.
`----------' : : Child/ :<-->: 0..n : Each child node is the root
`-: Value : : children : of its own tree of nodes.
`---------' `----------'
------------------------------------------------------------------------- */
/*- Structure definitions -------------------------------------------------- */
typedef struct _XML_ITEM XML_ITEM;
typedef struct _XML_ATTR XML_ATTR;
/*- Function prototypes ---------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
#endif
/* XML item functions */
XML_ITEM *xml_new (XML_ITEM *parent,
const char *name,
const char *value);
XML_ITEM *xml_create (const char *name,
const char *value);
void xml_modify_value (XML_ITEM *item,
const char *value);
void xml_rename (XML_ITEM *item,
const char *name);
char *xml_item_name (XML_ITEM *item);
char *xml_item_value (XML_ITEM *item);
void xml_free (XML_ITEM *item);
/* XML tree manipulation */
void xml_attach_child (XML_ITEM *parent, XML_ITEM *item);
void xml_attach_sibling (XML_ITEM *sibling, XML_ITEM *item);
void xml_detach (XML_ITEM *item);
/* XML family navigation */
XML_ITEM *xml_first_child (XML_ITEM *item);
XML_ITEM *xml_last_child (XML_ITEM *item);
XML_ITEM *xml_next_sibling (XML_ITEM *item);
XML_ITEM *xml_prev_sibling (XML_ITEM *item);
XML_ITEM *xml_parent (XML_ITEM *item);
/* XML attribute functions */
int xml_put_attr_ic (XML_ITEM *item,
const char *name,
const char *value,
Bool ignore_case);
XML_ATTR *xml_attr_ic (XML_ITEM *item,
const char *name,
Bool ignore_case);
char *xml_attr_name (XML_ATTR *item);
char *xml_attr_value (XML_ATTR *item);
char *xml_get_attr_ic (XML_ITEM *item,
const char *name,
const char *deflt,
Bool ignore_case);
void xml_free_attr (XML_ATTR *attr);
#define xml_put_attr(item, name, value) \
xml_put_attr_ic (item, name, value, FALSE)
#define xml_attr(item, name) \
xml_attr_ic (item, name, FALSE)
#define xml_get_attr(item, name, dflt) \
xml_get_attr_ic (item, name, dflt, FALSE)
/* XML attribute navigation */
XML_ATTR *xml_first_attr (XML_ITEM *item);
XML_ATTR *xml_last_attr (XML_ITEM *item);
XML_ATTR *xml_next_attr (XML_ATTR *attr);
XML_ATTR *xml_prev_attr (XML_ATTR *attr);
/* XML housekeeping functions */
Bool xml_changed (XML_ITEM *item);
Bool xml_refresh (XML_ITEM **item);
/* Macros to treat all children and all attributes */
#define FORCHILDREN(child,item) for (child = xml_first_child (item); \
child != NULL; \
child = xml_next_sibling (child)) \
if (xml_item_name (child))
#define FORVALUES(child,item) for (child = xml_first_child (item); \
child != NULL; \
child = xml_next_sibling (child)) \
if (!xml_item_name (child))
#define FORATTRIBUTES(attr,item) for (attr = xml_first_attr (item); \
attr != NULL; \
attr = xml_next_attr (attr))
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef _FEEDBACK_CONTROLLER_H_
#define _FEEDBACK_CONTROLLER_H_
#if defined(AVR) || defined(__SAM3X8E__)
#include "Arduino.h"
#include "Config.h"
class DMFControlBoard;
class FeedbackController {
public:
#if ___HARDWARE_MAJOR_VERSION___ == 1
static const uint8_t HV_SERIES_RESISTOR_0_ = 13;
static const uint8_t FB_SERIES_RESISTOR_0_ = 12;
static const uint8_t FB_SERIES_RESISTOR_1_ = 11;
static const uint8_t FB_SERIES_RESISTOR_2_ = 10;
#elif ___HARDWARE_MAJOR_VERSION___ == 2 && ___HARDWARE_MINOR_VERSION___ == 0
static const uint8_t HV_SERIES_RESISTOR_0_ = 8;
static const uint8_t HV_SERIES_RESISTOR_1_ = 9;
static const uint8_t FB_SERIES_RESISTOR_0_ = 10;
static const uint8_t FB_SERIES_RESISTOR_1_ = 11;
static const uint8_t FB_SERIES_RESISTOR_2_ = 12;
static const uint8_t FB_SERIES_RESISTOR_3_ = 13;
#else // 2.1
static const uint8_t HV_SERIES_RESISTOR_0_ = 4;
static const uint8_t HV_SERIES_RESISTOR_1_ = 5;
static const uint8_t FB_SERIES_RESISTOR_0_ = 6;
static const uint8_t FB_SERIES_RESISTOR_1_ = 7;
static const uint8_t FB_SERIES_RESISTOR_2_ = 8;
static const uint8_t FB_SERIES_RESISTOR_3_ = 9;
#endif
static const uint16_t SATURATION_THRESHOLD_HIGH = 972; // ~95% max
static const uint16_t SATURATION_THRESHOLD_LOW = 51; // ~5% max
static const uint8_t N_IGNORE_POST_SATURATION = 3;
static const float MAX_SAMPLING_RATE = 40e3;
struct ADCChannel {
ADCChannel() : series_resistor_index(0) {}
uint8_t channel;
uint8_t series_resistor_index;
uint8_t saturated;
uint8_t post_saturation_ignore;
uint16_t max_value;
uint16_t min_value;
uint32_t sum;
uint32_t prev_sum;
bool prev_saturated;
uint32_t sum2;
uint16_t vgnd;
float vgnd_exp_filtered;
};
static const uint8_t NUMBER_OF_ADC_CHANNELS = 2;
static const uint8_t HV_CHANNEL_INDEX = 0;
static const uint8_t FB_CHANNEL_INDEX = 1;
static void begin(DMFControlBoard* parent,
uint8_t hv_channel,
uint8_t fb_channel);
static uint8_t set_series_resistor_index(const uint8_t channel_index,
const uint8_t index);
static uint8_t series_resistor_index(uint8_t channel_index) {
return channels_[channel_index].series_resistor_index;
}
static uint8_t measure_impedance(float sampling_window_ms,
uint16_t n_sampling_windows,
float delay_between_windows_ms,
float frequency,
bool interleave_samples,
bool rms);
static void interleaved_callback(uint8_t channel_index, uint16_t value);
static void hv_channel_callback(uint8_t channel_index, uint16_t value);
static void fb_channel_callback(uint8_t channel_index, uint16_t value);
static ADCChannel* channels() { return channels_; }
private:
static void find_sampling_rate(float sampling_window_ms,
float frequency,
float max_sampling_rate,
float* sampling_rate_out,
uint16_t* n_samples_per_window_out);
static ADCChannel channels_[];
static uint16_t n_samples_per_window_;
static DMFControlBoard* parent_;
static bool rms_;
static bool current_limit_exceeded_;
};
#endif // defined(AVR) || defined(__SAM3X8E__)
#endif // _FEEDBACK_CONTROLLER_H_
|
#ifndef TASKVALIDATOR_H
#define TASKVALIDATOR_H
#include "task.h"
class CLIENT_API TaskValidator
{
Q_DISABLE_COPY(TaskValidator)
public:
TaskValidator();
~TaskValidator();
enum ValidationResult
{
Invalid,
Valid // TODO: Find more texts
};
ValidationResult validate(const ScheduleDefinition &testDefinition);
protected:
class Private;
Private *d;
};
#endif // TASKVALIDATOR_H
|
/*
* Copyright (c) 2017, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file implements the OpenThread platform abstraction for UART communication.
*
*/
#include <stddef.h>
#include "platform-emsk.h"
#include <utils/code_utils.h>
#include "openthread/platform/uart.h"
#include <stdio.h>
#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
enum
{
kUartId = BOARD_CONSOLE_UART_ID,
kBaudRate = BOARD_CONSOLE_UART_BAUD,
kReceiveBufferSize = 128,
};
static void processReceive(void);
static void processTransmit(void);
static const uint8_t *sTransmitBuffer = NULL;
static uint16_t sTransmitLength = 0;
static uint8_t sReceiveBuffer[kReceiveBufferSize];
static uint16_t sReceiveHead = 0;
static DEV_UART *consoleUart;
otError otPlatUartEnable(void)
{
int32_t stateUart = 0;
otError error = OT_ERROR_DROP;
/* UART in embARC */
consoleUart = uart_get_dev(BOARD_CONSOLE_UART_ID);
otEXPECT_ACTION(!(consoleUart == NULL), DBG("Console UART is missing.\r\n"));
stateUart = consoleUart->uart_open(BOARD_CONSOLE_UART_BAUD);
if (stateUart == E_OPNED)
{
consoleUart->uart_control(UART_CMD_SET_BAUD, (void *)(BOARD_CONSOLE_UART_BAUD));
error = OT_ERROR_NONE;
DBG("Set Console UART Baudrate to %d.\r\n", BOARD_CONSOLE_UART_BAUD);
}
else if (stateUart == E_OK)
{
error = OT_ERROR_NONE;
DBG("Open Console UART Successfully.\r\n");
}
else
{
DBG("Open Console UART Error.\r\n");
}
exit:
return error;
}
otError otPlatUartDisable(void)
{
return OT_ERROR_NONE;
}
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
{
otError error = OT_ERROR_NONE;
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
sTransmitBuffer = aBuf;
sTransmitLength = aBufLength;
exit:
return error;
}
void processReceive(void)
{
int32_t rdAvail = 0;
uint16_t remaining;
consoleUart->uart_control(UART_CMD_GET_RXAVAIL, (void *)(&rdAvail));
otEXPECT_ACTION(rdAvail > 0, ;);
remaining = kReceiveBufferSize - sReceiveHead;
if (rdAvail >= remaining)
{
consoleUart->uart_read((void *)(sReceiveBuffer + sReceiveHead), (uint32_t)remaining);
otPlatUartReceived(sReceiveBuffer + sReceiveHead, remaining);
sReceiveHead = 0;
rdAvail -= (int32_t)remaining;
}
while (rdAvail >= kReceiveBufferSize)
{
consoleUart->uart_read((void *)(sReceiveBuffer + sReceiveHead), (uint32_t)kReceiveBufferSize);
otPlatUartReceived(sReceiveBuffer + sReceiveHead, kReceiveBufferSize);
rdAvail -= kReceiveBufferSize;
}
if (rdAvail > 0)
{
consoleUart->uart_read((void *)(sReceiveBuffer + sReceiveHead), (uint32_t)rdAvail);
otPlatUartReceived(sReceiveBuffer + sReceiveHead, rdAvail);
sReceiveHead += (uint16_t)rdAvail;
}
exit:
return;
}
void processTransmit(void)
{
otEXPECT_ACTION(sTransmitBuffer != NULL, ;);
consoleUart->uart_write((void *)sTransmitBuffer, (int32_t)sTransmitLength);
sTransmitBuffer = NULL;
otPlatUartSendDone();
exit:
return;
}
void emskUartProcess(void)
{
processReceive();
processTransmit();
}
|
//===- Testing/Support/SupportHelpers.h -----------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H
#define LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "gtest/gtest-printers.h"
namespace llvm {
namespace detail {
struct ErrorHolder {
std::vector<std::shared_ptr<ErrorInfoBase>> Infos;
bool Success() const { return Infos.empty(); }
};
template <typename T> struct ExpectedHolder : public ErrorHolder {
ExpectedHolder(ErrorHolder Err, Expected<T> &Exp)
: ErrorHolder(std::move(Err)), Exp(Exp) {}
Expected<T> &Exp;
};
inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) {
raw_os_ostream OS(*Out);
OS << (Err.Success() ? "succeeded" : "failed");
if (!Err.Success()) {
const char *Delim = " (";
for (const auto &Info : Err.Infos) {
OS << Delim;
Delim = "; ";
Info->log(OS);
}
OS << ")";
}
}
template <typename T>
void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) {
if (Item.Success()) {
*Out << "succeeded with value " << ::testing::PrintToString(*Item.Exp);
} else {
PrintTo(static_cast<const ErrorHolder &>(Item), Out);
}
}
} // namespace detail
} // namespace llvm
#endif
|
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Externally-callable APIs
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "vb2_common.h"
int vb2api_fw_phase3(struct vb2_context *ctx)
{
int rv;
/* Verify firmware keyblock */
rv = vb2_load_fw_keyblock(ctx);
if (rv) {
vb2_fail(ctx, VB2_RECOVERY_RO_INVALID_RW, rv);
return rv;
}
/* Verify firmware preamble */
rv = vb2_load_fw_preamble(ctx);
if (rv) {
vb2_fail(ctx, VB2_RECOVERY_RO_INVALID_RW, rv);
return rv;
}
return VB2_SUCCESS;
}
int vb2api_init_hash2(struct vb2_context *ctx,
const struct vb2_id *id,
uint32_t *size)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
const struct vb2_fw_preamble *pre;
const struct vb2_signature *sig = NULL;
struct vb2_digest_context *dc;
struct vb2_workbuf wb;
uint32_t hash_offset;
int i, rv;
vb2_workbuf_from_ctx(ctx, &wb);
/* Get preamble pointer */
if (!sd->workbuf_preamble_size)
return VB2_ERROR_API_INIT_HASH_PREAMBLE;
pre = (const struct vb2_fw_preamble *)
(ctx->workbuf + sd->workbuf_preamble_offset);
/* Find the matching signature */
hash_offset = pre->hash_offset;
for (i = 0; i < pre->hash_count; i++) {
sig = (const struct vb2_signature *)
((uint8_t *)pre + hash_offset);
if (!memcmp(id, &sig->id, sizeof(*id)))
break;
hash_offset += sig->c.total_size;
}
if (i >= pre->hash_count)
return VB2_ERROR_API_INIT_HASH_ID; /* No match */
/* Allocate workbuf space for the hash */
if (sd->workbuf_hash_size) {
dc = (struct vb2_digest_context *)
(ctx->workbuf + sd->workbuf_hash_offset);
} else {
uint32_t dig_size = sizeof(*dc);
dc = vb2_workbuf_alloc(&wb, dig_size);
if (!dc)
return VB2_ERROR_API_INIT_HASH_WORKBUF;
sd->workbuf_hash_offset = vb2_offset_of(ctx->workbuf, dc);
sd->workbuf_hash_size = dig_size;
ctx->workbuf_used = sd->workbuf_hash_offset + dig_size;
}
sd->hash_tag = vb2_offset_of(ctx->workbuf, sig);
sd->hash_remaining_size = sig->data_size;
if (size)
*size = sig->data_size;
if (!(pre->flags & VB2_FIRMWARE_PREAMBLE_DISALLOW_HWCRYPTO)) {
rv = vb2ex_hwcrypto_digest_init(sig->hash_alg, sig->data_size);
if (!rv) {
VB2_DEBUG("Using HW crypto engine for hash_alg %d\n",
sig->hash_alg);
dc->hash_alg = sig->hash_alg;
dc->using_hwcrypto = 1;
return VB2_SUCCESS;
}
if (rv != VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED)
return rv;
VB2_DEBUG("HW crypto for hash_alg %d not supported, using SW\n",
sig->hash_alg);
} else {
VB2_DEBUG("HW crypto forbidden by preamble, using SW\n");
}
return vb2_digest_init(dc, sig->hash_alg);
}
int vb2api_check_hash(struct vb2_context *ctx)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
struct vb2_digest_context *dc = (struct vb2_digest_context *)
(ctx->workbuf + sd->workbuf_hash_offset);
struct vb2_workbuf wb;
uint8_t *digest;
uint32_t digest_size = vb2_digest_size(dc->hash_alg);
const struct vb2_signature *sig;
int rv;
vb2_workbuf_from_ctx(ctx, &wb);
/* Get signature pointer */
if (!sd->hash_tag)
return VB2_ERROR_API_CHECK_HASH_TAG;
sig = (const struct vb2_signature *)(ctx->workbuf + sd->hash_tag);
/* Must have initialized hash digest work area */
if (!sd->workbuf_hash_size)
return VB2_ERROR_API_CHECK_HASH_WORKBUF;
/* Should have hashed the right amount of data */
if (sd->hash_remaining_size)
return VB2_ERROR_API_CHECK_HASH_SIZE;
/* Allocate the digest */
digest = vb2_workbuf_alloc(&wb, digest_size);
if (!digest)
return VB2_ERROR_API_CHECK_HASH_WORKBUF_DIGEST;
/* Finalize the digest */
if (dc->using_hwcrypto)
rv = vb2ex_hwcrypto_digest_finalize(digest, digest_size);
else
rv = vb2_digest_finalize(dc, digest, digest_size);
if (rv)
return rv;
/* Compare with the signature */
if (vb2_safe_memcmp(digest, (const uint8_t *)sig + sig->sig_offset,
digest_size))
return VB2_ERROR_API_CHECK_HASH_SIG;
/* TODO: the old check-hash function called vb2_fail() on any mismatch.
* I don't think it should do that; the caller should. */
return VB2_SUCCESS;
}
|
// Copyright 2015 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 MOJO_EDK_UTIL_REF_PTR_INTERNAL_H_
#define MOJO_EDK_UTIL_REF_PTR_INTERNAL_H_
#include <utility>
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
namespace util {
template <typename T>
class RefPtr;
template <typename T>
RefPtr<T> AdoptRef(T* ptr);
namespace internal {
// This is a wrapper class that can be friended for a particular |T|, if you
// want to make |T|'s constructor private, but still use |MakeRefCounted()|
// (below). (You can't friend partial specializations.) See |MakeRefCounted()|
// and |FRIEND_MAKE_REF_COUNTED()|.
template <typename T>
class MakeRefCountedHelper final {
public:
template <typename... Args>
static RefPtr<T> MakeRefCounted(Args&&... args) {
return AdoptRef<T>(new T(std::forward<Args>(args)...));
}
};
} // namespace internal
} // namespace util
} // namespace mojo
#endif // MOJO_EDK_UTIL_REF_PTR_INTERNAL_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 CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
#define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "media/filters/gpu_video_decoder.h"
#include "ui/gfx/size.h"
namespace base {
class WaitableEvent;
}
namespace content {
class GpuChannelHost;
class WebGraphicsContext3DCommandBufferImpl;
// Glue code to expose functionality needed by media::GpuVideoDecoder to
// RenderViewImpl. This class is entirely an implementation detail of
// RenderViewImpl and only has its own header to allow extraction of its
// implementation from render_view_impl.cc which is already far too large.
//
// The public methods of the class can be called from any thread, and are
// internally trampolined to the appropriate thread. GPU/GL-related calls go to
// the constructor-argument loop (mostly that's the compositor thread, or the
// renderer thread if threaded compositing is disabled), and shmem-related calls
// go to the render thread.
class CONTENT_EXPORT RendererGpuVideoDecoderFactories
: public media::GpuVideoDecoder::Factories {
public:
// Takes a ref on |gpu_channel_host| and tests |context| for loss before each
// use.
RendererGpuVideoDecoderFactories(
GpuChannelHost* gpu_channel_host,
const scoped_refptr<base::MessageLoopProxy>& message_loop,
WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
// media::GpuVideoDecoder::Factories implementation.
virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
media::VideoCodecProfile profile,
media::VideoDecodeAccelerator::Client* client) OVERRIDE;
virtual bool CreateTextures(int32 count, const gfx::Size& size,
std::vector<uint32>* texture_ids,
uint32 texture_target) OVERRIDE;
virtual void DeleteTexture(uint32 texture_id) OVERRIDE;
virtual void ReadPixels(uint32 texture_id, uint32 texture_target,
const gfx::Size& size, void* pixels) OVERRIDE;
virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
protected:
friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>;
virtual ~RendererGpuVideoDecoderFactories();
private:
// Helper for the constructor to acquire the ContentGLContext on the
// compositor thread (when it is enabled).
void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context,
base::WaitableEvent* waiter);
// Async versions of the public methods. They use output parameters instead
// of return values and each takes a WaitableEvent* param to signal completion
// (except for DeleteTexture, which is fire-and-forget).
// AsyncCreateSharedMemory runs on the renderer thread and the rest run on
// |message_loop_|.
void AsyncCreateVideoDecodeAccelerator(
media::VideoCodecProfile profile,
media::VideoDecodeAccelerator::Client* client,
media::VideoDecodeAccelerator** vda,
base::WaitableEvent* waiter);
void AsyncCreateTextures(
int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids,
uint32 texture_target, bool* success, base::WaitableEvent* waiter);
void AsyncDeleteTexture(uint32 texture_id);
void AsyncReadPixels(uint32 texture_id, uint32 texture_target,
const gfx::Size& size,
void* pixels, base::WaitableEvent* waiter);
void AsyncCreateSharedMemory(
size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter);
scoped_refptr<base::MessageLoopProxy> message_loop_;
scoped_refptr<GpuChannelHost> gpu_channel_host_;
base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context_;
DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories);
};
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_
|
/*
* Copyright (c) 2015, Ford Motor Company
* 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 the Ford Motor Company nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#if defined(OS_POSIX)
#include <sys/time.h>
typedef struct timeval TimevalStruct;
#elif defined(OS_WIN32)
#include <stdint.h>
#include <pthread.h>
#include <winsock.h>
typedef struct timeval TimevalStruct;
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
void clock_gettime(int i, timespec * tm);
#elif defined(OS_WINCE)
#include <unistd.h>
#include <pthread.h>
#ifndef _WINSOCKAPI_
#include <winsock2.h>
#endif
typedef struct timeval TimevalStruct;
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
void clock_gettime(int i, timespec * tm);
#elif defined(OS_MAC)
#include <mach/clock.h>
#include <mach/mach.h>
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
void clock_gettime(int i, timespec * tm);
#endif
#include <stdint.h>
namespace date_time {
enum TimeCompare {
LESS,
EQUAL,
GREATER
};
class DateTime {
public:
static const int32_t MILLISECONDS_IN_SECOND = 1000;
static const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
static const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
static const int32_t MICROSECONDS_IN_SECOND =
MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
static const int32_t NANOSECONDS_IN_MILLISECOND =
MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
static TimevalStruct getCurrentTime();
// return SECONDS count
static int64_t getSecs(const TimevalStruct& time);
// return MILLISECONDS count
static int64_t getmSecs(const TimevalStruct& time);
// return MICROSECONDS count
static int64_t getuSecs(const TimevalStruct& time);
// return MILLISECONDS count between sinceTime value and current time
static int64_t calculateTimeSpan(const TimevalStruct& sinceTime);
// return MILLISECONDS count between time1 and time2
static int64_t calculateTimeDiff(const TimevalStruct& time1,
const TimevalStruct& time2);
/**
* @brief Adds milliseconds to time struct
* @param time contains time struct
* @param milliseconds contains value which need to
* add to time struct
**/
static void AddMilliseconds(TimevalStruct& time,
uint32_t milliseconds);
static TimevalStruct Sub(const TimevalStruct& time1,
const TimevalStruct& time2);
static TimeCompare compareTime(const TimevalStruct& time1,
const TimevalStruct& time2);
static bool Greater(const TimevalStruct& time1, const TimevalStruct& time2);
static bool Less(const TimevalStruct& time1, const TimevalStruct& time2);
static bool Equal(const TimevalStruct& time1, const TimevalStruct& time2);
private:
static TimevalStruct ConvertionUsecs(const TimevalStruct &time);
};
} // namespace date_time
bool operator<(const TimevalStruct& time1, const TimevalStruct& time2);
bool operator==(const TimevalStruct& time1, const TimevalStruct& time2);
const TimevalStruct operator-(const TimevalStruct& time1, const TimevalStruct& time2);
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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.
//
//******************************************************************************
// WindowsUIXamlAutomationText.h
// Generated from winmd2objc
#pragma once
#include "interopBase.h"
// Windows.UI.Xaml.Automation.Text.TextPatternRangeEndpoint
enum _WUXATTextPatternRangeEndpoint {
WUXATTextPatternRangeEndpointStart = 0,
WUXATTextPatternRangeEndpointEnd = 1,
};
typedef unsigned WUXATTextPatternRangeEndpoint;
// Windows.UI.Xaml.Automation.Text.TextUnit
enum _WUXATTextUnit {
WUXATTextUnitCharacter = 0,
WUXATTextUnitFormat = 1,
WUXATTextUnitWord = 2,
WUXATTextUnitLine = 3,
WUXATTextUnitParagraph = 4,
WUXATTextUnitPage = 5,
WUXATTextUnitDocument = 6,
};
typedef unsigned WUXATTextUnit;
#import <Foundation/Foundation.h>
|
//
// LogQuery.h
// TSLocationManager
//
// Created by Christopher Scott on 2019-10-22.
// Copyright © 2019 Transistor Software. All rights reserved.
//
#import "SQLQuery.h"
@interface LogQuery:SQLQuery
@end
|
/* }`^XNÖW */
#include "bootpack.h"
struct TASKCTL *taskctl;
struct TIMER *task_timer;
struct TASK *task_init(struct MEMMAN *memman)
{
int i;
struct TASK *task;
struct SEGMENT_DESCRIPTOR *gdt = (struct SEGMENT_DESCRIPTOR *) ADR_GDT;
taskctl = (struct TASKCTL *) memman_alloc_4k(memman, sizeof (struct TASKCTL));
for (i = 0; i < MAX_TASKS; i++) {
taskctl->tasks0[i].flags = 0;
taskctl->tasks0[i].sel = (TASK_GDT0 + i) * 8;
set_segmdesc(gdt + TASK_GDT0 + i, 103, (int) &taskctl->tasks0[i].tss, AR_TSS32);
}
task = task_alloc();
task->flags = 2; /* ®ì}[N */
taskctl->running = 1;
taskctl->now = 0;
taskctl->tasks[0] = task;
load_tr(task->sel);
task_timer = timer_alloc();
timer_settime(task_timer, 2);
return task;
}
struct TASK *task_alloc(void)
{
int i;
struct TASK *task;
for (i = 0; i < MAX_TASKS; i++) {
if (taskctl->tasks0[i].flags == 0) {
task = &taskctl->tasks0[i];
task->flags = 1; /* gp}[N */
task->tss.eflags = 0x00000202; /* IF = 1; */
task->tss.eax = 0; /* Æè ¦¸0ɵĨ±ÆÉ·é */
task->tss.ecx = 0;
task->tss.edx = 0;
task->tss.ebx = 0;
task->tss.ebp = 0;
task->tss.esi = 0;
task->tss.edi = 0;
task->tss.es = 0;
task->tss.ds = 0;
task->tss.fs = 0;
task->tss.gs = 0;
task->tss.ldtr = 0;
task->tss.iomap = 0x40000000;
return task;
}
}
return 0; /* à¤Sgp */
}
void task_run(struct TASK *task)
{
task->flags = 2; /* ®ì}[N */
taskctl->tasks[taskctl->running] = task;
taskctl->running++;
return;
}
void task_switch(void)
{
timer_settime(task_timer, 2);
if (taskctl->running >= 2) {
taskctl->now++;
if (taskctl->now == taskctl->running) {
taskctl->now = 0;
}
farjmp(0, taskctl->tasks[taskctl->now]->sel);
}
return;
}
void task_sleep(struct TASK *task)
{
int i;
char ts = 0;
if (task->flags == 2) { /* wè^XNªàµN«Ä¢½ç */
if (task == taskctl->tasks[taskctl->now]) {
ts = 1; /* ©ª©gðQ©¹éÌÅA ÆÅ^XNXCb`·é */
}
/* taskªÇ±É¢é©ðT· */
for (i = 0; i < taskctl->running; i++) {
if (taskctl->tasks[i] == task) {
/* ±±É¢½ */
break;
}
}
taskctl->running--;
if (i < taskctl->now) {
taskctl->now--; /* ¸êéÌÅA±êà í¹Ä¨ */
}
/* ¸çµ */
for (; i < taskctl->running; i++) {
taskctl->tasks[i] = taskctl->tasks[i + 1];
}
task->flags = 1; /* ®ìµÄ¢È¢óÔ */
if (ts != 0) {
/* ^XNXCb`·é */
if (taskctl->now >= taskctl->running) {
/* nowª¨©µÈlÉÈÁÄ¢½çAC³·é */
taskctl->now = 0;
}
farjmp(0, taskctl->tasks[taskctl->now]->sel);
}
}
return;
}
|
/* Copyright (c) 2014 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.
*/
//
// GTLGmail.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Gmail API (gmail/v1)
// Description:
// The Gmail REST API.
// Documentation:
// https://developers.google.com/gmail/api/
#import "GTLGmailConstants.h"
#import "GTLGmailDraft.h"
#import "GTLGmailHistory.h"
#import "GTLGmailLabel.h"
#import "GTLGmailListDraftsResponse.h"
#import "GTLGmailListHistoryResponse.h"
#import "GTLGmailListLabelsResponse.h"
#import "GTLGmailListMessagesResponse.h"
#import "GTLGmailListThreadsResponse.h"
#import "GTLGmailMessage.h"
#import "GTLGmailMessagePart.h"
#import "GTLGmailMessagePartBody.h"
#import "GTLGmailMessagePartHeader.h"
#import "GTLGmailProfile.h"
#import "GTLGmailThread.h"
#import "GTLQueryGmail.h"
#import "GTLServiceGmail.h"
|
#include "include/docksys.h"
#include "i3_docking.h"
#include <stdlib.h>
#include <stdbool.h>
#include <pd_common.h>
#include <pd_docking.h>
struct DummyData {
int data;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void* create_instance(int x, int y, int width, int height) {
docksys_create(x, y, width, height);
return malloc(sizeof(struct DummyData));
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void destroy_instance(void* data) {
free(data);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void* get_dock_at(int x, int y) {
return 0;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void set_callbacks(void* instance, PDDockingCallbacks* callbacks) {
(void)instance;
(void)callbacks;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void save_state(void* instance, const char* filename) {
(void)instance;
(void)filename;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void load_state(void* instance, const char* filename) {
(void)instance;
(void)filename;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void update(void* instance) {
(void)instance;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void set_mouse(void* instance, void* user_data, float x, float y, bool left_down) {
(void)instance;
(void)user_data;
(void)x;
(void)y;
(void)left_down;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void split(void* instance, void* user_data, PDDockingSplitDir dir, PDDockHandle handle) {
(void)instance;
(void)user_data;
(void)dir;
(void)handle;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static PD_EXPORT PDDocking plugin = {
"i3_docking_system",
create_instance,
destroy_instance,
get_dock_at,
docksys_set_callbacks,
split,
//docksys_horizontal_split,
//docksys_vertical_split,
docksys_close_con,
docksys_update_size,
docksys_set_mouse,
save_state,
load_state,
update,
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PD_EXPORT void InitPlugin(RegisterPlugin* registerPlugin, void* private_data) {
registerPlugin(PD_DOCKING_API_VERSION, &plugin, private_data);
}
|
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Jasper Blues & Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
@interface TyphoonInjectedObject : NSObject
@end
@protocol TyphoonInjectedProtocol
@end |
/*-----------------------------------------------------------------------
/ Low level disk interface modlue include file (C)ChaN, 2010
/-----------------------------------------------------------------------*/
#ifndef _DISKIO
#define _READONLY 0 /* 1: Remove write functions */
#define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
#include "integer.h"
/* Status of Disk Functions */
typedef BYTE DSTATUS;
/* Results of Disk Functions */
typedef enum {
RES_OK = 0, /* 0: Successful */
RES_ERROR, /* 1: R/W Error */
RES_WRPRT, /* 2: Write Protected */
RES_NOTRDY, /* 3: Not Ready */
RES_PARERR /* 4: Invalid Parameter */
} DRESULT;
/*---------------------------------------*/
/* Prototypes for disk control functions */
int assign_drives (int, int);
DSTATUS disk_initialize (BYTE);
DSTATUS disk_status (BYTE);
DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
#if _READONLY == 0
DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
#endif
DRESULT disk_ioctl (BYTE, BYTE, void*);
/* Disk Status Bits (DSTATUS) */
#define STA_NOINIT 0x01 /* Drive not initialized */
#define STA_NODISK 0x02 /* No medium in the drive */
#define STA_PROTECT 0x04 /* Write protected */
/* Card type flags (CardType) */
#define CT_MMC 0x01
#define CT_SD1 0x02
#define CT_SD2 0x04
#define CT_SDC (CT_SD1|CT_SD2)
#define CT_BLOCK 0x08
/* Command code for disk_ioctrl fucntion */
/* Generic command (defined for FatFs) */
#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
/* Generic command */
#define CTRL_POWER 5 /* Get/Set power status */
#define CTRL_LOCK 6 /* Lock/Unlock media removal */
#define CTRL_EJECT 7 /* Eject media */
/* MMC/SDC specific ioctl command */
#define MMC_GET_TYPE 10 /* Get card type */
#define MMC_GET_CSD 11 /* Get CSD */
#define MMC_GET_CID 12 /* Get CID */
#define MMC_GET_OCR 13 /* Get OCR */
#define MMC_GET_SDSTAT 14 /* Get SD status */
/* ATA/CF specific ioctl command */
#define ATA_GET_REV 20 /* Get F/W revision */
#define ATA_GET_MODEL 21 /* Get model name */
#define ATA_GET_SN 22 /* Get serial number */
/* NAND specific ioctl command */
#define NAND_FORMAT 30 /* Create physical format */
#define _DISKIO
#endif
|
/*
The MIT License
Copyright (c) 2012 by Jorrit Tyberghein
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef __CEL_PF_GAMECONTROL__
#define __CEL_PF_GAMECONTROL__
#include "cstypes.h"
#include "iutil/comp.h"
#include "iutil/plugin.h"
#include "csutil/scf.h"
#include "physicallayer/propclas.h"
#include "physicallayer/propfact.h"
#include "physicallayer/facttmpl.h"
#include "propclass/dynworld.h"
#include "celtool/stdpcimp.h"
#include "celtool/stdparams.h"
#include "include/igamecontrol.h"
#include "tools/uitools/inventory.h"
struct iCelEntity;
struct iObjectRegistry;
struct iPcCamera;
struct iMouseDriver;
struct iGraphics3D;
struct iGraphics2D;
struct iPcDynamicWorld;
struct iPcDynamicMove;
struct iDynamicObject;
struct iFont;
struct iEngine;
struct iVirtualClock;
struct iPcInventory;
struct iPcMessenger;
class csSimplePixmap;
/**
* Factory for game controller.
*/
CEL_DECLARE_FACTORY (GameController)
enum DragType
{
DRAGTYPE_NORMAL = 0,
DRAGTYPE_ROTY
};
/**
* This is a game controller property class.
*/
class celPcGameController : public scfImplementationExt1<
celPcGameController, celPcCommon, iPcGameController>
{
private:
// For SendMessage parameters.
static csStringID id_name;
static csStringID id_template;
static csStringID id_factory;
static csStringID id_destination;
csRef<iGraphics3D> g3d;
csRef<iGraphics2D> g2d;
csRef<iVirtualClock> vc;
csRef<iEngine> engine;
csRef<iCelEntity> player;
csRef<iPcMessenger> messenger;
csRef<iUIInventory> uiInventory;
csRef<CS::Physics::iPhysicalSystem> dyn;
/// Find the object that is pointed at in the center of the screen.
iDynamicObject* FindCenterObject (CS::Physics::iRigidBody*& hitBody,
csVector3& start, csVector3& isect);
// For dragging.
csRef<iMouseDriver> mouse;
csRef<CS::Physics::iPhysicalSector> dynSys;
csRef<CS::Physics::iJoint> dragJoint;
float oldLinearDampening;
float oldAngularDampening;
float dragDistance; // Distance depends on type of dragging.
iDynamicObject* dragobj;
csVector3 dragOrigin;
csVector3 dragAnchor;
DragType dragType;
// Icons.
csSimplePixmap* iconCursor;
csSimplePixmap* iconEye;
csSimplePixmap* iconBook;
csSimplePixmap* iconDot;
csSimplePixmap* iconCheck;
void LoadIcons ();
// ID's
csStringID classNoteID;
csStringID classInfoID;
csStringID classPickUpID;
csStringID classNoActivate;
csStringID attrDragType;
csStringID msgActivate;
csRef<iPcDynamicWorld> dynworld;
void TryGetDynworld ();
csWeakRef<iPcCamera> pccamera;
csWeakRef<iPcDynamicMove> pcdynmove;
void TryGetCamera ();
void TryGetDynmove ();
bool FindPlayer ();
// For actions.
enum actionids
{
action_startdrag = 0,
action_stopdrag,
action_examine,
action_pickup,
action_activate,
action_spawn,
action_createentity,
action_inventory,
action_teleport,
};
// For properties.
//enum propids
//{
//propid_counter = 0,
//propid_max
//};
static PropertyHolder propinfo;
//csRef<iMessageDispatcher> dispatcher_print;
void PickUpDynObj (iDynamicObject* dynobj);
void FindSiblingPropertyClasses ();
public:
celPcGameController (iObjectRegistry* object_reg);
virtual ~celPcGameController ();
void SelectEntity (iCelEntity* entity, const char* command);
void SelectTemplate (iCelEntityTemplate* tpl, const char* command);
iPcDynamicWorld* GetDynWorld () { TryGetDynworld (); return dynworld; }
virtual void Examine ();
virtual bool StartDrag ();
virtual void StopDrag ();
virtual void PickUp ();
virtual void Activate ();
virtual void Inventory ();
virtual void Spawn (const char* factname);
virtual void CreateEntity (const char* tmpname, const char* name);
virtual void Teleport (const char* entityname);
virtual bool PerformActionIndexed (int idx,
iCelParameterBlock* params, celData& ret);
virtual void TickEveryFrame ();
};
#endif // __CEL_PF_GAMECONTROL__
|
#include <linux/fs.h>
#include <linux/ext2_fs.h>
/*
* second extended file system inode data in memory
*/
struct ext2_inode_info {
__le32 i_data[15];
__u32 i_flags;
__u32 i_faddr;
__u8 i_frag_no;
__u8 i_frag_size;
__u16 i_state;
__u32 i_file_acl;
__u32 i_dir_acl;
__u32 i_dtime;
/*
* i_block_group is the number of the block group which contains
* this file's inode. Constant across the lifetime of the inode,
* it is ued for making block allocation decisions - we try to
* place a file's data blocks near its inode block, and new inodes
* near to their parent directory's inode.
*/
__u32 i_block_group;
/*
* i_next_alloc_block is the logical (file-relative) number of the
* most-recently-allocated block in this file. Yes, it is misnamed.
* We use this for detecting linearly ascending allocation requests.
*/
__u32 i_next_alloc_block;
/*
* i_next_alloc_goal is the *physical* companion to i_next_alloc_block.
* it the the physical block number of the block which was most-recently
* allocated to this file. This give us the goal (target) for the next
* allocation when we detect linearly ascending requests.
*/
__u32 i_next_alloc_goal;
__u32 i_prealloc_block;
__u32 i_prealloc_count;
__u32 i_dir_start_lookup;
#ifdef CONFIG_EXT2_FS_XATTR
/*
* Extended attributes can be read independently of the main file
* data. Taking i_sem even when reading would cause contention
* between readers of EAs and writers of regular file data, so
* instead we synchronize on xattr_sem when reading or changing
* EAs.
*/
struct rw_semaphore xattr_sem;
#endif
#ifdef CONFIG_EXT2_FS_POSIX_ACL
struct posix_acl *i_acl;
struct posix_acl *i_default_acl;
#endif
rwlock_t i_meta_lock;
struct inode vfs_inode;
};
/*
* Inode dynamic state flags
*/
#define EXT2_STATE_NEW 0x00000001 /* inode is newly created */
/*
* Function prototypes
*/
/*
* Ok, these declarations are also in <linux/kernel.h> but none of the
* ext2 source programs needs to include it so they are duplicated here.
*/
static inline struct ext2_inode_info *EXT2_I(struct inode *inode)
{
return container_of(inode, struct ext2_inode_info, vfs_inode);
}
/* balloc.c */
extern int ext2_bg_has_super(struct super_block *sb, int group);
extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group);
extern int ext2_new_block (struct inode *, unsigned long,
__u32 *, __u32 *, int *);
extern void ext2_free_blocks (struct inode *, unsigned long,
unsigned long);
extern unsigned long ext2_count_free_blocks (struct super_block *);
extern unsigned long ext2_count_dirs (struct super_block *);
extern void ext2_check_blocks_bitmap (struct super_block *);
extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
unsigned int block_group,
struct buffer_head ** bh);
/* dir.c */
extern int ext2_add_link (struct dentry *, struct inode *);
extern ino_t ext2_inode_by_name(struct inode *, struct dentry *);
extern int ext2_make_empty(struct inode *, struct inode *);
extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct dentry *, struct page **);
extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
extern int ext2_empty_dir (struct inode *);
extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *);
/* fsync.c */
extern int ext2_sync_file (struct file *, struct dentry *, int);
/* ialloc.c */
extern struct inode * ext2_new_inode (struct inode *, int);
extern void ext2_free_inode (struct inode *);
extern unsigned long ext2_count_free_inodes (struct super_block *);
extern void ext2_check_inodes_bitmap (struct super_block *);
extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
/* inode.c */
extern void ext2_read_inode (struct inode *);
extern int ext2_write_inode (struct inode *, int);
extern void ext2_put_inode (struct inode *);
extern void ext2_delete_inode (struct inode *);
extern int ext2_sync_inode (struct inode *);
extern void ext2_discard_prealloc (struct inode *);
extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
extern void ext2_truncate (struct inode *);
extern int ext2_setattr (struct dentry *, struct iattr *);
extern void ext2_set_inode_flags(struct inode *inode);
/* ioctl.c */
extern int ext2_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
/* super.c */
extern void ext2_error (struct super_block *, const char *, const char *, ...)
__attribute__ ((format (printf, 3, 4)));
extern void ext2_warning (struct super_block *, const char *, const char *, ...)
__attribute__ ((format (printf, 3, 4)));
extern void ext2_update_dynamic_rev (struct super_block *sb);
extern void ext2_write_super (struct super_block *);
/*
* Inodes and files operations
*/
/* dir.c */
extern struct file_operations ext2_dir_operations;
/* file.c */
extern struct inode_operations ext2_file_inode_operations;
extern struct file_operations ext2_file_operations;
/* inode.c */
extern struct address_space_operations ext2_aops;
extern struct address_space_operations ext2_nobh_aops;
/* namei.c */
extern struct inode_operations ext2_dir_inode_operations;
extern struct inode_operations ext2_special_inode_operations;
/* symlink.c */
extern struct inode_operations ext2_fast_symlink_inode_operations;
extern struct inode_operations ext2_symlink_inode_operations;
|
/*
* This file is part of the flashrom project.
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.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 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.
*/
#include <stdlib.h>
#include "flash.h"
#include "programmer.h"
#include "hwaccess_x86_io.h"
#include "platform/pci.h"
#define BIOS_ROM_ADDR 0x04
#define BIOS_ROM_DATA 0x08
#define INT_STATUS 0x0e
#define INTERNAL_CONFIG 0x00
#define SELECT_REG_WINDOW 0x800
#define PCI_VENDOR_ID_3COM 0x10b7
struct nic3com_data {
uint32_t io_base_addr;
uint32_t internal_conf;
uint16_t id;
};
static const struct dev_entry nics_3com[] = {
/* 3C90xB */
{0x10b7, 0x9055, OK, "3COM", "3C90xB: PCI 10/100 Mbps; shared 10BASE-T/100BASE-TX"},
{0x10b7, 0x9001, NT, "3COM", "3C90xB: PCI 10/100 Mbps; shared 10BASE-T/100BASE-T4" },
{0x10b7, 0x9004, OK, "3COM", "3C90xB: PCI 10BASE-T (TPO)" },
{0x10b7, 0x9005, NT, "3COM", "3C90xB: PCI 10BASE-T/10BASE2/AUI (COMBO)" },
{0x10b7, 0x9006, NT, "3COM", "3C90xB: PCI 10BASE-T/10BASE2 (TPC)" },
{0x10b7, 0x900a, NT, "3COM", "3C90xB: PCI 10BASE-FL" },
{0x10b7, 0x905a, NT, "3COM", "3C90xB: PCI 10BASE-FX" },
{0x10b7, 0x9058, OK, "3COM", "3C905B: Cyclone 10/100/BNC" },
/* 3C905C */
{0x10b7, 0x9200, OK, "3COM", "3C905C: EtherLink 10/100 PCI (TX)" },
/* 3C980C */
{0x10b7, 0x9805, NT, "3COM", "3C980C: EtherLink Server 10/100 PCI (TX)" },
{0},
};
static void nic3com_chip_writeb(const struct flashctx *flash, uint8_t val,
chipaddr addr)
{
struct nic3com_data *data = flash->mst->par.data;
OUTL((uint32_t)addr, data->io_base_addr + BIOS_ROM_ADDR);
OUTB(val, data->io_base_addr + BIOS_ROM_DATA);
}
static uint8_t nic3com_chip_readb(const struct flashctx *flash,
const chipaddr addr)
{
struct nic3com_data *data = flash->mst->par.data;
OUTL((uint32_t)addr, data->io_base_addr + BIOS_ROM_ADDR);
return INB(data->io_base_addr + BIOS_ROM_DATA);
}
static int nic3com_shutdown(void *par_data)
{
struct nic3com_data *data = par_data;
const uint16_t id = data->id;
/* 3COM 3C90xB cards need a special fixup. */
if (id == 0x9055 || id == 0x9001 || id == 0x9004 || id == 0x9005
|| id == 0x9006 || id == 0x900a || id == 0x905a || id == 0x9058) {
/* Select register window 3 and restore the receiver status. */
OUTW(SELECT_REG_WINDOW + 3, data->io_base_addr + INT_STATUS);
OUTL(data->internal_conf, data->io_base_addr + INTERNAL_CONFIG);
}
free(data);
return 0;
}
static const struct par_master par_master_nic3com = {
.chip_readb = nic3com_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
.chip_readn = fallback_chip_readn,
.chip_writeb = nic3com_chip_writeb,
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
.shutdown = nic3com_shutdown,
};
static int nic3com_init(void)
{
struct pci_dev *dev = NULL;
uint32_t io_base_addr = 0;
uint32_t internal_conf = 0;
uint16_t id;
if (rget_io_perms())
return 1;
dev = pcidev_init(nics_3com, PCI_BASE_ADDRESS_0);
if (!dev)
return 1;
io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
if (!io_base_addr)
return 1;
id = dev->device_id;
/* 3COM 3C90xB cards need a special fixup. */
if (id == 0x9055 || id == 0x9001 || id == 0x9004 || id == 0x9005
|| id == 0x9006 || id == 0x900a || id == 0x905a || id == 0x9058) {
/* Select register window 3 and save the receiver status. */
OUTW(SELECT_REG_WINDOW + 3, io_base_addr + INT_STATUS);
internal_conf = INL(io_base_addr + INTERNAL_CONFIG);
/* Set receiver type to MII for full BIOS ROM access. */
OUTL((internal_conf & 0xf00fffff) | 0x00600000, io_base_addr);
}
/*
* The lowest 16 bytes of the I/O mapped register space of (most) 3COM
* cards form a 'register window' into one of multiple (usually 8)
* register banks. For 3C90xB/3C90xC we need register window/bank 0.
*/
OUTW(SELECT_REG_WINDOW + 0, io_base_addr + INT_STATUS);
struct nic3com_data *data = calloc(1, sizeof(*data));
if (!data) {
msg_perr("Unable to allocate space for PAR master data\n");
goto init_err_cleanup_exit;
}
data->io_base_addr = io_base_addr;
data->internal_conf = internal_conf;
data->id = id;
max_rom_decode.parallel = 128 * 1024;
return register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
init_err_cleanup_exit:
/* 3COM 3C90xB cards need a special fixup. */
if (id == 0x9055 || id == 0x9001 || id == 0x9004 || id == 0x9005
|| id == 0x9006 || id == 0x900a || id == 0x905a || id == 0x9058) {
/* Select register window 3 and restore the receiver status. */
OUTW(SELECT_REG_WINDOW + 3, io_base_addr + INT_STATUS);
OUTL(internal_conf, io_base_addr + INTERNAL_CONFIG);
}
return 1;
}
const struct programmer_entry programmer_nic3com = {
.name = "nic3com",
.type = PCI,
.devs.dev = nics_3com,
.init = nic3com_init,
.map_flash_region = fallback_map,
.unmap_flash_region = fallback_unmap,
.delay = internal_delay,
};
|
#ifndef __CMD_MANAGER_H__
#define __CMD_MANAGER_H__
#include <stdio.h>
#include "cmd_gpsim.h"
#include "gpsim_interface.h"
#include <vector>
#include <string>
#include <functional>
using namespace std;
class CommandHandlerKey : public ICommandHandler {
public:
CommandHandlerKey(const char *name) {
m_name = name;
}
virtual const char *GetName(void) {return m_name; }
virtual int Execute(const char * commandline, ISimConsole *out) {
return CMD_ERR_COMMANDNOTDEFINED;}
virtual int ExecuteScript(list<string *> &script, ISimConsole *out)
{ return CMD_ERR_ERROR;}
const char * m_name;
};
class CCommandManager {
public:
CCommandManager();
int Register(ICommandHandler * ch);
int Execute(string &sName, const char *cmdline);
static CCommandManager m_CommandManger;
static CCommandManager &GetManager();
ICommandHandler * find(const char *name);
ISimConsole &GetConsole() {
return GetUserInterface().GetConsole();
}
void ListToConsole();
private:
struct lessThan : binary_function<ICommandHandler*, ICommandHandler*, bool> {
bool operator()(const ICommandHandler* left, const ICommandHandler* right) const {
return strcmp(((ICommandHandler*)left)->GetName(),
((ICommandHandler*)right)->GetName()) < 0;
}
};
typedef vector<ICommandHandler*> List;
List m_HandlerList;
};
#endif
|
#ifndef _EXPRESSIONPARSER_H_
#define _EXPRESSIONPARSER_H_
#include <string>
#include "Device.h"
namespace ciface
{
namespace ExpressionParser
{
class ControlQualifier
{
public:
bool has_device;
Core::DeviceQualifier device_qualifier;
std::string control_name;
ControlQualifier() : has_device(false) {}
operator std::string()
{
if (has_device)
return device_qualifier.ToString() + ":" + control_name;
else
return control_name;
}
};
class ControlFinder
{
public:
ControlFinder(const Core::DeviceContainer &container_, const Core::DeviceQualifier &default_, const bool is_input_) : container(container_), default_device(default_), is_input(is_input_) {}
Core::Device::Control *FindControl(ControlQualifier qualifier);
private:
Core::Device *FindDevice(ControlQualifier qualifier);
const Core::DeviceContainer &container;
const Core::DeviceQualifier &default_device;
bool is_input;
};
class ExpressionNode;
class Expression
{
public:
Expression() : node(NULL) {}
Expression(ExpressionNode *node);
~Expression();
ControlState GetValue();
void SetValue (ControlState state);
int num_controls;
ExpressionNode *node;
};
enum ExpressionParseStatus
{
EXPRESSION_PARSE_SUCCESS = 0,
EXPRESSION_PARSE_SYNTAX_ERROR,
EXPRESSION_PARSE_NO_DEVICE,
};
ExpressionParseStatus ParseExpression(std::string expr, ControlFinder &finder, Expression **expr_out);
}
}
#endif
|
/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
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/>. */
#ifndef _SEMAPHORE_H
# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
#endif
#define __SIZEOF_SEM_T 16
/* Value returned if `sem_open' failed. */
#define SEM_FAILED ((sem_t *) 0)
typedef union
{
char __size[__SIZEOF_SEM_T];
long int __align;
} sem_t;
|
#ifndef _KD_CAMERA_HW_H_
#define _KD_CAMERA_HW_H_
#include <mach/mt_gpio.h>
#ifdef MTK_MT6306_SUPPORT
#include <mach/dcl_sim_gpio.h>
#endif
#include <mach/mt_pm_ldo.h>
#include "pmic_drv.h"
//
//Analog
#define CAMERA_POWER_VCAM_A PMIC_APP_MAIN_CAMERA_POWER_A
#define SUB_CAMERA_POWER_VCAM_A PMIC_APP_SUB_CAMERA_POWER_A
//Digital
#define CAMERA_POWER_VCAM_D PMIC_APP_MAIN_CAMERA_POWER_D
#define SUB_CAMERA_POWER_VCAM_D PMIC_APP_SUB_CAMERA_POWER_D
//digital io
#define CAMERA_POWER_VCAM_IO PMIC_APP_MAIN_CAMERA_POWER_IO
#define SUB_CAMERA_POWER_VCAM_IO PMIC_APP_SUB_CAMERA_POWER_IO
//AF
#define CAMERA_POWER_VCAM_AF PMIC_APP_MAIN_CAMERA_POWER_AF
//FIXME, should defined in DCT tool
//Main sensor
#define CAMERA_CMRST_PIN GPIO_CAMERA_CMRST_PIN
#define CAMERA_CMRST_PIN_M_GPIO GPIO_CAMERA_CMRST_PIN_M_GPIO
#define CAMERA_CMPDN_PIN GPIO_CAMERA_CMPDN_PIN
#define CAMERA_CMPDN_PIN_M_GPIO GPIO_CAMERA_CMPDN_PIN_M_GPIO
//FRONT sensor
#define CAMERA_CMRST1_PIN GPIO_CAMERA_CMRST1_PIN
#define CAMERA_CMRST1_PIN_M_GPIO GPIO_CAMERA_CMRST1_PIN_M_GPIO
#define CAMERA_CMPDN1_PIN GPIO_CAMERA_CMPDN1_PIN
#define CAMERA_CMPDN1_PIN_M_GPIO GPIO_CAMERA_CMPDN1_PIN_M_GPIO
// Define I2C Bus Num
#define SUPPORT_I2C_BUS_NUM1 0
#define SUPPORT_I2C_BUS_NUM2 0
typedef enum{
VDD_None,
PDN,
RST,
SensorMCLK,
AVDD = CAMERA_POWER_VCAM_A,
DVDD = CAMERA_POWER_VCAM_D,
DOVDD = CAMERA_POWER_VCAM_IO,
AFVDD = CAMERA_POWER_VCAM_AF
}PowerType;
typedef enum{
Vol_Low =0,
Vol_High=1,
Vol_900 = VOL_0900,
Vol_1000 = VOL_1000,
Vol_1100 = VOL_1100,
Vol_1200 = VOL_1200,
Vol_1300 = VOL_1300,
Vol_1350 = VOL_1350,
Vol_1500 = VOL_1500,
Vol_1800 = VOL_1800,
Vol_2000 = VOL_2000,
Vol_2100 = VOL_2100,
Vol_2500 = VOL_2500,
Vol_2800 = VOL_2800,
Vol_3000 = VOL_3000,
Vol_3300 = VOL_3300,
Vol_3400 = VOL_3400,
Vol_3500 = VOL_3500,
Vol_3600 = VOL_3600
}Voltage;
typedef struct{
PowerType PowerType;
Voltage Voltage;
u32 Delay;
}PowerInformation;
typedef struct{
char* SensorName;
PowerInformation PowerInfo[12];
}PowerSequence;
typedef struct{
PowerSequence PowerSeq[16];
}PowerUp;
typedef struct{
u32 Gpio_Pin;
u32 Gpio_Mode;
Voltage Voltage;
}PowerCustInfo;
typedef struct{
PowerCustInfo PowerCustInfo[6];
}PowerCust;
#endif
|
/* Copyright (C) 1991-2017 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 <unistd.h>
/* Set the name of the current host to NAME, which is LEN bytes long.
This call is restricted to the super-user. */
int
sethostname (const char *name, size_t len)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (sethostname)
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007-2009 coresystems GmbH
* Copyright (C) 2014 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.
*/
#include <types.h>
#include <string.h>
#include <smbios.h>
#include <device/device.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <pc80/mc146818rtc.h>
#include <arch/acpi.h>
#include <arch/io.h>
#include <arch/interrupt.h>
#include <boot/coreboot_tables.h>
#include "onboard.h"
void mainboard_suspend_resume(void)
{
/* Call SMM finalize() handlers before resume */
outb(0xcb, 0xb2);
}
static void mainboard_init(device_t dev)
{
lan_init();
}
// mainboard_enable is executed as first thing after
// enumerate_buses().
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
}
struct chip_operations mainboard_ops = {
.enable_dev = mainboard_enable,
};
|
#ifndef __NET_RTNETLINK_H
#define __NET_RTNETLINK_H
#include <linux/rtnetlink.h>
#include <net/netlink.h>
typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *);
typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
int __rtnl_register(int protocol, int msgtype,
rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func);
void rtnl_register(int protocol, int msgtype,
rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func);
int rtnl_unregister(int protocol, int msgtype);
void rtnl_unregister_all(int protocol);
static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
{
if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family;
else
return AF_UNSPEC;
}
/**
* struct rtnl_link_ops - rtnetlink link operations
*
* @list: Used internally
* @kind: Identifier
* @maxtype: Highest device specific netlink attribute number
* @policy: Netlink policy for device specific attribute validation
* @validate: Optional validation function for netlink/changelink parameters
* @priv_size: sizeof net_device private space
* @setup: net_device setup function
* @newlink: Function for configuring and registering a new device
* @changelink: Function for changing parameters of an existing device
* @dellink: Function to remove a device
* @get_size: Function to calculate required room for dumping device
* specific netlink attributes
* @fill_info: Function to dump device specific netlink attributes
* @get_xstats_size: Function to calculate required room for dumping device
* specific statistics
* @fill_xstats: Function to dump device specific statistics
* @get_num_tx_queues: Function to determine number of transmit queues
* to create when creating a new device.
* @get_num_rx_queues: Function to determine number of receive queues
* to create when creating a new device.
*/
struct rtnl_link_ops {
struct list_head list;
const char *kind;
size_t priv_size;
void (*setup)(struct net_device *dev);
int maxtype;
const struct nla_policy *policy;
int (*validate)(struct nlattr *tb[],
struct nlattr *data[]);
int (*newlink)(struct net *src_net,
struct net_device *dev,
struct nlattr *tb[],
struct nlattr *data[]);
int (*changelink)(struct net_device *dev,
struct nlattr *tb[],
struct nlattr *data[]);
void (*dellink)(struct net_device *dev,
struct list_head *head);
size_t (*get_size)(const struct net_device *dev);
int (*fill_info)(struct sk_buff *skb,
const struct net_device *dev);
size_t (*get_xstats_size)(const struct net_device *dev);
int (*fill_xstats)(struct sk_buff *skb,
const struct net_device *dev);
unsigned int (*get_num_tx_queues)(void);
unsigned int (*get_num_rx_queues)(void);
int slave_maxtype;
const struct nla_policy *slave_policy;
int (*slave_validate)(struct nlattr *tb[],
struct nlattr *data[]);
int (*slave_changelink)(struct net_device *dev,
struct net_device *slave_dev,
struct nlattr *tb[],
struct nlattr *data[]);
size_t (*get_slave_size)(const struct net_device *dev,
const struct net_device *slave_dev);
int (*fill_slave_info)(struct sk_buff *skb,
const struct net_device *dev,
const struct net_device *slave_dev);
} __do_const;
int __rtnl_link_register(struct rtnl_link_ops *ops);
void __rtnl_link_unregister(struct rtnl_link_ops *ops);
int rtnl_link_register(struct rtnl_link_ops *ops);
void rtnl_link_unregister(struct rtnl_link_ops *ops);
/**
* struct rtnl_af_ops - rtnetlink address family operations
*
* @list: Used internally
* @family: Address family
* @fill_link_af: Function to fill IFLA_AF_SPEC with address family
* specific netlink attributes.
* @get_link_af_size: Function to calculate size of address family specific
* netlink attributes.
* @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr
* for invalid configuration settings.
* @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify
* net_device accordingly.
*/
struct rtnl_af_ops {
struct list_head list;
int family;
int (*fill_link_af)(struct sk_buff *skb,
const struct net_device *dev);
size_t (*get_link_af_size)(const struct net_device *dev);
int (*validate_link_af)(const struct net_device *dev,
const struct nlattr *attr);
int (*set_link_af)(struct net_device *dev,
const struct nlattr *attr);
};
void __rtnl_af_unregister(struct rtnl_af_ops *ops);
void rtnl_af_register(struct rtnl_af_ops *ops);
void rtnl_af_unregister(struct rtnl_af_ops *ops);
struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
struct net_device *rtnl_create_link(struct net *net, char *ifname,
const struct rtnl_link_ops *ops,
struct nlattr *tb[]);
int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm);
extern const struct nla_policy ifla_policy[IFLA_MAX+1];
#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind)
#endif
|
/*
* Copyright (C) 2002-2011 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DOSBOX_MEM_H
#define DOSBOX_MEM_H
#ifndef DOSBOX_DOSBOX_H
#include "dosbox.h"
#endif
typedef Bit32u PhysPt;
typedef Bit8u * HostPt;
typedef Bit32u RealPt;
typedef Bit32s MemHandle;
#define MEM_PAGESIZE 4096
extern HostPt MemBase;
HostPt GetMemBase(void);
bool MEM_A20_Enabled(void);
void MEM_A20_Enable(bool enable);
/* Memory management / EMS mapping */
HostPt MEM_GetBlockPage(void);
Bitu MEM_FreeTotal(void); //Free 4 kb pages
Bitu MEM_FreeLargest(void); //Largest free 4 kb pages block
Bitu MEM_TotalPages(void); //Total amount of 4 kb pages
Bitu MEM_AllocatedPages(MemHandle handle); // amount of allocated pages of handle
MemHandle MEM_AllocatePages(Bitu pages,bool sequence);
MemHandle MEM_GetNextFreePage(void);
PhysPt MEM_AllocatePage(void);
void MEM_ReleasePages(MemHandle handle);
bool MEM_ReAllocatePages(MemHandle & handle,Bitu pages,bool sequence);
MemHandle MEM_NextHandle(MemHandle handle);
MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
/*
The folowing six functions are used everywhere in the end so these should be changed for
Working on big or little endian machines
*/
#if defined(WORDS_BIGENDIAN) || !defined(C_UNALIGNED_MEMORY)
static INLINE Bit8u host_readb(HostPt off) {
return off[0];
}
static INLINE Bit16u host_readw(HostPt off) {
return off[0] | (off[1] << 8);
}
static INLINE Bit32u host_readd(HostPt off) {
return off[0] | (off[1] << 8) | (off[2] << 16) | (off[3] << 24);
}
static INLINE void host_writeb(HostPt off,Bit8u val) {
off[0]=val;
}
static INLINE void host_writew(HostPt off,Bit16u val) {
off[0]=(Bit8u)(val);
off[1]=(Bit8u)(val >> 8);
}
static INLINE void host_writed(HostPt off,Bit32u val) {
off[0]=(Bit8u)(val);
off[1]=(Bit8u)(val >> 8);
off[2]=(Bit8u)(val >> 16);
off[3]=(Bit8u)(val >> 24);
}
#else
static INLINE Bit8u host_readb(HostPt off) {
return *(Bit8u *)off;
}
static INLINE Bit16u host_readw(HostPt off) {
return *(Bit16u *)off;
}
static INLINE Bit32u host_readd(HostPt off) {
return *(Bit32u *)off;
}
static INLINE void host_writeb(HostPt off,Bit8u val) {
*(Bit8u *)(off)=val;
}
static INLINE void host_writew(HostPt off,Bit16u val) {
*(Bit16u *)(off)=val;
}
static INLINE void host_writed(HostPt off,Bit32u val) {
*(Bit32u *)(off)=val;
}
#endif
static INLINE void var_write(Bit8u * var, Bit8u val) {
host_writeb((HostPt)var, val);
}
static INLINE void var_write(Bit16u * var, Bit16u val) {
host_writew((HostPt)var, val);
}
static INLINE void var_write(Bit32u * var, Bit32u val) {
host_writed((HostPt)var, val);
}
/* The Folowing six functions are slower but they recognize the paged memory system */
Bit8u mem_readb(PhysPt pt);
Bit16u mem_readw(PhysPt pt);
Bit32u mem_readd(PhysPt pt);
void mem_writeb(PhysPt pt,Bit8u val);
void mem_writew(PhysPt pt,Bit16u val);
void mem_writed(PhysPt pt,Bit32u val);
static INLINE void phys_writeb(PhysPt addr,Bit8u val) {
host_writeb(MemBase+addr,val);
}
static INLINE void phys_writew(PhysPt addr,Bit16u val){
host_writew(MemBase+addr,val);
}
static INLINE void phys_writed(PhysPt addr,Bit32u val){
host_writed(MemBase+addr,val);
}
static INLINE Bit8u phys_readb(PhysPt addr) {
return host_readb(MemBase+addr);
}
static INLINE Bit16u phys_readw(PhysPt addr){
return host_readw(MemBase+addr);
}
static INLINE Bit32u phys_readd(PhysPt addr){
return host_readd(MemBase+addr);
}
/* These don't check for alignment, better be sure it's correct */
void MEM_BlockWrite(PhysPt pt,void const * const data,Bitu size);
void MEM_BlockRead(PhysPt pt,void * data,Bitu size);
void MEM_BlockCopy(PhysPt dest,PhysPt src,Bitu size);
void MEM_StrCopy(PhysPt pt,char * data,Bitu size);
void mem_memcpy(PhysPt dest,PhysPt src,Bitu size);
Bitu mem_strlen(PhysPt pt);
void mem_strcpy(PhysPt dest,PhysPt src);
/* The folowing functions are all shortcuts to the above functions using physical addressing */
static INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
return mem_readb((seg<<4)+off);
}
static INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
return mem_readw((seg<<4)+off);
}
static INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
return mem_readd((seg<<4)+off);
}
static INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
mem_writeb(((seg<<4)+off),val);
}
static INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
mem_writew(((seg<<4)+off),val);
}
static INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
mem_writed(((seg<<4)+off),val);
}
static INLINE Bit16u RealSeg(RealPt pt) {
return (Bit16u)(pt>>16);
}
static INLINE Bit16u RealOff(RealPt pt) {
return (Bit16u)(pt&0xffff);
}
static INLINE PhysPt Real2Phys(RealPt pt) {
return (RealSeg(pt)<<4) +RealOff(pt);
}
static INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
return (seg<<4)+off;
}
static INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
return (seg<<16)+off;
}
static INLINE void RealSetVec(Bit8u vec,RealPt pt) {
mem_writed(vec<<2,pt);
}
static INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
old = mem_readd(vec<<2);
mem_writed(vec<<2,pt);
}
static INLINE RealPt RealGetVec(Bit8u vec) {
return mem_readd(vec<<2);
}
#endif
|
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2" } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%ymm\[0-9\]\[^\{\]" 2 } } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%xmm\[0-9\]\[^\{\]" 2 } } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
/* { dg-final { scan-assembler-times "vpermilpd\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
#include <immintrin.h>
volatile __m256d y;
volatile __m256i c;
volatile __m128d x;
volatile __m128i k;
volatile __mmask8 m;
void extern
avx512vl_test (void)
{
y = _mm256_mask_permutevar_pd (y, m, y, c);
y = _mm256_maskz_permutevar_pd (m, y, c);
x = _mm_mask_permutevar_pd (x, m, x, k);
x = _mm_maskz_permutevar_pd (m, x, k);
}
|
/*
* \brief Client-side CAP session interface
* \author Norman Feske
* \date 2006-07-10
*/
/*
* Copyright (C) 2006-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__CAP_SESSION__CLIENT_H_
#define _INCLUDE__CAP_SESSION__CLIENT_H_
#include <cap_session/capability.h>
#include <cap_session/cap_session.h>
#include <base/rpc_client.h>
namespace Genode {
struct Cap_session_client : Rpc_client<Cap_session>
{
explicit Cap_session_client(Cap_session_capability session)
: Rpc_client<Cap_session>(session) { }
Native_capability alloc(Native_capability ep) {
return call<Rpc_alloc>(ep); }
void free(Native_capability cap) { call<Rpc_free>(cap); }
};
}
#endif /* _INCLUDE__CAP_SESSION__CLIENT_H_ */
|
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/apt/apt.h"
namespace Service {
namespace APT {
// Application and title launching service. These services handle signaling for home/power button as
// well. Only one session for either APT service can be open at a time, normally processes close the
// service handle immediately once finished using the service. The commands for APT:U and APT:S are
// exactly the same, however certain commands are only accessible with APT:S(NS module will call
// svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services.
/// Interface to "APT:U" service
class APT_U final : public Module::Interface {
public:
explicit APT_U(std::shared_ptr<Module> apt);
};
} // namespace APT
} // namespace Service
|
#ifndef __ASM_MPSPEC_H
#define __ASM_MPSPEC_H
/*
* Structure definitions for SMP machines following the
* Intel Multiprocessing Specification 1.1 and 1.4.
*/
/*
* This tag identifies where the SMP configuration
* information is.
*/
#define SMP_MAGIC_IDENT (('_'<<24)|('P'<<16)|('M'<<8)|'_')
/*
* a maximum of 16 APICs with the current APIC ID architecture.
* xAPICs can have up to 256. SAPICs have 16 ID bits.
*/
#ifdef CONFIG_X86_CLUSTERED_APIC
#define MAX_APICS 256
#else
#define MAX_APICS 16
#endif
#define MAX_MPC_ENTRY 1024
struct intel_mp_floating
{
char mpf_signature[4]; /* "_MP_" */
unsigned long mpf_physptr; /* Configuration table address */
unsigned char mpf_length; /* Our length (paragraphs) */
unsigned char mpf_specification;/* Specification version */
unsigned char mpf_checksum; /* Checksum (makes sum 0) */
unsigned char mpf_feature1; /* Standard or configuration ? */
unsigned char mpf_feature2; /* Bit7 set for IMCR|PIC */
unsigned char mpf_feature3; /* Unused (0) */
unsigned char mpf_feature4; /* Unused (0) */
unsigned char mpf_feature5; /* Unused (0) */
};
struct mp_config_table
{
char mpc_signature[4];
#define MPC_SIGNATURE "PCMP"
unsigned short mpc_length; /* Size of table */
char mpc_spec; /* 0x01 */
char mpc_checksum;
char mpc_oem[8];
char mpc_productid[12];
unsigned long mpc_oemptr; /* 0 if not present */
unsigned short mpc_oemsize; /* 0 if not present */
unsigned short mpc_oemcount;
unsigned long mpc_lapic; /* APIC address */
unsigned long reserved;
};
/* Followed by entries */
#define MP_PROCESSOR 0
#define MP_BUS 1
#define MP_IOAPIC 2
#define MP_INTSRC 3
#define MP_LINTSRC 4
#define MP_TRANSLATION 192 /* Used by IBM NUMA-Q to describe node locality */
struct mpc_config_processor
{
unsigned char mpc_type;
unsigned char mpc_apicid; /* Local APIC number */
unsigned char mpc_apicver; /* Its versions */
unsigned char mpc_cpuflag;
#define CPU_ENABLED 1 /* Processor is available */
#define CPU_BOOTPROCESSOR 2 /* Processor is the BP */
unsigned long mpc_cpufeature;
#define CPU_STEPPING_MASK 0x0F
#define CPU_MODEL_MASK 0xF0
#define CPU_FAMILY_MASK 0xF00
unsigned long mpc_featureflag; /* CPUID feature value */
unsigned long mpc_reserved[2];
};
struct mpc_config_bus
{
unsigned char mpc_type;
unsigned char mpc_busid;
unsigned char mpc_bustype[6];
};
/* List of Bus Type string values, Intel MP Spec. */
#define BUSTYPE_EISA "EISA"
#define BUSTYPE_ISA "ISA"
#define BUSTYPE_INTERN "INTERN" /* Internal BUS */
#define BUSTYPE_MCA "MCA"
#define BUSTYPE_VL "VL" /* Local bus */
#define BUSTYPE_PCI "PCI"
#define BUSTYPE_PCMCIA "PCMCIA"
#define BUSTYPE_CBUS "CBUS"
#define BUSTYPE_CBUSII "CBUSII"
#define BUSTYPE_FUTURE "FUTURE"
#define BUSTYPE_MBI "MBI"
#define BUSTYPE_MBII "MBII"
#define BUSTYPE_MPI "MPI"
#define BUSTYPE_MPSA "MPSA"
#define BUSTYPE_NUBUS "NUBUS"
#define BUSTYPE_TC "TC"
#define BUSTYPE_VME "VME"
#define BUSTYPE_XPRESS "XPRESS"
struct mpc_config_ioapic
{
unsigned char mpc_type;
unsigned char mpc_apicid;
unsigned char mpc_apicver;
unsigned char mpc_flags;
#define MPC_APIC_USABLE 0x01
unsigned long mpc_apicaddr;
};
struct mpc_config_intsrc
{
unsigned char mpc_type;
unsigned char mpc_irqtype;
unsigned short mpc_irqflag;
unsigned char mpc_srcbus;
unsigned char mpc_srcbusirq;
unsigned char mpc_dstapic;
unsigned char mpc_dstirq;
};
enum mp_irq_source_types {
mp_INT = 0,
mp_NMI = 1,
mp_SMI = 2,
mp_ExtINT = 3
};
#define MP_IRQDIR_DEFAULT 0
#define MP_IRQDIR_HIGH 1
#define MP_IRQDIR_LOW 3
struct mpc_config_lintsrc
{
unsigned char mpc_type;
unsigned char mpc_irqtype;
unsigned short mpc_irqflag;
unsigned char mpc_srcbusid;
unsigned char mpc_srcbusirq;
unsigned char mpc_destapic;
#define MP_APIC_ALL 0xFF
unsigned char mpc_destapiclint;
};
struct mp_config_oemtable
{
char oem_signature[4];
#define MPC_OEM_SIGNATURE "_OEM"
unsigned short oem_length; /* Size of table */
char oem_rev; /* 0x01 */
char oem_checksum;
char mpc_oem[8];
};
struct mpc_config_translation
{
unsigned char mpc_type;
unsigned char trans_len;
unsigned char trans_type;
unsigned char trans_quad;
unsigned char trans_global;
unsigned char trans_local;
unsigned short trans_reserved;
};
/*
* Default configurations
*
* 1 2 CPU ISA 82489DX
* 2 2 CPU EISA 82489DX neither IRQ 0 timer nor IRQ 13 DMA chaining
* 3 2 CPU EISA 82489DX
* 4 2 CPU MCA 82489DX
* 5 2 CPU ISA+PCI
* 6 2 CPU EISA+PCI
* 7 2 CPU MCA+PCI
*/
#ifdef CONFIG_MULTIQUAD
#define MAX_IRQ_SOURCES 512
#else /* !CONFIG_MULTIQUAD */
#define MAX_IRQ_SOURCES 256
#endif /* CONFIG_MULTIQUAD */
#define MAX_MP_BUSSES 32
enum mp_bustype {
MP_BUS_ISA = 1,
MP_BUS_EISA,
MP_BUS_PCI,
MP_BUS_MCA
};
extern int *mp_bus_id_to_type;
extern int *mp_bus_id_to_node;
extern int *mp_bus_id_to_local;
extern int *mp_bus_id_to_pci_bus;
extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
extern unsigned int boot_cpu_physical_apicid;
extern unsigned long phys_cpu_present_map;
extern int smp_found_config;
extern void find_smp_config (void);
extern void get_smp_config (void);
extern int nr_ioapics;
extern int apic_version [MAX_APICS];
extern int mp_irq_entries;
extern struct mpc_config_intsrc *mp_irqs;
extern int mpc_default_type;
extern int mp_current_pci_id;
extern unsigned long mp_lapic_addr;
extern int pic_mode;
extern int using_apic_timer;
#ifdef CONFIG_ACPI_BOOT
extern void mp_register_lapic (u8 id, u8 enabled);
extern void mp_register_lapic_address (u64 address);
#ifdef CONFIG_X86_IO_APIC
extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
extern void mp_config_acpi_legacy_irqs (void);
extern void mp_parse_prt (void);
extern int mp_irqs_alloc(void);
#endif /*!CONFIG_X86_IO_APIC*/
#endif /*CONFIG_ACPI_BOOT*/
#endif
|
/*
* fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
*
* Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
* Copyright (C) 2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
*
* 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/init.h>
#include <linux/pci.h>
#include <asm/vr41xx/tb0219.h>
int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = -1;
switch (slot) {
case 12:
vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN,
TRIGGER_LEVEL,
SIGNAL_THROUGH);
vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN,
LEVEL_LOW);
irq = TB0219_PCI_SLOT1_IRQ;
break;
case 13:
vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN,
TRIGGER_LEVEL,
SIGNAL_THROUGH);
vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN,
LEVEL_LOW);
irq = TB0219_PCI_SLOT2_IRQ;
break;
case 14:
vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN,
TRIGGER_LEVEL,
SIGNAL_THROUGH);
vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN,
LEVEL_LOW);
irq = TB0219_PCI_SLOT3_IRQ;
break;
default:
break;
}
return irq;
}
|
/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the QtScript module of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html. In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
#ifndef QSCRIPTABLE_P_H
#define QSCRIPTABLE_P_H
#include <QtCore/qobjectdefs.h>
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#if !defined(QT_NO_QOBJECT) && !defined(QT_NO_SCRIPT)
QT_BEGIN_NAMESPACE
class QScriptEngine;
class QScriptablePrivate
{
Q_DECLARE_PUBLIC(QScriptable)
public:
inline QScriptablePrivate()
: engine(0)
{ }
static inline QScriptablePrivate *get(QScriptable *q)
{ return q->d_func(); }
QScriptEngine *engine;
QScriptable *q_ptr;
};
QT_END_NAMESPACE
#endif // QT_NO_QOBJECT && QT_NO_SCRIPT
#endif
|
/*PGR-GNU*****************************************************************
File: testXYedges.c
Generated with Template by:
Copyright (c) 2015 pgRouting developers
Mail: project@pgrouting.org
Function's developer:
Copyright (c) 2015 Rohith Reddy
Mail:
------
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.
********************************************************************PGR-GNU*/
#include "c_common/postgres_connection.h"
#include "c_common/debug_macro.h"
#include "c_common/edges_input.h"
#include "./test_c_edges_driver.h"
PGDLLEXPORT Datum test_c_edges(PG_FUNCTION_ARGS);
static
void
process(char *edges_sql,
bool *result_bool) {
pgr_SPI_connect();
PGR_DBG("Load data");
pgr_edge_t *edges = NULL;
size_t total_edges = 0;
pgr_get_edges(edges_sql, &edges, &total_edges);
if (total_edges == 0) {
PGR_DBG("No edges found");
(*result_bool) = true;
pfree(edges);
pgr_SPI_finish();
return;
}
PGR_DBG("Total %ld tuples in query:", total_edges);
size_t i;
for (i = 0; i < total_edges; ++i) {
PGR_DBG("id = %li \t source = %li \t target = %ld cost = %lf reverse_cost = %lf",
edges[i].id, edges[i].source, edges[i].target, edges[i].cost, edges[i].reverse_cost);
/*PGR_DBG(" (x1,y1) = (%.32lf ,%.32lf) (x2,y2) = (%.32lf,.%.32lf)",
edges[i].x1, edges[i].y1, edges[i].x2, edges[i].y2);*/
}
PGR_DBG("Starting processing");
char *err_msg = NULL;
char *log_msg = NULL;
(*result_bool) = do_pgr_test_c_edges(
edges,
total_edges,
&log_msg,
&err_msg);
pfree(edges);
PGR_DBG("Returned log message = %s\n", log_msg);
if (log_msg) {
elog(DEBUG1, "%s", log_msg);
free(log_msg);
}
PGR_DBG("Returned error message = %s\n", err_msg);
if (err_msg) {
pgr_SPI_finish();
elog(ERROR, "%s", err_msg);
free(err_msg);
}
pgr_SPI_finish();
}
PG_FUNCTION_INFO_V1(test_c_edges);
PGDLLEXPORT Datum
test_c_edges(PG_FUNCTION_ARGS) {
bool result_bool = false;
process(
text_to_cstring(PG_GETARG_TEXT_P(0)),
&result_bool);
PG_RETURN_BOOL(result_bool);
}
|
/* arch/arm/mach-tcc92xx/tcc_display.c
*
* Copyright (C) 2010 Telechips, Inc.
*
* 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 <asm/mach/flash.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <asm/setup.h>
#include <mach/tccfb_ioctrl.h>
#define ATAG_TCC_DISPLAY 0x54434380 /* TCCp*/
struct tag_tcc_display {
__u32 output;
__u32 resolution;
__u32 hdmi_resolution;
__u32 composite_resolution;
__u32 component_resolution;
};
extern struct display_platform_data tcc_display_data;
static int __init parse_tag_tcc_display(const struct tag *tag)
{
struct tag_tcc_display *entry = (void *) &tag->u;
tcc_display_data.output = entry->output;
tcc_display_data.resolution = entry->resolution;
tcc_display_data.hdmi_resolution = entry->hdmi_resolution;
tcc_display_data.composite_resolution = entry->composite_resolution;
tcc_display_data.component_resolution = entry->component_resolution;
printk("kernel start display option [output:%d] [resolution:%d] [hdmi_r:%d] [composite_r:%d] [component_r:%d]\n",
tcc_display_data.output, tcc_display_data.resolution, tcc_display_data.hdmi_resolution, tcc_display_data.composite_resolution, tcc_display_data.component_resolution);
return 0;
}
__tagtable(ATAG_TCC_DISPLAY, parse_tag_tcc_display);
|
// Copyright (c) 2015- PPSSPP 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, version 2.0 or later versions.
// 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 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include <string>
#include <stdint.h>
// Compatibility flags are controlled by assets/compat.ini.
// Alternatively, if PSP/SYSTEM/compat.ini exists, it is merged on top, to enable editing
// the file on Android for tests.
//
// This file is not meant to be user-editable, although is kept as a separate ini
// file instead of compiled into the code for debugging purposes.
//
// The uses cases are strict:
// * Enable fixes for things we can't reasonably emulate without completely ruining
// performance for other games, such as the screen copies in Dangan Ronpa
// * Disabling accuracy features like 16-bit depth rounding, when we can't seem to
// implement them at all in a 100% compatible way
// * Emergency game-specific compatibility fixes before releases, such as the GTA
// music problem where every attempted fix has reduced compatibility with other games
// * Enable "unsafe" performance optimizations that some games can tolerate and
// others cannot. We do not currently have any of those.
//
// This functionality should NOT be used for any of the following:
// * Cheats
// * Fun hacks, like enlarged heads or whatever
// * Fixing general compatibility issues. First try to find a general solution. Try hard.
//
// We already have the Action Replay-based cheat system for such use cases.
struct CompatFlags {
bool VertexDepthRounding;
bool PixelDepthRounding;
bool DepthRangeHack;
};
class IniFile;
class Compatibility {
public:
Compatibility() {
Clear();
}
// Flags enforced read-only through const. Only way to change them is to load assets/compat.ini.
const CompatFlags &flags() const { return flags_; }
void Load(const std::string &gameID);
private:
void Clear();
void CheckSettings(IniFile &iniFile, const std::string &gameID);
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool &flag);
CompatFlags flags_;
}; |
/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html. In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of Qt Designer. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#ifndef QDESIGNER_MENUBAR_H
#define QDESIGNER_MENUBAR_H
#include "shared_global_p.h"
#include <QtGui/QAction>
#include <QtGui/QMenuBar>
#include <QtCore/QPointer>
#include <QtCore/QMimeData>
QT_BEGIN_NAMESPACE
class QDesignerFormWindowInterface;
class QDesignerActionProviderExtension;
class QLineEdit;
class QMimeData;
namespace qdesigner_internal {
class PromotionTaskMenu;
class SpecialMenuAction: public QAction
{
Q_OBJECT
public:
SpecialMenuAction(QObject *parent = 0);
virtual ~SpecialMenuAction();
};
} // namespace qdesigner_internal
class QDESIGNER_SHARED_EXPORT QDesignerMenuBar: public QMenuBar
{
Q_OBJECT
public:
QDesignerMenuBar(QWidget *parent = 0);
virtual ~QDesignerMenuBar();
bool eventFilter(QObject *object, QEvent *event);
QDesignerFormWindowInterface *formWindow() const;
QDesignerActionProviderExtension *actionProvider();
void adjustSpecialActions();
bool interactive(bool i);
bool dragging() const;
void moveLeft(bool ctrl = false);
void moveRight(bool ctrl = false);
void moveUp();
void moveDown();
private slots:
void deleteMenu();
void slotRemoveMenuBar();
protected:
virtual void actionEvent(QActionEvent *event);
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event);
virtual void paintEvent(QPaintEvent *event);
virtual void focusOutEvent(QFocusEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
bool handleEvent(QWidget *widget, QEvent *event);
bool handleMouseDoubleClickEvent(QWidget *widget, QMouseEvent *event);
bool handleMousePressEvent(QWidget *widget, QMouseEvent *event);
bool handleMouseReleaseEvent(QWidget *widget, QMouseEvent *event);
bool handleMouseMoveEvent(QWidget *widget, QMouseEvent *event);
bool handleContextMenuEvent(QWidget *widget, QContextMenuEvent *event);
bool handleKeyPressEvent(QWidget *widget, QKeyEvent *event);
void startDrag(const QPoint &pos);
enum ActionDragCheck { NoActionDrag, ActionDragOnSubMenu, AcceptActionDrag };
ActionDragCheck checkAction(QAction *action) const;
void adjustIndicator(const QPoint &pos);
int findAction(const QPoint &pos) const;
QAction *currentAction() const;
int realActionCount() const;
enum LeaveEditMode {
Default = 0,
ForceAccept
};
void enterEditMode();
void leaveEditMode(LeaveEditMode mode);
void showLineEdit();
void showMenu(int index = -1);
void hideMenu(int index = -1);
QAction *safeActionAt(int index) const;
bool swap(int a, int b);
private:
void updateCurrentAction(bool selectAction);
QAction *m_addMenu;
QPointer<QMenu> m_activeMenu;
QPoint m_startPosition;
int m_currentIndex;
bool m_interactive;
QLineEdit *m_editor;
bool m_dragging;
int m_lastMenuActionIndex;
QPointer<QWidget> m_lastFocusWidget;
qdesigner_internal::PromotionTaskMenu* m_promotionTaskMenu;
};
QT_END_NAMESPACE
#endif // QDESIGNER_MENUBAR_H
|
// Copyright (C) 2013 OpenSim Ltd.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
// Author: Benjamin Martin Seregi
#ifndef __INET_IEEE8021DRELAY_H
#define __INET_IEEE8021DRELAY_H
#include "inet/common/INETDefs.h"
#include "inet/networklayer/common/InterfaceTable.h"
#include "inet/linklayer/ethernet/switch/IMACAddressTable.h"
#include "inet/linklayer/ethernet/EtherFrame_m.h"
#include "inet/common/lifecycle/NodeOperations.h"
#include "inet/common/lifecycle/NodeStatus.h"
#include "inet/linklayer/ieee8021d/common/Ieee8021dBPDU_m.h"
namespace inet {
//
// This module forward frames (~EtherFrame) based on their destination MAC addresses to appropriate ports.
// See the NED definition for details.
//
class INET_API Ieee8021dRelay : public cSimpleModule, public ILifecycle
{
public:
Ieee8021dRelay();
protected:
MACAddress bridgeAddress;
IInterfaceTable *ifTable = nullptr;
IMACAddressTable *macTable = nullptr;
InterfaceEntry *ie = nullptr;
bool isOperational = false;
bool isStpAware = false;
unsigned int portCount = 0; // number of ports in the switch
// statistics: see finish() for details.
int numReceivedNetworkFrames = 0;
int numDroppedFrames = 0;
int numReceivedBPDUsFromSTP = 0;
int numDeliveredBDPUsToSTP = 0;
int numDispatchedNonBPDUFrames = 0;
int numDispatchedBDPUFrames = 0;
protected:
virtual void initialize(int stage) override;
virtual int numInitStages() const override { return NUM_INIT_STAGES; }
virtual void handleMessage(cMessage *msg) override;
/**
* Updates address table (if the port is in learning state)
* with source address, determines output port
* and sends out (or broadcasts) frame on ports
* (if the ports are in forwarding state).
* Includes calls to updateTableWithAddress() and getPortForAddress().
*
*/
void handleAndDispatchFrame(EtherFrame *frame);
void dispatch(EtherFrame *frame, unsigned int portNum);
void learn(EtherFrame *frame);
void broadcast(EtherFrame *frame);
/**
* Receives BPDU from the STP/RSTP module and dispatch it to network.
* Sets EherFrame destination, source, etc. according to the BPDU's Ieee802Ctrl info.
*/
void dispatchBPDU(BPDU *bpdu);
/**
* Deliver BPDU to the STP/RSTP module.
* Sets the BPDU's Ieee802Ctrl info according to the arriving EtherFrame.
*/
void deliverBPDU(EtherFrame *frame);
// For lifecycle
virtual void start();
virtual void stop();
bool handleOperationStage(LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override;
/*
* Gets port data from the InterfaceTable
*/
Ieee8021dInterfaceData *getPortInterfaceData(unsigned int portNum);
/*
* Returns the first non-loopback interface.
*/
virtual InterfaceEntry *chooseInterface();
virtual void finish() override;
};
} // namespace inet
#endif // ifndef __INET_IEEE8021DRELAY_H
|
/* An Alternative Software Serial Library
* http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
* Copyright (c) 2012 PJRC.COM, LLC, Paul Stoffregen, paul@pjrc.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef AltSoftSerial_h
#define AltSoftSerial_h
#include <inttypes.h>
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#include "pins_arduino.h"
#endif
class AltSoftSerial : public Stream
{
public:
AltSoftSerial() { }
~AltSoftSerial() { end(); }
static void begin(uint32_t baud) { init((F_CPU + baud / 2) / baud); }
static void end();
int peek();
int read();
int available();
#if ARDUINO >= 100
size_t write(uint8_t byte) { writeByte(byte); return 1; }
void flush() { flushOutput(); }
#else
void write(uint8_t byte) { writeByte(byte); }
void flush() { flushInput(); }
#endif
using Print::write;
static void flushInput();
static void flushOutput();
// for drop-in compatibility with NewSoftSerial, rxPin & txPin ignored
AltSoftSerial(uint8_t rxPin, uint8_t txPin, bool inverse = false) { }
bool listen() { return false; }
bool isListening() { return true; }
bool overflow() { bool r = timing_error; timing_error = false; return r; }
static int library_version() { return 1; }
static void enable_timer0(bool enable) { }
static bool timing_error;
private:
static void init(uint32_t cycles_per_bit);
static void writeByte(uint8_t byte);
};
#endif
|
#undef CONFIG_MORE
|
/*
Copyright [2008] [Trevor Hogan]
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.
CODE PORTED FROM THE ORIGINAL GHOST PROJECT: http://ghost.pwner.org/
*/
#ifndef CONFIG_H
#define CONFIG_H
//
// CConfig
//
class CConfig
{
private:
map<string, string> m_CFG;
public:
CConfig( );
~CConfig( );
void Read( string file );
bool Exists( string key );
int GetInt( string key, int x );
long GetLong( string key, long x );
string GetString( string key, string x );
void Set( string key, string x );
};
#endif
|
#ifndef __BUSMASTER_CAN_INCLUDES_
#define __BUSMASTER_CAN_INCLUDES_
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Wrapper_J1939.h"
#endif |
//
// $Id$
// TMRenderable.h
// TapMania
//
// Created by Alex Kremer on 26.11.08.
// Copyright 2008 Godexsoft. All rights reserved.
//
@protocol TMRenderable
- (void)render:(float)fDelta;
@end
|
/* sysselect.h - System-dependent definitions for the select function.
Copyright (C) 1995, 2001-2017 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs 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.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SYSSELECT_H
#define SYSSELECT_H 1
#ifndef DOS_NT
#include <sys/select.h>
#endif
#include "lisp.h"
/* The w32 build defines select stuff in w32.h, which is included
where w32 needs it, but not where sysselect.h is included. The w32
definitions in w32.h are incompatible with the below. */
#ifndef WINDOWSNT
#ifdef FD_SET
#ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif
#else /* no FD_SET */
#define FD_SETSIZE 32
typedef int fd_set;
/* Define the macros to access a single-int bitmap of descriptors. */
#define FD_SET(n, p) (*(p) |= (1 << (n)))
#define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
#define FD_ISSET(n, p) (*(p) & (1 << (n)))
#define FD_ZERO(p) (*(p) = 0)
#endif /* no FD_SET */
#endif /* not WINDOWSNT */
#if !defined (HAVE_SELECT)
#define select sys_select
#endif
#ifdef MSDOS
#define pselect sys_select
#endif
#ifndef WINDOWSNT
INLINE_HEADER_BEGIN
/* Check for out-of-range errors if ENABLE_CHECKING is defined. */
INLINE void
fd_CLR (int fd, fd_set *set)
{
eassume (0 <= fd && fd < FD_SETSIZE);
FD_CLR (fd, set);
}
INLINE bool
fd_ISSET (int fd, fd_set *set)
{
eassume (0 <= fd && fd < FD_SETSIZE);
return FD_ISSET (fd, set) != 0;
}
INLINE void
fd_SET (int fd, fd_set *set)
{
eassume (0 <= fd && fd < FD_SETSIZE);
FD_SET (fd, set);
}
#undef FD_CLR
#undef FD_ISSET
#undef FD_SET
#define FD_CLR(fd, set) fd_CLR (fd, set)
#define FD_ISSET(fd, set) fd_ISSET (fd, set)
#define FD_SET(fd, set) fd_SET (fd, set)
INLINE_HEADER_END
#endif /* !WINDOWSNT */
#endif
|
/*
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
* Open-Sankoré is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library).
*
* Open-Sankoré 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 Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBIMPORTDOCUMENT_H_
#define UBIMPORTDOCUMENT_H_
#include <QtGui>
#include "UBImportAdaptor.h"
class UBDocumentProxy;
class UBImportDocument : public UBDocumentBasedImportAdaptor
{
Q_OBJECT;
public:
UBImportDocument(QObject *parent = 0);
virtual ~UBImportDocument();
virtual QStringList supportedExtentions();
virtual QString importFileFilter();
virtual UBDocumentProxy* importFile(const QFile& pFile, const QString& pGroup);
virtual bool addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile);
private:
bool extractFileToDir(const QFile& pZipFile, const QString& pDir, QString& documentRoot);
};
#endif /* UBIMPORTDOCUMENT_H_ */
|
/*
* Copyright © 2003 Sun Microsystems Inc.
* Copyright © 2007 Christian Persch
*
* 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 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef GUCHARMAP_CHARTABLE_ACCESSIBLE_H
#define GUCHARMAP_CHARTABLE_ACCESSIBLE_H
#include <gtk/gtk.h>
#include "gucharmap-chartable.h"
G_BEGIN_DECLS
#define GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE (gucharmap_chartable_accessible_get_type ())
#define GUCHARMAP_CHARTABLE_ACCESSIBLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE, GucharmapChartableAccessible))
#define GUCHARMAP_CHARTABLE_ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE, GucharmapChartableAccessibleClass))
#define GUCHARMAP_IS_CHARTABLE_ACCESSIBLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE))
#define GUCHARMAP_IS_CHARTABLE_ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE))
#define GUCHARMAP_CHARTABLE_ACCESSIBLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GUCHARMAP_TYPE_CHARTABLE_ACCESSIBLE, GucharmapChartableAccessibleClass))
typedef struct _GucharmapChartableAccessible GucharmapChartableAccessible;
typedef struct _GucharmapChartableAccessibleClass GucharmapChartableAccessibleClass;
GType gucharmap_chartable_accessible_get_type (void);
AtkObject *gucharmap_chartable_accessible_new (GucharmapChartable *chartable);
G_END_DECLS
#endif /* !GUCHARMAP_CHARTABLE_ACCESSIBLE_H */
|
#include "asf.h"
#include "ifm.h"
complexFloat **cpxmatrix(int nrl, int nrh, int ncl, int nch)
{
int i,nelem;
complexFloat **m;
nelem = nrh-nrl+1;
m=(complexFloat **)MALLOC(nelem * sizeof(complexFloat *));
m -= nrl;
for(i=nrl;i<=nrh;i++) {
m[i]=(complexFloat *)MALLOC((unsigned)(nch-ncl+1)*sizeof(complexFloat));
m[i] -= ncl;
}
return m;
}
void free_cpxmatrix(m,nrl,nrh,ncl,nch)
complexFloat **m;
int nrl,nrh,ncl,nch;
{
int i;
for(i=nrh;i>=nrl;i--) free((complexFloat*) (m[i]+ncl));
free((complexFloat**) (m+nrl));
}
|
/*
* Multi2Sim
* Copyright (C) 2007 Rafael Ubal Tena (raurte@gap.upv.es)
*
* 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 "m2skernel.h"
#define DUMP_ABORT printf("\n%lld\n", (long long) isa_inst_count), abort()
#define DUMP printf("\n"), x86_inst_dump(&isa_inst, stdout), printf("\n")
#define OP_REP_IMPL(X) \
void op_rep_##X##_impl() { \
isa_inst.rep = 0; \
while (isa_regs->ecx) { \
op_##X##_impl(); \
isa_regs->ecx--; \
isa_inst.rep++; \
} \
}
#define OP_REPZ_IMPL(X) \
void op_repz_##X##_impl() { \
isa_inst.rep = 0; \
while (isa_regs->ecx) { \
op_##X##_impl(); \
isa_regs->ecx--; \
isa_inst.rep++; \
if (!isa_get_flag(flag_zf)) \
break; \
} \
}
#define OP_REPNZ_IMPL(X) \
void op_repnz_##X##_impl() { \
isa_inst.rep = 0; \
while (isa_regs->ecx) { \
op_##X##_impl(); \
isa_regs->ecx--; \
isa_inst.rep++; \
if (isa_get_flag(flag_zf)) \
break; \
} \
}
/* Implementation of string instructions with the
* REP, REPZ or REPNZ preffix. */
void op_insb_impl() { panic("insb not implemented"); }
void op_insd_impl() { panic("insd not implemented"); }
void op_lodsb_impl() { panic("lodsb not implemented"); }
void op_lodsd_impl() { panic("lodsd not implemented"); }
void op_outsb_impl() { panic("outsb not implemented"); }
void op_outsd_impl() { panic("outsd not implemented"); }
OP_REP_IMPL(insb)
OP_REP_IMPL(insd)
OP_REP_IMPL(movsb)
OP_REP_IMPL(movsw)
OP_REP_IMPL(movsd)
OP_REP_IMPL(outsb)
OP_REP_IMPL(outsd)
OP_REP_IMPL(lodsb)
OP_REP_IMPL(lodsd)
OP_REP_IMPL(stosb)
OP_REP_IMPL(stosd)
OP_REPZ_IMPL(cmpsb)
OP_REPZ_IMPL(cmpsd)
OP_REPZ_IMPL(scasb)
OP_REPZ_IMPL(scasd)
OP_REPNZ_IMPL(cmpsb)
OP_REPNZ_IMPL(cmpsd)
OP_REPNZ_IMPL(scasb)
OP_REPNZ_IMPL(scasd)
/* String Instructions */
void op_cmpsb_impl() {
uint8_t op1, op2;
unsigned long flags;
mem_read(isa_mem, isa_regs->esi, 1, &op1);
mem_read(isa_mem, isa_regs->edi, 1, &op2);
flags = isa_regs->eflags;
asm volatile (
"push %1 ; popf\n\t"
"mov %2, %%al\n\t"
"cmp %3, %%al\n\t"
"pushf ; pop %0"
: "=g" (flags)
: "g" (flags), "m" (op1), "m" (op2)
: "al"
);
isa_regs->eflags = flags;
isa_regs->esi += isa_get_flag(flag_df) ? -1 : 1;
isa_regs->edi += isa_get_flag(flag_df) ? -1 : 1;
}
void op_cmpsd_impl() {
uint32_t op1, op2;
unsigned long flags;
mem_read(isa_mem, isa_regs->edi, 4, &op1);
mem_read(isa_mem, isa_regs->esi, 4, &op2);
flags = isa_regs->eflags;
asm volatile (
"push %1 ; popf\n\t"
"mov %2, %%eax\n\t"
"cmp %3, %%eax\n\t"
"pushf ; pop %0"
: "=g" (flags)
: "g" (flags), "m" (op1), "m" (op2)
: "eax"
);
isa_regs->eflags = flags;
isa_regs->esi += isa_get_flag(flag_df) ? -4 : 4;
isa_regs->edi += isa_get_flag(flag_df) ? -4 : 4;
}
void op_movsb_impl() {
uint8_t m8;
mem_read(isa_mem, isa_regs->esi, 1, &m8);
mem_write(isa_mem, isa_regs->edi, 1, &m8);
isa_regs->edi += isa_get_flag(flag_df) ? -1 : 1;
isa_regs->esi += isa_get_flag(flag_df) ? -1 : 1;
}
void op_movsw_impl() {
uint16_t m16;
mem_read(isa_mem, isa_regs->esi, 2, &m16);
mem_write(isa_mem, isa_regs->edi, 2, &m16);
isa_regs->edi += isa_get_flag(flag_df) ? -2 : 2;
isa_regs->esi += isa_get_flag(flag_df) ? -2 : 2;
}
void op_movsd_impl() {
uint32_t m32;
mem_read(isa_mem, isa_regs->esi, 4, &m32);
mem_write(isa_mem, isa_regs->edi, 4, &m32);
isa_regs->edi += isa_get_flag(flag_df) ? -4 : 4;
isa_regs->esi += isa_get_flag(flag_df) ? -4 : 4;
}
void op_scasb_impl() {
uint8_t al = isa_load_reg(reg_al);
uint8_t m8;
unsigned long flags = isa_regs->eflags;
mem_read(isa_mem, isa_regs->edi, 1, &m8);
asm volatile (
"push %3 ; popf\n\t"
"mov %1, %%al\n\t"
"cmp %2, %%al\n\t"
"pushf ; pop %0\n\t"
: "=g" (flags)
: "m" (al), "m" (m8), "g" (flags)
: "al"
);
isa_regs->eflags = flags;
isa_regs->edi += isa_get_flag(flag_df) ? -1 : 1;
}
void op_scasd_impl() {
uint32_t eax = isa_load_reg(reg_eax);
uint32_t m32;
unsigned long flags = isa_regs->eflags;
mem_read(isa_mem, isa_regs->edi, 4, &m32);
asm volatile (
"push %3 ; popf\n\t"
"mov %1, %%eax\n\t"
"cmp %2, %%eax\n\t"
"pushf ; pop %0\n\t"
: "=g" (flags)
: "m" (eax), "m" (m32), "g" (flags)
: "eax"
);
isa_regs->eflags = flags;
isa_regs->edi += isa_get_flag(flag_df) ? -4 : 4;
}
void op_stosb_impl() {
uint8_t m8 = isa_load_reg(reg_al);
uint32_t addr = isa_load_reg(reg_edi);
mem_write(isa_mem, addr, 1, &m8);
isa_regs->edi += isa_get_flag(flag_df) ? -1 : 1;
}
void op_stosd_impl() {
uint32_t m32 = isa_load_reg(reg_eax);
uint32_t addr = isa_load_reg(reg_edi);
mem_write(isa_mem, addr, 4, &m32);
isa_regs->edi += isa_get_flag(flag_df) ? -4 : 4;
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Note: This file is included by Variant.h.
*/
#ifndef mozilla_storage_Variant_h__
#error "Do not include this file directly!"
#endif
namespace mozilla {
namespace storage {
////////////////////////////////////////////////////////////////////////////////
//// Variant_base
inline NS_IMPL_THREADSAFE_ADDREF(Variant_base)
inline NS_IMPL_THREADSAFE_RELEASE(Variant_base)
inline NS_IMPL_THREADSAFE_QUERY_INTERFACE1(
Variant_base,
nsIVariant
)
////////////////////////////////////////////////////////////////////////////////
//// nsIVariant
inline
NS_IMETHODIMP
Variant_base::GetDataType(uint16_t *_type)
{
NS_ENSURE_ARG_POINTER(_type);
*_type = nsIDataType::VTYPE_VOID;
return NS_OK;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt32(int32_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt64(int64_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsDouble(double *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsAUTF8String(nsACString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsAString(nsAString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsArray(uint16_t *,
nsIID *,
uint32_t *,
void **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt8(uint8_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt16(int16_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint8(uint8_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint16(uint16_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint32(uint32_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint64(uint64_t *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsFloat(float *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsBool(bool *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsChar(char *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWChar(PRUnichar *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsID(nsID *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsDOMString(nsAString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsString(char **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWString(PRUnichar **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsISupports(nsISupports **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInterface(nsIID **,
void **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsACString(nsACString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsStringWithSize(uint32_t *,
char **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWStringWithSize(uint32_t *,
PRUnichar **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsJSVal(JS::Value *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
} // namespace storage
} // namespace mozilla
|
/*
* 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.
*
* "Null" Compression Algorithm Support.
*/
#include "tiffiop.h"
static int
DumpFixupTags(TIFF* tif)
{
(void) tif;
return (1);
}
/*
* Encode a hunk of pixels.
*/
static int
DumpModeEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
{
(void) s;
while (cc > 0) {
tmsize_t n;
n = cc;
if (tif->tif_rawcc + n > tif->tif_rawdatasize)
n = tif->tif_rawdatasize - tif->tif_rawcc;
assert( n > 0 );
/*
* Avoid copy if client has setup raw
* data buffer to avoid extra copy.
*/
if (tif->tif_rawcp != pp)
_TIFFmemcpy(tif->tif_rawcp, pp, n);
tif->tif_rawcp += n;
tif->tif_rawcc += n;
pp += n;
cc -= n;
if (tif->tif_rawcc >= tif->tif_rawdatasize &&
!TIFFFlushData1(tif))
return (0);
}
return (1);
}
/*
* Decode a hunk of pixels.
*/
static int
DumpModeDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
{
static const char module[] = "DumpModeDecode";
(void) s;
if (tif->tif_rawcc < cc) {
#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
"Not enough data for scanline %lu, expected a request for at most %I64d bytes, got a request for %I64d bytes",
(unsigned long) tif->tif_row,
(signed __int64) tif->tif_rawcc,
(signed __int64) cc);
#else
TIFFErrorExt(tif->tif_clientdata, module,
"Not enough data for scanline %lu, expected a request for at most %lld bytes, got a request for %lld bytes",
(unsigned long) tif->tif_row,
(signed long long) tif->tif_rawcc,
(signed long long) cc);
#endif
return (0);
}
/*
* Avoid copy if client has setup raw
* data buffer to avoid extra copy.
*/
if (tif->tif_rawcp != buf)
_TIFFmemcpy(buf, tif->tif_rawcp, cc);
tif->tif_rawcp += cc;
tif->tif_rawcc -= cc;
return (1);
}
/*
* Seek forwards nrows in the current strip.
*/
static int
DumpModeSeek(TIFF* tif, uint32 nrows)
{
tif->tif_rawcp += nrows * tif->tif_scanlinesize;
tif->tif_rawcc -= nrows * tif->tif_scanlinesize;
return (1);
}
/*
* Initialize dump mode.
*/
int
TIFFInitDumpMode(TIFF* tif, int scheme)
{
(void) scheme;
tif->tif_fixuptags = DumpFixupTags;
tif->tif_decoderow = DumpModeDecode;
tif->tif_decodestrip = DumpModeDecode;
tif->tif_decodetile = DumpModeDecode;
tif->tif_encoderow = DumpModeEncode;
tif->tif_encodestrip = DumpModeEncode;
tif->tif_encodetile = DumpModeEncode;
tif->tif_seek = DumpModeSeek;
return (1);
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
|
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
This file is part of ChibiOS.
ChibiOS 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.
ChibiOS 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/>.
*/
/**
* @file SPC56ELxx/ppcparams.h
* @brief PowerPC parameters for the SPC56ELxx.
*
* @defgroup PPC_SPC56ELxx SPC56ELxx Specific Parameters
* @ingroup PPC_SPECIFIC
* @details This file contains the PowerPC specific parameters for the
* SPC56ELxx platform.
* @{
*/
#ifndef _PPCPARAMS_H_
#define _PPCPARAMS_H_
/**
* @brief Family identification macro.
*/
#define PPC_SPC56ELxx
/**
* @brief PPC core model.
*/
#define PPC_VARIANT PPC_VARIANT_e200z4
/**
* @brief Number of cores.
*/
#define PPC_CORE_NUMBER 1
/**
* @brief Number of writable bits in IVPR register.
*/
#define PPC_IVPR_BITS 16
/**
* @brief IVORx registers support.
*/
#define PPC_SUPPORTS_IVORS TRUE
/**
* @brief Book E instruction set support.
*/
#define PPC_SUPPORTS_BOOKE TRUE
/**
* @brief VLE instruction set support.
*/
#define PPC_SUPPORTS_VLE TRUE
/**
* @brief Supports VLS Load/Store Multiple Volatile instructions.
*/
#define PPC_SUPPORTS_VLE_MULTI TRUE
/**
* @brief Supports the decrementer timer.
*/
#define PPC_SUPPORTS_DECREMENTER TRUE
/**
* @brief Number of interrupt sources.
*/
#define PPC_NUM_VECTORS 256
#endif /* _PPCPARAMS_H_ */
/** @} */
|
#ifndef _RENDERING_H
#define _RENDERING_H
#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid1(TTF_Font *font,
const char *text, SDL_Color *fg);
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded1(TTF_Font *font,
const char *text, SDL_Color *fg, SDL_Color *bg);
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended1(TTF_Font *font,
const char *text, SDL_Color *fg);
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid1(TTF_Font *font,
const char *text, SDL_Color *fg);
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded1(TTF_Font *font,
const char *text, SDL_Color *fg, SDL_Color *bg);
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended1(TTF_Font *font,
const char *text, SDL_Color *fg);
#endif
|
#pragma once
#include "Backward.h"
#include "EasyCL.h"
#include "DeepCLDllExport.h"
class Im2Col;
#define STATIC static
#define VIRTUAL virtual
class DeepCL_EXPORT BackwardIm2Col : public Backward {
private:
Im2Col *im2Col;
// CLKernel *kernelCol2Im;
// AddBias *addBias;
float *columns;
CLWrapper *columnsWrapper;
int numKernels;
// [[[cog
// import cog_addheaders
// cog_addheaders.addv2()
// ]]]
// generated, using cog:
public:
BackwardIm2Col(EasyCL *cl, LayerDimensions dim);
VIRTUAL ~BackwardIm2Col();
VIRTUAL void backward(int batchSize,
CLWrapper *inputDataWrapper, CLWrapper *gradOutputWrapper, CLWrapper *weightsWrapper,
CLWrapper *gradInputWrapper);
// [[[end]]]
};
|
#ifndef TETRA_TDMA_H
#define TETRA_TDMA_H
#include <stdint.h>
struct tetra_tdma_time {
uint16_t hn; /* hyperframe number (1 ... 65535) */
uint32_t sn; /* symbol number (1 ... 255) */
uint32_t tn; /* timeslot number (1 .. 4) */
uint32_t fn; /* frame number (1 .. 18) */
uint32_t mn; /* multiframe number (1 .. 60) */
};
void tetra_tdma_time_add_sym(struct tetra_tdma_time *tm, uint32_t sym_count);
void tetra_tdma_time_add_tn(struct tetra_tdma_time *tm, uint32_t tn_count);
void tetra_tdma_time_add_fn(struct tetra_tdma_time *tm, uint32_t fn_count);
char *tetra_tdma_time_dump(const struct tetra_tdma_time *tm);
uint32_t tetra_tdma_time2fn(struct tetra_tdma_time *tm);
#endif
|
/* ********************************************************************** */
/* num_name.h: numerical type name and mangling */
/* ********************************************************************** */
/* Unlike num.h, this file can be included several times.
*/
#undef NUM_NAME
#undef NUM_SUFFIX
#undef NUMFUN3
#undef NUMFUN2
#undef NUMFUN
/* NUMFUN(xxx) expands to xxx_mpq, or xxx_dbl, ... */
#define NUMFUN3(NAME,SUFFIX) NAME ## _ ## SUFFIX
#define NUMFUN2(x,y) NUMFUN3(x,y)
#define NUMFUN(x) NUMFUN2(x,NUM_SUFFIX)
#if defined(NUM_LONGRAT)
#define NUM_NAME "NUM_LONGRAT"
#define NUM_SUFFIX Rl
#elif defined(NUM_LONGLONGRAT)
#define NUM_NAME "NUM_LONGLONGRAT"
#define NUM_SUFFIX Rll
#elif defined(NUM_MPQ)
#define NUM_NAME "NUM_MPQ"
#define NUM_SUFFIX MPQ
#elif defined(NUM_LONGINT)
#define NUM_NAME "NUM_LONGINT"
#define NUM_SUFFIX Il
#elif defined(NUM_LONGLONGINT)
#define NUM_NAME "NUM_LONGLONGINT"
#define NUM_SUFFIX Ill
#elif defined(NUM_MPZ)
#define NUM_NAME "NUM_MPZ"
#define NUM_SUFFIX MPZ
#elif defined(NUM_DOUBLE)
#define NUM_NAME "NUM_DOUBLE"
#define NUM_SUFFIX D
#elif defined(NUM_LONGDOUBLE)
#define NUM_NAME "NUM_LONGDOUBLE"
#define NUM_SUFFIX Dl
#elif defined(NUM_MPFR)
#define NUM_NAME "NUM_MPFR"
#define NUM_SUFFIX MPFR
#else
#error "HERE"
#endif
|
#include <unistd.h>
#include <stdlib.h>
#include "asm/types.h"
#include "rbtree.h"
#include "util.h"
#include "syscall.h"
#include "kcmp-ids.h"
/*
* We track shared files by global rbtree, where each node might
* be a root for subtree. The reason for that is the nature of data
* we obtain from operating system.
*
* Basically OS provides us two ways to distinguish files
*
* - information obtained from fstat call
* - shiny new sys_kcmp system call (which may compare the file descriptor
* pointers inside the kernel and provide us order info)
*
* So, to speedup procedure of searching for shared file descriptors
* we use both techniques. From fstat call we get that named general file
* IDs (genid) which are carried in the main rbtree.
*
* In case if two genid are the same -- we need to use a second way and
* call for sys_kcmp. Thus, if kernel tells us that files have identical
* genid but in real they are different from kernel point of view -- we assign
* a second unique key (subid) to such file descriptor and put it into a subtree.
*
* So the tree will look like
*
* (root)
* genid-1
* / \
* genid-2 genid-3
* / \ / \
*
* Where each genid node might be a sub-rbtree as well
*
* (genid-N)
* / \
* subid-1 subid-2
* / \ / \
*
* Carrying two rbtree at once allow us to minimize the number
* of sys_kcmp syscalls, also to collect and dump file descriptors
* in one pass.
*/
struct kid_entry {
struct rb_node node;
struct rb_root subtree_root;
struct rb_node subtree_node;
u32 subid; /* subid is always unique */
struct kid_elem elem;
} __aligned(sizeof(long));
static struct kid_entry *alloc_kid_entry(struct kid_tree *tree, struct kid_elem *elem)
{
struct kid_entry *e;
e = xmalloc(sizeof(*e));
if (!e)
goto err;
e->subid = tree->subid++;
e->elem = *elem;
/* Make sure no overflow here */
BUG_ON(!e->subid);
rb_init_node(&e->node);
rb_init_node(&e->subtree_node);
e->subtree_root = RB_ROOT;
rb_link_and_balance(&e->subtree_root, &e->subtree_node,
NULL, &e->subtree_root.rb_node);
err:
return e;
}
static u32 kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
struct kid_elem *elem, int *new_id)
{
struct rb_node *node = e->subtree_root.rb_node;
struct kid_entry *sub = NULL;
struct rb_node **new = &e->subtree_root.rb_node;
struct rb_node *parent = NULL;
BUG_ON(!node);
while (node) {
struct kid_entry *this = rb_entry(node, struct kid_entry, subtree_node);
int ret = sys_kcmp(this->elem.pid, elem->pid, tree->kcmp_type,
this->elem.idx, elem->idx);
parent = *new;
if (ret == 1)
node = node->rb_left, new = &((*new)->rb_left);
else if (ret == 2)
node = node->rb_right, new = &((*new)->rb_right);
else if (ret == 0)
return this->subid;
else {
pr_err("kcmp failed: pid (%d %d) type %u idx (%u %u) ret %d\n",
this->elem.pid, elem->pid, tree->kcmp_type,
this->elem.idx, elem->idx, ret);
return 0;
}
}
sub = alloc_kid_entry(tree, elem);
if (!sub)
return 0;
rb_link_and_balance(&e->subtree_root, &sub->subtree_node, parent, new);
*new_id = 1;
return sub->subid;
}
u32 kid_generate_gen(struct kid_tree *tree,
struct kid_elem *elem, int *new_id)
{
struct rb_node *node = tree->root.rb_node;
struct kid_entry *e = NULL;
struct rb_node **new = &tree->root.rb_node;
struct rb_node *parent = NULL;
while (node) {
struct kid_entry *this = rb_entry(node, struct kid_entry, node);
parent = *new;
if (elem->genid < this->elem.genid)
node = node->rb_left, new = &((*new)->rb_left);
else if (elem->genid > this->elem.genid)
node = node->rb_right, new = &((*new)->rb_right);
else
return kid_generate_sub(tree, this, elem, new_id);
}
e = alloc_kid_entry(tree, elem);
if (!e)
return 0;
rb_link_and_balance(&tree->root, &e->node, parent, new);
*new_id = 1;
return e->subid;
}
|
/**************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
**
** Contact: BlackBerry (qt@blackberry.com)
** Contact: KDAB (info@kdab.com)
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QNX_INTERNAL_BARDESCRIPTORFILENODEMANAGER_H
#define QNX_INTERNAL_BARDESCRIPTORFILENODEMANAGER_H
#include <QObject>
namespace ProjectExplorer {
class DeployConfiguration;
class Project;
class ProjectNode;
class Target;
}
namespace Qnx {
namespace Internal {
class BarDescriptorFileNode;
class BarDescriptorFileNodeManager : public QObject
{
Q_OBJECT
public:
explicit BarDescriptorFileNodeManager(QObject *parent = 0);
private slots:
void setCurrentProject(ProjectExplorer::Project *project);
void updateBarDescriptorNodes(ProjectExplorer::Target *target);
void handleDeploymentInfoChanged(bool modelReset);
void handleDeploymentDataChanged();
void handleDeploymentModelReset();
private:
BarDescriptorFileNode *findBarDescriptorFileNode(ProjectExplorer::ProjectNode *parent) const;
ProjectExplorer::ProjectNode *findProjectNode(ProjectExplorer::ProjectNode *parent,
const QString &projectFilePath) const;
void updateBarDescriptorNodes(ProjectExplorer::Project *project, bool attemptCreate);
bool createBarDescriptor(ProjectExplorer::Project *project, const QString &barDescriptorPath,
ProjectExplorer::ProjectNode *projectNode);
void updateBarDescriptor(const QString &barDescriptorPath, ProjectExplorer::Target *target,
bool skipConfirmation = false);
void removeBarDescriptorNodes(ProjectExplorer::Project *project);
void removeBarDescriptorNodes(ProjectExplorer::ProjectNode *parent);
};
} // namespace Internal
} // namespace Qnx
#endif // QNX_INTERNAL_BARDESCRIPTORFILENODEMANAGER_H
|
/* XMMS2 - X Music Multiplexer System
* Copyright (C) 2003-2012 XMMS2 Team
*
* PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "xmmsclient/xmmsclient.h"
#include "xmmsclientpriv/xmmsclient.h"
#include "xmmsclientpriv/xmmsclient_ipc.h"
#include "xmmsc/xmmsc_idnumbers.h"
/**
* @defgroup StatsFunctions StatsFunctions
* @ingroup XMMSClient
* @brief This module contains functions to access informations and statistics of the XMMS server.
*
* @{
*/
/**
* Get a list of loaded plugins from the server
*/
xmmsc_result_t *
xmmsc_main_list_plugins (xmmsc_connection_t *c, xmms_plugin_type_t type)
{
x_check_conn (c, NULL);
return xmmsc_send_cmd (c, XMMS_IPC_OBJECT_MAIN, XMMS_IPC_CMD_PLUGIN_LIST,
XMMSV_LIST_ENTRY_INT (type), XMMSV_LIST_END);
}
/**
* Get a list of statistics from the server
*/
xmmsc_result_t *
xmmsc_main_stats (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_msg_no_arg (c, XMMS_IPC_OBJECT_MAIN, XMMS_IPC_CMD_STATS);
}
/**
* Request status for the mediainfo reader. It can be idle or working
*/
xmmsc_result_t *
xmmsc_broadcast_mediainfo_reader_status (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_broadcast_msg (c, XMMS_IPC_SIGNAL_MEDIAINFO_READER_STATUS);
}
/**
* Request number of unindexed entries in medialib.
*/
xmmsc_result_t *
xmmsc_signal_mediainfo_reader_unindexed (xmmsc_connection_t *c)
{
x_check_conn (c, NULL);
return xmmsc_send_signal_msg (c, XMMS_IPC_SIGNAL_MEDIAINFO_READER_UNINDEXED);
}
/** @} */
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef DEBUGGERSOURCEPATHMAPPINGWIDGET_H
#define DEBUGGERSOURCEPATHMAPPINGWIDGET_H
#include <QGroupBox>
#include <QMap>
QT_BEGIN_NAMESPACE
class QStandardItemModel;
class QTreeView;
class QLineEdit;
class QPushButton;
class QLineEdit;
class QModelIndex;
QT_END_NAMESPACE
namespace Utils { class PathChooser; }
namespace Debugger {
class DebuggerStartParameters;
namespace Internal {
class SourcePathMappingModel;
class DebuggerSourcePathMappingWidget : public QGroupBox
{
Q_OBJECT
public:
typedef QMap<QString, QString> SourcePathMap;
explicit DebuggerSourcePathMappingWidget(QWidget *parent = 0);
SourcePathMap sourcePathMap() const;
void setSourcePathMap(const SourcePathMap &);
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
static SourcePathMap mergePlatformQtPath(const DebuggerStartParameters &sp,
const SourcePathMap &in);
private slots:
void slotAdd();
void slotAddQt();
void slotRemove();
void slotCurrentRowChanged(const QModelIndex &,const QModelIndex &);
void slotEditSourceFieldChanged();
void slotEditTargetFieldChanged();
private:
void resizeColumns();
void updateEnabled();
QString editSourceField() const;
QString editTargetField() const;
void setEditFieldMapping(const QPair<QString, QString> &m);
int currentRow() const;
void setCurrentRow(int r);
SourcePathMappingModel *m_model;
QTreeView *m_treeView;
QPushButton *m_addButton;
QPushButton *m_addQtButton;
QPushButton *m_removeButton;
QLineEdit *m_sourceLineEdit;
Utils::PathChooser *m_targetChooser;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGERSOURCEPATHMAPPINGWIDGET_H
|
// included from p/debug_native.c
// splitted for better reading/cleaning up
static char *r_debug_native_reg_profile(RDebug *dbg) {
#if __WINDOWS__
/*_______
| | |
|___|___|
| | |
|___|___|
*/
if (dbg->bits & R_SYS_BITS_64) {
#include "reg/windows-x64.h"
} else {
#include "reg/windows-x86.h"
}
#elif (__OpenBSD__ || __NetBSD__)
/* __.--..__
\-/-/-/ _ __ _.--' _.--'
_ \' \ \\ '' `------.__
\\/ __)_) \\ ____..---'
//\ o o \\----'
/ <_/ 3 \\
\_,_,__,_/ \\
*/
#if __i386__
#include "reg/netbsd-x86.h"
#elif __x86_64__
#include "reg/netbsd-x64.h"
#else
#error "Unsupported BSD architecture"
#endif
#elif __KFBSD__ || __FreeBSD__
/*
/( ).
\ \__ /|
/ _ '-/ |
(/\/ | \
/ / | \ )
O O _/ |
(__) __ /
\___/ /
`----'
*/
#if __i386__ || __i386
#include "reg/kfbsd-x86.h"
#elif __x86_64__ || __amd64__
#include "reg/kfbsd-x64.h"
#elif __aarch64__
#include "reg/kfbsd-arm64.h"
#else
#error "Unsupported BSD architecture"
#endif
#else
#warning Unsupported Kernel
return NULL;
#endif
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.