text stringlengths 4 6.14k |
|---|
/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../common.h"
#include "../core/JsonFwd.hpp"
#include <future>
#include <optional>
#include <stdexcept>
#include <string>
#include <vector>
struct INetworkEndpoint;
struct ServerListEntry
{
std::string Address;
std::string Name;
std::string Description;
std::string Version;
bool RequiresPassword{};
bool Favourite{};
uint8_t Players{};
uint8_t MaxPlayers{};
bool Local{};
int32_t CompareTo(const ServerListEntry& other) const;
bool IsVersionValid() const;
/**
* Creates a ServerListEntry object from a JSON object
*
* @param json JSON data source - must be object type
* @return A NetworkGroup object
* @note json is deliberately left non-const: json_t behaviour changes when const
*/
static std::optional<ServerListEntry> FromJson(json_t& server);
};
class ServerList
{
private:
std::vector<ServerListEntry> _serverEntries;
void Sort();
std::vector<ServerListEntry> ReadFavourites() const;
bool WriteFavourites(const std::vector<ServerListEntry>& entries) const;
std::future<std::vector<ServerListEntry>> FetchLocalServerListAsync(const INetworkEndpoint& broadcastEndpoint) const;
public:
ServerListEntry& GetServer(size_t index);
size_t GetCount() const;
void Add(const ServerListEntry& entry);
void AddRange(const std::vector<ServerListEntry>& entries);
void Clear();
void ReadAndAddFavourites();
void WriteFavourites() const;
std::future<std::vector<ServerListEntry>> FetchLocalServerListAsync() const;
std::future<std::vector<ServerListEntry>> FetchOnlineServerListAsync() const;
uint32_t GetTotalPlayerCount() const;
};
class MasterServerException : public std::exception
{
public:
rct_string_id StatusText;
MasterServerException(rct_string_id statusText)
: StatusText(statusText)
{
}
};
|
#pragma once
#include <map>
#include <time.h>
#include "DomoticzHardware.h"
class ZWaveBase : public CDomoticzHardwareBase
{
friend class CRazberry;
friend class COpenZWave;
enum _eZWaveDeviceType
{
ZDTYPE_SWITCH_NORMAL = 0,
ZDTYPE_SWITCH_DIMMER,
ZDTYPE_SWITCH_RGBW,
ZDTYPE_SWITCH_COLOR,
ZDTYPE_SENSOR_TEMPERATURE,
ZDTYPE_SENSOR_SETPOINT,
ZDTYPE_SENSOR_HUMIDITY,
ZDTYPE_SENSOR_LIGHT,
ZDTYPE_SENSOR_PERCENTAGE,
ZDTYPE_SENSOR_POWER,
ZDTYPE_SENSOR_POWERENERGYMETER,
ZDTYPE_SENSOR_GAS,
ZDTYPE_SENSOR_VOLTAGE,
ZDTYPE_SENSOR_AMPERE,
ZDTYPE_SENSOR_THERMOSTAT_CLOCK,
ZDTYPE_SENSOR_THERMOSTAT_FAN_MODE,
ZDTYPE_SENSOR_THERMOSTAT_MODE,
ZDTYPE_SENSOR_VELOCITY,
ZDTYPE_SENSOR_BAROMETER,
ZDTYPE_SENSOR_DEWPOINT,
ZDTYPE_SENSOR_CO2,
ZDTYPE_SENSOR_UV,
ZDTYPE_SENSOR_WATER,
ZDTYPE_SENSOR_MOISTURE,
ZDTYPE_SENSOR_TANK_CAPACITY,
ZDTYPE_ALARM,
ZDTYPE_CENTRAL_SCENE,
ZDTYPE_SENSOR_CUSTOM,
};
struct _tZWaveDevice
{
int nodeID;
int commandClassID;
int instanceID;
int indexID;
int orgInstanceID;
int orgIndexID;
_eZWaveDeviceType devType;
int scaleID;
int scaleMultiply;
int basicType;
int genericType;
int specificType;
bool isListening;
bool sensor250;
bool sensor1000;
bool isFLiRS;
bool hasWakeup;
bool hasBattery;
int Manufacturer_id;
int Product_id;
int Product_type;
//values
float floatValue;
int intvalue;
bool bValidValue;
//battery
int batValue;
//main_id
std::string string_id;
//label
std::string label;
std::string custom_label;
time_t lastreceived;
unsigned char sequence_number;
int Alarm_Type;
_tZWaveDevice() :
label("Unknown")
{
sequence_number=1;
nodeID=-1;
scaleID=1;
scaleMultiply=1;
isListening=false;
sensor250=false;
sensor1000=false;
isFLiRS=false;
hasWakeup=false;
hasBattery=false;
batValue = 255;
floatValue=0;
intvalue=0;
bValidValue=true;
commandClassID=0;
instanceID=0;
indexID=0;
orgInstanceID=0;
orgIndexID=0;
devType = ZDTYPE_SWITCH_NORMAL;
basicType=0;
genericType=0;
specificType=0;
Manufacturer_id = -1;
Product_id = -1;
Product_type = -1;
lastreceived = 0;
Alarm_Type = -1;
}
};
public:
ZWaveBase();
~ZWaveBase(void);
virtual bool GetInitialDevices()=0;
virtual bool GetUpdates()=0;
bool StartHardware();
bool StopHardware();
bool WriteToHardware(const char *pdata, const unsigned char length);
public:
int m_LastIncludedNode;
std::string m_LastIncludedNodeType;
bool m_bHaveLastIncludedNodeInfo;
int m_LastRemovedNode;
boost::mutex m_NotificationMutex;
private:
void Do_Work();
void SendDevice2Domoticz(const _tZWaveDevice *pDevice);
void SendSwitchIfNotExists(const _tZWaveDevice *pDevice);
_tZWaveDevice* FindDevice(const int nodeID, const int instanceID, const int indexID);
_tZWaveDevice* FindDevice(const int nodeID, const int instanceID, const int indexID, const _eZWaveDeviceType devType);
_tZWaveDevice* FindDevice(const int nodeID, const int instanceID, const int indexID, const int CommandClassID, const _eZWaveDeviceType devType);
_tZWaveDevice* FindDeviceEx(const int nodeID, const int instanceID, const _eZWaveDeviceType devType);
void ForceUpdateForNodeDevices(const unsigned int homeID, const int nodeID);
bool IsNodeRGBW(const unsigned int homeID, const int nodeID);
std::string GenerateDeviceStringID(const _tZWaveDevice *pDevice);
void InsertDevice(_tZWaveDevice device);
void UpdateDeviceBatteryStatus(const int nodeID, const int value);
unsigned char Convert_Battery_To_PercInt(const unsigned char level);
virtual bool SwitchLight(const int nodeID, const int instanceID, const int commandClass, const int value)=0;
virtual bool SwitchColor(const int nodeID, const int instanceID, const int commandClass, const std::string &ColorStr) = 0;
virtual void SetThermostatSetPoint(const int nodeID, const int instanceID, const int commandClass, const float value)=0;
virtual void SetClock(const int nodeID, const int instanceID, const int commandClass, const int day, const int hour, const int minute)=0;
virtual void SetThermostatMode(const int nodeID, const int instanceID, const int commandClass, const int tMode) = 0;
virtual void SetThermostatFanMode(const int nodeID, const int instanceID, const int commandClass, const int fMode) = 0;
virtual std::string GetSupportedThermostatFanModes(const unsigned long ID) = 0;
virtual void StopHardwareIntern() = 0;
virtual bool IncludeDevice(const bool bSecure) = 0;
virtual bool ExcludeDevice(const int nodeID)=0;
virtual bool RemoveFailedDevice(const int nodeID)=0;
virtual bool CancelControllerCommand(const bool bForce = false)=0;
virtual bool HasNodeFailed(const int nodeID) = 0;
virtual bool IsNodeIncluded() = 0;
virtual bool IsNodeExcluded() = 0;
bool m_bControllerCommandInProgress;
bool m_bControllerCommandCanceled;
time_t m_ControllerCommandStartTime;
time_t m_updateTime;
bool m_bInitState;
std::map<std::string,_tZWaveDevice> m_devices;
boost::shared_ptr<boost::thread> m_thread;
bool m_stoprequested;
};
|
/*
* 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/>.
*/
/**
* \file SignalWatch_CAN.h
* \author Ratnadip Choudhury
* \copyright Copyright (c) 2011, Robert Bosch Engineering and Business Solutions. All rights reserved.
*/
#pragma once
#include "SignalWatch_Resource.h"
#include "Datatypes/MsgBufAll_Datatypes.h"
#include "Datatypes/SigWatch_Datatypes.h"
#include "SignalWatchDefs.h"
#include "DataTypes/MainSubEntry.h"
#include "SigWatchAddDelDlg.h"
#include "SigWatchDlg.h"
/* MSG INTERPRETATION */
#include "Utility/MsgInterpretation.h"
#include "Utility/Utility_Thread.h"
/* DIL CAN INTERFACE */
#include "DIL_Interface/DIL_Interface_extern.h"
#include "DIL_Interface/BaseDIL_CAN.h"
#include "BaseSignalWatch_CAN.h"
#include "include/XMLDefines.h"
#include "Utility/XMLUtils.h"
class CSignalWatch_CAN : CBaseSignalWatch_CAN
{
public:
CCANBufFSE m_ouCanBufFSE;
private:
BOOL m_bHex;
CSigWatchDlg* m_pouSigWnd;
CMsgInterpretation* m_pMsgInterPretObj;
CPARAM_THREADPROC m_ouReadThread;
CRITICAL_SECTION m_omCritSecSW;
public:
BOOL InitInstance(void);
int ExitInstance(void);
HRESULT SW_DoInitialization(void* RefObj, void* info) ;
HRESULT SW_ShowAddDelSignalsDlg(CWnd* pParent, void* info) ;
HRESULT SW_ShowSigWatchWnd(CWnd* pParent, HWND hMainWnd, INT nCmd);
HRESULT SW_SetDisplayMode(BOOL bHex);
HRESULT SW_GetConfigSize(void);
HRESULT SW_GetConfigData(void* pbyConfigData);
HRESULT SW_GetConfigData(xmlNodePtr pNodePtr);
HRESULT SW_SetConfigData(const void* pbyConfigData);
HRESULT SW_SetConfigData(xmlNodePtr pNode);
HRESULT SW_ClearSigWatchWnd(void);
HRESULT SW_UpdateMsgInterpretObj(void* RefObj);
BOOL SW_IsWindowVisible(void);
void vDisplayInSigWatchWnd(STCANDATA& sCanData);
void vDeleteRemovedListEntries();
private:
BOOL bStartSigWatchReadThread(void);
INT nParseXMLColumn(xmlNodePtr pNode);
}; |
/*
* 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/>.
*/
/**
* @file
* CANControllerConfigDlg.h
*
* @brief
* Implements the configuration dialog to select the baud rate of the CAN controller.
* It's a MFC dialog.
*/
#pragma once
#include <string>
#include "afxwin.h"
/**
* @def IXXAT_NUM_OF_CIA_ENTRIES
*
* @brief
* The number of entries for the baud rate list combo box.
* All CiA baud rates and the "user defined" entry.
*/
#define IXXAT_NUM_OF_CIA_ENTRIES 10
/**
* @def IXXAT_LAST_ENTRY_BAUD_LIST
*
* @brief
* The index number of the last combo box entry.
*
*/
#define IXXAT_LAST_ENTRY_BAUD_LIST 9
/**
* @class CCANControllerConfigDlg
*
* @brief
* MFC-Dialog for setting the CAN controller baud rate.
*
*/
class CCANControllerConfigDlg : public CDialog
{
DECLARE_DYNAMIC(CCANControllerConfigDlg)
public:
CCANControllerConfigDlg(int iBTRRegisters, CWnd* pParent /*=nullptr*/);
virtual ~CCANControllerConfigDlg();
// Dialog Data
enum { IDD = IDD_IXXAT_CAN_CONFIG_DLG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonCancfgOk();
CComboBox m_comboBoxCiABaudSelection;
protected:
/**
* @struct sCiaBaud
*
* @brief
* A structur to fill with the CiA and the user defined
* baud values.
*
*/
struct sCiaBaud
{
std::string strName;
DWORD dwBaud;
DWORD dwBTR0;
DWORD dwBTR1;
};
sCiaBaud m_asBaudList[IXXAT_NUM_OF_CIA_ENTRIES]; ///< List of as baud entries.
DWORD m_dwBTR0; ///< The class member for the bit timing register 0
DWORD m_dwBTR1; ///< The class member for the bit timing register 1
std::string m_strSelectedBaudName; ///< The selected baud rate as string
BOOL m_bSuppressUpdateCalculation; ///< internal flag to prevent problems while changing the combox box selection
void FillBaudStruct();
void UpdateBTRFields(int iIndex);
int GetListIndexFromBTRRegisters();
void UpdateComboBoxIndexFromEditFields();
public:
CEdit m_editBTR0; ///< A corresponing member for the edit box bit timing register 0
CEdit m_editBTR1; ///< A corresponing member for the edit box bit timing register 0
afx_msg void OnCbnSelendokComboCiaBaudSelection();
int GetBitTimingValue();
std::string GetBitTimingName();
afx_msg void OnBnClickedButtonCancel();
afx_msg void OnEnChangeEditBitreg0();
afx_msg void OnEnChangeEditBitreg1();
};
|
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef bpi_DCR_EM_H
#define bpi_DCR_EM_H
/* ---- includes ----------------------------------------------------------- */
#include "b_BasicEm/Context.h"
#include "b_BasicEm/MemTbl.h"
#include "b_ImageEm/UInt16ByteImage.h"
#include "b_ImageEm/UInt32Image.h"
#include "b_TensorEm/IdCluster2D.h"
#include "b_TensorEm/RBFMap2D.h"
#include "b_BitFeatureEm/Scanner.h"
/* ---- related objects --------------------------------------------------- */
/* ---- typedefs ----------------------------------------------------------- */
/* ---- constants ---------------------------------------------------------- */
/** maximum size of dcr cluster */
#define bpi_DCR_MAX_CLUSTER_SIZE 60
/** maximum size of dcr sdk cluster */
#define bpi_DCR_MAX_SDK_CLUSTER_SIZE 24
/* ---- object definition -------------------------------------------------- */
/** data carrier */
struct bpi_DCR
{
/* ---- temporary data ------------------------------------------------- */
/* ---- private data --------------------------------------------------- */
/* ---- public data ---------------------------------------------------- */
/** maximum allowed image width */
uint32 maxImageWidthE;
/** maximum allowed image height */
uint32 maxImageHeightE;
/** pointer to original image data */
void* imageDataPtrE;
/** width of original image */
uint32 imageWidthE;
/** height of original image */
uint32 imageHeightE;
/** offset refering to main and sdk clusters */
struct bts_Int16Vec2D offsE;
/** main cluster */
struct bts_IdCluster2D mainClusterE;
/** output cluster accessible by sdk users */
struct bts_IdCluster2D sdkClusterE;
/** confidence value ( 8.24 ) */
int32 confidenceE;
/** approval flag */
flag approvedE;
/** (image) id value */
int32 idE;
/** region of interest */
struct bts_Int16Rect roiRectE;
/** cue data */
struct bbs_UInt16Arr cueDataE;
};
/* ---- associated objects ------------------------------------------------- */
/* ---- external functions ------------------------------------------------- */
/* ---- \ghd{ constructor/destructor } ------------------------------------- */
/** initializes data carrier */
void bpi_DCR_init( struct bbs_Context* cpA,
struct bpi_DCR* ptrA );
/** destroys data carrier */
void bpi_DCR_exit( struct bbs_Context* cpA,
struct bpi_DCR* ptrA );
/* ---- \ghd{ operators } -------------------------------------------------- */
/* ---- \ghd{ query functions } -------------------------------------------- */
/* ---- \ghd{ modify functions } ------------------------------------------- */
/** create a data carrier */
void bpi_DCR_create( struct bbs_Context* cpA,
struct bpi_DCR* ptrA,
uint32 imageWidthA,
uint32 imageHeightA,
uint32 cueSizeA,
struct bbs_MemTbl* mtpA );
/* ---- \ghd{ memory I/O } ------------------------------------------------- */
/* ---- \ghd{ exec functions } --------------------------------------------- */
/** references external byte gray image through memory block referenced by bufferPtrA to be used as input image */
void bpi_DCR_assignGrayByteImage( struct bbs_Context* cpA,
struct bpi_DCR* ptrA,
const void* bufferPtrA,
uint32 widthA,
uint32 heightA );
/** assigns external byte gray image as input image and region of interest.
*
* bufferPtrA: pointer to memory block of imput image
* pRectA: rectangle describing region of interest
*/
void bpi_DCR_assignGrayByteImageROI( struct bbs_Context* cpA,
struct bpi_DCR* ptrA,
const void* bufferPtrA,
uint32 widthA,
uint32 heightA,
const struct bts_Int16Rect* pRectA );
/** returns confidence 8.24 fixed format */
int32 bpi_DCR_confidence( struct bbs_Context* cpA,
const struct bpi_DCR* ptrA );
#endif /* bpi_DCR_EM_H */
|
// ---------------------------------------------------------------------
//
// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, 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 full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
#ifndef dealii__polynomials_nedelec_h
#define dealii__polynomials_nedelec_h
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/tensor.h>
#include <deal.II/base/point.h>
#include <deal.II/base/polynomial.h>
#include <deal.II/base/polynomial_space.h>
#include <deal.II/base/tensor_product_polynomials.h>
#include <deal.II/base/table.h>
#include <vector>
DEAL_II_NAMESPACE_OPEN
/**
* This class implements the first family <i>H<sup>curl</sup></i>-conforming,
* vector-valued polynomials, proposed by J.-C. Nédélec in 1980 (Numer.
* Math. 35).
*
* The Nédélec polynomials are constructed such that the curl is in the
* tensor product polynomial space <i>Q<sub>k</sub></i>. Therefore, the
* polynomial order of each component must be one order higher in the
* corresponding two directions, yielding the polynomial spaces
* <i>(Q<sub>k,k+1</sub>, Q<sub>k+1,k</sub>)</i> and
* <i>(Q<sub>k,k+1,k+1</sub>, Q<sub>k+1,k,k+1</sub>,
* Q<sub>k+1,k+1,k</sub>)</i> in 2D and 3D, resp.
*
* @ingroup Polynomials
* @author Markus Bürg
* @date 2009, 2010
*/
template <int dim>
class PolynomialsNedelec
{
public:
/**
* Constructor. Creates all basis functions for Nédélec polynomials of
* given degree.
*
* @arg k: the degree of the Nédélec space, which is the degree of the
* largest tensor product polynomial space <i>Q<sub>k</sub></i> contained.
*/
PolynomialsNedelec (const unsigned int k);
/**
* Computes the value and the first and second derivatives of each Nédélec
* polynomial at @p unit_point.
*
* The size of the vectors must either be zero or equal <tt>n()</tt>. In
* the first case, the function will not compute these values.
*
* If you need values or derivatives of all tensor product polynomials then
* use this function, rather than using any of the <tt>compute_value</tt>,
* <tt>compute_grad</tt> or <tt>compute_grad_grad</tt> functions, see below,
* in a loop over all tensor product polynomials.
*/
void compute (const Point<dim> &unit_point, std::vector<Tensor<1, dim> > &values, std::vector<Tensor<2, dim> > &grads, std::vector<Tensor<3, dim> > &grad_grads) const;
/**
* Returns the number of Nédélec polynomials.
*/
unsigned int n () const;
/**
* Returns the degree of the Nédélec space, which is one less than the
* highest polynomial degree.
*/
unsigned int degree () const;
/**
* Return the name of the space, which is <tt>Nedelec</tt>.
*/
std::string name () const;
/**
* Return the number of polynomials in the space <tt>N(degree)</tt> without
* requiring to build an object of PolynomialsNedelec. This is required by
* the FiniteElement classes.
*/
static unsigned int compute_n_pols (unsigned int degree);
private:
/**
* The degree of this object as given to the constructor.
*/
const unsigned int my_degree;
/**
* An object representing the polynomial space for a single component. We
* can re-use it by rotating the coordinates of the evaluation point.
*/
const AnisotropicPolynomials<dim> polynomial_space;
/**
* Number of Nédélec polynomials.
*/
const unsigned int n_pols;
/**
* A static member function that creates the polynomial space we use to
* initialize the #polynomial_space member variable.
*/
static std::vector<std::vector< Polynomials::Polynomial< double > > > create_polynomials (const unsigned int k);
};
template <int dim>
inline unsigned int PolynomialsNedelec<dim>::n () const
{
return n_pols;
}
template <int dim>
inline unsigned int PolynomialsNedelec<dim>::degree () const
{
return my_degree;
}
template <int dim>
inline std::string
PolynomialsNedelec<dim>::name() const
{
return "Nedelec";
}
DEAL_II_NAMESPACE_CLOSE
#endif
|
// Copyright (c) 2005-2008 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Peter Hachenberger <hachenberger@mpi-sb.mpg.de>
#ifndef CGAL_CD3_SFACE_SEPARATOR_H
#define CGAL_CD3_SFACE_SEPARATOR_H
#include <CGAL/Nef_3/SNC_decorator.h>
#include <CGAL/Convex_decomposition_3/SM_walls.h>
namespace CGAL {
template<typename Nef_>
class SFace_separator : public Modifier_base<typename Nef_::SNC_structure> {
typedef Nef_ Nef_polyhedron;
typedef typename Nef_polyhedron::SNC_structure SNC_structure;
typedef typename SNC_structure::Items Items;
typedef CGAL::SNC_decorator<SNC_structure> Base;
typedef CGAL::SNC_point_locator<Base> SNC_point_locator;
typedef CGAL::SNC_constructor<Items, SNC_structure>
SNC_constructor;
typedef typename SNC_structure::Sphere_map Sphere_map;
typedef CGAL::SM_decorator<Sphere_map> SM_decorator;
typedef CGAL::SM_point_locator<SM_decorator> SM_point_locator;
typedef CGAL::SM_walls<Sphere_map> SM_walls;
typedef typename Base::SHalfedge_handle SHalfedge_handle;
typedef typename Base::SHalfloop_handle SHalfloop_handle;
typedef typename Base::SFace_handle SFace_handle;
typedef typename Base::SFace_iterator SFace_iterator;
typedef typename Base::SFace_cycle_iterator SFace_cycle_iterator;
public:
SFace_separator() {}
void operator()(SNC_structure& snc) {
SFace_iterator sf;
CGAL_forall_sfaces(sf, snc) {
if(!sf->mark() ||
sf->sface_cycles_begin() ==
sf->sface_cycles_end()) continue;
SM_decorator SD(&*sf->center_vertex());
SFace_cycle_iterator sfci
(++sf->sface_cycles_begin());
while(sfci != sf->sface_cycles_end()) {
SFace_handle sf_new = SD.new_sface();
sf_new->mark() = sf->mark();
sf_new->volume() = sf->volume();
if(sfci.is_shalfedge()) {
SHalfedge_handle se = sfci;
SD.unlink_as_face_cycle(se);
SD.link_as_face_cycle(se,sf_new);
} else if(sfci.is_shalfloop()) {
SHalfloop_handle sl = sfci;
SD.unlink_as_loop(sl);
SD.link_as_loop(sl, sf_new);
} else
CGAL_error_msg("there should be no isolated edges");
sfci = ++sf->sface_cycles_begin();
}
}
}
};
} //namespace CGAL
#endif //CGAL_CD3_SFACE_SEPARATOR_H
|
// esign.h - originally written and placed in the public domain by Wei Dai
/// \file esign.h
/// \brief Classes providing ESIGN signature schemes as defined in IEEE P1363a
/// \since Crypto++ 5.0
#ifndef CRYPTOPP_ESIGN_H
#define CRYPTOPP_ESIGN_H
#include "cryptlib.h"
#include "pubkey.h"
#include "integer.h"
#include "asn.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief ESIGN trapdoor function using the public key
/// \since Crypto++ 5.0
class ESIGNFunction : public TrapdoorFunction, public ASN1CryptoMaterial<PublicKey>
{
typedef ESIGNFunction ThisClass;
public:
/// \brief Initialize a ESIGN public key with {n,e}
/// \param n the modulus
/// \param e the public exponent
void Initialize(const Integer &n, const Integer &e)
{m_n = n; m_e = e;}
// PublicKey
void BERDecode(BufferedTransformation &bt);
void DEREncode(BufferedTransformation &bt) const;
// CryptoMaterial
bool Validate(RandomNumberGenerator &rng, unsigned int level) const;
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const;
void AssignFrom(const NameValuePairs &source);
// TrapdoorFunction
Integer ApplyFunction(const Integer &x) const;
Integer PreimageBound() const {return m_n;}
Integer ImageBound() const {return Integer::Power2(GetK());}
// non-derived
const Integer & GetModulus() const {return m_n;}
const Integer & GetPublicExponent() const {return m_e;}
void SetModulus(const Integer &n) {m_n = n;}
void SetPublicExponent(const Integer &e) {m_e = e;}
protected:
// Covertiy finding on overflow. The library allows small values for research purposes.
unsigned int GetK() const {return SaturatingSubtract(m_n.BitCount()/3, 1U);}
Integer m_n, m_e;
};
/// \brief ESIGN trapdoor function using the private key
/// \since Crypto++ 5.0
class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey
{
typedef InvertibleESIGNFunction ThisClass;
public:
/// \brief Initialize a ESIGN private key with {n,e,p,q}
/// \param n modulus
/// \param e public exponent
/// \param p first prime factor
/// \param q second prime factor
/// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q)
{m_n = n; m_e = e; m_p = p; m_q = q;}
/// \brief Create a ESIGN private key
/// \param rng a RandomNumberGenerator derived class
/// \param modulusBits the size of the modulud, in bits
/// \details This function overload of Initialize() creates a new private key because it
/// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
/// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
{GenerateRandomWithKeySize(rng, modulusBits);}
// Squash Visual Studio C4250 warning
void Save(BufferedTransformation &bt) const
{BEREncode(bt);}
// Squash Visual Studio C4250 warning
void Load(BufferedTransformation &bt)
{BERDecode(bt);}
void BERDecode(BufferedTransformation &bt);
void DEREncode(BufferedTransformation &bt) const;
Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const;
// GeneratibleCryptoMaterial
bool Validate(RandomNumberGenerator &rng, unsigned int level) const;
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const;
void AssignFrom(const NameValuePairs &source);
/*! parameters: (ModulusSize) */
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
const Integer& GetPrime1() const {return m_p;}
const Integer& GetPrime2() const {return m_q;}
void SetPrime1(const Integer &p) {m_p = p;}
void SetPrime2(const Integer &q) {m_q = q;}
protected:
Integer m_p, m_q;
};
/// \brief EMSA5 padding method
/// \tparam T Mask Generation Function
/// \since Crypto++ 5.0
template <class T>
class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod
{
public:
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "EMSA5";}
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
const byte *recoverableMessage, size_t recoverableMessageLength,
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
byte *representative, size_t representativeBitLength) const
{
CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength);
CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier);
SecByteBlock digest(hash.DigestSize());
hash.Final(digest);
size_t representativeByteLength = BitsToBytes(representativeBitLength);
T mgf;
mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(), false);
if (representativeBitLength % 8 != 0)
representative[0] = (byte)Crop(representative[0], representativeBitLength % 8);
}
};
/// \brief EMSA5 padding method, for use with ESIGN
/// \since Crypto++ 5.0
struct P1363_EMSA5 : public SignatureStandard
{
typedef EMSA5Pad<P1363_MGF1> SignatureMessageEncodingMethod;
};
/// \brief ESIGN keys
/// \since Crypto++ 5.0
struct ESIGN_Keys
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "ESIGN";}
typedef ESIGNFunction PublicKey;
typedef InvertibleESIGNFunction PrivateKey;
};
/// \brief ESIGN signature scheme, IEEE P1363a
/// \tparam H HashTransformation derived class
/// \tparam STANDARD Signature encoding method
/// \since Crypto++ 5.0
template <class H, class STANDARD = P1363_EMSA5>
struct ESIGN : public TF_SS<ESIGN_Keys, STANDARD, H>
{
};
NAMESPACE_END
#endif
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by TaskQueue.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
// Copyright (c) 2013 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_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_H_
#define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_H_
#include <list>
#include <map>
#include <memory>
#include "base/macros.h"
#include "components/keyed_service/content/browser_context_keyed_base_factory.h"
namespace base {
template <typename T>
struct DefaultSingletonTraits;
class SequencedTaskRunner;
} // namespace base
namespace content {
class BrowserContext;
}
namespace policy {
class ConfigurationPolicyProvider;
class ProfilePolicyConnector;
// Creates ProfilePolicyConnectors for Profiles, which manage the common
// policy providers and other policy components.
// TODO(joaodasilva): convert this class to a proper BCKS once the PrefService,
// which depends on this class, becomes a BCKS too.
class ProfilePolicyConnectorFactory : public BrowserContextKeyedBaseFactory {
public:
// Returns the ProfilePolicyConnectorFactory singleton.
static ProfilePolicyConnectorFactory* GetInstance();
// Returns the ProfilePolicyConnector associated with |context|. This is only
// valid before |context| is shut down.
static ProfilePolicyConnector* GetForBrowserContext(
content::BrowserContext* context);
// Creates a new ProfilePolicyConnector for |context|, which must be managed
// by the caller. Subsequent calls to GetForBrowserContext() will return the
// instance created, as long as it lives.
// If |force_immediate_load| is true then policy is loaded synchronously on
// startup.
static std::unique_ptr<ProfilePolicyConnector> CreateForBrowserContext(
content::BrowserContext* context,
bool force_immediate_load);
// Overrides the |connector| for the given |context|; use only in tests.
// Once this class becomes a proper BCKS then it can reuse the testing
// methods of BrowserContextKeyedServiceFactory.
void SetServiceForTesting(content::BrowserContext* context,
ProfilePolicyConnector* connector);
// The next Profile to call CreateForBrowserContext() will get a PolicyService
// with |provider| as its sole policy provider. This can be called multiple
// times to override the policy providers for more than 1 Profile.
void PushProviderForTesting(ConfigurationPolicyProvider* provider);
private:
friend struct base::DefaultSingletonTraits<ProfilePolicyConnectorFactory>;
ProfilePolicyConnectorFactory();
~ProfilePolicyConnectorFactory() override;
ProfilePolicyConnector* GetForBrowserContextInternal(
content::BrowserContext* context);
std::unique_ptr<ProfilePolicyConnector> CreateForBrowserContextInternal(
content::BrowserContext* context,
bool force_immediate_load);
// BrowserContextKeyedBaseFactory:
void BrowserContextShutdown(content::BrowserContext* context) override;
void BrowserContextDestroyed(content::BrowserContext* context) override;
void SetEmptyTestingFactory(content::BrowserContext* context) override;
bool HasTestingFactory(content::BrowserContext* context) override;
void CreateServiceNow(content::BrowserContext* context) override;
typedef std::map<content::BrowserContext*, ProfilePolicyConnector*>
ConnectorMap;
ConnectorMap connectors_;
std::list<ConfigurationPolicyProvider*> test_providers_;
DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnectorFactory);
};
} // namespace policy
#endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_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 UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
#define UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
#include <memory>
#include "base/macros.h"
#include "build/build_config.h"
#include "ui/views/views_delegate.h"
namespace wm {
class WMState;
}
namespace views {
class TestViewsDelegate : public ViewsDelegate {
public:
TestViewsDelegate();
~TestViewsDelegate() override;
// If set to |true|, forces widgets that do not provide a native widget to use
// DesktopNativeWidgetAura instead of whatever the default native widget would
// be. This has no effect on ChromeOS.
void set_use_desktop_native_widgets(bool desktop) {
use_desktop_native_widgets_ = desktop;
}
void set_use_transparent_windows(bool transparent) {
use_transparent_windows_ = transparent;
}
// Allows tests to provide a ContextFactory via the ViewsDelegate interface.
void set_context_factory(ui::ContextFactory* context_factory) {
context_factory_ = context_factory;
}
// ViewsDelegate:
#if defined(OS_WIN)
HICON GetSmallWindowIcon() const override;
#endif
void OnBeforeWidgetInit(Widget::InitParams* params,
internal::NativeWidgetDelegate* delegate) override;
ui::ContextFactory* GetContextFactory() override;
private:
ui::ContextFactory* context_factory_;
bool use_desktop_native_widgets_;
bool use_transparent_windows_;
#if defined(USE_AURA)
std::unique_ptr<wm::WMState> wm_state_;
#endif
DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
};
} // namespace views
#endif // UI_VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_WEBRTC_OVERRIDES_RTC_BASE_EVENT_H_
#define THIRD_PARTY_WEBRTC_OVERRIDES_RTC_BASE_EVENT_H_
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread_restrictions.h"
#include "third_party/webrtc/rtc_base/system/rtc_export.h"
namespace rtc {
// Overrides WebRTC's internal event implementation to use Chromium's.
class RTC_EXPORT Event {
public:
static const int kForever = -1;
Event();
Event(bool manual_reset, bool initially_signaled);
Event(const Event&) = delete;
Event& operator=(const Event&) = delete;
~Event();
void Set();
void Reset();
// Wait for the event to become signaled, for the specified number of
// milliseconds. To wait indefinetly, pass kForever.
bool Wait(int give_up_after_ms);
bool Wait(int give_up_after_ms, int /*warn_after_ms*/) {
return Wait(give_up_after_ms);
}
private:
base::WaitableEvent event_;
};
// Pull ScopedAllowBaseSyncPrimitives(ForTesting) into the rtc namespace.
// Managing what types in WebRTC are allowed to use
// ScopedAllowBaseSyncPrimitives, is done via thread_restrictions.h.
using ScopedAllowBaseSyncPrimitives = base::ScopedAllowBaseSyncPrimitives;
using ScopedAllowBaseSyncPrimitivesForTesting =
base::ScopedAllowBaseSyncPrimitivesForTesting;
} // namespace rtc
#endif // THIRD_PARTY_WEBRTC_OVERRIDES_RTC_BASE_EVENT_H_
|
#include "sysincludes.h"
#include "msdos.h"
#include "mtools.h"
typedef struct Filter_t {
Class_t *Class;
int refs;
Stream_t *Next;
Stream_t *Buffer;
int dospos;
int unixpos;
int mode;
int rw;
int lastchar;
} Filter_t;
#define F_READ 1
#define F_WRITE 2
/* read filter filters out messy dos' bizarre end of lines and final 0x1a's */
static int read_filter(Stream_t *Stream, char *buf, mt_off_t iwhere, size_t len)
{
DeclareThis(Filter_t);
int i,j,ret;
off_t where = truncBytes32(iwhere);
if ( where != This->unixpos ){
fprintf(stderr,"Bad offset\n");
exit(1);
}
if (This->rw == F_WRITE){
fprintf(stderr,"Change of transfer direction!\n");
exit(1);
}
This->rw = F_READ;
ret = READS(This->Next, buf, (mt_off_t) This->dospos, len);
if ( ret < 0 )
return ret;
j = 0;
for (i=0; i< ret; i++){
if ( buf[i] == '\r' )
continue;
if (buf[i] == 0x1a)
break;
This->lastchar = buf[j++] = buf[i];
}
This->dospos += i;
This->unixpos += j;
return j;
}
static int write_filter(Stream_t *Stream, char *buf, mt_off_t iwhere,
size_t len)
{
DeclareThis(Filter_t);
int i,j,ret;
char buffer[1025];
off_t where = truncBytes32(iwhere);
if(This->unixpos == -1)
return -1;
if (where != This->unixpos ){
fprintf(stderr,"Bad offset\n");
exit(1);
}
if (This->rw == F_READ){
fprintf(stderr,"Change of transfer direction!\n");
exit(1);
}
This->rw = F_WRITE;
j=i=0;
while(i < 1024 && j < len){
if (buf[j] == '\n' ){
buffer[i++] = '\r';
buffer[i++] = '\n';
j++;
continue;
}
buffer[i++] = buf[j++];
}
This->unixpos += j;
ret = force_write(This->Next, buffer, (mt_off_t) This->dospos, i);
if(ret >0 )
This->dospos += ret;
if ( ret != i ){
/* no space on target file ? */
This->unixpos = -1;
return -1;
}
return j;
}
static int free_filter(Stream_t *Stream)
{
DeclareThis(Filter_t);
char buffer=0x1a;
/* write end of file */
if (This->rw == F_WRITE)
return force_write(This->Next, &buffer, (mt_off_t) This->dospos, 1);
else
return 0;
}
static Class_t FilterClass = {
read_filter,
write_filter,
0, /* flush */
free_filter,
0, /* set geometry */
get_data_pass_through,
0
};
Stream_t *open_filter(Stream_t *Next)
{
Filter_t *This;
This = New(Filter_t);
if (!This)
return NULL;
This->Class = &FilterClass;
This->dospos = This->unixpos = This->rw = 0;
This->Next = Next;
This->refs = 1;
This->Buffer = 0;
return (Stream_t *) This;
}
|
// Copyright 2013 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_TIMER_ELAPSED_TIMER_H_
#define BASE_TIMER_ELAPSED_TIMER_H_
#include "base/base_export.h"
#include "base/time/time.h"
namespace base {
// A simple wrapper around TimeTicks::Now().
class BASE_EXPORT ElapsedTimer {
public:
ElapsedTimer();
ElapsedTimer(const ElapsedTimer&) = delete;
ElapsedTimer& operator=(const ElapsedTimer&) = delete;
ElapsedTimer(ElapsedTimer&& other);
void operator=(ElapsedTimer&& other);
// Returns the time elapsed since object construction.
TimeDelta Elapsed() const;
// Returns the timestamp of the creation of this timer.
TimeTicks Begin() const { return begin_; }
private:
TimeTicks begin_;
};
// A simple wrapper around ThreadTicks::Now().
class BASE_EXPORT ElapsedThreadTimer {
public:
ElapsedThreadTimer();
ElapsedThreadTimer(const ElapsedThreadTimer&) = delete;
ElapsedThreadTimer& operator=(const ElapsedThreadTimer&) = delete;
// Returns the ThreadTicks time elapsed since object construction.
// Only valid if |is_supported()| returns true, otherwise returns TimeDelta().
TimeDelta Elapsed() const;
bool is_supported() const { return is_supported_; }
private:
const bool is_supported_;
const ThreadTicks begin_;
};
// Whenever there's a ScopedMockElapsedTimersForTest in scope,
// Elapsed(Thread)Timers will always return kMockElapsedTime from Elapsed().
// This is useful, for example, in unit tests that verify that their impl
// records timing histograms. It enables such tests to observe reliable timings.
class BASE_EXPORT ScopedMockElapsedTimersForTest {
public:
static constexpr TimeDelta kMockElapsedTime = Milliseconds(1337);
// ScopedMockElapsedTimersForTest is not thread-safe (it must be instantiated
// in a test before other threads begin using ElapsedTimers; and it must
// conversely outlive any usage of ElapsedTimer in that test).
ScopedMockElapsedTimersForTest();
ScopedMockElapsedTimersForTest(const ScopedMockElapsedTimersForTest&) =
delete;
ScopedMockElapsedTimersForTest& operator=(
const ScopedMockElapsedTimersForTest&) = delete;
~ScopedMockElapsedTimersForTest();
};
} // namespace base
#endif // BASE_TIMER_ELAPSED_TIMER_H_
|
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2018.2
// Copyright (C) 1986-2018 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
#ifdef __linux__
/***************************** Include Files *********************************/
#include "xgcd.h"
/***************** Macros (Inline Functions) Definitions *********************/
#define MAX_UIO_PATH_SIZE 256
#define MAX_UIO_NAME_SIZE 64
#define MAX_UIO_MAPS 5
#define UIO_INVALID_ADDR 0
/**************************** Type Definitions ******************************/
typedef struct {
u32 addr;
u32 size;
} XGcd_uio_map;
typedef struct {
int uio_fd;
int uio_num;
char name[ MAX_UIO_NAME_SIZE ];
char version[ MAX_UIO_NAME_SIZE ];
XGcd_uio_map maps[ MAX_UIO_MAPS ];
} XGcd_uio_info;
/***************** Variable Definitions **************************************/
static XGcd_uio_info uio_info;
/************************** Function Implementation *************************/
static int line_from_file(char* filename, char* linebuf) {
char* s;
int i;
FILE* fp = fopen(filename, "r");
if (!fp) return -1;
s = fgets(linebuf, MAX_UIO_NAME_SIZE, fp);
fclose(fp);
if (!s) return -2;
for (i=0; (*s)&&(i<MAX_UIO_NAME_SIZE); i++) {
if (*s == '\n') *s = 0;
s++;
}
return 0;
}
static int uio_info_read_name(XGcd_uio_info* info) {
char file[ MAX_UIO_PATH_SIZE ];
sprintf(file, "/sys/class/uio/uio%d/name", info->uio_num);
return line_from_file(file, info->name);
}
static int uio_info_read_version(XGcd_uio_info* info) {
char file[ MAX_UIO_PATH_SIZE ];
sprintf(file, "/sys/class/uio/uio%d/version", info->uio_num);
return line_from_file(file, info->version);
}
static int uio_info_read_map_addr(XGcd_uio_info* info, int n) {
int ret;
char file[ MAX_UIO_PATH_SIZE ];
info->maps[n].addr = UIO_INVALID_ADDR;
sprintf(file, "/sys/class/uio/uio%d/maps/map%d/addr", info->uio_num, n);
FILE* fp = fopen(file, "r");
if (!fp) return -1;
ret = fscanf(fp, "0x%x", &info->maps[n].addr);
fclose(fp);
if (ret < 0) return -2;
return 0;
}
static int uio_info_read_map_size(XGcd_uio_info* info, int n) {
int ret;
char file[ MAX_UIO_PATH_SIZE ];
sprintf(file, "/sys/class/uio/uio%d/maps/map%d/size", info->uio_num, n);
FILE* fp = fopen(file, "r");
if (!fp) return -1;
ret = fscanf(fp, "0x%x", &info->maps[n].size);
fclose(fp);
if (ret < 0) return -2;
return 0;
}
int XGcd_Initialize(XGcd *InstancePtr, const char* InstanceName) {
XGcd_uio_info *InfoPtr = &uio_info;
struct dirent **namelist;
int i, n;
char* s;
char file[ MAX_UIO_PATH_SIZE ];
char name[ MAX_UIO_NAME_SIZE ];
int flag = 0;
assert(InstancePtr != NULL);
n = scandir("/sys/class/uio", &namelist, 0, alphasort);
if (n < 0) return XST_DEVICE_NOT_FOUND;
for (i = 0; i < n; i++) {
strcpy(file, "/sys/class/uio/");
strcat(file, namelist[i]->d_name);
strcat(file, "/name");
if ((line_from_file(file, name) == 0) && (strcmp(name, InstanceName) == 0)) {
flag = 1;
s = namelist[i]->d_name;
s += 3; // "uio"
InfoPtr->uio_num = atoi(s);
break;
}
}
if (flag == 0) return XST_DEVICE_NOT_FOUND;
uio_info_read_name(InfoPtr);
uio_info_read_version(InfoPtr);
for (n = 0; n < MAX_UIO_MAPS; ++n) {
uio_info_read_map_addr(InfoPtr, n);
uio_info_read_map_size(InfoPtr, n);
}
sprintf(file, "/dev/uio%d", InfoPtr->uio_num);
if ((InfoPtr->uio_fd = open(file, O_RDWR)) < 0) {
return XST_OPEN_DEVICE_FAILED;
}
// NOTE: slave interface 'Gcd_bus' should be mapped to uioX/map0
InstancePtr->Gcd_bus_BaseAddress = (u32)mmap(NULL, InfoPtr->maps[0].size, PROT_READ|PROT_WRITE, MAP_SHARED, InfoPtr->uio_fd, 0 * getpagesize());
assert(InstancePtr->Gcd_bus_BaseAddress);
InstancePtr->IsReady = XIL_COMPONENT_IS_READY;
return XST_SUCCESS;
}
int XGcd_Release(XGcd *InstancePtr) {
XGcd_uio_info *InfoPtr = &uio_info;
assert(InstancePtr != NULL);
assert(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
munmap((void*)InstancePtr->Gcd_bus_BaseAddress, InfoPtr->maps[0].size);
close(InfoPtr->uio_fd);
return XST_SUCCESS;
}
#endif
|
/* Copyright 2020 MT
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_64_ansi(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
KC_LCTL, KC_LALT, KC_LWIN, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_64_ansi(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9 , KC_F10, KC_F11, KC_F12, _______,
_______, _______,_______,_______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______,
RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, _______, _______,_______, _______,
_______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, _______,_______,_______,_______,
_______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
void rgb_matrix_indicators_user(void) {
if (!g_suspend_state && layer_state_is(1)) {
rgb_matrix_set_color(77,0xFF, 0x80, 0x00);
}
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF);
}
}
|
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2009 Trolltech ASA.
**
** Contact: Qt Extended Information (info@qtextended.org)
**
** This file may be used under the terms of the GNU General Public License
** version 2.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.
**
**
****************************************************************************/
#ifndef QVIDEOTOOLS_H
#define QVIDEOTOOLS_H
#include <qtopiaglobal.h>
#include <QVideoFrame>
#include "qcamera.h"
QSize QTOPIAVIDEO_EXPORT qResolutionToQSize(int res);
QVideoFrame::PixelFormat QTOPIAVIDEO_EXPORT qFourccToVideoFormat(unsigned int);
#endif
|
#ifndef __MTK_MEMCFG_H__
#define __MTK_MEMCFG_H__
#ifdef CONFIG_MTK_MEMCFG
#define MTK_MEMCFG_LOG_AND_PRINTK(fmt, arg...) \
do { \
printk(fmt, ##arg); \
mtk_memcfg_write_memory_layout_buf(fmt, ##arg); \
} while (0)
extern void mtk_memcfg_write_memory_layout_buf(char *, ...);
extern unsigned long mtk_memcfg_get_force_inode_gfp_lowmem(void);
extern unsigned long mtk_memcfg_set_force_inode_gfp_lowmem(unsigned long);
#ifdef CONFIG_SLUB_DEBUG
extern unsigned long mtk_memcfg_get_bypass_slub_debug_flag(void);
extern unsigned long mtk_memcfg_set_bypass_slub_debug_flag(unsigned long);
#else
#define mtk_memcfg_get_bypass_slub_debug_flag() (0)
#define mtk_memcfg_set_bypass_slub_debug_flag(flag) (0)
#endif /* end CONFIG_SLUB_DEBUG */
#else
#define MTK_MEMCFG_LOG_AND_PRINTK(fmt, arg...) \
do { \
printk(fmt, ##arg); \
} while (0)
#define mtk_memcfg_get_force_inode_gfp_lowmem() (0)
#define mtk_memcfg_set_force_inode_gfp_lowmem(flag) (0)
#define mtk_memcfg_get_bypass_slub_debug_flag() (0)
#define mtk_memcfg_set_bypass_slub_debug_flag(flag) (0)
#define mtk_memcfg_write_memory_layout_buf(fmt, arg...) do { } while (0)
#endif /* end CONFIG_MTK_MEMCFG */
#endif /* end __MTK_MEMCFG_H__ */
|
/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_AUDIO_TRANSPORT_IMPL_H_
#define AUDIO_AUDIO_TRANSPORT_IMPL_H_
#include <memory>
#include <vector>
#include "api/audio/audio_mixer.h"
#include "api/scoped_refptr.h"
#include "common_audio/resampler/include/push_resampler.h"
#include "modules/async_audio_processing/async_audio_processing.h"
#include "modules/audio_device/include/audio_device.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/audio_processing/typing_detection.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_annotations.h"
namespace webrtc {
class AudioSender;
class AudioTransportImpl : public AudioTransport {
public:
AudioTransportImpl(
AudioMixer* mixer,
AudioProcessing* audio_processing,
AsyncAudioProcessing::Factory* async_audio_processing_factory);
AudioTransportImpl() = delete;
AudioTransportImpl(const AudioTransportImpl&) = delete;
AudioTransportImpl& operator=(const AudioTransportImpl&) = delete;
~AudioTransportImpl() override;
int32_t RecordedDataIsAvailable(const void* audioSamples,
const size_t nSamples,
const size_t nBytesPerSample,
const size_t nChannels,
const uint32_t samplesPerSec,
const uint32_t totalDelayMS,
const int32_t clockDrift,
const uint32_t currentMicLevel,
const bool keyPressed,
uint32_t& newMicLevel) override;
int32_t NeedMorePlayData(const size_t nSamples,
const size_t nBytesPerSample,
const size_t nChannels,
const uint32_t samplesPerSec,
void* audioSamples,
size_t& nSamplesOut,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) override;
void PullRenderData(int bits_per_sample,
int sample_rate,
size_t number_of_channels,
size_t number_of_frames,
void* audio_data,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) override;
void UpdateAudioSenders(std::vector<AudioSender*> senders,
int send_sample_rate_hz,
size_t send_num_channels);
void SetStereoChannelSwapping(bool enable);
bool typing_noise_detected() const;
private:
void SendProcessedData(std::unique_ptr<AudioFrame> audio_frame);
// Shared.
AudioProcessing* audio_processing_ = nullptr;
// Capture side.
// Thread-safe.
const std::unique_ptr<AsyncAudioProcessing> async_audio_processing_;
mutable Mutex capture_lock_;
std::vector<AudioSender*> audio_senders_ RTC_GUARDED_BY(capture_lock_);
int send_sample_rate_hz_ RTC_GUARDED_BY(capture_lock_) = 8000;
size_t send_num_channels_ RTC_GUARDED_BY(capture_lock_) = 1;
bool typing_noise_detected_ RTC_GUARDED_BY(capture_lock_) = false;
bool swap_stereo_channels_ RTC_GUARDED_BY(capture_lock_) = false;
PushResampler<int16_t> capture_resampler_;
TypingDetection typing_detection_;
// Render side.
rtc::scoped_refptr<AudioMixer> mixer_;
AudioFrame mixed_frame_;
// Converts mixed audio to the audio device output rate.
PushResampler<int16_t> render_resampler_;
};
} // namespace webrtc
#endif // AUDIO_AUDIO_TRANSPORT_IMPL_H_
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
* Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc.
*/
#include <arch/io.h>
#include <soc/pci_devs.h>
#include <soc/systemagent.h>
static void bootblock_northbridge_init(void)
{
uint32_t reg;
/*
* The "io" variant of the config access is explicitly used to
* setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT_DEFAULT is set to
* to true. That way all subsequent non-explicit config accesses use
* MCFG. This code also assumes that bootblock_northbridge_init() is
* the first thing called in the non-asm boot block code. The final
* assumption is that no assembly code is using the
* CONFIG_MMCONF_SUPPORT_DEFAULT option to do PCI config acceses.
*
* The PCIEXBAR is assumed to live in the memory mapped IO space under
* 4GiB.
*/
reg = 0;
pci_io_write_config32(SA_DEV_ROOT, PCIEXBAR + 4, reg);
reg = CONFIG_MMCONF_BASE_ADDRESS | 4 | 1; /* 64MiB - 0-63 buses. */
pci_io_write_config32(SA_DEV_ROOT, PCIEXBAR, reg);
}
|
/**
* \file
* <!--
* This file is part of BeRTOS.
*
* Bertos is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
* Copyright 2010 Develer S.r.l. (http://www.develer.com/)
* -->
*
* \brief Keyboard map definitions.
*
* \author Andrea Righi <arighi@develer.com>
*/
#ifndef HW_KBD_MAP_H
#define HW_KBD_MAP_H
#include <cfg/macros.h>
/**
* Type for keyboard mask.
*/
typedef uint16_t keymask_t;
/**
* \name Keycodes.
*/
/*@{*/
#define K_UP BV(0)
#define K_DOWN BV(1)
#define K_LEFT BV(2)
#define K_RIGHT BV(3)
#define K_OK BV(4)
#define K_CANCEL BV(8)
#define K_REPEAT BV(13) /**< This is a repeated keyevent. */
#define K_TIMEOUT BV(14) /**< Fake key event for timeouts. */
#define K_LONG BV(15)
/*@}*/
#define K_LNG_MASK 0
#endif /* HW_KBD_MAP_H */
|
#ifndef _RTSP_H
#define _RTSP_H
void rtsp_listen_loop(void);
void rtsp_shutdown_stream(void);
#endif // _RTSP_H
|
/*
* Copyright (c) 2011 Atheros Communications Inc.
* Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef DEBUG_H
#define DEBUG_H
#include "hif.h"
#include "trace.h"
enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_CREDIT = BIT(0),
/* hole */
ATH6KL_DBG_WLAN_TX = BIT(2), /* wlan tx */
ATH6KL_DBG_WLAN_RX = BIT(3), /* wlan rx */
ATH6KL_DBG_BMI = BIT(4), /* bmi tracing */
ATH6KL_DBG_HTC = BIT(5),
ATH6KL_DBG_HIF = BIT(6),
ATH6KL_DBG_IRQ = BIT(7), /* interrupt processing */
/* hole */
/* hole */
ATH6KL_DBG_WMI = BIT(10), /* wmi tracing */
ATH6KL_DBG_TRC = BIT(11), /* generic func tracing */
ATH6KL_DBG_SCATTER = BIT(12), /* hif scatter tracing */
ATH6KL_DBG_WLAN_CFG = BIT(13), /* cfg80211 i/f file tracing */
ATH6KL_DBG_RAW_BYTES = BIT(14), /* dump tx/rx frames */
ATH6KL_DBG_AGGR = BIT(15), /* aggregation */
ATH6KL_DBG_SDIO = BIT(16),
ATH6KL_DBG_SDIO_DUMP = BIT(17),
ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
ATH6KL_DBG_WMI_DUMP = BIT(19),
ATH6KL_DBG_SUSPEND = BIT(20),
ATH6KL_DBG_USB = BIT(21),
ATH6KL_DBG_USB_BULK = BIT(22),
ATH6KL_DBG_RECOVERY = BIT(23),
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
};
extern unsigned int debug_mask;
__printf(2, 3) void ath6kl_printk(const char *level, const char *fmt, ...);
__printf(1, 2) void ath6kl_info(const char *fmt, ...);
__printf(1, 2) void ath6kl_err(const char *fmt, ...);
__printf(1, 2) void ath6kl_warn(const char *fmt, ...);
enum ath6kl_war {
ATH6KL_WAR_INVALID_RATE,
};
#ifdef CONFIG_BACKPORT_ATH6KL_DEBUG
void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...);
void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
const void *buf, size_t len);
void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
struct ath6kl_irq_enable_reg *irq_en_reg);
void dump_cred_dist_stats(struct htc_target *target);
void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len);
void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war);
int ath6kl_debug_roam_tbl_event(struct ath6kl *ar, const void *buf,
size_t len);
void ath6kl_debug_set_keepalive(struct ath6kl *ar, u8 keepalive);
void ath6kl_debug_set_disconnect_timeout(struct ath6kl *ar, u8 timeout);
void ath6kl_debug_init(struct ath6kl *ar);
int ath6kl_debug_init_fs(struct ath6kl *ar);
void ath6kl_debug_cleanup(struct ath6kl *ar);
#else
static inline void ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask,
const char *fmt, ...)
{
}
static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
const void *buf, size_t len)
{
}
static inline void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
struct ath6kl_irq_enable_reg *irq_en_reg)
{
}
static inline void dump_cred_dist_stats(struct htc_target *target)
{
}
static inline void ath6kl_debug_fwlog_event(struct ath6kl *ar,
const void *buf, size_t len)
{
}
static inline void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war)
{
}
static inline int ath6kl_debug_roam_tbl_event(struct ath6kl *ar,
const void *buf, size_t len)
{
return 0;
}
static inline void ath6kl_debug_set_keepalive(struct ath6kl *ar, u8 keepalive)
{
}
static inline void ath6kl_debug_set_disconnect_timeout(struct ath6kl *ar,
u8 timeout)
{
}
static inline void ath6kl_debug_init(struct ath6kl *ar)
{
}
static inline int ath6kl_debug_init_fs(struct ath6kl *ar)
{
return 0;
}
static inline void ath6kl_debug_cleanup(struct ath6kl *ar)
{
}
#endif
#endif
|
/*
* include/asm-xtensa/swab.h
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2001 - 2005 Tensilica Inc.
*/
#ifndef _XTENSA_SWAB_H
#define _XTENSA_SWAB_H
#include <linux/types.h>
#include <linux/compiler.h>
#define __SWAB_64_THRU_32__
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
__u32 res;
/* */
__asm__("ssai 8 \n\t"
"srli %0, %1, 16 \n\t"
"src %0, %0, %1 \n\t"
"src %0, %0, %0 \n\t"
"src %0, %1, %0 \n"
: "=&a" (res)
: "a" (x)
);
return res;
}
#define __arch_swab32 __arch_swab32
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
/*
*/
/*
*/
__u32 res;
__u32 tmp;
__asm__("extui %1, %2, 8, 8\n\t"
"slli %0, %2, 8 \n\t"
"or %0, %0, %1 \n"
: "=&a" (res), "=&a" (tmp)
: "a" (x)
);
return res;
}
#define __arch_swab16 __arch_swab16
#endif /* */
|
/**
* @file
*
* @ingroup IMFS
*/
/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include "imfs.h"
static const rtems_filesystem_file_handlers_r IMFS_dir_minimal_handlers = {
.open_h = rtems_filesystem_default_open,
.close_h = rtems_filesystem_default_close,
.read_h = rtems_filesystem_default_read,
.write_h = rtems_filesystem_default_write,
.ioctl_h = rtems_filesystem_default_ioctl,
.lseek_h = rtems_filesystem_default_lseek_directory,
.fstat_h = IMFS_stat,
.ftruncate_h = rtems_filesystem_default_ftruncate_directory,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
.fcntl_h = rtems_filesystem_default_fcntl,
.kqfilter_h = rtems_filesystem_default_kqfilter,
.poll_h = rtems_filesystem_default_poll,
.readv_h = rtems_filesystem_default_readv,
.writev_h = rtems_filesystem_default_writev
};
const IMFS_mknod_control IMFS_mknod_control_dir_minimal = {
{
.handlers = &IMFS_dir_minimal_handlers,
.node_initialize = IMFS_node_initialize_directory,
.node_remove = IMFS_node_remove_directory,
.node_destroy = IMFS_node_destroy_default
},
.node_size = sizeof( IMFS_directory_t )
};
|
/*
* Header for Bestcomm FEC tasks driver
*
*
* Copyright (C) 2006-2007 Sylvain Munaut <tnt@246tNt.com>
* Copyright (C) 2003-2004 MontaVista, Software, Inc.
* ( by Dale Farnsworth <dfarnsworth@mvista.com> )
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/
#ifndef __BESTCOMM_FEC_H__
#define __BESTCOMM_FEC_H__
struct bcom_fec_bd {
u32 status;
u32 skb_pa;
};
#define BCOM_FEC_TX_BD_TFD 0x08000000ul /* */
#define BCOM_FEC_TX_BD_TC 0x04000000ul /* */
#define BCOM_FEC_TX_BD_ABC 0x02000000ul /* */
#define BCOM_FEC_RX_BD_L 0x08000000ul /* */
#define BCOM_FEC_RX_BD_BC 0x00800000ul /* */
#define BCOM_FEC_RX_BD_MC 0x00400000ul /* */
#define BCOM_FEC_RX_BD_LG 0x00200000ul /* */
#define BCOM_FEC_RX_BD_NO 0x00100000ul /* */
#define BCOM_FEC_RX_BD_CR 0x00040000ul /* */
#define BCOM_FEC_RX_BD_OV 0x00020000ul /* */
#define BCOM_FEC_RX_BD_TR 0x00010000ul /* */
#define BCOM_FEC_RX_BD_LEN_MASK 0x000007fful /* */
#define BCOM_FEC_RX_BD_ERRORS (BCOM_FEC_RX_BD_LG | BCOM_FEC_RX_BD_NO | \
BCOM_FEC_RX_BD_CR | BCOM_FEC_RX_BD_OV | BCOM_FEC_RX_BD_TR)
extern struct bcom_task *
bcom_fec_rx_init(int queue_len, phys_addr_t fifo, int maxbufsize);
extern int
bcom_fec_rx_reset(struct bcom_task *tsk);
extern void
bcom_fec_rx_release(struct bcom_task *tsk);
extern struct bcom_task *
bcom_fec_tx_init(int queue_len, phys_addr_t fifo);
extern int
bcom_fec_tx_reset(struct bcom_task *tsk);
extern void
bcom_fec_tx_release(struct bcom_task *tsk);
#endif /* */
|
/*
sample.h: The conversion from internal data to output samples of differing formats.
copyright 2007-9 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
Later added the end-conversion specific macros here, too.
*/
#ifndef SAMPLE_H
#define SAMPLE_H
/* mpg123lib_intern.h is included already, right? */
/* Special case is fixed point math... which does work, but not that nice yet. */
#ifdef REAL_IS_FIXED
static inline int16_t idiv_signed_rounded(int32_t x, int shift)
{
x >>= (shift - 1);
x += (x & 1);
return (int16_t)(x >> 1);
}
# define REAL_PLUS_32767 ( 32767 << 15 )
# define REAL_MINUS_32768 ( -32768 << 15 )
# define REAL_TO_SHORT(x) (idiv_signed_rounded(x, 15))
/* No better code (yet). */
# define REAL_TO_SHORT_ACCURATE(x) REAL_TO_SHORT(x)
/* This is just here for completeness, it is not used! */
# define REAL_TO_S32(x) (x)
#endif
/* From now on for single precision float... double precision is a possible option once we added some bits. But, it would be rather insane. */
#ifndef REAL_TO_SHORT
#if (defined FORCE_ACCURATE) || (defined ACCURATE_ROUNDING)
/* Define the accurate rounding function. */
# if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT)
/* This function is only available for IEEE754 single-precision values
This is nearly identical to proper rounding, just -+0.5 is rounded to 0 */
static inline int16_t ftoi16(float x)
{
union
{
float f;
int32_t i;
} u_fi;
u_fi.f = x + 12582912.0f; /* Magic Number: 2^23 + 2^22 */
return (int16_t)u_fi.i;
}
# define REAL_TO_SHORT_ACCURATE(x) ftoi16(x)
# else
/* The "proper" rounding, plain C, a bit slow. */
# define REAL_TO_SHORT_ACCURATE(x) (short)((x)>0.0?(x)+0.5:(x)-0.5)
# endif
#endif
/* Now define the normal rounding. */
# ifdef ACCURATE_ROUNDING
# define REAL_TO_SHORT(x) REAL_TO_SHORT_ACCURATE(x)
# else
/* Non-accurate rounding... simple truncation. Fastest, most LSB errors. */
# define REAL_TO_SHORT(x) (short)(x)
# endif
#endif /* REAL_TO_SHORT */
/* We should add dithering for S32, too? */
#ifndef REAL_TO_S32
# ifdef ACCURATE_ROUNDING
# define REAL_TO_S32(x) (int32_t)((x)>0.0?(x)+0.5:(x)-0.5)
# else
# define REAL_TO_S32(x) (int32_t)(x)
# endif
#endif
#ifndef REAL_PLUS_32767
# define REAL_PLUS_32767 32767.0
#endif
#ifndef REAL_MINUS_32768
# define REAL_MINUS_32768 -32768.0
#endif
#ifndef REAL_PLUS_S32
# define REAL_PLUS_S32 2147483647.0
#endif
#ifndef REAL_MINUS_S32
# define REAL_MINUS_S32 -2147483648.0
#endif
/* The actual storage of a decoded sample is separated in the following macros.
We can handle different types, we could also handle dithering here. */
#ifdef NEWOLD_WRITE_SAMPLE
/* This is the old new mpg123 WRITE_SAMPLE, fixed for newer GCC by MPlayer folks.
Makes a huge difference on old machines. */
#if WORDS_BIGENDIAN
#define MANTISSA_OFFSET 1
#else
#define MANTISSA_OFFSET 0
#endif
#define WRITE_SHORT_SAMPLE(samples,sum,clip) { \
union { double dtemp; int itemp[2]; } u; int v; \
u.dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
v = u.itemp[MANTISSA_OFFSET] - 0x80000000; \
if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = v; } \
}
#else
/* Macro to produce a short (signed 16bit) output sample from internal representation,
which may be float, double or indeed some integer for fixed point handling. */
#define WRITE_SHORT_SAMPLE(samples,sum,clip) \
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = REAL_TO_SHORT(sum); }
#endif
/* Same as above, but always using accurate rounding. Would we want softer clipping here, too? */
#define WRITE_SHORT_SAMPLE_ACCURATE(samples,sum,clip) \
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = REAL_TO_SHORT_ACCURATE(sum); }
/*
32bit signed
We do clipping with the same old borders... but different conversion.
We see here that we need extra work for non-16bit output... we optimized for 16bit.
-0x7fffffff-1 is the minimum 32 bit signed integer value expressed so that MSVC
does not give a compile time warning.
*/
#define WRITE_S32_SAMPLE(samples,sum,clip) \
{ \
real tmpsum = REAL_MUL((sum),S32_RESCALE); \
if( tmpsum > REAL_PLUS_S32 ){ *(samples) = 0x7fffffff; (clip)++; } \
else if( tmpsum < REAL_MINUS_S32 ) { *(samples) = -0x7fffffff-1; (clip)++; } \
else { *(samples) = REAL_TO_S32(tmpsum); } \
}
/* Produce an 8bit sample, via 16bit intermediate. */
#define WRITE_8BIT_SAMPLE(samples,sum,clip) \
{ \
int16_t write_8bit_tmp; \
if( (sum) > REAL_PLUS_32767) { write_8bit_tmp = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { write_8bit_tmp = -0x8000; (clip)++; } \
else { write_8bit_tmp = REAL_TO_SHORT(sum); } \
*(samples) = fr->conv16to8[write_8bit_tmp>>AUSHIFT]; \
}
#ifndef REAL_IS_FIXED
#define WRITE_REAL_SAMPLE(samples,sum,clip) *(samples) = ((real)1./SHORT_SCALE)*(sum)
#endif
#endif
|
#pragma once
#include <AP_Common/AP_Common.h>
#include <AP_Param/AP_Param.h>
#include <AP_Math/AP_Math.h>
#include <AP_InertialNav/AP_InertialNav.h> // Inertial Navigation library
#include <AC_AttitudeControl/AC_PosControl.h> // Position control library
// loiter maximum velocities and accelerations
#define AC_CIRCLE_RADIUS_DEFAULT 1000.0f // radius of the circle in cm that the vehicle will fly
#define AC_CIRCLE_RATE_DEFAULT 20.0f // turn rate in deg/sec. Positive to turn clockwise, negative for counter clockwise
#define AC_CIRCLE_ANGULAR_ACCEL_MIN 2.0f // angular acceleration should never be less than 2deg/sec
#define AC_CIRCLE_DEGX100 5729.57795f // constant to convert from radians to centi-degrees
class AC_Circle
{
public:
/// Constructor
AC_Circle(const AP_InertialNav& inav, const AP_AHRS& ahrs, AC_PosControl& pos_control);
/// init - initialise circle controller setting center specifically
/// caller should set the position controller's x,y and z speeds and accelerations before calling this
void init(const Vector3f& center);
/// init - initialise circle controller setting center using stopping point and projecting out based on the copter's heading
/// caller should set the position controller's x,y and z speeds and accelerations before calling this
void init();
/// set_circle_center in cm from home
void set_center(const Vector3f& center) { _center = center; }
/// get_circle_center in cm from home
const Vector3f& get_center() const { return _center; }
/// get_radius - returns radius of circle in cm
float get_radius() { return _radius; }
/// set_radius - sets circle radius in cm
void set_radius(float radius_cm) { _radius = radius_cm; }
/// set_circle_rate - set circle rate in degrees per second
void set_rate(float deg_per_sec);
/// get_angle_total - return total angle in radians that vehicle has circled
float get_angle_total() const { return _angle_total; }
/// update - update circle controller
void update();
/// get desired roll, pitch which should be fed into stabilize controllers
int32_t get_roll() const { return _pos_control.get_roll(); }
int32_t get_pitch() const { return _pos_control.get_pitch(); }
int32_t get_yaw() const { return _yaw; }
// get_closest_point_on_circle - returns closest point on the circle
// circle's center should already have been set
// closest point on the circle will be placed in result
// result's altitude (i.e. z) will be set to the circle_center's altitude
// if vehicle is at the center of the circle, the edge directly behind vehicle will be returned
void get_closest_point_on_circle(Vector3f &result);
static const struct AP_Param::GroupInfo var_info[];
private:
// calc_velocities - calculate angular velocity max and acceleration based on radius and rate
// this should be called whenever the radius or rate are changed
// initialises the yaw and current position around the circle
// init_velocity should be set true if vehicle is just starting circle
void calc_velocities(bool init_velocity);
// init_start_angle - sets the starting angle around the circle and initialises the angle_total
// if use_heading is true the vehicle's heading will be used to init the angle causing minimum yaw movement
// if use_heading is false the vehicle's position from the center will be used to initialise the angle
void init_start_angle(bool use_heading);
// flags structure
struct circle_flags {
uint8_t panorama : 1; // true if we are doing a panorama
} _flags;
// references to inertial nav and ahrs libraries
const AP_InertialNav& _inav;
const AP_AHRS& _ahrs;
AC_PosControl& _pos_control;
// parameters
AP_Float _radius; // maximum horizontal speed in cm/s during missions
AP_Float _rate; // rotation speed in deg/sec
// internal variables
Vector3f _center; // center of circle in cm from home
float _yaw; // yaw heading (normally towards circle center)
float _angle; // current angular position around circle in radians (0=directly north of the center of the circle)
float _angle_total; // total angle travelled in radians
float _angular_vel; // angular velocity in radians/sec
float _angular_vel_max; // maximum velocity in radians/sec
float _angular_accel; // angular acceleration in radians/sec/sec
};
|
/*
SuperCollider real time audio synthesis system
Copyright (c) 2002 James McCartney. All rights reserved.
http://www.audiosynth.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SC_SynthImpl_
#define _SC_SynthImpl_
#include "SC_Synth.h"
#include "SC_SynthDef.h"
#include "HashTable.h"
#include "SC_AllocPool.h"
#include "SC_UnorderedList.h"
extern SynthInterfaceTable gSynthInterfaceTable;
void InitSynthInterfaceTable();
typedef void (*SetupInterfaceFunc)(SynthInterfaceTable*);
const int kMaxSynths = 1024;
extern StaticHashTable<Synth, kMaxSynths, const char*> gSynthTable;
extern AllocPool *gSynthAllocPool;
extern float32 gSine[8193];
#endif |
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __VECTORS_COMMANDS_H__
#define __VECTORS_COMMANDS_H__
void vectors_vectors_tool_cmd_callback (GtkAction *action,
gpointer data);
void vectors_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);
void vectors_new_cmd_callback (GtkAction *action,
gpointer data);
void vectors_new_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void vectors_raise_cmd_callback (GtkAction *action,
gpointer data);
void vectors_raise_to_top_cmd_callback (GtkAction *action,
gpointer data);
void vectors_lower_cmd_callback (GtkAction *action,
gpointer data);
void vectors_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data);
void vectors_duplicate_cmd_callback (GtkAction *action,
gpointer data);
void vectors_delete_cmd_callback (GtkAction *action,
gpointer data);
void vectors_merge_visible_cmd_callback (GtkAction *action,
gpointer data);
void vectors_to_selection_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void vectors_selection_to_vectors_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void vectors_stroke_cmd_callback (GtkAction *action,
gpointer data);
void vectors_stroke_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void vectors_copy_cmd_callback (GtkAction *action,
gpointer data);
void vectors_paste_cmd_callback (GtkAction *action,
gpointer data);
void vectors_export_cmd_callback (GtkAction *action,
gpointer data);
void vectors_import_cmd_callback (GtkAction *action,
gpointer data);
void vectors_visible_cmd_callback (GtkAction *action,
gpointer data);
void vectors_linked_cmd_callback (GtkAction *action,
gpointer data);
void vectors_lock_content_cmd_callback (GtkAction *action,
gpointer data);
void vectors_lock_position_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __VECTORS_COMMANDS_H__ */
|
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_values.h"
#include "include/capi/cef_values_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefListValueCToCpp
: public CefCToCpp<CefListValueCToCpp, CefListValue, cef_list_value_t> {
public:
CefListValueCToCpp();
// CefListValue methods.
bool IsValid() OVERRIDE;
bool IsOwned() OVERRIDE;
bool IsReadOnly() OVERRIDE;
bool IsSame(CefRefPtr<CefListValue> that) OVERRIDE;
bool IsEqual(CefRefPtr<CefListValue> that) OVERRIDE;
CefRefPtr<CefListValue> Copy() OVERRIDE;
bool SetSize(size_t size) OVERRIDE;
size_t GetSize() OVERRIDE;
bool Clear() OVERRIDE;
bool Remove(int index) OVERRIDE;
CefValueType GetType(int index) OVERRIDE;
CefRefPtr<CefValue> GetValue(int index) OVERRIDE;
bool GetBool(int index) OVERRIDE;
int GetInt(int index) OVERRIDE;
double GetDouble(int index) OVERRIDE;
CefString GetString(int index) OVERRIDE;
CefRefPtr<CefBinaryValue> GetBinary(int index) OVERRIDE;
CefRefPtr<CefDictionaryValue> GetDictionary(int index) OVERRIDE;
CefRefPtr<CefListValue> GetList(int index) OVERRIDE;
bool SetValue(int index, CefRefPtr<CefValue> value) OVERRIDE;
bool SetNull(int index) OVERRIDE;
bool SetBool(int index, bool value) OVERRIDE;
bool SetInt(int index, int value) OVERRIDE;
bool SetDouble(int index, double value) OVERRIDE;
bool SetString(int index, const CefString& value) OVERRIDE;
bool SetBinary(int index, CefRefPtr<CefBinaryValue> value) OVERRIDE;
bool SetDictionary(int index, CefRefPtr<CefDictionaryValue> value) OVERRIDE;
bool SetList(int index, CefRefPtr<CefListValue> value) OVERRIDE;
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_
|
// @(#)root/eve:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TEveDigitSetEditor
#define ROOT_TEveDigitSetEditor
#include "TGedFrame.h"
class TGCheckButton;
class TGNumberEntry;
class TGColorSelect;
class TEveDigitSet;
class TEveGValuator;
class TEveGDoubleValuator;
class TEveTransSubEditor;
// It would be also good to have button to change model to the palette
// object itself.
class TEveRGBAPaletteSubEditor;
class TEveDigitSetEditor : public TGedFrame
{
private:
TEveDigitSetEditor(const TEveDigitSetEditor&); // Not implemented
TEveDigitSetEditor& operator=(const TEveDigitSetEditor&); // Not implemented
void CreateInfoTab();
protected:
TEveDigitSet *fM; // Model object.
TEveRGBAPaletteSubEditor *fPalette; // Palette sub-editor.
TGHorizontalFrame *fHistoButtFrame; // Frame holding histogram display buttons.
TGVerticalFrame *fInfoFrame; // Frame displaying basic digit statistics.
public:
TEveDigitSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual ~TEveDigitSetEditor() {}
virtual void SetModel(TObject* obj);
// Declare callback/slot methods
void DoHisto();
void DoRangeHisto();
void PlotHisto(Int_t min, Int_t max);
ClassDef(TEveDigitSetEditor, 1); // Editor for TEveDigitSet class.
};
#endif
|
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
#ifndef CLING_VALUE_PRINTER_SYNTHESIZER_H
#define CLING_VALUE_PRINTER_SYNTHESIZER_H
#include "ASTTransformer.h"
#include <memory>
namespace clang {
class ASTContext;
class CompoundStmt;
class Decl;
class FunctionDecl;
class Expr;
class Sema;
class LookupResult;
}
namespace llvm {
class raw_ostream;
}
namespace cling {
class ValuePrinterSynthesizer : public WrapperTransformer {
private:
///\brief Needed for the AST transformations, owned by Sema.
///
clang::ASTContext* m_Context;
///\brief Stream to dump values into.
///
std::unique_ptr<llvm::raw_ostream> m_ValuePrinterStream;
///\brief cling runtime "Cannot find cling_PrintValue(...)" cache.
///
clang::LookupResult* m_LookupResult;
public:
///\ brief Constructs the value printer synthesizer.
///
///\param[in] S - The semantic analysis object
///\param[in] Stream - The output stream where the value printer will write
/// to. Defaults to std::cout. Owns the stream.
ValuePrinterSynthesizer(clang::Sema* S, llvm::raw_ostream* Stream);
virtual ~ValuePrinterSynthesizer();
Result Transform(clang::Decl* D) override;
private:
///\brief Tries to attach a value printing mechanism to the given decl group
/// ref.
///
///\param[in] FD - wrapper function that the value printer will attached to.
///
///\returns true if the attachment was considered as success. I.e. even if
/// even if the value printer wasn't attached because of the compilation
/// options disallowint it - it will return still true. Returns false on
/// critical error.
bool tryAttachVP(clang::FunctionDecl* FD);
clang::Expr* SynthesizeVP(clang::Expr* E);
unsigned ClearNullStmts(clang::CompoundStmt* CS);
// Find and cache cling::runtime on first request.
void FindAndCacheRuntimeLookupResult(clang::SourceLocation SourceLoc);
};
} // namespace cling
#endif // CLING_DECL_EXTRACTOR_H
|
/*
* Copyright Beijing 58 Information Technology Co.,Ltd.
*
* 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.
*/
/*
* SFPStruct.h
*
* Created on: 2011-7-12
* Author: Service Platform Architecture Team (spat@58.com)
*/
#ifndef SFPSTRUCT_H_
#define SFPSTRUCT_H_
namespace gaea {
class SFPStruct {
public:
const static int Version = 1;
const static int TotalLen = 4;
const static int SessionId = 4;
const static int ServerId = 1;
const static int SDPType = 1;
const static int CompressType = 1;
const static int SerializeType = 1;
const static int Platform = 1;
};
}
#endif /* SFPSTRUCT_H_ */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#if defined(USE_TI_FILESYSTEM) || defined(USE_TI_DATABASE)
#import "TiStreamProxy.h"
@interface TiFilesystemFileStreamProxy : TiStreamProxy<TiStreamInternal> {
@private
NSFileHandle *fileHandle;
TiStreamMode mode;
}
@end
#endif |
#import "CoreNotificationWrapper.h"
#include "map/notifications/notification_manager.hpp"
@interface CoreNotificationWrapper (Core)
- (instancetype)initWithNotificationCandidate:(notifications::NotificationCandidate const &)notification;
- (notifications::NotificationCandidate)notificationCandidate;
@end
|
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import <WebRTC/RTCAVFoundationVideoSource.h>
#import <WebRTC/RTCAudioSource.h>
#import <WebRTC/RTCAudioTrack.h>
#import <WebRTC/RTCCameraPreviewView.h>
#import <WebRTC/RTCConfiguration.h>
#import <WebRTC/RTCDataChannel.h>
#import <WebRTC/RTCDataChannelConfiguration.h>
#import <WebRTC/RTCDispatcher.h>
#import <WebRTC/RTCEAGLVideoView.h>
#import <WebRTC/RTCFieldTrials.h>
#import <WebRTC/RTCFileLogger.h>
#import <WebRTC/RTCIceCandidate.h>
#import <WebRTC/RTCIceServer.h>
#import <WebRTC/RTCLegacyStatsReport.h>
#import <WebRTC/RTCLogging.h>
#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaConstraints.h>
#import <WebRTC/RTCMediaSource.h>
#import <WebRTC/RTCMediaStream.h>
#import <WebRTC/RTCMediaStreamTrack.h>
#import <WebRTC/RTCMetrics.h>
#import <WebRTC/RTCMetricsSampleInfo.h>
#import <WebRTC/RTCPeerConnection.h>
#import <WebRTC/RTCPeerConnectionFactory.h>
#import <WebRTC/RTCRtpCodecParameters.h>
#import <WebRTC/RTCRtpEncodingParameters.h>
#import <WebRTC/RTCRtpParameters.h>
#import <WebRTC/RTCRtpReceiver.h>
#import <WebRTC/RTCRtpSender.h>
#import <WebRTC/RTCSSLAdapter.h>
#import <WebRTC/RTCSessionDescription.h>
#import <WebRTC/RTCTracing.h>
#import <WebRTC/RTCVideoFrame.h>
#import <WebRTC/RTCVideoRenderer.h>
#import <WebRTC/RTCVideoSource.h>
#import <WebRTC/RTCVideoTrack.h>
#import <WebRTC/UIDevice+RTCDevice.h>
|
// Copyright (c) 2011 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 WEBKIT_BLOB_BLOB_DATA_H_
#define WEBKIT_BLOB_BLOB_DATA_H_
#include <vector>
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
#include "webkit/blob/blob_export.h"
#include "webkit/blob/shareable_file_reference.h"
namespace WebKit {
class WebBlobData;
}
namespace webkit_blob {
class BLOB_EXPORT BlobData : public base::RefCounted<BlobData> {
public:
enum Type {
TYPE_DATA,
TYPE_DATA_EXTERNAL,
TYPE_FILE,
TYPE_BLOB
};
struct BLOB_EXPORT Item {
Item();
~Item();
void SetToData(const std::string& data) {
SetToData(data.c_str(), data.size());
}
void SetToData(const char* data, size_t length) {
type = TYPE_DATA;
this->data.assign(data, length);
this->offset = 0;
this->length = length;
}
void SetToDataExternal(const char* data, size_t length) {
type = TYPE_DATA_EXTERNAL;
this->data_external = data;
this->offset = 0;
this->length = length;
}
void SetToFile(const FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
type = TYPE_FILE;
this->file_path = file_path;
this->offset = offset;
this->length = length;
this->expected_modification_time = expected_modification_time;
}
void SetToBlob(const GURL& blob_url, uint64 offset, uint64 length) {
type = TYPE_BLOB;
this->blob_url = blob_url;
this->offset = offset;
this->length = length;
}
Type type;
std::string data; // For Data type.
const char* data_external; // For DataExternal type.
GURL blob_url; // For Blob type.
FilePath file_path; // For File type.
base::Time expected_modification_time; // Also for File type.
uint64 offset;
uint64 length;
};
BlobData();
explicit BlobData(const WebKit::WebBlobData& data);
void AppendData(const std::string& data) {
AppendData(data.c_str(), data.size());
}
void AppendData(const char* data, size_t length) {
if (length > 0) {
items_.push_back(Item());
items_.back().SetToData(data, length);
}
}
void AppendFile(const FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
items_.push_back(Item());
items_.back().SetToFile(file_path, offset, length,
expected_modification_time);
}
void AppendBlob(const GURL& blob_url, uint64 offset, uint64 length) {
items_.push_back(Item());
items_.back().SetToBlob(blob_url, offset, length);
}
void AttachShareableFileReference(ShareableFileReference* reference) {
shareable_files_.push_back(reference);
}
const std::vector<Item>& items() const { return items_; }
const std::string& content_type() const { return content_type_; }
void set_content_type(const std::string& content_type) {
content_type_ = content_type;
}
const std::string& content_disposition() const {
return content_disposition_;
}
void set_content_disposition(const std::string& content_disposition) {
content_disposition_ = content_disposition;
}
int64 GetMemoryUsage() const {
int64 memory = 0;
for (std::vector<Item>::const_iterator iter = items_.begin();
iter != items_.end(); ++iter) {
if (iter->type == TYPE_DATA)
memory += iter->data.size();
}
return memory;
}
private:
friend class base::RefCounted<BlobData>;
virtual ~BlobData();
std::string content_type_;
std::string content_disposition_;
std::vector<Item> items_;
std::vector<scoped_refptr<ShareableFileReference> > shareable_files_;
DISALLOW_COPY_AND_ASSIGN(BlobData);
};
#if defined(UNIT_TEST)
inline bool operator==(const BlobData::Item& a, const BlobData::Item& b) {
if (a.type != b.type)
return false;
if (a.type == BlobData::TYPE_DATA) {
return a.data == b.data &&
a.offset == b.offset &&
a.length == b.length;
}
if (a.type == BlobData::TYPE_FILE) {
return a.file_path == b.file_path &&
a.offset == b.offset &&
a.length == b.length &&
a.expected_modification_time == b.expected_modification_time;
}
if (a.type == BlobData::TYPE_BLOB) {
return a.blob_url == b.blob_url &&
a.offset == b.offset &&
a.length == b.length;
}
return false;
}
inline bool operator!=(const BlobData::Item& a, const BlobData::Item& b) {
return !(a == b);
}
inline bool operator==(const BlobData& a, const BlobData& b) {
if (a.content_type() != b.content_type())
return false;
if (a.content_disposition() != b.content_disposition())
return false;
if (a.items().size() != b.items().size())
return false;
for (size_t i = 0; i < a.items().size(); ++i) {
if (a.items()[i] != b.items()[i])
return false;
}
return true;
}
inline bool operator!=(const BlobData& a, const BlobData& b) {
return !(a == b);
}
#endif // defined(UNIT_TEST)
} // namespace webkit_blob
#endif // WEBKIT_BLOB_BLOB_DATA_H_
|
#ifndef JSONTEST_H
#define JSONTEST_H
#include <Cutelyst/Controller>
using namespace Cutelyst;
class JsonTest : public Controller
{
Q_OBJECT
C_NAMESPACE("")
public:
explicit JsonTest(QObject *parent = 0);
C_ATTR(json, :Local :AutoArgs)
void json(Context *c);
C_ATTR(pson, :Local :AutoArgs)
void pson(Context *c);
};
#endif // JSONTEST_H
|
// 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 MEDIA_FORMATS_MP2T_TS_SECTION_CAT_H_
#define MEDIA_FORMATS_MP2T_TS_SECTION_CAT_H_
#include "base/callback.h"
#include "media/base/encryption_scheme.h"
#include "media/formats/mp2t/ts_section_psi.h"
namespace media {
namespace mp2t {
class TsSectionCat : public TsSectionPsi {
public:
// RegisterCencPidsCB::Run(int ca_pid, int pssh_pid);
using RegisterCencPidsCB = base::RepeatingCallback<void(int, int)>;
// RegisterEncryptionScheme::Run(EncryptionScheme scheme);
using RegisterEncryptionSchemeCB =
base::RepeatingCallback<void(EncryptionScheme)>;
TsSectionCat(const RegisterCencPidsCB& register_cenc_ids_cb,
const RegisterEncryptionSchemeCB& register_encryption_scheme_cb);
TsSectionCat(const TsSectionCat&) = delete;
TsSectionCat& operator=(const TsSectionCat&) = delete;
~TsSectionCat() override;
// TsSectionPsi implementation.
bool ParsePsiSection(BitReader* bit_reader) override;
void ResetPsiSection() override;
private:
RegisterCencPidsCB register_cenc_ids_cb_;
RegisterEncryptionSchemeCB register_encryption_scheme_cb_;
// Parameters from the CAT.
int version_number_;
};
} // namespace mp2t
} // namespace media
#endif // MEDIA_FORMATS_MP2T_TS_SECTION_CAT_H_
|
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
int main() {
int d = 0;
for (d = 0;;) {
}
return 0;
}
|
// Copyright 2018 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 CHROMECAST_PUBLIC_MEDIA_AUDIO_POST_PROCESSOR2_SHLIB_H_
#define CHROMECAST_PUBLIC_MEDIA_AUDIO_POST_PROCESSOR2_SHLIB_H_
#include <string>
#include "volume_control.h"
// Plugin interface for audio DSP modules.
// This is applicable only to audio CMA backends (Alsa, Fuscia).
//
// Please refer to
// chromecast/media/cma/backend/post_processors/governor_shlib.cc
// as an example for new code, but OEM's implementations should not have any
// Chromium dependencies.
//
// Please refer to
// chromecast/media/cma/backend/post_processors/post_processor_wrapper.h for an
// example of how to port an existing AudioPostProcessor to AudioPostProcessor2
//
// Notes on PostProcessors that have a different number of in/out channels:
// * PostProcessor authors are free to define their channel order; Cast will
// simply pass this data to subsequent PostProcessors and MixerOutputStream.
// * Channel selection for stereo pairs will occur after the "mix" group, so
// devices that support stereo pairs should only change the number of
// in the "linearize" group of cast_audio.json.
namespace chromecast {
namespace media {
// Interface for AudioPostProcessors used for applying DSP in StreamMixer.
class AudioPostProcessor2 {
public:
struct Config {
int output_sample_rate; // The output sample rate for this processor.
int system_output_sample_rate; // The system (hardware) output sample rate.
// The number of output frames expected from ProcessFrames().
int output_frames_per_write;
};
struct Metadata {
// The maximum volume multiplier applied to the current buffer, in dBFS.
float volume_dbfs;
// The (max) current target volume multiplier that we are slewing towards.
float target_volume_dbfs;
// The system volume applied to the stream (normalized to 0-1). Equivalent
// to DbFSToVolume(volume_dbfs).
float system_volume;
};
struct Status {
int input_sample_rate = -1;
int output_channels = -1;
// The group delay, measured in frames at the input sample rate. See
// chromecast/media/cma/backend/post_processors/post_processor_unittest.cc
// for how this is tested.
int rendering_delay_frames = 0;
// The number of input frames of silence it will take for the processor to
// come to rest after playing out audio.
// In the case of an FIR filter, this is the length of the FIR kernel.
// In the case of IIR filters, this should be calculated as the number of
// frames for the output to decay to 10% (5 time constants).
// When inputs are paused, at least |GetRingingTimeInFrames()| of
// silence will be passed through the processor.
int ringing_time_frames = 0;
// The data buffer in which the last output from ProcessFrames() was stored.
// This will never be called before ProcessFrames().
// This data location should be valid until ProcessFrames() is called
// again.
// The data returned by GetOutputBuffer() should not be modified by this
// instance until the next call to ProcessFrames().
// If |channels_in| >= |channels_out|, this may be |data| from the
// last call to ProcessFrames().
// If |channels_in| < |channels_out|, this PostProcessor is responsible for
// allocating an output buffer.
// If PostProcessor owns |output_buffer|, it must ensure that the memory
// is valid until the next call to ProcessFrames() or destruction.
float* output_buffer = nullptr;
};
virtual ~AudioPostProcessor2() = default;
// Sets the Config of the processor.
// Returns |false| if the processor cannot support |config|
virtual bool SetConfig(const Config& config) = 0;
// Returns the processor's generated settings. Post processors should keep
// an up-to-date Status as a member variable.
virtual const Status& GetStatus() = 0;
// Processes audio frames from |data|.
// This will never be called before SetOutputSampleRate().
// ProcessFrames may overwrite |data|, in which case GetOutputBuffer() should
// return |data|.
// |data| will be 32-bit interleaved float with |channels_in| channels.
// ProcessFrames must produce an equal duration of audio as was input,
// allowing for sample rate / channel count changes. If the output data
// will take up equal or less space than the input data, ProcessFrames()
// should overwrite the input data and store a pointer to |data| in |Status|.
// Otherwise, the Processor should allocate and own its own output buffer.
virtual void ProcessFrames(float* data, int frames, Metadata* metadata) = 0;
// Sends a message to the PostProcessor. Implementations are responsible
// for the format and parsing of messages.
// Returns |true| if the message was accepted or |false| if the message could
// not be applied (i.e. invalid parameter, format error, parameter out of
// range, etc).
// If the PostProcessor can/will not be updated at runtime, this can be
// implemented as "return false;"
virtual bool UpdateParameters(const std::string& message) = 0;
// Sets content type to the PostProcessor so it could change processing
// settings accordingly.
virtual void SetContentType(AudioContentType content_type) {}
// Called when device is playing as part of a stereo pair.
// |channel| is the playout channel on this device (0 for left, 1 for right).
// or -1 if the device is not part of a stereo pair.
virtual void SetPlayoutChannel(int channel) {}
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_PUBLIC_MEDIA_AUDIO_POST_PROCESSOR2_SHLIB_H_
|
/**
* \file
*
* \brief Board configuration.
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
/** Enable Com Port. */
#define CONF_BOARD_COM_PORT
/* Configure DACC out channel */
#define CONF_BOARD_DACC_VOUT
#endif /* CONF_BOARD_H_INCLUDED */
|
/*
skyeye_flash.c - skyeye general flash device file support functions
Copyright (C) 2003 - 2005 Skyeye Develop Group
for help please send mail to <skyeye-developer@lists.gro.clinux.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* 09/22/2005 initial version
* walimis <wlm@student.dlut.edu.cn>
*/
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include "armdefs.h"
#include "skyeye_device.h"
#include "skyeye_options.h"
#include "skyeye.h"
#include "skyeye_flash.h"
extern void flash_intel_init(struct device_module_set *mod_set);
extern void flash_sst39lvf160_init(struct device_module_set *mod_set);
extern void flash_am29_init(struct device_module_set *mod_set);
/* initialize the flash module set.
* If you want to add a new flash simulation, just add a "flash_*_init" function to it.
* */
static void
flash_init (struct device_module_set *mod_set)
{
flash_intel_init (mod_set);
flash_sst39lvf160_init (mod_set);
flash_am29_init (mod_set);
}
static int
flash_setup (struct device_desc *dev, void *option)
{
struct flash_device *flash_dev;
struct flash_option *flash_opt = (struct flash_option *) option;
int ret = 0;
flash_dev =
(struct flash_device *) malloc (sizeof (struct flash_device));
if (flash_dev == NULL)
return 1;
memset (flash_dev, 0, sizeof (struct flash_device));
memcpy (&flash_dev->dump[0], &flash_opt->dump[0], MAX_STR_NAME);
dev->dev = (void *) flash_dev;
return ret;
}
static struct device_module_set flash_mod_set = {
.name = "flash",
.count = 0,
.count_max = 0,
.init = flash_init,
.initialized = 0,
.setup_module = flash_setup,
};
/* used by global device initialize function.
* */
void
flash_register ()
{
if (register_device_module_set (&flash_mod_set))
SKYEYE_ERR ("\"%s\" module set register error!\n",
flash_mod_set.name);
}
/* helper functions */
#ifdef __MINGW32__
#include <io.h>
#undef S_IREAD
#undef S_IWRITE
#undef O_CREAT
#undef O_TRUNC
#undef O_WRONLY
#define S_IREAD _S_IREAD
#define S_IWRITE _S_IWRITE
#define O_CREAT _O_CREAT
#define O_TRUNC _O_TRUNC
#define O_WRONLY (_O_WRONLY | _O_BINARY)
#define open(file, flags, mode) _open(file, flags, mode)
#define close(fd) _close(fd)
#define write(fd, buf, count) _write(fd, buf, count)
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef S_IREAD
#define S_IREAD S_IRUSR
#endif
#ifndef S_IWRITE
#define S_IWRITE S_IWUSR
#endif
#endif
static int skyeye_flash_arm_read_word (uint32_t addr, uint32_t *data)
{
/*
extern mem_bank_t *global_mbp;
extern mem_bank_t *bank_ptr(ARMword addr);
*/
ARMul_State *state = (ARMul_State*)skyeye_config.mach->state;
/*
if (data == NULL || state == NULL || (global_mbp = bank_ptr(addr)) == NULL ) return -1;
*/
//*data = real_read_word(state, addr);
bus_read(state, addr, data);
#ifndef HOST_IS_BIG_ENDIAN
if (state->bigendSig == HIGH)
#else
if (state->bigendSig != HIGH)
#endif
*data = ((*data & 0xff) << 24) |
(((*data >> 8) & 0xff) << 16) |
(((*data >> 16) & 0xff) << 8) |
(((*data >> 24) & 0xff));
return 0;
}
int skyeye_flash_dump (const char *filename, uint32_t base, uint32_t size)
{
uint32_t addr, data;
int fd;
int (*read_word_func)(uint32_t, uint32_t*) = NULL;
if (filename == NULL || *filename == 0 ||
skyeye_config.arch == NULL ||
skyeye_config.arch->arch_name == NULL) return -1;
if (strcmp(skyeye_config.arch->arch_name, "arm") == 0) /* arm */
read_word_func = skyeye_flash_arm_read_word;
else /* TODO */
return -1;
fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE);
if (fd == -1) return -1;
for (addr = base; addr < base + size; addr += 4) {
if ((*read_word_func)(addr, &data) != 0) {
close(fd);
return -1;
}
write(fd, &data, 4);
}
close(fd);
return 0;
}
|
/**
* \file
*
* \brief SERCOM SPI master with vectored I/O driver configuration
*
* Copyright (C) 2013-2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_SPI_MASTER_VEC_H
#define CONF_SPI_MASTER_VEC_H
#if defined(__FREERTOS__) || defined(__DOXYGEN__)
# include <FreeRTOS.h>
# include <semphr.h>
# define CONF_SPI_MASTER_VEC_OS_SUPPORT
# define CONF_SPI_MASTER_VEC_SEMAPHORE_TYPE xSemaphoreHandle
# define CONF_SPI_MASTER_VEC_CREATE_SEMAPHORE(semaphore) \
vSemaphoreCreateBinary(semaphore)
# define CONF_SPI_MASTER_VEC_DELETE_SEMAPHORE(semaphore) \
vSemaphoreDelete(semaphore)
# define CONF_SPI_MASTER_VEC_TAKE_SEMAPHORE(semaphore) \
xSemaphoreTake((semaphore), portMAX_DELAY)
# define CONF_SPI_MASTER_VEC_GIVE_SEMAPHORE(semaphore) \
xSemaphoreGive((semaphore))
# define CONF_SPI_MASTER_VEC_GIVE_SEMAPHORE_FROM_ISR(semaphore) \
xSemaphoreGiveFromISR((semaphore), NULL)
#endif
#endif // CONF_SPI_MASTER_VEC_H |
//
// ESTCloudBeaconTableVC.h
// DistanceDemo
//
// Created by Grzegorz Krukiewicz-Gacek on 17.03.2014.
// Copyright (c) 2014 Estimote. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <EstimoteSDK/EstimoteSDK.h>
/*
* Lists all Estimote beacons in range and returns selected beacon.
*/
@interface ESTCloudBeaconTableVC : UIViewController <UITableViewDataSource, UITableViewDelegate>
@end
|
/**
* @file
*
* @brief OR1K Architecture Types API
*/
/*
* This include file contains type definitions pertaining to the
* arm processor family.
*
* COPYRIGHT (c) 2014 Hesham ALMatary <heshamelmatary@gmail.com>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*
*/
#ifndef _RTEMS_SCORE_TYPES_H
#define _RTEMS_SCORE_TYPES_H
#include <rtems/score/basedefs.h>
#ifndef ASM
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup ScoreCPU
*/
/**@{**/
/*
* This section defines the basic types for this processor.
*/
typedef uint16_t Priority_bit_map_Word;
typedef void or1k_isr;
typedef void ( *or1k_isr_entry )( void );
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* !ASM */
#endif
|
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/spi/spi.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/delay.h>
#include <mach/gpio.h>
#include <mach/board.h>
#include <mach/socinfo.h>
#include <mach/rpc_pmapp.h>
#include <mach/pmic.h>
/* ktd3102 timing params */
#define DELAY_TSTART udelay(4)
#define DELAY_TEOS udelay(4)
#define DELAY_THLB udelay(33)
#define DELAY_TLLB udelay(67)
#define DELAY_THHB udelay(67)
#define DELAY_TLHB udelay(33)
#define DELAY_TESDET udelay(286)
#define DELAY_TESDELAY udelay(190)
#define DELAY_TESWIN mdelay(1)
#define DELAY_TOFF mdelay(4)
#define BL_CTRL 0
//spinlock_t ktd3102_spin_lock;
static int bl_ctl_num = 0;
static int pulse_num = 6;
static int volatile flag = 0;
static struct msm_panel_common_pdata *ktd3102_backlight_pdata;
#if 0
static void ktd3102_send_bit(int bit_data)
{
if (bit_data == 0) {
pmic_gpio_set_value(bl_ctl_num, 0);;
DELAY_TLLB;
pmic_gpio_set_value(bl_ctl_num, 1);;
DELAY_THLB;
} else {
pmic_gpio_set_value(bl_ctl_num, 0);;
DELAY_TLHB;
pmic_gpio_set_value(bl_ctl_num, 1);;
DELAY_THHB;
}
}
static void ktd3102_send_byte(unsigned char byte_data)
{
int n;
for (n = 0; n < 8; n++) {
ktd3102_send_bit((byte_data & 0x80) ? 1 : 0);
byte_data = byte_data << 1;
}
}
#endif
static int ktd3102_set_bl(int level, int max, int min)
{
int i;
printk("****************** %s enter flag = %d ******************\n", __func__, flag);
if (level == 0) {
flag = 0;
pmic_gpio_set_value(bl_ctl_num, 0);
printk("****************** %s backlight (off) ******************\n", __func__);
printk("****************** %s done flag = %d ******************\n", __func__, flag);
return 0;
} else {
if (!flag) {
flag = 1;
printk("****************** %s backlight (on); pulse_num = %d ******************\n", __func__, pulse_num);
for (i = 0; i < pulse_num; i++) {
pmic_gpio_set_value(bl_ctl_num, 1);
udelay(250);
pmic_gpio_set_value(bl_ctl_num, 0);
udelay(100);
pmic_gpio_set_value(bl_ctl_num, 1);
}
}
}
printk("****************** %s done flag = %d******************\n", __func__, flag);
return 0;
}
#ifdef KTD3102_DEBUG
static int ktd3102_set_pulse(const char *val, struct kernel_param *kp)
{
int i, ret, level;
ret = param_set_int(val, kp);
if(ret < 0)
{
printk(KERN_ERR"Errored pulse value");
return -EINVAL;
}
level = *((int*)kp->arg);
printk("%s level = %d\n", __func__, level);
if (!level) {
flag = 0;
pmic_gpio_set_value(bl_ctl_num, 0);
} else {
if (!flag)
flag = 1;
if (level > pulse_num) {
for (i = 0; i < level - pulse_num; i++) {
pmic_gpio_set_value(bl_ctl_num, 1);
udelay(250);
pmic_gpio_set_value(bl_ctl_num, 0);
udelay(100);
pmic_gpio_set_value(bl_ctl_num, 1);
}
} else {
for (i = 0; i < 32 + level - pulse_num; i++) {
pmic_gpio_set_value(bl_ctl_num, 1);
udelay(250);
pmic_gpio_set_value(bl_ctl_num, 0);
udelay(100);
pmic_gpio_set_value(bl_ctl_num, 1);
}
}
}
pulse_num = level;
printk("%s pulse_num = %d\n", __func__, pulse_num);
return 0;
}
#endif
static int __devinit ktd3102_backlight_probe(struct platform_device *pdev)
{
printk("[DISP]%s\n", __func__);
if (pdev->id == 0) {
ktd3102_backlight_pdata = (struct msm_panel_common_pdata *)pdev->dev.platform_data;
if (ktd3102_backlight_pdata) {
ktd3102_backlight_pdata->backlight_level = ktd3102_set_bl;
//bl_ctl_num = ktd3102_backlight_pdata->gpio;
bl_ctl_num = BL_CTRL;
printk("[DISP]%s: bl_ctl_num = %d\n", __func__, bl_ctl_num);
/* FIXME: if continuous splash is enabled, set prev_bl to
* a non-zero value to avoid entering easyscale.
*/
//if (ktd3102_backlight_pdata->cont_splash_enabled)
// prev_bl = 1;
}
pmic_gpio_direction_output(bl_ctl_num);
pmic_gpio_set_value(bl_ctl_num, 1);
return 0;
}
printk("[DISP]%s: Wrong ID\n", __func__);
return -1;
}
static struct platform_driver this_driver = {
.probe = ktd3102_backlight_probe,
.driver = {
.name = "ktd3102_backlight",
},
};
static int __init ktd3102_backlight_init(void)
{
printk("[DISP]%s\n", __func__);
//spin_lock_init(&ktd3102_spin_lock);
return platform_driver_register(&this_driver);
}
module_init(ktd3102_backlight_init);
#ifdef KTD3102_DEBUG
module_param_call(set_pulse, ktd3102_set_pulse, param_get_int, &pulse_num, S_IRUSR | S_IWUSR);
#endif
|
/*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
*
* Squid is the result of efforts by numerous individuals from
* the Internet community; see the CONTRIBUTORS file for full
* details. Many organizations have provided support for Squid's
* development; see the SPONSORS file for full details. Squid is
* Copyrighted (C) 2001 by the Regents of the University of
* California; see the COPYRIGHT file for full details. Squid
* incorporates software developed and/or copyrighted by other
* sources; see the CREDITS file for full details.
*
* 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, USA.
*
*/
#ifndef SQUID_STOREMETAOBJSIZE_H
#define SQUID_STOREMETAOBJSIZE_H
#include "StoreMeta.h"
#include "MemPool.h"
class StoreMetaObjSize : public StoreMeta
{
public:
MEMPROXY_CLASS(StoreMetaObjSize);
char getType() const {return STORE_META_OBJSIZE;}
};
MEMPROXY_CLASS_INLINE(StoreMetaObjSize);
#endif /* SQUID_STOREMETAOBJSIZE_H */
|
/*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <inttypes.h>
#include "std.h"
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "led.h"
#include "mcu_periph/usb_serial.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
#include "interrupt_hw.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
static inline void main_event_task( void );
int main( void ) {
main_init();
while(1) {
if (sys_time_check_and_ack_timer(0))
main_periodic_task();
main_event_task();
}
return 0;
}
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
led_init();
VCOM_init();
mcu_int_enable();
}
static inline void main_periodic_task( void ) {
RunOnceEvery(10, {
LED_TOGGLE(1);
DOWNLINK_SEND_ALIVE(PprzTransport,16, MD5SUM);
});
}
static inline void main_event_task( void ) {
}
|
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef UFS_MSM_H_
#define UFS_MSM_H_
#include <linux/phy/phy.h>
#define MAX_U32 (~(u32)0)
#define MPHY_TX_FSM_STATE 0x41
#define TX_FSM_HIBERN8 0x1
#define HBRN8_POLL_TOUT_MS 100
#define DEFAULT_CLK_RATE_HZ 1000000
#define BUS_VECTOR_NAME_LEN 32
#define UFS_HW_VER_MAJOR_SHFT (28)
#define UFS_HW_VER_MAJOR_MASK (0x000F << UFS_HW_VER_MAJOR_SHFT)
#define UFS_HW_VER_MINOR_SHFT (16)
#define UFS_HW_VER_MINOR_MASK (0x0FFF << UFS_HW_VER_MINOR_SHFT)
#define UFS_HW_VER_STEP_SHFT (0)
#define UFS_HW_VER_STEP_MASK (0xFFFF << UFS_HW_VER_STEP_SHFT)
/* vendor specific pre-defined parameters */
#define SLOW 1
#define FAST 2
#define UFS_MSM_LIMIT_NUM_LANES_RX 2
#define UFS_MSM_LIMIT_NUM_LANES_TX 2
#define UFS_MSM_LIMIT_HSGEAR_RX UFS_HS_G2
#define UFS_MSM_LIMIT_HSGEAR_TX UFS_HS_G2
#define UFS_MSM_LIMIT_PWMGEAR_RX UFS_PWM_G4
#define UFS_MSM_LIMIT_PWMGEAR_TX UFS_PWM_G4
#define UFS_MSM_LIMIT_RX_PWR_PWM SLOW_MODE
#define UFS_MSM_LIMIT_TX_PWR_PWM SLOW_MODE
#define UFS_MSM_LIMIT_RX_PWR_HS FAST_MODE
#define UFS_MSM_LIMIT_TX_PWR_HS FAST_MODE
#define UFS_MSM_LIMIT_HS_RATE PA_HS_MODE_A
#define UFS_MSM_LIMIT_DESIRED_MODE FAST
/* MSM UFS host controller vendor specific registers */
enum {
REG_UFS_SYS1CLK_1US = 0xC0,
REG_UFS_TX_SYMBOL_CLK_NS_US = 0xC4,
REG_UFS_LOCAL_PORT_ID_REG = 0xC8,
REG_UFS_PA_ERR_CODE = 0xCC,
REG_UFS_RETRY_TIMER_REG = 0xD0,
REG_UFS_PA_LINK_STARTUP_TIMER = 0xD8,
REG_UFS_CFG1 = 0xDC,
REG_UFS_CFG2 = 0xE0,
REG_UFS_HW_VERSION = 0xE4,
};
/* bit offset */
enum {
OFFSET_UFS_PHY_SOFT_RESET = 1,
OFFSET_CLK_NS_REG = 10,
};
/* bit masks */
enum {
MASK_UFS_PHY_SOFT_RESET = 0x2,
MASK_TX_SYMBOL_CLK_1US_REG = 0x3FF,
MASK_CLK_NS_REG = 0xFFFC00,
};
static LIST_HEAD(phy_list);
enum ufs_msm_phy_init_type {
UFS_PHY_INIT_FULL,
UFS_PHY_INIT_CFG_RESTORE,
};
struct ufs_msm_phy_vreg {
const char *name;
struct regulator *reg;
int max_uA;
int min_uV;
int max_uV;
bool enabled;
};
static inline void
ufs_msm_get_controller_revision(struct ufs_hba *hba,
u8 *major, u16 *minor, u16 *step)
{
u32 ver = ufshcd_readl(hba, REG_UFS_HW_VERSION);
*major = (ver & UFS_HW_VER_MAJOR_MASK) >> UFS_HW_VER_MAJOR_SHFT;
*minor = (ver & UFS_HW_VER_MINOR_MASK) >> UFS_HW_VER_MINOR_SHFT;
*step = (ver & UFS_HW_VER_STEP_MASK) >> UFS_HW_VER_STEP_SHFT;
};
static inline void ufs_msm_assert_reset(struct ufs_hba *hba)
{
ufshcd_rmwl(hba, MASK_UFS_PHY_SOFT_RESET,
1 << OFFSET_UFS_PHY_SOFT_RESET, REG_UFS_CFG1);
mb();
}
static inline void ufs_msm_deassert_reset(struct ufs_hba *hba)
{
ufshcd_rmwl(hba, MASK_UFS_PHY_SOFT_RESET,
0 << OFFSET_UFS_PHY_SOFT_RESET, REG_UFS_CFG1);
mb();
}
struct ufs_msm_bus_vote {
uint32_t client_handle;
uint32_t curr_vote;
int min_bw_vote;
int max_bw_vote;
int saved_vote;
bool is_max_bw_needed;
struct device_attribute max_bus_bw;
};
struct ufs_msm_host {
struct phy *generic_phy;
struct ufs_hba *hba;
struct ufs_msm_bus_vote bus_vote;
struct ufs_pa_layer_attr dev_req_params;
struct clk *rx_l0_sync_clk;
struct clk *tx_l0_sync_clk;
struct clk *rx_l1_sync_clk;
struct clk *tx_l1_sync_clk;
bool is_lane_clks_enabled;
};
#define ufs_msm_is_link_off(hba) ufshcd_is_link_off(hba)
#define ufs_msm_is_link_active(hba) ufshcd_is_link_active(hba)
#define ufs_msm_is_link_hibern8(hba) ufshcd_is_link_hibern8(hba)
enum {
MASK_SERDES_START = 0x1,
MASK_PCS_READY = 0x1,
};
enum {
OFFSET_SERDES_START = 0x0,
};
#define MAX_PROP_NAME 32
#define VDDA_PHY_MIN_UV 1000000
#define VDDA_PHY_MAX_UV 1000000
#define VDDA_PLL_MIN_UV 1800000
#define VDDA_PLL_MAX_UV 1800000
#endif /* UFS_MSM_H_ */
|
/* Copyright (C) 1997-2013 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 <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate64 (fd, length)
int fd;
off64_t length;
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0,
(long) (length >> 32),
(long) length);
return result;
}
weak_alias (__ftruncate64, ftruncate64)
|
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** Any non-GPL usage of this software or parts of this software is strictly
** forbidden.
**
** Commercial non-GPL licensing of this software is possible.
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
**
** $Id: error.c,v 1.28 2004/09/04 14:56:28 menno Exp $
**/
#include "common.h"
#include "error.h"
char *err_msg[] = {
"No error",
"Gain control not yet implemented",
"Pulse coding not allowed in short blocks",
"Invalid huffman codebook",
"Scalefactor out of range",
"Unable to find ADTS syncword",
"Channel coupling not yet implemented",
"Channel configuration not allowed in error resilient frame",
"Bit error in error resilient scalefactor decoding",
"Error decoding huffman scalefactor (bitstream error)",
"Error decoding huffman codeword (bitstream error)",
"Non existent huffman codebook number found",
"Invalid number of channels",
"Maximum number of bitstream elements exceeded",
"Input data buffer too small",
"Array index out of range",
"Maximum number of scalefactor bands exceeded",
"Quantised value out of range",
"LTP lag out of range",
"Invalid SBR parameter decoded",
"SBR called without being initialised",
"Unexpected channel configuration change",
"Error in program_config_element",
"First SBR frame is not the same as first AAC frame",
"Unexpected fill element with SBR data",
"Not all elements were provided with SBR data",
"LTP decoding not available",
"Output data buffer too small"
};
|
/*
* This is the source code of Telegram for iOS v. 1.1
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Peter Iakovlev, 2013.
*/
#import "TGConversationItem.h"
@interface TGConversationDateItem : TGConversationItem
@property (nonatomic) NSTimeInterval date;
@property (nonatomic, strong) NSString *dateString;
- (id)initWithDate:(NSTimeInterval)date;
@end
|
/*
Copyright 2019 Vorror
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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4B42
#define PRODUCT_ID 0x6067
#define DEVICE_VER 0x0002
#define MANUFACTURER KBDFans
#define PRODUCT KBD67v2
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 16
#define MATRIX_ROW_PINS { B7, D0, F0, F1, F4 }
#define MATRIX_COL_PINS { B0, B1, B2, B3, D1, D2, D3, D6, D7, B4, B6, C6, C7, F7, F6, F5 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* number of backlight levels */
#define BACKLIGHT_PIN B5
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 3
#endif
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 20
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 240
#define RGBLIGHT_SLEEP
#endif
|
/* linux/drivers/video/sunxi/lcd/video_source_interface.c
*
* Copyright (c) 2013 Allwinnertech Co., Ltd.
* Author: Tyle <tyle@allwinnertech.com>
*
* Video source interface for LCD driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include "lcd_source.h"
extern struct sunxi_lcd_drv g_lcd_drv;
/**
* sunxi_lcd_delay_ms.
* @ms: Delay time, unit: millisecond.
*/
s32 sunxi_lcd_delay_ms(u32 ms)
{
if(g_lcd_drv.src_ops.sunxi_lcd_delay_ms) {
return g_lcd_drv.src_ops.sunxi_lcd_delay_ms(ms);
}
return -1;
}
/**
* sunxi_lcd_delay_us.
* @us: Delay time, unit: microsecond.
*/
s32 sunxi_lcd_delay_us(u32 us)
{
if(g_lcd_drv.src_ops.sunxi_lcd_delay_us) {
return g_lcd_drv.src_ops.sunxi_lcd_delay_us(us);
}
return -1;
}
/**
* sunxi_lcd_tcon_enable - enable timing controller.
* @screen_id: The index of screen.
*/
void sunxi_lcd_tcon_enable(u32 screen_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_tcon_enable) {
g_lcd_drv.src_ops.sunxi_lcd_tcon_enable(screen_id);
}
return ;
}
/**
* sunxi_lcd_tcon_disable - disable timing controller.
* @screen_id: The index of screen.
*/
void sunxi_lcd_tcon_disable(u32 screen_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_tcon_disable) {
g_lcd_drv.src_ops.sunxi_lcd_tcon_disable(screen_id);
}
return ;
}
/**
* sunxi_lcd_backlight_enable - enable the backlight of panel.
* @screen_id: The index of screen.
*/
void sunxi_lcd_backlight_enable(u32 screen_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_backlight_enable) {
g_lcd_drv.src_ops.sunxi_lcd_backlight_enable(screen_id);
}
return ;
}
/**
* sunxi_lcd_backlight_disable - disable the backlight of panel.
* @screen_id: The index of screen.
*/
void sunxi_lcd_backlight_disable(u32 screen_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_backlight_disable) {
g_lcd_drv.src_ops.sunxi_lcd_backlight_disable(screen_id);
}
return ;
}
/**
* sunxi_lcd_power_enable - enable the power of panel.
* @screen_id: The index of screen.
* @pwr_id: The index of power
*/
void sunxi_lcd_power_enable(u32 screen_id, u32 pwr_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_power_enable) {
g_lcd_drv.src_ops.sunxi_lcd_power_enable(screen_id, pwr_id);
}
return ;
}
/**
* sunxi_lcd_power_disable - disable the power of panel.
* @screen_id: The index of screen.
* @pwr_id: The index of power
*/
void sunxi_lcd_power_disable(u32 screen_id, u32 pwr_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_power_disable) {
g_lcd_drv.src_ops.sunxi_lcd_power_disable(screen_id, pwr_id);
}
return ;
}
/**
* sunxi_lcd_cpu_write - write command and para to cpu panel.
* @scree_id: The index of screen.
* @command: Command to be transfer.
* @para: The pointer to para
* @para_num: The number of para
*/
s32 sunxi_lcd_cpu_write(u32 scree_id, u32 command, u32 *para, u32 para_num)
{
if(g_lcd_drv.src_ops.sunxi_lcd_cpu_write) {
return g_lcd_drv.src_ops.sunxi_lcd_cpu_write(scree_id, command, para, para_num);
}
return -1;
}
/**
* sunxi_lcd_cpu_write_index - write command to cpu panel.
* @scree_id: The index of screen.
* @index: Command or index to be transfer.
*/
s32 sunxi_lcd_cpu_write_index(u32 scree_id, u32 index)
{
if(g_lcd_drv.src_ops.sunxi_lcd_cpu_write_index) {
return g_lcd_drv.src_ops.sunxi_lcd_cpu_write_index(scree_id, index);
}
return -1;
}
/**
* sunxi_lcd_cpu_write_data - write data to cpu panel.
* @scree_id: The index of screen.
* @data: Data to be transfer.
*/
s32 sunxi_lcd_cpu_write_data(u32 scree_id, u32 data)
{
if(g_lcd_drv.src_ops.sunxi_lcd_cpu_write_data) {
return g_lcd_drv.src_ops.sunxi_lcd_cpu_write_data(scree_id, data);
}
return -1;
}
/**
* sunxi_lcd_dsi_write - write command and para to mipi panel.
* @scree_id: The index of screen.
* @command: Command to be transfer.
* @para: The pointer to para.
* @para_num: The number of para
*/
s32 sunxi_lcd_dsi_write(u32 scree_id, u8 command, u8 *para, u32 para_num)
{
if(g_lcd_drv.src_ops.sunxi_lcd_dsi_write) {
return g_lcd_drv.src_ops.sunxi_lcd_dsi_write(scree_id, command, para, para_num);
}
return -1;
}
/**
* sunxi_lcd_dsi_clk_enable - enable dsi clk.
* @scree_id: The index of screen.
*/
s32 sunxi_lcd_dsi_clk_enable(u32 scree_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_dsi_clk_enable) {
return g_lcd_drv.src_ops.sunxi_lcd_dsi_clk_enable(scree_id, 1);
}
return -1;
}
/**
* sunxi_lcd_dsi_clk_disable - disable dsi clk.
* @scree_id: The index of screen.
*/
s32 sunxi_lcd_dsi_clk_disable(u32 scree_id)
{
if(g_lcd_drv.src_ops.sunxi_lcd_dsi_clk_enable) {
return g_lcd_drv.src_ops.sunxi_lcd_dsi_clk_enable(scree_id, 0);
}
return -1;
}
/**
* sunxi_lcd_set_panel_funs - set panel functions.
* @panel: the pointer to sunxi_Lcd_panel
*/
s32 sunxi_lcd_register_panel(sunxi_lcd_panel *panel)
{
if(g_lcd_drv.src_ops.sunxi_lcd_register_panel) {
return g_lcd_drv.src_ops.sunxi_lcd_register_panel(panel);
}
return -1;
}
/**
* sunxi_lcd_pin_cfg - config pin panel used
* @screen_id: The index of screen.
* @bon: 1: config pin according to sys_config, 0: set disable state
*/
s32 sunxi_lcd_pin_cfg(u32 screen_id, u32 bon)
{
if(g_lcd_drv.src_ops.sunxi_lcd_pin_cfg) {
return g_lcd_drv.src_ops.sunxi_lcd_pin_cfg(screen_id, bon);
}
return -1;
}
/**
* sunxi_lcd_gpio_set_value
* @screen_id: The index of screen.
* @io_index: the index of gpio
* @value: value of gpio to be set
*/
s32 sunxi_lcd_gpio_set_value(u32 screen_id, u32 io_index, u32 value)
{
if(g_lcd_drv.src_ops.sunxi_lcd_gpio_set_value) {
return g_lcd_drv.src_ops.sunxi_lcd_gpio_set_value(screen_id, io_index, value);
}
return -1;
}
/**
* sunxi_lcd_gpio_set_direction
* @screen_id: The index of screen.
* @io_index: the index of gpio
* @direction: value of gpio to be set
*/
s32 sunxi_lcd_gpio_set_direction(u32 screen_id, u32 io_index, u32 direction)
{
if(g_lcd_drv.src_ops.sunxi_lcd_gpio_set_direction) {
return g_lcd_drv.src_ops.sunxi_lcd_gpio_set_direction(screen_id, io_index, direction);
}
return -1;
}
|
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DocumentThreadableLoader_h
#define DocumentThreadableLoader_h
#include "FrameLoaderTypes.h"
#include "SubresourceLoaderClient.h"
#include "ThreadableLoader.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class Document;
class KURL;
class ResourceRequest;
class ThreadableLoaderClient;
class DocumentThreadableLoader : public RefCounted<DocumentThreadableLoader>, public ThreadableLoader, private SubresourceLoaderClient {
public:
static void loadResourceSynchronously(Document*, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
static PassRefPtr<DocumentThreadableLoader> create(Document*, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
virtual ~DocumentThreadableLoader();
virtual void cancel();
using RefCounted<DocumentThreadableLoader>::ref;
using RefCounted<DocumentThreadableLoader>::deref;
protected:
virtual void refThreadableLoader() { ref(); }
virtual void derefThreadableLoader() { deref(); }
private:
enum BlockingBehavior {
LoadSynchronously,
LoadAsynchronously
};
DocumentThreadableLoader(Document*, ThreadableLoaderClient*, BlockingBehavior blockingBehavior, const ResourceRequest&, const ThreadableLoaderOptions& options);
virtual void willSendRequest(SubresourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
virtual void didSendData(SubresourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
virtual void didReceiveResponse(SubresourceLoader*, const ResourceResponse&);
virtual void didReceiveData(SubresourceLoader*, const char*, int lengthReceived);
virtual void didFinishLoading(SubresourceLoader*);
virtual void didFail(SubresourceLoader*, const ResourceError&);
virtual bool getShouldUseCredentialStorage(SubresourceLoader*, bool& shouldUseCredentialStorage);
virtual void didReceiveAuthenticationChallenge(SubresourceLoader*, const AuthenticationChallenge&);
virtual void receivedCancellation(SubresourceLoader*, const AuthenticationChallenge&);
void didFinishLoading(unsigned long identifier);
void makeSimpleCrossOriginAccessRequest(const ResourceRequest& request);
void makeCrossOriginAccessRequestWithPreflight(const ResourceRequest& request);
void preflightSuccess();
void preflightFailure();
void loadRequest(const ResourceRequest&, SecurityCheckPolicy);
bool isAllowedRedirect(const KURL&);
RefPtr<SubresourceLoader> m_loader;
ThreadableLoaderClient* m_client;
Document* m_document;
ThreadableLoaderOptions m_options;
bool m_sameOriginRequest;
bool m_async;
OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Control preflight checks
};
} // namespace WebCore
#endif // DocumentThreadableLoader_h
|
/* Test of <locale.h> substitute.
Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
#include <config.h>
#include <locale.h>
#include "verify.h"
int a[] =
{
LC_ALL,
LC_COLLATE,
LC_CTYPE,
LC_MESSAGES,
LC_MONETARY,
LC_NUMERIC,
LC_TIME
};
/* Check that the 'struct lconv' type is defined. */
struct lconv l;
int ls;
/* Check that NULL can be passed through varargs as a pointer type,
per POSIX 2008. */
verify (sizeof NULL == sizeof (void *));
int
main ()
{
#if HAVE_NEWLOCALE
/* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined. */
locale_t b = LC_GLOBAL_LOCALE;
(void) b;
#endif
/* Check that 'struct lconv' has the ISO C and POSIX specified members. */
ls += sizeof (*l.decimal_point);
ls += sizeof (*l.thousands_sep);
ls += sizeof (*l.grouping);
ls += sizeof (*l.mon_decimal_point);
ls += sizeof (*l.mon_thousands_sep);
ls += sizeof (*l.mon_grouping);
ls += sizeof (*l.positive_sign);
ls += sizeof (*l.negative_sign);
ls += sizeof (*l.currency_symbol);
ls += sizeof (l.frac_digits);
ls += sizeof (l.p_cs_precedes);
ls += sizeof (l.p_sign_posn);
ls += sizeof (l.p_sep_by_space);
ls += sizeof (l.n_cs_precedes);
ls += sizeof (l.n_sign_posn);
ls += sizeof (l.n_sep_by_space);
ls += sizeof (*l.int_curr_symbol);
ls += sizeof (l.int_frac_digits);
ls += sizeof (l.int_p_cs_precedes);
ls += sizeof (l.int_p_sign_posn);
ls += sizeof (l.int_p_sep_by_space);
ls += sizeof (l.int_n_cs_precedes);
ls += sizeof (l.int_n_sign_posn);
ls += sizeof (l.int_n_sep_by_space);
return 0;
}
|
// Copyright 2020 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 COMPONENTS_SERVICES_STORAGE_TEST_API_TEST_API_H_
#define COMPONENTS_SERVICES_STORAGE_TEST_API_TEST_API_H_
namespace storage {
void InjectTestApiImplementation();
} // namespace storage
#endif // COMPONENTS_SERVICES_STORAGE_TEST_API_TEST_API_H_
|
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGMetadataElement_h
#define SVGMetadataElement_h
#include "core/svg/SVGElement.h"
namespace blink {
class SVGMetadataElement FINAL : public SVGElement {
DEFINE_WRAPPERTYPEINFO();
public:
DECLARE_NODE_FACTORY(SVGMetadataElement);
private:
explicit SVGMetadataElement(Document&);
virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; }
};
} // namespace blink
#endif // SVGMetadataElement_h
|
/*
* qemu_capspriv.h: private declarations for QEMU capabilities generation
*
* Copyright (C) 2015 Samsung Electronics Co. Ltd
* Copyright (C) 2015 Pavel Fedin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Pavel Fedin <p.fedin@samsung.com>
*/
#ifndef __QEMU_CAPSRIV_H_ALLOW__
# error "qemu_capspriv.h may only be included by qemu_capabilities.c or test suites"
#endif
#ifndef __QEMU_CAPSPRIV_H__
# define __QEMU_CAPSPRIV_H__
struct _virQEMUCapsCache {
virMutex lock;
virHashTablePtr binaries;
char *libDir;
char *cacheDir;
uid_t runUid;
gid_t runGid;
};
#endif
|
/****************************************************************************
*
* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
#ifndef __gc_hal_kernel_os_h_
#define __gc_hal_kernel_os_h_
typedef struct _LINUX_MDL_MAP
{
gctINT pid;
gctPOINTER vmaAddr;
struct vm_area_struct * vma;
struct _LINUX_MDL_MAP * next;
}
LINUX_MDL_MAP;
typedef struct _LINUX_MDL_MAP * PLINUX_MDL_MAP;
typedef struct _LINUX_MDL
{
gctINT pid;
char * addr;
union _pages
{
/* Pointer to a array of pages. */
struct page * contiguousPages;
/* Pointer to a array of pointers to page. */
struct page ** nonContiguousPages;
}
u;
#ifdef NO_DMA_COHERENT
gctPOINTER kaddr;
#endif /* NO_DMA_COHERENT */
gctINT numPages;
gctINT pagedMem;
gctBOOL contiguous;
dma_addr_t dmaHandle;
PLINUX_MDL_MAP maps;
struct _LINUX_MDL * prev;
struct _LINUX_MDL * next;
}
LINUX_MDL, *PLINUX_MDL;
extern PLINUX_MDL_MAP
FindMdlMap(
IN PLINUX_MDL Mdl,
IN gctINT PID
);
typedef struct _DRIVER_ARGS
{
gctPOINTER InputBuffer;
gctUINT32 InputBufferSize;
gctPOINTER OutputBuffer;
gctUINT32 OutputBufferSize;
}
DRIVER_ARGS;
#endif /* __gc_hal_kernel_os_h_ */
|
//
// MusepackFile.h
// zyVorbis
//
// Created by Vincent Spader on 1/23/05.
// Copyright 2005 Vincent Spader All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <mpcdec/mpcdec.h>
#import "Plugin.h"
@interface MusepackDecoder : NSObject <CogDecoder>
{
id<CogSource> source;
mpc_decoder decoder;
mpc_streaminfo info;
mpc_reader reader;
char buffer[MPC_FRAME_LENGTH*4];
int bufferFrames;
int bitrate;
float frequency;
long totalFrames;
}
- (BOOL)writeToBuffer:(uint16_t *)sample_buffer fromBuffer:(const MPC_SAMPLE_FORMAT *)p_buffer frames:(unsigned)frames;
- (void)setSource:(id<CogSource>)s;
- (id<CogSource>)source;
@end
|
/* ascend-int.h
* Definitions for routines common to multiple modules in the Lucent/Ascend
* capture file reading code code, but not used outside that code.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __ASCEND_INT_H__
#define __ASCEND_INT_H__
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <glib.h>
#include "ws_symbol_export.h"
extern int at_eof;
extern const gchar *ascend_parse_error;
/*
* Pointer to the pseudo-header for the current packet.
*/
extern struct ascend_phdr *pseudo_header;
typedef struct {
time_t inittime;
gboolean adjusted;
gint64 next_packet_seek_start;
} ascend_t;
/* Here we provide interfaces to make our scanner act and look like lex */
int ascendlex(void);
void init_parse_ascend(void);
void ascend_init_lexer(FILE_T fh);
gboolean check_ascend(FILE_T fh, struct wtap_pkthdr *phdr);
typedef enum {
PARSED_RECORD,
PARSED_NONRECORD,
PARSE_FAILED
} parse_t;
parse_t parse_ascend(ascend_t *ascend, FILE_T fh, struct wtap_pkthdr *phdr,
Buffer *buf, guint length);
#endif /* ! __ASCEND_INT_H__ */
|
/*******************************************************************************************/
/*******************************************************************************************/
/* SENSOR FULL SIZE */
#ifndef __SENSOR_H
#define __SENSOR_H
#define ZSD15FPS
typedef enum group_enum {
PRE_GAIN=0,
CMMCLK_CURRENT,
FRAME_RATE_LIMITATION,
REGISTER_EDITOR,
GROUP_TOTAL_NUMS
} FACTORY_GROUP_ENUM;
#define ENGINEER_START_ADDR 10
#define FACTORY_START_ADDR 0
typedef enum engineer_index
{
CMMCLK_CURRENT_INDEX=ENGINEER_START_ADDR,
ENGINEER_END
} FACTORY_ENGINEER_INDEX;
typedef enum register_index
{
SENSOR_BASEGAIN=FACTORY_START_ADDR,
PRE_GAIN_R_INDEX,
PRE_GAIN_Gr_INDEX,
PRE_GAIN_Gb_INDEX,
PRE_GAIN_B_INDEX,
FACTORY_END_ADDR
} FACTORY_REGISTER_INDEX;
typedef struct
{
SENSOR_REG_STRUCT Reg[ENGINEER_END];
SENSOR_REG_STRUCT CCT[FACTORY_END_ADDR];
} SENSOR_DATA_STRUCT, *PSENSOR_DATA_STRUCT;
typedef enum {
SENSOR_MODE_INIT = 0,
SENSOR_MODE_PREVIEW,
SENSOR_MODE_VIDEO,
SENSOR_MODE_CAPTURE
} OV8826_SENSOR_MODE;
typedef struct
{
kal_uint32 DummyPixels;
kal_uint32 DummyLines;
kal_uint32 pvShutter;
kal_uint32 pvGain;
kal_uint32 pvPclk; // x10 480 for 48MHZ
kal_uint32 videoPclk;
kal_uint32 capPclk; // x10
kal_uint32 shutter;
kal_uint32 maxExposureLines;
kal_uint16 sensorGlobalGain;//sensor gain read from 0x350a 0x350b;
kal_uint16 ispBaseGain;//64
kal_uint16 realGain;//ispBaseGain as 1x
kal_int16 imgMirror;
OV8826_SENSOR_MODE sensorMode;
kal_bool OV8826AutoFlickerMode;
kal_bool OV8826VideoMode;
}OV8826_PARA_STRUCT,*POV8826_PARA_STRUCT;
#define OV8826_IMAGE_SENSOR_FULL_WIDTH (3264-64)
#define OV8826_IMAGE_SENSOR_FULL_HEIGHT (2448-48)
/* SENSOR PV SIZE */
#define OV8826_IMAGE_SENSOR_PV_WIDTH (1632-32)
#define OV8826_IMAGE_SENSOR_PV_HEIGHT (1224-24)
#define OV8826_IMAGE_SENSOR_VIDEO_WIDTH (2160-40)
#define OV8826_IMAGE_SENSOR_VIDEO_HEIGHT (1620-30)
/* SENSOR SCALER FACTOR */
#define OV8826_PV_SCALER_FACTOR 3
#define OV8826_FULL_SCALER_FACTOR 1
/* SENSOR START/EDE POSITION */
#define OV8826_FULL_X_START (2)
#define OV8826_FULL_Y_START (2)
#define OV8826_FULL_X_END (3264+200)
#define OV8826_FULL_Y_END (2448)
#define OV8826_PV_X_START (2)
#define OV8826_PV_Y_START (2)
#define OV8826_PV_X_END (1632)
#define OV8826_PV_Y_END (1224)
#define OV8826_VIDEO_X_START (2)
#define OV8826_VIDEO_Y_START (2)
#define OV8826_VIDEO_X_END (2160)
#define OV8826_VIDEO_Y_END (1620)
#define OV8826_MAX_ANALOG_GAIN (16)
#define OV8826_MIN_ANALOG_GAIN (1)
#define OV8826_ANALOG_GAIN_1X (0x0020)
//#define OV8826_MAX_DIGITAL_GAIN (8)
//#define OV8826_MIN_DIGITAL_GAIN (1)
//#define OV8826_DIGITAL_GAIN_1X (0x0100)
/* SENSOR PIXEL/LINE NUMBERS IN ONE PERIOD */
#define OV8826_FULL_PERIOD_PIXEL_NUMS (0x16C0+200) //5824+200 //mt6589 add dummy pixel 200 for line_start/end
#if defined(ZSD15FPS)
#define OV8826_FULL_PERIOD_LINE_NUMS 0x9B0 //2480
#else
//Add dummy lines for 13fps
#define OV8826_FULL_PERIOD_LINE_NUMS 0xB78 //2936
#endif
#define OV8826_PV_PERIOD_PIXEL_NUMS 0x0DBC //3516
#define OV8826_PV_PERIOD_LINE_NUMS 0x51E //1310
#define OV8826_VIDEO_PERIOD_PIXEL_NUMS 0x0F30 //3888
#define OV8826_VIDEO_PERIOD_LINE_NUMS 0x0740 //1856
#define OV8826_MIN_LINE_LENGTH 0x0AA4 //2724
#define OV8826_MIN_FRAME_LENGTH 0x0214 //532
#define OV8826_MAX_LINE_LENGTH 0xCCCC
#define OV8826_MAX_FRAME_LENGTH 0xFFFF
/* DUMMY NEEDS TO BE INSERTED */
/* SETUP TIME NEED TO BE INSERTED */
#define OV8826_IMAGE_SENSOR_PV_INSERTED_PIXELS 2
#define OV8826_IMAGE_SENSOR_PV_INSERTED_LINES 2
#define OV8826_IMAGE_SENSOR_FULL_INSERTED_PIXELS 4
#define OV8826_IMAGE_SENSOR_FULL_INSERTED_LINES 4
#define OV8826MIPI_WRITE_ID (0x6C)
#define OV8826MIPI_READ_ID (0x6D)
// SENSOR CHIP VERSION
#define OV8826MIPI_SENSOR_ID OV8826_SENSOR_ID
#define OV8826MIPI_PAGE_SETTING_REG (0xFF)
//s_add for porting
//s_add for porting
//s_add for porting
//export functions
UINT32 OV8826MIPIOpen(void);
UINT32 OV8826MIPIGetResolution(MSDK_SENSOR_RESOLUTION_INFO_STRUCT *pSensorResolution);
UINT32 OV8826MIPIGetInfo(MSDK_SCENARIO_ID_ENUM ScenarioId, MSDK_SENSOR_INFO_STRUCT *pSensorInfo, MSDK_SENSOR_CONFIG_STRUCT *pSensorConfigData);
UINT32 OV8826MIPIControl(MSDK_SCENARIO_ID_ENUM ScenarioId, MSDK_SENSOR_EXPOSURE_WINDOW_STRUCT *pImageWindow, MSDK_SENSOR_CONFIG_STRUCT *pSensorConfigData);
UINT32 OV8826MIPIFeatureControl(MSDK_SENSOR_FEATURE_ENUM FeatureId, UINT8 *pFeaturePara,UINT32 *pFeatureParaLen);
UINT32 OV8826MIPIClose(void);
//#define Sleep(ms) mdelay(ms)
//#define RETAILMSG(x,...)
//#define TEXT
//e_add for porting
//e_add for porting
//e_add for porting
#endif /* __SENSOR_H */
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
/* ftp can use this as well */
CURLcode Curl_proxyCONNECT(struct connectdata *conn,
int tunnelsocket,
const char *hostname, unsigned short remote_port);
/* Default proxy timeout in milliseconds */
#define PROXY_TIMEOUT (3600*1000)
#else
#define Curl_proxyCONNECT(x,y,z,w) CURLE_NOT_BUILT_IN
#endif
|
/*
* \brief Log root interface
* \author Norman Feske
* \date 2006-09-15
*/
/*
* 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 _CORE__INCLUDE__LOG_ROOT_H_
#define _CORE__INCLUDE__LOG_ROOT_H_
#include <root/component.h>
#include <util/arg_string.h>
#include "log_session_component.h"
namespace Genode {
class Log_root : public Root_component<Log_session_component>
{
protected:
/**
* Root component interface
*/
Log_session_component *_create_session(const char *args)
{
char label_buf[Log_session_component::LABEL_LEN];
Arg label_arg = Arg_string::find_arg(args, "label");
label_arg.string(label_buf, sizeof(label_buf), "");
return new (md_alloc()) Log_session_component(label_buf);
}
public:
/**
* Constructor
*
* \param session_ep entry point for managing cpu session objects
* \param md_alloc meta-data allocator to be used by root component
*/
Log_root(Rpc_entrypoint *session_ep, Allocator *md_alloc):
Root_component<Log_session_component>(session_ep, md_alloc) { }
};
}
#endif /* _CORE__INCLUDE__LOG_ROOT_H_ */
|
/* packet-nt-oui.c
* Register an LLC dissector table for Nortel's OUI 00:00:0c
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include "packet-llc.h"
#include <epan/oui.h>
void proto_register_nortel_oui(void);
static int hf_llc_nortel_pid = -1;
static const value_string nortel_pid_vals[] = {
{ 0x01a1, "NDP flatnet hello" },
{ 0x01a2, "NDP segment hello" },
{ 0x01a3, "NDP bridge hello" },
{ 0, NULL }
};
/*
* NOTE: there's no dissector here, just registration routines to set
* up the dissector table for the Nortel OUI.
*/
void
proto_register_nortel_oui(void)
{
static hf_register_info hf[] = {
{ &hf_llc_nortel_pid,
{ "PID", "llc.nortel_pid", FT_UINT16, BASE_HEX,
VALS(nortel_pid_vals), 0x0, NULL, HFILL }
}
};
llc_add_oui(OUI_NORTEL, "llc.nortel_pid", "LLC Nortel OUI PID", hf, -1);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
|
/******************************************************************************
* Filename: ccfgread.c
* Revised: 2015-08-04 11:44:20 +0200 (Tue, 04 Aug 2015)
* Revision: 44329
*
* Description: API for reading CCFG.
*
* Copyright (c) 2015, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
#include <driverlib/ccfgread.h>
// See ccfgread.h for implementation
|
#include <gtk/gtk.h>
static void
child_size_allocate (GtkWidget *child,
GdkRectangle *allocation,
gpointer user_data)
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (child);
g_print ("Child %p\nHas left? %d\nHas right? %d\nHas top? %d\nHas bottom? %d\n",
child,
gtk_style_context_has_class (context, "left"),
gtk_style_context_has_class (context, "right"),
gtk_style_context_has_class (context, "top"),
gtk_style_context_has_class (context, "bottom"));
}
static gboolean
overlay_get_child_position (GtkOverlay *overlay,
GtkWidget *child,
GdkRectangle *allocation,
gpointer user_data)
{
GtkWidget *custom_child = user_data;
GtkRequisition req;
if (child != custom_child)
return FALSE;
gtk_widget_get_preferred_size (child, NULL, &req);
allocation->x = 120;
allocation->y = 0;
allocation->width = req.width;
allocation->height = req.height;
return TRUE;
}
int
main (int argc, char *argv[])
{
GtkWidget *win, *overlay, *grid, *main_child, *child, *label, *sw;
GtkCssProvider *provider;
gchar *str;
gtk_init (&argc, &argv);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider,
"GtkLabel { border: 3px solid black; border-radius: 5px; padding: 2px; }"
".top { border-top-style: none; right-radius: 0px; border-top-left-radius: 0px; }"
".bottom { border-bottom-style: none; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; }"
".left { border-left-style: none; border-top-left-radius: 0px; border-bottom-left-radius: 0px; }"
".right { border-right-style: none; border-top-right-radius: 0px; border-bottom-right-radius: 0px; }",
-1, NULL);
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (win), 600, 600);
grid = gtk_grid_new ();
child = gtk_event_box_new ();
gtk_widget_set_hexpand (child, TRUE);
gtk_widget_set_vexpand (child, TRUE);
gtk_container_add (GTK_CONTAINER (grid), child);
label = gtk_label_new ("Out of overlay");
gtk_container_add (GTK_CONTAINER (child), label);
overlay = gtk_overlay_new ();
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_ALWAYS,
GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (overlay), sw);
main_child = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (sw), main_child);
gtk_widget_set_hexpand (main_child, TRUE);
gtk_widget_set_vexpand (main_child, TRUE);
label = gtk_label_new ("Main child");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (main_child), label);
child = gtk_label_new (NULL);
str = g_strdup_printf ("%p", child);
gtk_label_set_text (GTK_LABEL (child), str);
g_free (str);
g_print ("Bottom/Right child: %p\n", child);
gtk_widget_set_halign (child, GTK_ALIGN_END);
gtk_widget_set_valign (child, GTK_ALIGN_END);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_signal_connect (child, "size-allocate",
G_CALLBACK (child_size_allocate), overlay);
child = gtk_label_new (NULL);
str = g_strdup_printf ("%p", child);
gtk_label_set_text (GTK_LABEL (child), str);
g_free (str);
g_print ("Left/Top child: %p\n", child);
gtk_widget_set_halign (child, GTK_ALIGN_START);
gtk_widget_set_valign (child, GTK_ALIGN_START);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_signal_connect (child, "size-allocate",
G_CALLBACK (child_size_allocate), overlay);
child = gtk_label_new (NULL);
str = g_strdup_printf ("%p", child);
gtk_label_set_text (GTK_LABEL (child), str);
g_free (str);
g_print ("Right/Center child: %p\n", child);
gtk_widget_set_halign (child, GTK_ALIGN_END);
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_signal_connect (child, "size-allocate",
G_CALLBACK (child_size_allocate), overlay);
child = gtk_label_new (NULL);
str = g_strdup_printf ("%p", child);
gtk_label_set_text (GTK_LABEL (child), str);
g_free (str);
gtk_widget_set_margin_start (child, 55);
gtk_widget_set_margin_top (child, 4);
g_print ("Left/Top margined child: %p\n", child);
gtk_widget_set_halign (child, GTK_ALIGN_START);
gtk_widget_set_valign (child, GTK_ALIGN_START);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_signal_connect (child, "size-allocate",
G_CALLBACK (child_size_allocate), overlay);
child = gtk_label_new (NULL);
str = g_strdup_printf ("%p", child);
gtk_label_set_text (GTK_LABEL (child), str);
g_free (str);
g_print ("Custom get-child-position child: %p\n", child);
gtk_widget_set_halign (child, GTK_ALIGN_START);
gtk_widget_set_valign (child, GTK_ALIGN_START);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_signal_connect (child, "size-allocate",
G_CALLBACK (child_size_allocate), overlay);
g_signal_connect (overlay, "get-child-position",
G_CALLBACK (overlay_get_child_position), child);
gtk_grid_attach (GTK_GRID (grid), overlay, 1, 0, 1, 3);
gtk_container_add (GTK_CONTAINER (win), grid);
g_print ("\n");
gtk_widget_show_all (win);
gtk_main ();
return 0;
}
|
/*----------------------------------------------------------------------------
* File: ooaofooa_A_AP_class.h
*
* Class: Activity Partition (A_AP)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#ifndef OOAOFOOA_A_AP_CLASS_H
#define OOAOFOOA_A_AP_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structural representation of application analysis class:
* Activity Partition (A_AP)
*/
struct ooaofooa_A_AP {
/* application analysis class attributes */
Escher_UniqueID_t Id;
Escher_UniqueID_t Package_ID;
c_t * Name;
c_t * Descrip;
/* relationship storage */
ooaofooa_A_A * A_A_R1111;
ooaofooa_PE_PE * PE_PE_R8001;
};
void ooaofooa_A_AP_instancedumper( Escher_iHandle_t );
Escher_iHandle_t ooaofooa_A_AP_instanceloader( Escher_iHandle_t, const c_t * [] );
void ooaofooa_A_AP_batch_relate( Escher_iHandle_t );
void ooaofooa_A_AP_R1111_Link_group( ooaofooa_A_A *, ooaofooa_A_AP * );
void ooaofooa_A_AP_R1111_Unlink_group( ooaofooa_A_A *, ooaofooa_A_AP * );
void ooaofooa_A_AP_R8001_Link( ooaofooa_PE_PE *, ooaofooa_A_AP * );
void ooaofooa_A_AP_R8001_Unlink( ooaofooa_PE_PE *, ooaofooa_A_AP * );
#define ooaofooa_A_AP_MAX_EXTENT_SIZE 10
extern Escher_Extent_t pG_ooaofooa_A_AP_extent;
#ifdef __cplusplus
}
#endif
#endif /* OOAOFOOA_A_AP_CLASS_H */
|
//===- DelayedParsingCallbacks.h - Callbacks for Parser's delayed parsing -===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_PARSE_DELAYED_PARSING_CALLBACKS_H
#define SWIFT_PARSE_DELAYED_PARSING_CALLBACKS_H
#include "swift/Basic/SourceLoc.h"
#include "swift/Basic/SourceManager.h"
#include "swift/Parse/Parser.h"
namespace swift {
class DeclAttributes;
class AbstractFunctionDecl;
/// \brief Callbacks for Parser's delayed parsing.
class DelayedParsingCallbacks {
virtual void anchor();
public:
virtual ~DelayedParsingCallbacks() = default;
/// Checks if a function body should be delayed or skipped altogether.
virtual bool shouldDelayFunctionBodyParsing(Parser &TheParser,
AbstractFunctionDecl *AFD,
const DeclAttributes &Attrs,
SourceRange BodyRange) = 0;
};
class AlwaysDelayedCallbacks : public DelayedParsingCallbacks {
bool shouldDelayFunctionBodyParsing(Parser &TheParser,
AbstractFunctionDecl *AFD,
const DeclAttributes &Attrs,
SourceRange BodyRange) override {
return true;
}
};
/// \brief Implementation of callbacks that guide the parser in delayed
/// parsing for code completion.
class CodeCompleteDelayedCallbacks : public DelayedParsingCallbacks {
SourceLoc CodeCompleteLoc;
public:
explicit CodeCompleteDelayedCallbacks(SourceLoc CodeCompleteLoc)
: CodeCompleteLoc(CodeCompleteLoc) {
}
bool shouldDelayFunctionBodyParsing(Parser &TheParser,
AbstractFunctionDecl *AFD,
const DeclAttributes &Attrs,
SourceRange BodyRange) override {
// Delay parsing if the code completion point is in the function body.
return TheParser.SourceMgr
.rangeContainsTokenLoc(BodyRange, CodeCompleteLoc);
}
};
} // namespace swift
#endif
|
#include <tommath.h>
#ifdef BN_MP_READ_SIGNED_BIN_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, tomstdenis@gmail.com, http://libtom.org
*/
/* read signed bin, big endian, first byte is 0==positive or 1==negative */
int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c)
{
int res;
/* read magnitude */
if ((res = mp_read_unsigned_bin (a, b + 1, c - 1)) != MP_OKAY) {
return res;
}
/* first byte is 0 for positive, non-zero for negative */
if (b[0] == 0) {
a->sign = MP_ZPOS;
} else {
a->sign = MP_NEG;
}
return MP_OKAY;
}
#endif
/* $Source$ */
/* $Revision: 0.41 $ */
/* $Date: 2007-04-18 09:58:18 +0000 $ */
|
#ifndef LIBTRADING_NASDAQ_ITCH41_MESSAGE_H
#define LIBTRADING_NASDAQ_ITCH41_MESSAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "libtrading/types.h"
struct buffer;
/*
* Message types:
*/
enum itch41_msg_type {
ITCH41_MSG_TIMESTAMP_SECONDS = 'T', /* Section 4.1 */
ITCH41_MSG_SYSTEM_EVENT = 'S', /* Section 4.2 */
ITCH41_MSG_STOCK_DIRECTORY = 'R', /* Section 4.3.1. */
ITCH41_MSG_STOCK_TRADING_ACTION = 'H', /* Section 4.3.2. */
ITCH41_MSG_REG_SHO_RESTRICTION = 'Y', /* Section 4.3.3. */
ITCH41_MSG_MARKET_PARTICIPANT_POS = 'L', /* Section 4.3.4. */
ITCH41_MSG_ADD_ORDER = 'A', /* Section 4.4.1. */
ITCH41_MSG_ADD_ORDER_MPID = 'F', /* Section 4.4.2. */
ITCH41_MSG_ORDER_EXECUTED = 'E', /* Section 4.5.1. */
ITCH41_MSG_ORDER_EXECUTED_WITH_PRICE = 'C', /* Section 4.5.2. */
ITCH41_MSG_ORDER_CANCEL = 'X', /* Section 4.5.3. */
ITCH41_MSG_ORDER_DELETE = 'D', /* Section 4.5.4. */
ITCH41_MSG_ORDER_REPLACE = 'U', /* Section 4.5.5. */
ITCH41_MSG_TRADE = 'P', /* Section 4.6.1. */
ITCH41_MSG_CROSS_TRADE = 'Q', /* Section 4.6.2. */
ITCH41_MSG_BROKEN_TRADE = 'B', /* Section 4.6.3. */
ITCH41_MSG_NOII = 'I', /* Section 4.7. */
ITCH41_MSG_RPII = 'N', /* Section 4.8. */
};
/*
* System event codes:
*/
enum itch41_event_code {
ITCH41_EVENT_START_OF_MESSAGES = 'O',
ITCH41_EVENT_START_OF_SYSTEM_HOURS = 'S',
ITCH41_EVENT_START_OF_MARKET_HOURS = 'Q',
ITCH41_EVENT_END_OF_MARKET_HOURS = 'M',
ITCH41_EVENT_END_OF_SYSTEM_HOURS = 'E',
ITCH41_EVENT_END_OF_MESSAGES = 'C',
ITCH41_EVENT_EMERGENCY_HALT = 'A',
ITCH41_EVENT_EMERGENCY_QUOTE_ONLY = 'R',
ITCH41_EVENT_EMERGENCY_RESUMPTION = 'B',
};
/*
* A data structure for ITCH messages.
*/
struct itch41_message {
u8 MessageType;
};
/* ITCH41_MSG_TIMESTAMP_SECONDS */
struct itch41_msg_timestamp_seconds {
u8 MessageType;
be32 Second;
} __attribute__((packed));
/* ITCH41_MSG_SYSTEM_EVENT */
struct itch41_msg_system_event {
u8 MessageType;
be32 Timestamp;
char EventCode; /* ITCH41_EVENT_<code> */
} __attribute__((packed));
/* ITCH41_MSG_STOCK_DIRECTORY */
struct itch41_msg_stock_directory {
u8 MessageType;
be32 TimestampNanoseconds;
char Stock[8];
char MarketCategory;
char FinancialStatusIndicator;
be32 RoundLotSize;
char RoundLotsOnly;
} __attribute__((packed));
/* ITCH41_MSG_STOCK_TRADING_ACTION */
struct itch41_msg_stock_trading_action {
u8 MessageType;
be32 TimestampNanoseconds;
char Stock[8];
char TradingState;
char Reserved;
char Reason[4];
} __attribute__((packed));
/* ITCH41_MSG_REG_SHO_RESTRICTION */
struct itch41_msg_reg_sho_restriction {
u8 MessageType;
be32 TimestampNanoseconds;
char Stock[8];
char RegSHOAction;
} __attribute__((packed));
/* ITCH41_MSG_MARKET_PARTICIPANT_POS */
struct itch41_msg_market_participant_pos {
u8 MessageType;
be32 TimestampNanoseconds;
char MPID[4];
char Stock[8];
char PrimaryMarketMaker;
char MarketMakerMode;
char MarketParticipantState;
} __attribute__((packed));
/* ITCH41_MSG_ADD_ORDER */
struct itch41_msg_add_order {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
char BuySellIndicator;
be32 Shares;
char Stock[8];
be32 Price;
} __attribute__((packed));
/* ITCH41_MSG_ADD_ORDER_MPID */
struct itch41_msg_add_order_mpid {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
char BuySellIndicator;
be32 Shares;
char Stock[8];
be32 Price;
char Attribution[4];
} __attribute__((packed));
/* ITCH41_MSG_ORDER_EXECUTED */
struct itch41_msg_order_executed {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
be32 ExecutedShares;
be64 MatchNumber;
} __attribute__((packed));
/* ITCH41_MSG_ORDER_EXECUTED_WITH_PRICE */
struct itch41_msg_order_executed_with_price {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
be32 ExecutedShares;
be64 MatchNumber;
char Printable;
be32 ExecutionPrice;
} __attribute__((packed));
/* ITCH41_MSG_ORDER_CANCEL */
struct itch41_msg_order_cancel {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
be32 CanceledShares;
} __attribute__((packed));
/* ITCH41_MSG_ORDER_DELETE */
struct itch41_msg_order_delete {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
} __attribute__((packed));
/* ITCH41_MSG_ORDER_REPLACE */
struct itch41_msg_order_replace {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OriginalOrderReferenceNumber;
be64 NewOrderReferenceNumber;
be32 Shares;
be32 Price;
} __attribute__((packed));
/* ITCH41_MSG_TRADE */
struct itch41_msg_trade {
u8 MessageType;
be32 TimestampNanoseconds;
be64 OrderReferenceNumber;
char BuySellIndicator;
be32 Shares;
char Stock[8];
be32 Price;
be64 MatchNumber;
} __attribute__((packed));
/* ITCH41_MSG_CROSS_TRADE */
struct itch41_msg_cross_trade {
u8 MessageType;
be32 TimestampNanoseconds;
be64 Shares;
char Stock[8];
be32 CrossPrice;
be64 MatchNumber;
char CrossType;
} __attribute__((packed));
/* ITCH41_MSG_BROKEN_TRADE */
struct itch41_msg_broken_trade {
u8 MessageType;
be32 TimestampNanoseconds;
be64 MatchNumber;
} __attribute__((packed));
/* ITCH41_MSG_NOII */
struct itch41_msg_noii {
u8 MessageType;
be32 TimestampNanoseconds;
be64 PairedShares;
be64 ImbalanceShares;
char ImbalanceDirection;
char Stock[8];
be32 FarPrice;
be32 NearPrice;
be32 CurrentReferencePrice;
char CrossType;
char PriceVariationIndicator;
} __attribute__((packed));
/* ITCH41_MSG_RPII */
struct itch41_msg_rpii {
u8 MessageType;
be32 TimestampNanoseconds;
char Stock[8];
char InterestFlag;
} __attribute__((packed));
struct itch41_message *itch41_message_decode(struct buffer *buf);
#ifdef __cplusplus
}
#endif
#endif
|
#include <stdlib.h>
void *bsearch(const void *key, const void *base, size_t nel, size_t width, int (*cmp)(const void *, const void *))
{
void *try;
int sign;
while (nel > 0) {
try = (char *)base + width*(nel/2);
sign = cmp(key, try);
if (sign < 0) {
nel /= 2;
} else if (sign > 0) {
base = (char *)try + width;
nel -= nel/2+1;
} else {
return try;
}
}
return NULL;
}
|
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYGUITKCONTROLEVENT_H_
#define BERRYGUITKCONTROLEVENT_H_
#include "berryGuiTkEvent.h"
namespace berry
{
namespace GuiTk
{
/**
* Instances of this class are sent as a result of
* controls being moved or resized.
*
* @see ControlListener
* @see <a href="http://www.blueberry.org/swt/">Sample code and further information</a>
*/
class BERRY_UI_QT ControlEvent: public Event
{
public:
berryObjectMacro(ControlEvent)
ControlEvent();
ControlEvent(QWidget* item, int x = 0, int y = 0, int width = 0, int height = 0);
};
}
}
#endif /* BERRYGUITKCONTROLEVENT_H_ */
|
// 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 CONTENT_COMMON_GPU_MEDIA_VP9_DECODER_H_
#define CONTENT_COMMON_GPU_MEDIA_VP9_DECODER_H_
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/gpu/media/accelerated_video_decoder.h"
#include "content/common/gpu/media/vp9_picture.h"
#include "media/filters/vp9_parser.h"
namespace content {
// This class implements an AcceleratedVideoDecoder for VP9 decoding.
// Clients of this class are expected to pass raw VP9 stream and are expected
// to provide an implementation of VP9Accelerator for offloading final steps
// of the decoding process.
//
// This class must be created, called and destroyed on a single thread, and
// does nothing internally on any other thread.
class CONTENT_EXPORT VP9Decoder : public AcceleratedVideoDecoder {
public:
class CONTENT_EXPORT VP9Accelerator {
public:
VP9Accelerator();
virtual ~VP9Accelerator();
// Create a new VP9Picture that the decoder client can use for initial
// stages of the decoding process and pass back to this accelerator for
// final, accelerated stages of it, or for reference when decoding other
// pictures.
//
// When a picture is no longer needed by the decoder, it will just drop
// its reference to it, and it may do so at any time.
//
// Note that this may return nullptr if the accelerator is not able to
// provide any new pictures at the given time. The decoder must handle this
// case and treat it as normal, returning kRanOutOfSurfaces from Decode().
virtual scoped_refptr<VP9Picture> CreateVP9Picture() = 0;
// Submit decode for |pic| to be run in accelerator, taking as arguments
// information contained in it, as well as current segmentation and loop
// filter state in |seg| and |lf|, respectively, and using pictures in
// |ref_pictures| for reference.
//
// Note that returning from this method does not mean that the decode
// process is finished, but the caller may drop its references to |pic|
// and |ref_pictures| immediately, and the data in |seg| and |lf| does not
// need to remain valid after this method returns.
//
// Return true when successful, false otherwise.
virtual bool SubmitDecode(
const scoped_refptr<VP9Picture>& pic,
const media::Vp9Segmentation& seg,
const media::Vp9LoopFilter& lf,
const std::vector<scoped_refptr<VP9Picture>>& ref_pictures) = 0;
// Schedule output (display) of |pic|.
//
// Note that returning from this method does not mean that |pic| has already
// been outputted (displayed), but guarantees that all pictures will be
// outputted in the same order as this method was called for them, and that
// they are decoded before outputting (assuming SubmitDecode() has been
// called for them beforehand). Decoder may drop its references to |pic|
// immediately after calling this method.
//
// Return true when successful, false otherwise.
virtual bool OutputPicture(const scoped_refptr<VP9Picture>& pic) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(VP9Accelerator);
};
VP9Decoder(VP9Accelerator* accelerator);
~VP9Decoder() override;
// content::AcceleratedVideoDecoder implementation.
void SetStream(const uint8_t* ptr, size_t size) override;
bool Flush() override WARN_UNUSED_RESULT;
void Reset() override;
DecodeResult Decode() override WARN_UNUSED_RESULT;
gfx::Size GetPicSize() const override;
size_t GetRequiredNumOfPictures() const override;
private:
// Update ref_frames_ based on the information in current frame header.
void RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic);
// Decode and possibly output |pic| (if the picture is to be shown).
// Return true on success, false otherwise.
bool DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic);
// Called on error, when decoding cannot continue. Sets state_ to kError and
// releases current state.
void SetError();
enum State {
kNeedStreamMetadata, // After initialization, need a keyframe.
kDecoding, // Ready to decode from any point.
kAfterReset, // After Reset(), need a resume point.
kError, // Error in decode, can't continue.
};
// Current decoder state.
State state_;
// Current frame header to be used in decoding the next picture.
scoped_ptr<media::Vp9FrameHeader> curr_frame_hdr_;
// Reference frames currently in use.
std::vector<scoped_refptr<VP9Picture>> ref_frames_;
// Current coded resolution.
gfx::Size pic_size_;
media::Vp9Parser parser_;
// VP9Accelerator instance owned by the client.
VP9Accelerator* accelerator_;
DISALLOW_COPY_AND_ASSIGN(VP9Decoder);
};
} // namespace content
#endif // CONTENT_COMMON_GPU_MEDIA_VP9_DECODER_H_
|
//
// PureLayout+Internal.h
// v2.0.1
// https://github.com/smileyborg/PureLayout
//
// Copyright (c) 2014 Tyler Fox
//
// This code is distributed under the terms and conditions of the MIT license.
//
// 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.
//
#import "PureLayoutDefines.h"
/**
A category that exposes the internal (private) helper methods of the ALView+PureLayout category.
*/
@interface ALView (PureLayoutInternal)
+ (BOOL)al_preventAutomaticConstraintInstallation;
+ (BOOL)al_isExecutingPriorityConstraintsBlock;
+ (ALLayoutPriority)al_currentGlobalConstraintPriority;
+ (NSString *)al_currentGlobalConstraintIdentifier;
+ (void)al_applyGlobalStateToConstraint:(NSLayoutConstraint *)constraint;
- (void)al_addConstraint:(NSLayoutConstraint *)constraint;
- (ALView *)al_commonSuperviewWithView:(ALView *)otherView;
- (NSLayoutConstraint *)al_alignAttribute:(ALAttribute)attribute toView:(ALView *)otherView forAxis:(ALAxis)axis;
@end
/**
A category that exposes the internal (private) helper methods of the NSArray+PureLayout category.
*/
@interface NSArray (PureLayoutInternal)
- (ALView *)al_commonSuperviewOfViews;
- (BOOL)al_containsMinimumNumberOfViews:(NSUInteger)minimumNumberOfViews;
- (NSArray *)al_copyViewsOnly;
@end
/**
A category that exposes the internal (private) helper methods of the NSLayoutConstraint+PureLayout category.
*/
@interface NSLayoutConstraint (PureLayoutInternal)
+ (NSLayoutAttribute)al_layoutAttributeForAttribute:(ALAttribute)attribute;
+ (ALLayoutConstraintAxis)al_constraintAxisForAxis:(ALAxis)axis;
#if __PureLayout_MinBaseSDK_iOS_8_0
+ (ALMargin)al_marginForEdge:(ALEdge)edge;
+ (ALMarginAxis)al_marginAxisForAxis:(ALAxis)axis;
#endif /* __PureLayout_MinBaseSDK_iOS_8_0 */
@end
|
/*************************************************************************/
/* register_types.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* 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 SQUISH_REGISTER_TYPES_H
#define SQUISH_REGISTER_TYPES_H
void register_squish_types();
void unregister_squish_types();
#endif // SQUISH_REGISTER_TYPES_H
|
// BEGIN: Mantis¹øÈ£ eternalblue@lge.com.2009-09-15
// MOD MantisÀÇ Activity ¹øÈ£ ¹× Á¦¸ñ
#ifndef EVE_AT_H
#define EVE_AT_H
/* LGE_CHANGE_S [kimeh@lge.com] 2009-04-15, for debugging */
struct atcmd_dev {
// const char *name;
char *name;
struct device *dev;
int index;
int state;
};
struct atcmd_platform_data {
const char *name;
};
extern int atcmd_dev_register(struct atcmd_dev *sdev);
extern void atcmd_dev_unregister(struct atcmd_dev *sdev);
static inline int atcmd_get_state(struct atcmd_dev *sdev)
{
return sdev->state;
}
extern void update_atcmd_state(struct atcmd_dev *sdev, char *cmd, int state);
extern struct atcmd_dev *atcmd_get_dev(void);
/* LGE_CHANGE_E [kimeh@lge.com] 2009-04-15, for debugging */
#endif // EVE_AT_H
// END: Mantis¹øÈ£ eternalblue@lge.com.2009-09-15 |
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
#include "test_sve_acle.h"
/*
** cmplt_u64_tied:
** (
** cmphi p0\.d, p0/z, z1\.d, z0\.d
** |
** cmplo p0\.d, p0/z, z0\.d, z1\.d
** )
** ret
*/
TEST_COMPARE_Z (cmplt_u64_tied, svuint64_t,
p0 = svcmplt_u64 (p0, z0, z1),
p0 = svcmplt (p0, z0, z1))
/*
** cmplt_u64_untied:
** (
** cmphi p0\.d, p1/z, z1\.d, z0\.d
** |
** cmplo p0\.d, p1/z, z0\.d, z1\.d
** )
** ret
*/
TEST_COMPARE_Z (cmplt_u64_untied, svuint64_t,
p0 = svcmplt_u64 (p1, z0, z1),
p0 = svcmplt (p1, z0, z1))
/*
** cmplt_x0_u64:
** mov (z[0-9]+\.d), x0
** (
** cmphi p0\.d, p1/z, \1, z0\.d
** |
** cmplo p0\.d, p1/z, z0\.d, \1
** )
** ret
*/
TEST_COMPARE_ZX (cmplt_x0_u64, svuint64_t, uint64_t,
p0 = svcmplt_n_u64 (p1, z0, x0),
p0 = svcmplt (p1, z0, x0))
/*
** cmplt_0_u64:
** cmplo p0\.d, p1/z, z0\.d, #0
** ret
*/
TEST_COMPARE_Z (cmplt_0_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 0),
p0 = svcmplt (p1, z0, 0))
/*
** cmplt_1_u64:
** cmplo p0\.d, p1/z, z0\.d, #1
** ret
*/
TEST_COMPARE_Z (cmplt_1_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 1),
p0 = svcmplt (p1, z0, 1))
/*
** cmplt_15_u64:
** cmplo p0\.d, p1/z, z0\.d, #15
** ret
*/
TEST_COMPARE_Z (cmplt_15_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 15),
p0 = svcmplt (p1, z0, 15))
/*
** cmplt_16_u64:
** cmplo p0\.d, p1/z, z0\.d, #16
** ret
*/
TEST_COMPARE_Z (cmplt_16_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 16),
p0 = svcmplt (p1, z0, 16))
/*
** cmplt_127_u64:
** cmplo p0\.d, p1/z, z0\.d, #127
** ret
*/
TEST_COMPARE_Z (cmplt_127_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 127),
p0 = svcmplt (p1, z0, 127))
/*
** cmplt_128_u64:
** mov (z[0-9]+\.d), #128
** (
** cmphi p0\.d, p1/z, \1, z0\.d
** |
** cmplo p0\.d, p1/z, z0\.d, \1
** )
** ret
*/
TEST_COMPARE_Z (cmplt_128_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, 128),
p0 = svcmplt (p1, z0, 128))
/*
** cmplt_m1_u64:
** mov (z[0-9]+)\.b, #-1
** (
** cmphi p0\.d, p1/z, \1\.d, z0\.d
** |
** cmplo p0\.d, p1/z, z0\.d, \1\.d
** )
** ret
*/
TEST_COMPARE_Z (cmplt_m1_u64, svuint64_t,
p0 = svcmplt_n_u64 (p1, z0, -1),
p0 = svcmplt (p1, z0, -1))
|
/*
* Copyright (C) 2011 Google, 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 <linux/kernel.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/rfkill.h>
#include <linux/gpio.h>
#include <linux/ioport.h>
#include <mach/board.h>
static struct rfkill *bt_rfk;
static const char bt_name[] = "bluetooth";
static unsigned long bt_power;
static unsigned long bt_reset;
static void getIoResource(struct platform_device *pdev)
{
struct resource *res;
printk("rfkill get gpio\n");
res = platform_get_resource_byname(pdev, IORESOURCE_IO,"bt_power");
if (!res) {
printk("couldn't bt_power gpio\n");
}
bt_power = res->start;
res = platform_get_resource_byname(pdev, IORESOURCE_IO,"bt_reset");
if (!res) {
printk("couldn't find bt_reset gpio\n");
}
bt_reset = res->start;
printk("bt_reset = %ld, bt_power = %ld\n", bt_reset, bt_power);
}
static int bluetooth_set_power(void *data, bool blocked)
{
printk("%s: block=%d\n",__func__, blocked);
if (!blocked) {
gpio_direction_output(bt_power, 0);
gpio_direction_output(bt_reset, 0);
mdelay(10);
gpio_direction_output(bt_power, 1);
gpio_direction_output(bt_reset, 1);
mdelay(150);
} else {
gpio_direction_output(bt_power, 0);
gpio_direction_output(bt_reset, 0);
mdelay(10);
}
return 0;
}
static struct rfkill_ops rfkill_bluetooth_ops = {
.set_block = bluetooth_set_power,
};
static void rfkill_gpio_init(void)
{
if(gpio_request(bt_power,"bt_power")){
printk("request bt power fail\n");
}
if(gpio_request(bt_reset,"bt_reset")){
printk("request bt reset fail\n");
}
}
static void rfkill_gpio_deinit(void)
{
gpio_free(bt_power);
gpio_free(bt_reset);
}
static int rfkill_bluetooth_probe(struct platform_device *pdev)
{
int rc = 0;
bool default_state = true;
printk(KERN_INFO "-->%s\n", __func__);
getIoResource(pdev);
bt_rfk = rfkill_alloc(bt_name, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
&rfkill_bluetooth_ops, NULL);
if (!bt_rfk) {
rc = -ENOMEM;
goto err_rfkill_alloc;
}
rfkill_gpio_init();
/* userspace cannot take exclusive control */
rfkill_init_sw_state(bt_rfk,false);
rc = rfkill_register(bt_rfk);
if (rc)
goto err_rfkill_reg;
rfkill_set_sw_state(bt_rfk,true);
bluetooth_set_power(NULL, default_state);
printk(KERN_INFO "<--%s\n", __func__);
return 0;
err_rfkill_reg:
rfkill_destroy(bt_rfk);
err_rfkill_alloc:
return rc;
}
static int rfkill_bluetooth_remove(struct platform_device *dev)
{
printk(KERN_INFO "-->%s\n", __func__);
rfkill_gpio_deinit();
rfkill_unregister(bt_rfk);
rfkill_destroy(bt_rfk);
printk(KERN_INFO "<--%s\n", __func__);
return 0;
}
static struct platform_driver rfkill_bluetooth_driver = {
.probe = rfkill_bluetooth_probe,
.remove = rfkill_bluetooth_remove,
.driver = {
.name = "rfkill",
.owner = THIS_MODULE,
},
};
static int __init rfkill_bluetooth_init(void)
{
printk(KERN_INFO "-->%s\n", __func__);
return platform_driver_register(&rfkill_bluetooth_driver);
}
static void __exit rfkill_bluetooth_exit(void)
{
printk(KERN_INFO "-->%s\n", __func__);
platform_driver_unregister(&rfkill_bluetooth_driver);
}
//late_initcall(rfkill_bluetooth_init);
module_init(rfkill_bluetooth_init);
module_exit(rfkill_bluetooth_exit);
MODULE_DESCRIPTION("bluetooth rfkill");
MODULE_AUTHOR("Yale Wu <ye.wu@spreadtrum.com>");
MODULE_LICENSE("GPL");
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 1996, 1997, 1998, 2000 by Ralf Baechle
*/
#ifndef _ASM_POSIX_TYPES_H
#define _ASM_POSIX_TYPES_H
/*
* This file is generally used by user-level software, so you need to
* be a little careful about namespace pollution etc. Also, we cannot
* assume GCC is being used.
*/
typedef unsigned int __kernel_dev_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef int __kernel_nlink_t;
typedef long __kernel_off_t;
typedef int __kernel_pid_t;
typedef int __kernel_ipc_pid_t;
typedef int __kernel_uid_t;
typedef int __kernel_gid_t;
#if _MIPS_SZLONG != 64
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
#else
typedef unsigned long __kernel_size_t;
typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
#endif
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t;
typedef long __kernel_daddr_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
typedef int __kernel_uid32_t;
typedef int __kernel_gid32_t;
typedef __kernel_uid_t __kernel_old_uid_t;
typedef __kernel_gid_t __kernel_old_gid_t;
#ifdef __GNUC__
typedef long long __kernel_loff_t;
#endif
typedef struct {
long val[2];
} __kernel_fsid_t;
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#undef __FD_SET
static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp)
{
unsigned long __tmp = __fd / __NFDBITS;
unsigned long __rem = __fd % __NFDBITS;
__fdsetp->fds_bits[__tmp] |= (1UL<<__rem);
}
#undef __FD_CLR
static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp)
{
unsigned long __tmp = __fd / __NFDBITS;
unsigned long __rem = __fd % __NFDBITS;
__fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem);
}
#undef __FD_ISSET
static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p)
{
unsigned long __tmp = __fd / __NFDBITS;
unsigned long __rem = __fd % __NFDBITS;
return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0;
}
/*
* This will unroll the loop for the normal constant case (8 ints,
* for a 256-bit fd_set)
*/
#undef __FD_ZERO
static __inline__ void __FD_ZERO(__kernel_fd_set *__p)
{
unsigned long *__tmp = __p->fds_bits;
int __i;
if (__builtin_constant_p(__FDSET_LONGS)) {
switch (__FDSET_LONGS) {
case 16:
__tmp[ 0] = 0; __tmp[ 1] = 0;
__tmp[ 2] = 0; __tmp[ 3] = 0;
__tmp[ 4] = 0; __tmp[ 5] = 0;
__tmp[ 6] = 0; __tmp[ 7] = 0;
__tmp[ 8] = 0; __tmp[ 9] = 0;
__tmp[10] = 0; __tmp[11] = 0;
__tmp[12] = 0; __tmp[13] = 0;
__tmp[14] = 0; __tmp[15] = 0;
return;
case 8:
__tmp[ 0] = 0; __tmp[ 1] = 0;
__tmp[ 2] = 0; __tmp[ 3] = 0;
__tmp[ 4] = 0; __tmp[ 5] = 0;
__tmp[ 6] = 0; __tmp[ 7] = 0;
return;
case 4:
__tmp[ 0] = 0; __tmp[ 1] = 0;
__tmp[ 2] = 0; __tmp[ 3] = 0;
return;
}
}
__i = __FDSET_LONGS;
while (__i) {
__i--;
*__tmp = 0;
__tmp++;
}
}
#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
#endif /* _ASM_POSIX_TYPES_H */
|
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <windows.h>
#include <Utils.h>
|
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_PIPELINE_H_
#define V8_COMPILER_PIPELINE_H_
#include "src/v8.h"
#include "src/compiler.h"
// Note: TODO(turbofan) implies a performance improvement opportunity,
// and TODO(name) implies an incomplete implementation
namespace v8 {
namespace internal {
namespace compiler {
// Clients of this interface shouldn't depend on lots of compiler internals.
class CallDescriptor;
class Graph;
class Schedule;
class SourcePositionTable;
class Linkage;
class Pipeline {
public:
explicit Pipeline(CompilationInfo* info) : info_(info) {}
// Run the entire pipeline and generate a handle to a code object.
Handle<Code> GenerateCode();
// Run the pipeline on a machine graph and generate code. If {schedule}
// is {NULL}, then compute a new schedule for code generation.
Handle<Code> GenerateCodeForMachineGraph(Linkage* linkage, Graph* graph,
Schedule* schedule = NULL);
CompilationInfo* info() const { return info_; }
Zone* zone() { return info_->zone(); }
Isolate* isolate() { return info_->isolate(); }
static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; }
static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; }
static inline bool VerifyGraphs() {
#ifdef DEBUG
return true;
#else
return FLAG_turbo_verify;
#endif
}
static void SetUp();
static void TearDown();
private:
CompilationInfo* info_;
Schedule* ComputeSchedule(Graph* graph);
void VerifyAndPrintGraph(Graph* graph, const char* phase);
Handle<Code> GenerateCode(Linkage* linkage, Graph* graph, Schedule* schedule,
SourcePositionTable* source_positions);
};
}
}
} // namespace v8::internal::compiler
#endif // V8_COMPILER_PIPELINE_H_
|
#ifndef __BYTEORDER_H
#define __BYTEORDER_H
static inline u16 __swab16_constant(u16 val) {
return (val<<8) | (val>>8);
}
static inline u32 __swab32_constant(u32 val) {
return (val<<24) | ((val&0xff00)<<8) | ((val&0xff0000)>>8) | (val>>24);
}
static inline u64 __swab64_constant(u64 val) {
return ((u64)__swab32_constant(val) << 32) | __swab32_constant(val>>32);
}
static inline u32 __swab32(u32 val) {
asm("bswapl %0" : "+r"(val));
return val;
}
static inline u64 __swab64(u64 val) {
union u64_u32_u i, o;
i.val = val;
o.lo = __swab32(i.hi);
o.hi = __swab32(i.lo);
return o.val;
}
#define swab16(x) __swab16_constant(x)
#define swab32(x) (__builtin_constant_p((u32)(x)) \
? __swab32_constant(x) : __swab32(x))
#define swab64(x) (__builtin_constant_p((u64)(x)) \
? __swab64_constant(x) : __swab64(x))
static inline u16 cpu_to_le16(u16 x) {
return x;
}
static inline u32 cpu_to_le32(u32 x) {
return x;
}
static inline u64 cpu_to_le64(u64 x) {
return x;
}
static inline u16 le16_to_cpu(u16 x) {
return x;
}
static inline u32 le32_to_cpu(u32 x) {
return x;
}
static inline u64 le64_to_cpu(u64 x) {
return x;
}
static inline u16 cpu_to_be16(u16 x) {
return swab16(x);
}
static inline u32 cpu_to_be32(u32 x) {
return swab32(x);
}
static inline u64 cpu_to_be64(u64 x) {
return swab64(x);
}
static inline u16 be16_to_cpu(u16 x) {
return swab16(x);
}
static inline u32 be32_to_cpu(u32 x) {
return swab32(x);
}
static inline u64 be64_to_cpu(u64 x) {
return swab64(x);
}
#endif // byteorder.h
|
/*
* This file is part of libbluray
* Copyright (C) 2010 hpi1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if !defined(_PES_BUFFER_H_)
#define _PES_BUFFER_H_
#include "util/attributes.h"
#include <stdint.h>
typedef struct pes_buffer_s PES_BUFFER;
struct pes_buffer_s {
uint8_t *buf;
uint32_t len; // payload length
unsigned size; // allocated size
int64_t pts;
int64_t dts;
struct pes_buffer_s *next;
};
BD_PRIVATE PES_BUFFER *pes_buffer_alloc(void) BD_ATTR_MALLOC;
BD_PRIVATE void pes_buffer_free(PES_BUFFER **); // free list of buffers
BD_PRIVATE void pes_buffer_append(PES_BUFFER **head, PES_BUFFER *buf); // append buf to list
BD_PRIVATE void pes_buffer_remove(PES_BUFFER **head, PES_BUFFER *buf); // remove buf from list and free it
BD_PRIVATE void pes_buffer_next(PES_BUFFER **head); // free first buffer and advance head to next buffer
#endif // _PES_BUFFER_H_
|
#include <stdio.h>
int
main(void)
{
char *ptr[1024];
int i;
for (i=0 ; i<1024 ; i++)
{
fprintf(stderr, "ptr[%d] = %p\n", i, ptr[i]);
}
return 0;
}
|
// RUN: %clang_cc1 %s -verify -fsyntax-only
struct simple { int i; };
void f(void) {
struct simple s[1];
s->i = 1;
}
typedef int x;
struct S {
int x;
x z;
};
void g(void) {
struct S s[1];
s->x = 1;
s->z = 2;
}
|
/*
pbrt source code Copyright(c) 1998-2012 Matt Pharr and Greg Humphreys.
This file is part of pbrt.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
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.
*/
#if defined(_MSC_VER)
#pragma once
#endif
#ifndef PBRT_TEXTURES_UV_H
#define PBRT_TEXTURES_UV_H
// textures/uv.h*
#include "pbrt.h"
#include "texture.h"
#include "paramset.h"
// UVTexture Declarations
class UVTexture : public Texture<Spectrum> {
public:
// UVTexture Public Methods
UVTexture(TextureMapping2D *m) {
mapping = m;
}
~UVTexture() {
delete mapping;
}
Spectrum Evaluate(const DifferentialGeometry &dg) const {
float s, t, dsdx, dtdx, dsdy, dtdy;
mapping->Map(dg, &s, &t, &dsdx, &dtdx, &dsdy, &dtdy);
float rgb[3] = { s - Floor2Int(s), t - Floor2Int(t), 0.f };
return Spectrum::FromRGB(rgb);
}
private:
TextureMapping2D *mapping;
};
Texture<float> *CreateUVFloatTexture(const Transform &tex2world,
const TextureParams &tp);
UVTexture *CreateUVSpectrumTexture(const Transform &tex2world,
const TextureParams &tp);
#endif // PBRT_TEXTURES_UV_H
|
// 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 COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARK_SERVICE_H_
#define COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARK_SERVICE_H_
#include <memory>
#include <string>
#include "base/callback_forward.h"
#include "base/macros.h"
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_storage.h"
#include "components/keyed_service/core/keyed_service.h"
class PrefService;
namespace bookmarks {
class BookmarkModel;
class ManagedBookmarksTracker;
// ManagedBookmarkService manages the bookmark folder controlled by enterprise
// policy or custodian of supervised users.
class ManagedBookmarkService : public KeyedService,
public BaseBookmarkModelObserver {
public:
typedef base::Callback<std::string()> GetManagementDomainCallback;
ManagedBookmarkService(PrefService* prefs,
const GetManagementDomainCallback& callback);
~ManagedBookmarkService() override;
// Called upon creation of the BookmarkModel.
void BookmarkModelCreated(BookmarkModel* bookmark_model);
// Returns a task that will be used to load any additional root nodes. This
// task will be invoked in the Profile's IO task runner.
LoadExtraCallback GetLoadExtraNodesCallback();
// Returns true if the |node| can have its title updated.
bool CanSetPermanentNodeTitle(const BookmarkNode* node);
// Returns true if |node| should sync.
bool CanSyncNode(const BookmarkNode* node);
// Returns true if |node| can be edited by the user.
// TODO(joaodasilva): the model should check this more aggressively, and
// should give the client a means to temporarily disable those checks.
// http://crbug.com/49598
bool CanBeEditedByUser(const BookmarkNode* node);
// Top-level managed bookmarks folder, defined by an enterprise policy; may be
// null.
const BookmarkNode* managed_node() { return managed_node_; }
// Top-level supervised bookmarks folder, defined by the custodian of a
// supervised user; may be null.
const BookmarkNode* supervised_node() { return supervised_node_; }
private:
// KeyedService implementation.
void Shutdown() override;
// BaseBookmarkModelObserver implementation.
void BookmarkModelChanged() override;
// BookmarkModelObserver implementation.
void BookmarkModelLoaded(BookmarkModel* bookmark_model,
bool ids_reassigned) override;
void BookmarkModelBeingDeleted(BookmarkModel* bookmark_model) override;
// Cleanup, called when service is shutdown or when BookmarkModel is being
// destroyed.
void Cleanup();
// Pointer to the PrefService. Must outlive ManagedBookmarkService.
PrefService* prefs_;
// Pointer to the BookmarkModel; may be null. Only valid between the calls to
// BookmarkModelCreated() and to BookmarkModelBeingDestroyed().
BookmarkModel* bookmark_model_;
// Managed bookmarks are defined by an enterprise policy. The lifetime of the
// BookmarkPermanentNode is controlled by BookmarkModel.
std::unique_ptr<ManagedBookmarksTracker> managed_bookmarks_tracker_;
GetManagementDomainCallback managed_domain_callback_;
BookmarkPermanentNode* managed_node_;
// Supervised bookmarks are defined by the custodian of a supervised user. The
// lifetime of the BookmarkPermanentNode is controlled by BookmarkModel.
std::unique_ptr<ManagedBookmarksTracker> supervised_bookmarks_tracker_;
BookmarkPermanentNode* supervised_node_;
DISALLOW_COPY_AND_ASSIGN(ManagedBookmarkService);
};
} // namespace bookmarks
#endif // COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARK_SERVICE_H_
|
// RUN: %clang %s -target bpfeb -x c -emit-llvm -S -g -O2 -o - | FileCheck --check-prefix=CHECK %s
// RUN: %clang %s -target bpfel -x c -emit-llvm -S -g -O2 -o - | FileCheck --check-prefix=CHECK %s
struct t {
int i:1;
int j:2;
union {
int a;
int b;
} c[4];
};
#define _(x) (__builtin_preserve_access_index(x))
const void *test(struct t *arg) {
return _(&arg->c[3].b);
}
// CHECK: llvm.preserve.struct.access.index
// CHECK: llvm.preserve.array.access.index
// CHECK: llvm.preserve.union.access.index
// CHECK-NOT: __builtin_preserve_access_index
|
// Copyright 2014 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 COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_
#define COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_
#include <vector>
#include "base/memory/scoped_vector.h"
#include "components/autofill/content/renderer/password_generation_agent.h"
#include "ipc/ipc_message.h"
namespace autofill {
class TestPasswordGenerationAgent : public PasswordGenerationAgent {
public:
TestPasswordGenerationAgent(content::RenderFrame* render_frame,
PasswordAutofillAgent* password_agent);
~TestPasswordGenerationAgent() override;
// content::RenderFrameObserver implementation:
bool OnMessageReceived(const IPC::Message& message) override;
bool Send(IPC::Message* message) override;
// Access messages that would have been sent to the browser.
const std::vector<IPC::Message*>& messages() const { return messages_.get(); }
// Clear outgoing message queue.
void clear_messages() { messages_.clear(); }
// PasswordGenreationAgent implementation:
// Always return true to allow loading of data URLs.
bool ShouldAnalyzeDocument() const override;
private:
ScopedVector<IPC::Message> messages_;
DISALLOW_COPY_AND_ASSIGN(TestPasswordGenerationAgent);
};
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_
|
/* Native AArch64 */
#include "errnoent.h"
|
/* Copyright (c) 2013 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.
*/
//
// GTLSpectrumGeoLocation.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Google Spectrum Database API (spectrum/v1explorer)
// Description:
// API for spectrum-management functions.
// Documentation:
// http://developers.google.com/spectrum
// Classes:
// GTLSpectrumGeoLocation (0 custom class methods, 3 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLObject.h"
#else
#import "GTLObject.h"
#endif
@class GTLSpectrumGeoLocationEllipse;
@class GTLSpectrumGeoLocationPolygon;
// ----------------------------------------------------------------------------
//
// GTLSpectrumGeoLocation
//
// This parameter is used to specify the geolocation of the device.
@interface GTLSpectrumGeoLocation : GTLObject
// The location confidence level, as an integer percentage, may be required,
// depending on the regulatory domain. When the parameter is optional and not
// provided, its value is assumed to be 95. Valid values range from 0 to 99,
// since, in practice, 100-percent confidence is not achievable. The confidence
// value is meaningful only when geolocation refers to a point with uncertainty.
@property (retain) NSNumber *confidence; // intValue
// If present, indicates that the geolocation represents a point. Paradoxically,
// a point is parameterized using an ellipse, where the center represents the
// location of the point and the distances along the major and minor axes
// represent the uncertainty. The uncertainty values may be required, depending
// on the regulatory domain.
@property (retain) GTLSpectrumGeoLocationEllipse *point;
// If present, indicates that the geolocation represents a region. Database
// support for regions is optional.
@property (retain) GTLSpectrumGeoLocationPolygon *region;
@end
|
/*
* Generic Platform Camera Driver
*
* Copyright (C) 2008 Magnus Damm
* Based on mt9m001 driver,
* Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/videodev2.h>
#include <media/v4l2-subdev.h>
#include <media/soc_camera.h>
#include <media/soc_camera_platform.h>
struct soc_camera_platform_priv {
struct v4l2_subdev subdev;
};
static struct soc_camera_platform_priv *get_priv(struct platform_device *pdev)
{
struct v4l2_subdev *subdev = platform_get_drvdata(pdev);
return container_of(subdev, struct soc_camera_platform_priv, subdev);
}
static int soc_camera_platform_s_stream(struct v4l2_subdev *sd, int enable)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
return p->set_capture(p, enable);
}
static int soc_camera_platform_fill_fmt(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mf)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
mf->width = p->format.width;
mf->height = p->format.height;
mf->code = p->format.code;
mf->colorspace = p->format.colorspace;
mf->field = p->format.field;
return 0;
}
static int soc_camera_platform_s_power(struct v4l2_subdev *sd, int on)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
return soc_camera_set_power(p->icd->control, &p->icd->sdesc->subdev_desc, on);
}
static struct v4l2_subdev_core_ops platform_subdev_core_ops = {
.s_power = soc_camera_platform_s_power,
};
static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
enum v4l2_mbus_pixelcode *code)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
if (index)
return -EINVAL;
*code = p->format.code;
return 0;
}
static int soc_camera_platform_g_crop(struct v4l2_subdev *sd,
struct v4l2_crop *a)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
a->c.left = 0;
a->c.top = 0;
a->c.width = p->format.width;
a->c.height = p->format.height;
a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
return 0;
}
static int soc_camera_platform_cropcap(struct v4l2_subdev *sd,
struct v4l2_cropcap *a)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
a->bounds.left = 0;
a->bounds.top = 0;
a->bounds.width = p->format.width;
a->bounds.height = p->format.height;
a->defrect = a->bounds;
a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
a->pixelaspect.numerator = 1;
a->pixelaspect.denominator = 1;
return 0;
}
static int soc_camera_platform_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
cfg->flags = p->mbus_param;
cfg->type = p->mbus_type;
return 0;
}
static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
.s_stream = soc_camera_platform_s_stream,
.enum_mbus_fmt = soc_camera_platform_enum_fmt,
.cropcap = soc_camera_platform_cropcap,
.g_crop = soc_camera_platform_g_crop,
.try_mbus_fmt = soc_camera_platform_fill_fmt,
.g_mbus_fmt = soc_camera_platform_fill_fmt,
.s_mbus_fmt = soc_camera_platform_fill_fmt,
.g_mbus_config = soc_camera_platform_g_mbus_config,
};
static struct v4l2_subdev_ops platform_subdev_ops = {
.core = &platform_subdev_core_ops,
.video = &platform_subdev_video_ops,
};
static int soc_camera_platform_probe(struct platform_device *pdev)
{
struct soc_camera_host *ici;
struct soc_camera_platform_priv *priv;
struct soc_camera_platform_info *p = pdev->dev.platform_data;
struct soc_camera_device *icd;
int ret;
if (!p)
return -EINVAL;
if (!p->icd) {
dev_err(&pdev->dev,
"Platform has not set soc_camera_device pointer!\n");
return -EINVAL;
}
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
icd = p->icd;
/* soc-camera convention: control's drvdata points to the subdev */
platform_set_drvdata(pdev, &priv->subdev);
/* Set the control device reference */
icd->control = &pdev->dev;
ici = to_soc_camera_host(icd->parent);
v4l2_subdev_init(&priv->subdev, &platform_subdev_ops);
v4l2_set_subdevdata(&priv->subdev, p);
strncpy(priv->subdev.name, dev_name(&pdev->dev), sizeof(priv->subdev.name)-1);
priv->subdev.name[sizeof(priv->subdev.name)-1] = '\0';
ret = v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
if (ret)
goto evdrs;
return ret;
evdrs:
platform_set_drvdata(pdev, NULL);
return ret;
}
static int soc_camera_platform_remove(struct platform_device *pdev)
{
struct soc_camera_platform_priv *priv = get_priv(pdev);
struct soc_camera_platform_info *p = v4l2_get_subdevdata(&priv->subdev);
p->icd->control = NULL;
v4l2_device_unregister_subdev(&priv->subdev);
platform_set_drvdata(pdev, NULL);
return 0;
}
static struct platform_driver soc_camera_platform_driver = {
.driver = {
.name = "soc_camera_platform",
.owner = THIS_MODULE,
},
.probe = soc_camera_platform_probe,
.remove = soc_camera_platform_remove,
};
module_platform_driver(soc_camera_platform_driver);
MODULE_DESCRIPTION("SoC Camera Platform driver");
MODULE_AUTHOR("Magnus Damm");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:soc_camera_platform");
|
// SPDX-License-Identifier: GPL-2.0
#include "ddk750_reg.h"
#include "ddk750_chip.h"
#include "ddk750_display.h"
#include "ddk750_power.h"
#include "ddk750_dvi.h"
static void set_display_control(int ctrl, int disp_state)
{
/* state != 0 means turn on both timing & plane en_bit */
unsigned long reg, val, reserved;
int cnt = 0;
if (!ctrl) {
reg = PANEL_DISPLAY_CTRL;
reserved = PANEL_DISPLAY_CTRL_RESERVED_MASK;
} else {
reg = CRT_DISPLAY_CTRL;
reserved = CRT_DISPLAY_CTRL_RESERVED_MASK;
}
val = peek32(reg);
if (disp_state) {
/*
* Timing should be enabled first before enabling the
* plane because changing at the same time does not
* guarantee that the plane will also enabled or
* disabled.
*/
val |= DISPLAY_CTRL_TIMING;
poke32(reg, val);
val |= DISPLAY_CTRL_PLANE;
/*
* Somehow the register value on the plane is not set
* until a few delay. Need to write and read it a
* couple times
*/
do {
cnt++;
poke32(reg, val);
} while ((peek32(reg) & ~reserved) != (val & ~reserved));
pr_debug("Set Plane enbit:after tried %d times\n", cnt);
} else {
/*
* When turning off, there is no rule on the
* programming sequence since whenever the clock is
* off, then it does not matter whether the plane is
* enabled or disabled. Note: Modifying the plane bit
* will take effect on the next vertical sync. Need to
* find out if it is necessary to wait for 1 vsync
* before modifying the timing enable bit.
*/
val &= ~DISPLAY_CTRL_PLANE;
poke32(reg, val);
val &= ~DISPLAY_CTRL_TIMING;
poke32(reg, val);
}
}
static void primary_wait_vertical_sync(int delay)
{
unsigned int status;
/*
* Do not wait when the Primary PLL is off or display control is
* already off. This will prevent the software to wait forever.
*/
if (!(peek32(PANEL_PLL_CTRL) & PLL_CTRL_POWER) ||
!(peek32(PANEL_DISPLAY_CTRL) & DISPLAY_CTRL_TIMING))
return;
while (delay-- > 0) {
/* Wait for end of vsync. */
do {
status = peek32(SYSTEM_CTRL);
} while (status & SYSTEM_CTRL_PANEL_VSYNC_ACTIVE);
/* Wait for start of vsync. */
do {
status = peek32(SYSTEM_CTRL);
} while (!(status & SYSTEM_CTRL_PANEL_VSYNC_ACTIVE));
}
}
static void swPanelPowerSequence(int disp, int delay)
{
unsigned int reg;
/* disp should be 1 to open sequence */
reg = peek32(PANEL_DISPLAY_CTRL);
reg |= (disp ? PANEL_DISPLAY_CTRL_FPEN : 0);
poke32(PANEL_DISPLAY_CTRL, reg);
primary_wait_vertical_sync(delay);
reg = peek32(PANEL_DISPLAY_CTRL);
reg |= (disp ? PANEL_DISPLAY_CTRL_DATA : 0);
poke32(PANEL_DISPLAY_CTRL, reg);
primary_wait_vertical_sync(delay);
reg = peek32(PANEL_DISPLAY_CTRL);
reg |= (disp ? PANEL_DISPLAY_CTRL_VBIASEN : 0);
poke32(PANEL_DISPLAY_CTRL, reg);
primary_wait_vertical_sync(delay);
reg = peek32(PANEL_DISPLAY_CTRL);
reg |= (disp ? PANEL_DISPLAY_CTRL_FPEN : 0);
poke32(PANEL_DISPLAY_CTRL, reg);
primary_wait_vertical_sync(delay);
}
void ddk750_setLogicalDispOut(enum disp_output output)
{
unsigned int reg;
if (output & PNL_2_USAGE) {
/* set panel path controller select */
reg = peek32(PANEL_DISPLAY_CTRL);
reg &= ~PANEL_DISPLAY_CTRL_SELECT_MASK;
reg |= (((output & PNL_2_MASK) >> PNL_2_OFFSET) <<
PANEL_DISPLAY_CTRL_SELECT_SHIFT);
poke32(PANEL_DISPLAY_CTRL, reg);
}
if (output & CRT_2_USAGE) {
/* set crt path controller select */
reg = peek32(CRT_DISPLAY_CTRL);
reg &= ~CRT_DISPLAY_CTRL_SELECT_MASK;
reg |= (((output & CRT_2_MASK) >> CRT_2_OFFSET) <<
CRT_DISPLAY_CTRL_SELECT_SHIFT);
/*se blank off */
reg &= ~CRT_DISPLAY_CTRL_BLANK;
poke32(CRT_DISPLAY_CTRL, reg);
}
if (output & PRI_TP_USAGE) {
/* set primary timing and plane en_bit */
set_display_control(0, (output & PRI_TP_MASK) >> PRI_TP_OFFSET);
}
if (output & SEC_TP_USAGE) {
/* set secondary timing and plane en_bit*/
set_display_control(1, (output & SEC_TP_MASK) >> SEC_TP_OFFSET);
}
if (output & PNL_SEQ_USAGE) {
/* set panel sequence */
swPanelPowerSequence((output & PNL_SEQ_MASK) >> PNL_SEQ_OFFSET,
4);
}
if (output & DAC_USAGE)
setDAC((output & DAC_MASK) >> DAC_OFFSET);
if (output & DPMS_USAGE)
ddk750_set_dpms((output & DPMS_MASK) >> DPMS_OFFSET);
}
|
/*
* Trustees ACL Project
*
* Copyright (c) 1999-2000 Vyacheslav Zavadsky
* Copyright (c) 2004 Andrew Ruder (aeruder@ksu.edu)
*
* 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.
*
* Module initialization and cleanup
*
* History:
* 2002-12-16 trustees 2.10 released by Vyacheslav Zavadsky
*
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/security.h>
#include <linux/capability.h>
#include "internal.h"
unsigned int trustee_hash_size = 256;
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Trustees ACL System");
MODULE_AUTHOR("Vyacheslav Zavadsky and Andrew E. Ruder <aeruder@ksu.edu>");
MODULE_VERSION("2.11");
MODULE_PARM_DESC(hash_size, "Trustees hash size");
module_param_named(hash_size, trustee_hash_size, uint, 0444);
static int __init trustees_init(void)
{
if (trustees_funcs_init_globals() != 0) {
return -EINVAL;
}
if (trustees_init_fs() != 0) {
trustees_funcs_cleanup_globals();
return -EINVAL;
}
if (trustees_init_security() != 0) {
trustees_deinit_fs();
trustees_funcs_cleanup_globals();
return -EINVAL;
}
return 0;
}
fs_initcall(trustees_init);
|
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QEvent>
#include <QWidget>
class QMouseEvent;
class QTimer;
class RenderWidget final : public QWidget
{
Q_OBJECT
public:
explicit RenderWidget(QWidget* parent = nullptr);
bool event(QEvent* event) override;
void showFullScreen();
QPaintEngine* paintEngine() const override;
signals:
void EscapePressed();
void Closed();
void HandleChanged(void* handle);
void StateChanged(bool fullscreen);
void SizeChanged(int new_width, int new_height);
void FocusChanged(bool focus);
private:
void HandleCursorTimer();
void OnHideCursorChanged();
void OnKeepOnTopChanged(bool top);
void OnFreeLookMouseMove(QMouseEvent* event);
void PassEventToImGui(const QEvent* event);
void SetImGuiKeyMap();
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
static constexpr int MOUSE_HIDE_DELAY = 3000;
QTimer* m_mouse_timer;
QPoint m_last_mouse{};
};
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 Google, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include <delay.h>
#include <timer.h>
#include "dmtimer.h"
static struct monotonic_counter {
int initialized;
struct mono_time time;
uint64_t last_value;
} mono_counter;
static const uint32_t clocks_per_usec = OSC_HZ/1000000;
void timer_monotonic_get(struct mono_time *mt)
{
uint64_t current_tick;
uint64_t usecs_elapsed;
if (!mono_counter.initialized) {
init_timer();
mono_counter.last_value = dmtimer_raw_value(0);
mono_counter.initialized = 1;
}
current_tick = dmtimer_raw_value(0);
usecs_elapsed = (current_tick - mono_counter.last_value) /
clocks_per_usec;
/* Update current time and tick values only if a full tick occurred. */
if (usecs_elapsed) {
mono_time_add_usecs(&mono_counter.time, usecs_elapsed);
mono_counter.last_value = current_tick;
}
/* Save result. */
*mt = mono_counter.time;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.