text stringlengths 4 6.14k |
|---|
#include "rfm12_config.h"
#include "../src/rfm12.c"
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef ADDEXTRANODESET_H
#define ADDEXTRANODESET_H
#include "MeshModifier.h"
//Forward Declaration
class AddExtraNodeset;
template<>
InputParameters validParams<AddExtraNodeset>();
class AddExtraNodeset :
public MeshModifier
{
public:
AddExtraNodeset(const InputParameters & params);
protected:
virtual void modify() override;
};
#endif // ADDEXTRANODESET_H
|
/*
* Copyright (C) 2014 Martin Landsmann <Martin.Landsmann@HAW-Hamburg.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup sys_universal_address Universal Address Container
* @ingroup sys
* @brief universal address container
*
* @{
*
* @file
* @brief Types and functions for operating universal addresses
* @author Martin Landsmann
*/
#ifndef UNIVERSAL_ADDRESS_H_
#define UNIVERSAL_ADDRESS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdlib.h>
#define UNIVERSAL_ADDRESS_SIZE (16) /**< size of the used addresses in bytes */
/**
* @brief The container descriptor used to identify a universal address entry
*/
typedef struct universal_address_container_t {
uint8_t use_count; /**< The number of entries link here */
uint8_t address_size; /**< Size in bytes of the used generic address */
uint8_t address[UNIVERSAL_ADDRESS_SIZE]; /**< The generic address data */
} universal_address_container_t;
/**
* @brief Initialize the data structure for the entries
*/
void universal_address_init(void);
/**
* @brief Resets the universal_address_container_t::use_count for all entries
*/
void universal_address_reset(void);
/**
* @brief Add a given address to the universal address entries. If the entry already exists,
* the universal_address_container_t::use_count will be increased.
*
* @param[in] addr pointer to the address
* @param[in] addr_size the number of bytes required for the address entry
*
* @return pointer to the universal_address_container_t containing the address on success
* NULL if the address could not be inserted
*/
universal_address_container_t *universal_address_add(uint8_t *addr, size_t addr_size);
/**
* @brief Add a given container from the universal address entries. If the entry exists,
* the universal_address_container_t::use_count will be decreased.
*
* @param[in] entry pointer to the universal_address_container_t to be removed
*/
void universal_address_rem(universal_address_container_t *entry);
/**
* @brief Copy the address from the given container to the provided pointer
*
* @param[in] entry pointer to the universal_address_container_t
* @param[out] addr pointer to store the address entry
* @param[in, out] addr_size pointer providing the size of available memory on addr
* this value is overwritten with the actual size required
*
* @return addr if the address is copied to the addr destination
* NULL if the size is unsufficient for copy
*/
uint8_t* universal_address_get_address(universal_address_container_t *entry,
uint8_t *addr, size_t *addr_size);
/**
* @brief Determine if the entry equals the provided address
* This function requires to be provided with the full size of the used
* address type behind @p addr to be comparable with the address stored in @p entry.
*
* @param[in] entry pointer to the universal_address_container_t for compare
* @param[in] addr pointer to the address for compare
* @param[in, out] addr_size_in_bits the number of bits used for the address entry
* on sucessfull return this value is overwritten
* with the number of matching bits till the
* first of trailing `0`s
*
* @return 0 if the entries are equal
* 1 if the entry match to a certain prefix (trailing '0's in *entry)
* -ENOENT if the given adresses do not match
*/
int universal_address_compare(universal_address_container_t *entry,
uint8_t *addr, size_t *addr_size_in_bits);
/**
* @brief Determine if the entry equals the provided prefix
* This function requires to be provided with the full size of the used
* address type behind @p prefix to be comparable with the address stored in @p entry.
*
*
* @param[in] entry pointer to the universal_address_container_t for compare
* @param[in] prefix pointer to the address for compare
* @param[in] prefix_size_in_bits the number of bits used for the prefix entry.
* This size MUST be the full address size including trailing '0's,
* e.g. for an ipv6_addr_t it would be sizeof(ipv6_addr_t)
* regardless if the stored prefix is < ::/128
*
* @return 0 if the entries are equal
* 1 if the entry match to a certain prefix (trailing '0's in *prefix)
* -ENOENT if the given adresses do not match
*/
int universal_address_compare_prefix(universal_address_container_t *entry,
uint8_t *prefix, size_t prefix_size_in_bits);
/**
* @brief Print the content of the given entry
*
* @param[in] entry pointer to the universal_address_container_t to be printed
*/
void universal_address_print_entry(universal_address_container_t *entry);
/**
* @brief Return the number of used entries
*/
int universal_address_get_num_used_entries(void);
/**
* @brief Print the content of the generic address table up to the used element
*/
void universal_address_print_table(void);
#ifdef __cplusplus
}
#endif
#endif /* UNIVERSAL_ADDRESS_H_ */
/** @} */
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 EMC Corp.
//
// @filename:
// CPhysicalFilter.h
//
// @doc:
// Filter operator
//---------------------------------------------------------------------------
#ifndef GPOPT_CPhysicalFilter_H
#define GPOPT_CPhysicalFilter_H
#include "gpos/base.h"
#include "gpopt/operators/CPhysical.h"
namespace gpopt
{
//---------------------------------------------------------------------------
// @class:
// CPhysicalFilter
//
// @doc:
// Filter operator
//
//---------------------------------------------------------------------------
class CPhysicalFilter : public CPhysical
{
private:
public:
CPhysicalFilter(const CPhysicalFilter &) = delete;
// ctor
explicit CPhysicalFilter(CMemoryPool *mp);
// dtor
~CPhysicalFilter() override;
// ident accessors
EOperatorId
Eopid() const override
{
return EopPhysicalFilter;
}
const CHAR *
SzId() const override
{
return "CPhysicalFilter";
}
// match function
BOOL Matches(COperator *pop) const override;
// sensitivity to order of inputs
BOOL
FInputOrderSensitive() const override
{
return true;
}
//-------------------------------------------------------------------------------------
// Required Plan Properties
//-------------------------------------------------------------------------------------
// compute required output columns of the n-th child
CColRefSet *PcrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
CColRefSet *pcrsRequired, ULONG child_index,
CDrvdPropArray *pdrgpdpCtxt,
ULONG ulOptReq) override;
// compute required ctes of the n-th child
CCTEReq *PcteRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
CCTEReq *pcter, ULONG child_index,
CDrvdPropArray *pdrgpdpCtxt,
ULONG ulOptReq) const override;
// compute required sort order of the n-th child
COrderSpec *PosRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
COrderSpec *posRequired, ULONG child_index,
CDrvdPropArray *pdrgpdpCtxt,
ULONG ulOptReq) const override;
// compute required distribution of the n-th child
CDistributionSpec *PdsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
CDistributionSpec *pdsRequired,
ULONG child_index,
CDrvdPropArray *pdrgpdpCtxt,
ULONG ulOptReq) const override;
// compute required rewindability of the n-th child
CRewindabilitySpec *PrsRequired(CMemoryPool *mp, CExpressionHandle &exprhdl,
CRewindabilitySpec *prsRequired,
ULONG child_index,
CDrvdPropArray *pdrgpdpCtxt,
ULONG ulOptReq) const override;
// check if required columns are included in output columns
BOOL FProvidesReqdCols(CExpressionHandle &exprhdl, CColRefSet *pcrsRequired,
ULONG ulOptReq) const override;
//-------------------------------------------------------------------------------------
// Derived Plan Properties
//-------------------------------------------------------------------------------------
// derive sort order
COrderSpec *PosDerive(CMemoryPool *mp,
CExpressionHandle &exprhdl) const override;
// derive distribution
CDistributionSpec *PdsDerive(CMemoryPool *mp,
CExpressionHandle &exprhdl) const override;
// derive rewindability
CRewindabilitySpec *PrsDerive(CMemoryPool *mp,
CExpressionHandle &exprhdl) const override;
//-------------------------------------------------------------------------------------
// Enforced Properties
//-------------------------------------------------------------------------------------
// return order property enforcing type for this operator
CEnfdProp::EPropEnforcingType EpetOrder(
CExpressionHandle &exprhdl, const CEnfdOrder *peo) const override;
// return rewindability property enforcing type for this operator
CEnfdProp::EPropEnforcingType EpetRewindability(
CExpressionHandle &exprhdl,
const CEnfdRewindability *per) const override;
// return true if operator passes through stats obtained from children,
// this is used when computing stats during costing
BOOL
FPassThruStats() const override
{
return false;
}
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
// conversion function
static CPhysicalFilter *
PopConvert(COperator *pop)
{
GPOS_ASSERT(nullptr != pop);
GPOS_ASSERT(EopPhysicalFilter == pop->Eopid());
return dynamic_cast<CPhysicalFilter *>(pop);
}
}; // class CPhysicalFilter
} // namespace gpopt
#endif // !GPOPT_CPhysicalFilter_H
// EOF
|
//===--- FrontendTool.h - Frontend control ----------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 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
//
//===----------------------------------------------------------------------===//
//
// This file provides a high-level API for interacting with the basic
// frontend tool operation.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_FRONTENDTOOL_H
#define SWIFT_FRONTENDTOOL_H
#include "swift/Basic/LLVM.h"
namespace llvm {
class Module;
}
namespace swift {
class CompilerInvocation;
class CompilerInstance;
class SILModule;
/// A simple observer of frontend activity.
///
/// Don't let this interface block enhancements to the frontend pipeline.
class FrontendObserver {
public:
FrontendObserver() = default;
virtual ~FrontendObserver() = default;
/// The frontend has parsed the command line.
virtual void parsedArgs(CompilerInvocation &invocation);
/// The frontend has configured the compiler instance.
virtual void configuredCompiler(CompilerInstance &instance);
/// The frontend has performed semantic analysis.
virtual void performedSemanticAnalysis(CompilerInstance &instance);
/// The frontend has performed basic SIL generation.
/// SIL diagnostic passes have not yet been applied.
virtual void performedSILGeneration(SILModule &module);
/// The frontend has executed the SIL diagnostic passes.
virtual void performedSILDiagnostics(SILModule &module);
/// The frontend has executed the SIL optimization pipeline.
virtual void performedSILOptimization(SILModule &module);
/// The frontend is about to run the program as an immediate script.
virtual void aboutToRunImmediately(CompilerInstance &instance);
// TODO: maybe enhance this interface to hear about IRGen and LLVM
// progress.
};
/// Perform all the operations of the frontend, exactly as if invoked
/// with -frontend.
///
/// \param args the arguments to use as the arguments to the frontend
/// \param argv0 the name used as the frontend executable
/// \param mainAddr an address from the main executable
///
/// \return the exit value of the frontend: 0 or 1 on success unless
/// the frontend executes in immediate mode, in which case this will be
/// the exit value of the script, assuming it exits normally
int performFrontend(ArrayRef<const char *> args,
const char *argv0,
void *mainAddr,
FrontendObserver *observer = nullptr);
} // namespace swift
#endif
|
/* nest97.h */
#include "nest98.h"
|
// 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 CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_
#define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromecast/media/cma/base/decoder_buffer_base.h"
namespace media {
class DecoderBuffer;
}
namespace chromecast {
namespace media {
// DecoderBufferAdapter wraps a ::media::DecoderBuffer
// into a DecoderBufferBase.
class DecoderBufferAdapter : public DecoderBufferBase {
public:
// Using explicit constructor without providing stream Id will set it to
// kPrimary by default.
explicit DecoderBufferAdapter(
const scoped_refptr<::media::DecoderBuffer>& buffer);
DecoderBufferAdapter(
StreamId stream_id, const scoped_refptr<::media::DecoderBuffer>& buffer);
// DecoderBufferBase implementation:
StreamId stream_id() const override;
int64_t timestamp() const override;
void set_timestamp(base::TimeDelta timestamp) override;
const uint8_t* data() const override;
uint8_t* writable_data() const override;
size_t data_size() const override;
const CastDecryptConfig* decrypt_config() const override;
bool end_of_stream() const override;
scoped_refptr<::media::DecoderBuffer> ToMediaBuffer() const override;
private:
~DecoderBufferAdapter() override;
StreamId stream_id_;
scoped_refptr<::media::DecoderBuffer> const buffer_;
std::unique_ptr<CastDecryptConfig> decrypt_config_;
DISALLOW_COPY_AND_ASSIGN(DecoderBufferAdapter);
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FUCHSIA_BASE_TEST_CONTEXT_PROVIDER_TEST_CONNECTOR_H_
#define FUCHSIA_BASE_TEST_CONTEXT_PROVIDER_TEST_CONNECTOR_H_
#include <fuchsia/sys/cpp/fidl.h>
#include <fuchsia/web/cpp/fidl.h>
#include <lib/fidl/cpp/interface_request.h>
#include <lib/sys/cpp/service_directory.h>
#include "base/command_line.h"
namespace cr_fuchsia {
// Starts a WebEngine and connects a ContextProvider instance for tests.
// WebEngine logs will be included in the test output but not in the Fuchsia
// system log.
fuchsia::web::ContextProviderPtr ConnectContextProvider(
fidl::InterfaceRequest<fuchsia::sys::ComponentController>
component_controller_request,
const base::CommandLine& command_line =
base::CommandLine(base::CommandLine::NO_PROGRAM));
// Does the same thing as ConnectContextProvider() except WebEngine logs are not
// redirected and thus are included in the Fuchsia system log. WebEngine logs
// are not included in the test output. Only use with tests that are verifying
// WebEngine's logging behavior.
fuchsia::web::ContextProviderPtr ConnectContextProviderForLoggingTest(
fidl::InterfaceRequest<fuchsia::sys::ComponentController>
component_controller_request,
const base::CommandLine& command_line =
base::CommandLine(base::CommandLine::NO_PROGRAM));
} // namespace cr_fuchsia
#endif // FUCHSIA_BASE_TEST_CONTEXT_PROVIDER_TEST_CONNECTOR_H_
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_ATTESTATION_CERTIFICATE_UTIL_H_
#define CHROME_BROWSER_ASH_ATTESTATION_CERTIFICATE_UTIL_H_
#include <string>
#include "base/time/time.h"
namespace ash {
namespace attestation {
enum class CertificateExpiryStatus {
kValid,
kExpiringSoon,
kExpired,
kInvalidPemChain,
kInvalidX509,
};
// Checks if |certificate_chain| is a PEM certificate chain that contains a
// certificate this is expired or expiring soon according to |expiry_threshold|.
// Returns the expiry status with the following precedence:
// 1. If there is an expired token in |certificate_chain|, returns kExpired.
// 2. If there is an expiring soon token but no expired token, returns
// kExpiringSoon.
// 3. If there are no expired or expiring soon tokens but there is an invalid
// token, returns kInvalidX509.
// 4. If there are no parsable tokens, returns kInvalidPemChain.
// 5. Otherwise, returns kValid.
CertificateExpiryStatus CheckCertificateExpiry(
const std::string& certificate_chain,
base::TimeDelta expiry_threshold);
std::string CertificateExpiryStatusToString(CertificateExpiryStatus status);
} // namespace attestation
} // namespace ash
#endif // CHROME_BROWSER_ASH_ATTESTATION_CERTIFICATE_UTIL_H_
|
/*
* File : clock.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-03-20 zchong first version
*/
#include <rtthread.h>
#include "sep4020.h"
#define CLK_IN 4000000 /* Fin = 4.00MHz */
#define SYSCLK 72000000 /* system clock we want */
#define CLK_ESRAM 0
#define CLK_LCDC 1
#define CLK_PWM 2
#define CLK_DMAC 3
#define CLK_EMI 4
#define CLK_MMCSD 5
#define CLK_SSI 7
#define CLK_UART0 8
#define CLK_UART1 9
#define CLK_UART2 10
#define CLK_UART3 11
#define CLK_USB 12
#define CLK_MAC 13
#define CLK_SMC 14
#define CLK_I2C 15
#define CLK_GPT 16
static void rt_hw_set_system_clock(void)
{
rt_uint8_t pv;
/* pv value*/
pv = SYSCLK/2/CLK_IN;
/* go to normal mode*/
*(RP)PMU_PMDR = 0x01;
/* set the clock */
*(RP)PMU_PMCR = 0x4000 | pv;
/* trige configurate*/
*(RP)PMU_PMCR = 0xc000 | pv;
}
static void rt_hw_set_usb_clock(void)
{
/* set the clock */
*(RP)PMU_PUCR = 0x000c;
/* trige configurate*/
*(RP)PMU_PMCR = 0x800c;
}
/**
* @brief System Clock Configuration
*/
void rt_hw_clock_init(void)
{
/* set system clock */
rt_hw_set_system_clock();
/* set usb clock */
rt_hw_set_usb_clock();
}
/**
* @brief Get system clock
*/
rt_uint32_t rt_hw_get_clock(void)
{
rt_uint32_t val;
rt_uint8_t pv, pd, npd;
/* get PMCR value */
val =*(RP) PMU_PMCR;
/* get NPD */
npd = (val >> 14) & 0x01;
/* get PD */
pd = (val >> 10) & 0x0f;
/* get PV */
pv = val & 0x7f;
/* caculate the system clock */
if(npd)
val = 2 * CLK_IN * pv;
else
val = CLK_IN * pv / (pd + 1);
return(val);
}
/**
* @brief Enable module clock
*/
void rt_hw_enable_module_clock(rt_uint8_t module)
{
}
/**
* @brief Disable module clock
*/
void rt_hw_disable_module_clock(rt_uint8_t module)
{
}
|
#pragma once
//------------------------------------------------------------------------------
/**
@class Oryol::SynthOp
@ingroup Synth
@brief a single wave synthesis 'instruction'
Op objects are instructions for the waveform synthesizer. To create the
final output of a voice, several the output waveforms of several
ops are combined (usually modulated). For instance, the Op on the
first voice track might generate a high frequency sawtooth wave, and
Ops on the second track might modulate this with an ASDR envelope,
and an Op on the third track could apply a final output volume.
*/
#include "Core/Types.h"
#include "Synth/Core/synth.h"
namespace Oryol {
class SynthOp {
public:
/// operation to perform on accumulated value
enum OpT : int32 {
Nop, // simply pass-thru accumulated value (default)
Modulate, // multiply with accumulated value
Add, // add-saturate with accumulated value
Replace, // replace accum with current value
ModFreq, // modulate frequency with accumulated value
} Op = Nop;
/// oscillator waveform
enum WaveT : int32 {
Const, // output a constant Amplitude, Frequency not used (default)
Sine, // sine wave
SawTooth, // sawtooth wave
Triangle, // triangle wave
Square, // square wave
Noise, // generate noise
Custom0,
Custom1,
Custom2,
Custom3,
Custom4,
Custom5,
Custom6,
Custom7,
NumWaves,
} Wave = Const;
/// amplitude (MinSampleVal .. MaxSampleVal)
int32 Amp = _priv::synth::MaxSampleVal;
/// amplitude bias (can be used to move wave into positive area)
int32 Bias = 0;
/// frequency
int32 Freq = 440;
/// start tick (private, computed)
int32 startTick = 0;
/// end tick (private, computed)
int32 endTick = (1<<30);
/// less-then operator for sorting by StartTick
bool operator<(const SynthOp& rhs) const {
return this->startTick < rhs.startTick;
};
/// convert op-code to string
static const char* ToString(enum OpT op) {
switch (op) {
case Nop: return "Nop";
case Modulate: return "Modulate";
case Add: return "Add";
case ModFreq: return "ModFreq";
default: return "Invalid";
}
}
/// convert wave-form to string
static const char* ToString(enum WaveT w) {
switch (w) {
case Const: return "Const";
case Sine: return "Sine";
case Triangle: return "Triangle";
case Square: return "Square";
case Noise: return "Noise";
case Custom0: return "Custom0";
case Custom1: return "Custom1";
case Custom2: return "Custom2";
case Custom3: return "Custom3";
case Custom4: return "Custom4";
case Custom5: return "Custom5";
case Custom6: return "Custom6";
case Custom7: return "Custom7";
default: return "Invalid";
}
};
};
} // namespace Oryol
|
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 _GUI_LISTBOXCTRL_H_
#define _GUI_LISTBOXCTRL_H_
#ifndef _CONSOLETYPES_H_
#include "console/consoleTypes.h"
#endif
#ifndef _GUICONTROL_H_
#include "gui/core/guiControl.h"
#endif
#ifndef _DGL_H_
#include "gfx/gfxDevice.h"
#endif
#ifndef _H_GUIDEFAULTCONTROLRENDER_
#include "gui/core/guiDefaultControlRender.h"
#endif
#ifndef _GUISCROLLCTRL_H_
#include "gui/containers/guiScrollCtrl.h"
#endif
class GuiListBoxCtrl : public GuiControl
{
private:
typedef GuiControl Parent;
public:
GuiListBoxCtrl();
~GuiListBoxCtrl();
DECLARE_CONOBJECT(GuiListBoxCtrl);
DECLARE_CATEGORY( "Gui Lists" );
DECLARE_DESCRIPTION( "Linear list of text items." );
DECLARE_CALLBACK( void, onMouseDragged, ());
DECLARE_CALLBACK( void, onClearSelection, ());
DECLARE_CALLBACK( void, onUnSelect, ( S32 index, const char* itemText));
DECLARE_CALLBACK( void, onSelect, ( S32 index , const char* itemText ));
DECLARE_CALLBACK( void, onDoubleClick, ());
DECLARE_CALLBACK( void, onMouseUp, ( S32 itemHit, S32 mouseClickCount ));
DECLARE_CALLBACK( void, onDeleteKey, ());
DECLARE_CALLBACK( bool, isObjectMirrored, ( const char* indexIdString ));
struct LBItem
{
StringTableEntry itemText;
String itemTooltip;
bool isSelected;
void* itemData;
LinearColorF color;
bool hasColor;
};
VectorPtr<LBItem*> mItems;
VectorPtr<LBItem*> mSelectedItems;
VectorPtr<LBItem*> mFilteredItems;
bool mMultipleSelections;
Point2I mItemSize;
bool mFitParentWidth;
bool mColorBullet;
LBItem* mLastClickItem;
// Persistence
static void initPersistFields();
// Item Accessors
S32 getItemCount();
S32 getSelCount();
S32 getSelectedItem();
void getSelectedItems( Vector<S32> &Items );
S32 getItemIndex( LBItem *item );
StringTableEntry getItemText( S32 index );
SimObject* getItemObject( S32 index );
void setCurSel( S32 index );
void setCurSelRange( S32 start, S32 stop );
void setItemText( S32 index, StringTableEntry text );
S32 addItem( StringTableEntry text, void *itemData = NULL );
S32 addItemWithColor( StringTableEntry text, LinearColorF color = LinearColorF(-1, -1, -1), void *itemData = NULL);
S32 insertItem( S32 index, StringTableEntry text, void *itemData = NULL );
S32 insertItemWithColor( S32 index, StringTableEntry text, LinearColorF color = LinearColorF(-1, -1, -1), void *itemData = NULL);
S32 findItemText( StringTableEntry text, bool caseSensitive = false );
void setItemColor(S32 index, const LinearColorF& color);
void clearItemColor(S32 index);
void deleteItem( S32 index );
void clearItems();
void clearSelection();
void removeSelection( LBItem *item, S32 index );
void removeSelection( S32 index );
void addSelection( LBItem *item, S32 index );
void addSelection( S32 index );
inline void setMultipleSelection( bool allowMultipleSelect = true ) { mMultipleSelections = allowMultipleSelect; };
bool hitTest( const Point2I& point, S32& outItem );
// Sizing
void updateSize();
virtual void parentResized(const RectI& oldParentRect, const RectI& newParentRect);
virtual bool onWake();
// Rendering
virtual void onRender( Point2I offset, const RectI &updateRect );
virtual void onRenderItem(const RectI& itemRect, LBItem *item);
void drawBox( const Point2I &box, S32 size, ColorI &outlineColor, ColorI &boxColor );
bool renderTooltip( const Point2I &hoverPos, const Point2I& cursorPos, const char* tipText );
void addFilteredItem( String item );
void removeFilteredItem( String item );
// Mouse/Key Events
virtual void onMouseDown( const GuiEvent &event );
virtual void onMouseDragged(const GuiEvent &event);
virtual void onMouseUp( const GuiEvent& event );
virtual bool onKeyDown( const GuiEvent &event );
// String Utility
static U32 getStringElementCount( const char *string );
static const char* getStringElement( const char* inString, const U32 index );
// SimSet Mirroring Stuff
void setMirrorObject( SimSet *inObj );
void _mirror();
StringTableEntry _makeMirrorItemName( SimObject *inObj );
String mMirrorSetName;
String mMakeNameCallback;
};
#endif |
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
#include "..\Common\DeviceResources.h"
#include "..\Common\StepTimer.h"
#include "ShaderStructures.h"
namespace HolographicDepthBasedImageStabilization
{
// This sample renderer instantiates a basic rendering pipeline.
class QuadRenderer
{
public:
QuadRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
void CreateDeviceDependentResources();
void ReleaseDeviceDependentResources();
void Render();
// Repositions the sample hologram.
void UpdateHologramPositionAndOrientation(
Windows::Foundation::Numerics::float3 const& position,
Windows::Foundation::Numerics::float3 const& planeNormal);
// Property accessors.
const Windows::Foundation::Numerics::float3& GetPosition() const { return m_position; }
const Windows::Foundation::Numerics::float3& GetNormal() const { return m_normal; }
private:
// Cached pointer to device resources.
std::shared_ptr<DX::DeviceResources> m_deviceResources;
// Direct3D resources for quad geometry.
Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer;
Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;
Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader;
Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer;
Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthWriteDisable;
Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthDefault;
// System resources for quad geometry.
ModelConstantBuffer m_modelConstantBufferData;
uint32 m_indexCount = 0;
// Variables used with the rendering loop.
bool m_loadingComplete = false;
Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f };
Windows::Foundation::Numerics::float3 m_normal = { 0.f, 0.f, 1.f };
// If the current D3D Device supports VPRT, we can avoid using a geometry
// shader just to set the render target array index.
bool m_usingVprtShaders = false;
};
}
|
#import "cocos2d.h"
#import "BaseAppController.h"
//CLASS INTERFACE
@interface AppController : BaseAppController
@end
@interface FontTest : CCLayer
{
}
@end
|
#pragma once
/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include "IDirectory.h"
class CURL;
class TiXmlElement;
namespace XFILE
{
class CDirectoryTuxBox : public IDirectory
{
public:
CDirectoryTuxBox(void);
virtual ~CDirectoryTuxBox(void);
virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items);
virtual bool IsAllowed(const CStdString &strFile) const { return true; };
virtual DIR_CACHE_TYPE GetCacheType(const CStdString& strPath) const { return DIR_CACHE_ALWAYS; };
private:
bool GetRootAndChildString(const CStdString strPath, CStdString& strBQRequest, CStdString& strXMLRootString, CStdString& strXMLChildString );
void GetRootAndChildStringEnigma2(CStdString& strBQRequest, CStdString& strXMLRootString, CStdString& strXMLChildString );
};
}
|
/*
* Copyright IBM Corp. 2006,2007
* Author(s): Jan Glauber <jan.glauber@de.ibm.com>
* Driver for the s390 pseudo random number generator
*/
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/random.h>
#include <asm/debug.h>
#include <asm/uaccess.h>
#include "crypt_s390.h"
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jan Glauber <jan.glauber@de.ibm.com>");
MODULE_DESCRIPTION("s390 PRNG interface");
static int prng_chunk_size = 256;
module_param(prng_chunk_size, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(prng_chunk_size, "PRNG read chunk size in bytes");
static int prng_entropy_limit = 4096;
module_param(prng_entropy_limit, int, S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR);
MODULE_PARM_DESC(prng_entropy_limit,
"PRNG add entropy after that much bytes were produced");
/*
* Any one who considers arithmetical methods of producing random digits is,
* of course, in a state of sin. -- John von Neumann
*/
struct s390_prng_data {
unsigned long count; /* how many bytes were produced */
char *buf;
};
static struct s390_prng_data *p;
/* copied from libica, use a non-zero initial parameter block */
static unsigned char parm_block[32] = {
0x0F,0x2B,0x8E,0x63,0x8C,0x8E,0xD2,0x52,0x64,0xB7,0xA0,0x7B,0x75,0x28,0xB8,0xF4,
0x75,0x5F,0xD2,0xA6,0x8D,0x97,0x11,0xFF,0x49,0xD8,0x23,0xF3,0x7E,0x21,0xEC,0xA0,
};
static int prng_open(struct inode *inode, struct file *file)
{
return nonseekable_open(inode, file);
}
static void prng_add_entropy(void)
{
__u64 entropy[4];
unsigned int i;
int ret;
for (i = 0; i < 16; i++) {
ret = crypt_s390_kmc(KMC_PRNG, parm_block, (char *)entropy,
(char *)entropy, sizeof(entropy));
BUG_ON(ret < 0 || ret != sizeof(entropy));
memcpy(parm_block, entropy, sizeof(entropy));
}
}
static void prng_seed(int nbytes)
{
char buf[16];
int i = 0;
BUG_ON(nbytes > 16);
get_random_bytes(buf, nbytes);
/* Add the entropy */
while (nbytes >= 8) {
*((__u64 *)parm_block) ^= *((__u64 *)buf+i*8);
prng_add_entropy();
i += 8;
nbytes -= 8;
}
prng_add_entropy();
}
static ssize_t prng_read(struct file *file, char __user *ubuf, size_t nbytes,
loff_t *ppos)
{
int chunk, n;
int ret = 0;
int tmp;
/* nbytes can be arbitrary length, we split it into chunks */
while (nbytes) {
/* same as in extract_entropy_user in random.c */
if (need_resched()) {
if (signal_pending(current)) {
if (ret == 0)
ret = -ERESTARTSYS;
break;
}
schedule();
}
/*
* we lose some random bytes if an attacker issues
* reads < 8 bytes, but we don't care
*/
chunk = min_t(int, nbytes, prng_chunk_size);
/* PRNG only likes multiples of 8 bytes */
n = (chunk + 7) & -8;
if (p->count > prng_entropy_limit)
prng_seed(8);
/* if the CPU supports PRNG stckf is present too */
asm volatile(".insn s,0xb27c0000,%0"
: "=m" (*((unsigned long long *)p->buf)) : : "cc");
/*
* Beside the STCKF the input for the TDES-EDE is the output
* of the last operation. We differ here from X9.17 since we
* only store one timestamp into the buffer. Padding the whole
* buffer with timestamps does not improve security, since
* successive stckf have nearly constant offsets.
* If an attacker knows the first timestamp it would be
* trivial to guess the additional values. One timestamp
* is therefore enough and still guarantees unique input values.
*
* Note: you can still get strict X9.17 conformity by setting
* prng_chunk_size to 8 bytes.
*/
tmp = crypt_s390_kmc(KMC_PRNG, parm_block, p->buf, p->buf, n);
BUG_ON((tmp < 0) || (tmp != n));
p->count += n;
if (copy_to_user(ubuf, p->buf, chunk))
return -EFAULT;
nbytes -= chunk;
ret += chunk;
ubuf += chunk;
}
return ret;
}
static const struct file_operations prng_fops = {
.owner = THIS_MODULE,
.open = &prng_open,
.release = NULL,
.read = &prng_read,
};
static struct miscdevice prng_dev = {
.name = "prandom",
.minor = MISC_DYNAMIC_MINOR,
.fops = &prng_fops,
};
static int __init prng_init(void)
{
int ret;
/* check if the CPU has a PRNG */
if (!crypt_s390_func_available(KMC_PRNG))
return -EOPNOTSUPP;
if (prng_chunk_size < 8)
return -EINVAL;
p = kmalloc(sizeof(struct s390_prng_data), GFP_KERNEL);
if (!p)
return -ENOMEM;
p->count = 0;
p->buf = kmalloc(prng_chunk_size, GFP_KERNEL);
if (!p->buf) {
ret = -ENOMEM;
goto out_free;
}
/* initialize the PRNG, add 128 bits of entropy */
prng_seed(16);
ret = misc_register(&prng_dev);
if (ret) {
printk(KERN_WARNING
"Could not register misc device for PRNG.\n");
goto out_buf;
}
return 0;
out_buf:
kfree(p->buf);
out_free:
kfree(p);
return ret;
}
static void __exit prng_exit(void)
{
/* wipe me */
memset(p->buf, 0, prng_chunk_size);
kfree(p->buf);
kfree(p);
misc_deregister(&prng_dev);
}
module_init(prng_init);
module_exit(prng_exit);
|
//
// Environment_WIN32.h
//
// $Id: //poco/1.3/Foundation/include/Poco/Environment_WIN32.h#2 $
//
// Library: Foundation
// Package: Core
// Module: Environment
//
// Definition of the EnvironmentImpl class for WIN32.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef Foundation_Environment_WIN32_INCLUDED
#define Foundation_Environment_WIN32_INCLUDED
#include "Poco/Foundation.h"
namespace Poco {
class Foundation_API EnvironmentImpl
{
public:
typedef UInt8 NodeId[6]; /// Ethernet address.
static std::string getImpl(const std::string& name);
static bool hasImpl(const std::string& name);
static void setImpl(const std::string& name, const std::string& value);
static std::string osNameImpl();
static std::string osVersionImpl();
static std::string osArchitectureImpl();
static std::string nodeNameImpl();
static void nodeIdImpl(NodeId& id);
};
} // namespace Poco
#endif // Foundation_Environment_WIN32_INCLUDED
|
/*
* NWNeXalt - Empty File
* (c) 2007 Doug Swarin (zac@intertex.net)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
* $HeadURL$
*
*/
#ifndef _NX_NWN_STRUCT_CNWAMBIENTSOUND_
#define _NX_NWN_STRUCT_CNWAMBIENTSOUND_
struct CNWAmbientSound_s {
void *unknown;
uint32_t enabled;
uint32_t music_delay;
uint32_t music_day;
uint32_t music_night;
uint32_t field_10;
uint32_t music_battle;
uint32_t field_18;
uint32_t ambient_day;
uint32_t ambient_night;
uint8_t ambient_day_volume;
uint8_t ambient_night_volume;
uint8_t field_26;
uint8_t field_27;
};
#endif /* _NX_NWN_STRUCT_CNWAMBIENTSOUND_ */
/* vim: set sw=4: */
|
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2 -mavx512f -mvzeroupper" } */
void
f(void)
{
__asm__ __volatile__("" ::: "zmm16");
}
/* { dg-final { scan-assembler-not "vzeroupper" } } */
|
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Altera SoCFPGA PinMux configuration
*/
#ifndef __SOCFPGA_PINMUX_CONFIG_H__
#define __SOCFPGA_PINMUX_CONFIG_H__
const u8 sys_mgr_init_table[] = {
3, /* EMACIO0 */
3, /* EMACIO1 */
3, /* EMACIO2 */
3, /* EMACIO3 */
3, /* EMACIO4 */
3, /* EMACIO5 */
3, /* EMACIO6 */
3, /* EMACIO7 */
3, /* EMACIO8 */
3, /* EMACIO9 */
3, /* EMACIO10 */
3, /* EMACIO11 */
3, /* EMACIO12 */
3, /* EMACIO13 */
0, /* EMACIO14 */
0, /* EMACIO15 */
0, /* EMACIO16 */
0, /* EMACIO17 */
0, /* EMACIO18 */
0, /* EMACIO19 */
0, /* FLASHIO0 */
0, /* FLASHIO1 */
0, /* FLASHIO2 */
0, /* FLASHIO3 */
0, /* FLASHIO4 */
0, /* FLASHIO5 */
0, /* FLASHIO6 */
0, /* FLASHIO7 */
0, /* FLASHIO8 */
0, /* FLASHIO9 */
0, /* FLASHIO10 */
0, /* FLASHIO11 */
3, /* GENERALIO0 */
3, /* GENERALIO1 */
3, /* GENERALIO2 */
3, /* GENERALIO3 */
3, /* GENERALIO4 */
3, /* GENERALIO5 */
3, /* GENERALIO6 */
3, /* GENERALIO7 */
3, /* GENERALIO8 */
3, /* GENERALIO9 */
3, /* GENERALIO10 */
3, /* GENERALIO11 */
3, /* GENERALIO12 */
3, /* GENERALIO13 */
3, /* GENERALIO14 */
0, /* GENERALIO15 */
0, /* GENERALIO16 */
0, /* GENERALIO17 */
0, /* GENERALIO18 */
0, /* GENERALIO19 */
0, /* GENERALIO20 */
0, /* GENERALIO21 */
0, /* GENERALIO22 */
0, /* GENERALIO23 */
0, /* GENERALIO24 */
0, /* GENERALIO25 */
0, /* GENERALIO26 */
0, /* GENERALIO27 */
0, /* GENERALIO28 */
0, /* GENERALIO29 */
0, /* GENERALIO30 */
0, /* GENERALIO31 */
3, /* MIXED1IO0 */
3, /* MIXED1IO1 */
3, /* MIXED1IO2 */
3, /* MIXED1IO3 */
3, /* MIXED1IO4 */
3, /* MIXED1IO5 */
3, /* MIXED1IO6 */
3, /* MIXED1IO7 */
3, /* MIXED1IO8 */
3, /* MIXED1IO9 */
3, /* MIXED1IO10 */
3, /* MIXED1IO11 */
3, /* MIXED1IO12 */
3, /* MIXED1IO13 */
3, /* MIXED1IO14 */
0, /* MIXED1IO15 */
0, /* MIXED1IO16 */
0, /* MIXED1IO17 */
0, /* MIXED1IO18 */
0, /* MIXED1IO19 */
0, /* MIXED1IO20 */
0, /* MIXED1IO21 */
0, /* MIXED2IO0 */
0, /* MIXED2IO1 */
0, /* MIXED2IO2 */
0, /* MIXED2IO3 */
0, /* MIXED2IO4 */
0, /* MIXED2IO5 */
0, /* MIXED2IO6 */
0, /* MIXED2IO7 */
0, /* GPLINMUX48 */
0, /* GPLINMUX49 */
0, /* GPLINMUX50 */
0, /* GPLINMUX51 */
0, /* GPLINMUX52 */
0, /* GPLINMUX53 */
0, /* GPLINMUX54 */
0, /* GPLINMUX55 */
0, /* GPLINMUX56 */
0, /* GPLINMUX57 */
0, /* GPLINMUX58 */
0, /* GPLINMUX59 */
0, /* GPLINMUX60 */
0, /* GPLINMUX61 */
0, /* GPLINMUX62 */
0, /* GPLINMUX63 */
0, /* GPLINMUX64 */
0, /* GPLINMUX65 */
0, /* GPLINMUX66 */
0, /* GPLINMUX67 */
0, /* GPLINMUX68 */
0, /* GPLINMUX69 */
0, /* GPLINMUX70 */
1, /* GPLMUX0 */
1, /* GPLMUX1 */
1, /* GPLMUX2 */
1, /* GPLMUX3 */
1, /* GPLMUX4 */
1, /* GPLMUX5 */
1, /* GPLMUX6 */
1, /* GPLMUX7 */
1, /* GPLMUX8 */
1, /* GPLMUX9 */
1, /* GPLMUX10 */
1, /* GPLMUX11 */
1, /* GPLMUX12 */
1, /* GPLMUX13 */
1, /* GPLMUX14 */
1, /* GPLMUX15 */
1, /* GPLMUX16 */
1, /* GPLMUX17 */
1, /* GPLMUX18 */
1, /* GPLMUX19 */
1, /* GPLMUX20 */
1, /* GPLMUX21 */
1, /* GPLMUX22 */
1, /* GPLMUX23 */
1, /* GPLMUX24 */
1, /* GPLMUX25 */
1, /* GPLMUX26 */
1, /* GPLMUX27 */
1, /* GPLMUX28 */
1, /* GPLMUX29 */
1, /* GPLMUX30 */
1, /* GPLMUX31 */
1, /* GPLMUX32 */
1, /* GPLMUX33 */
1, /* GPLMUX34 */
1, /* GPLMUX35 */
1, /* GPLMUX36 */
1, /* GPLMUX37 */
1, /* GPLMUX38 */
1, /* GPLMUX39 */
1, /* GPLMUX40 */
1, /* GPLMUX41 */
1, /* GPLMUX42 */
1, /* GPLMUX43 */
1, /* GPLMUX44 */
1, /* GPLMUX45 */
1, /* GPLMUX46 */
1, /* GPLMUX47 */
1, /* GPLMUX48 */
1, /* GPLMUX49 */
1, /* GPLMUX50 */
1, /* GPLMUX51 */
1, /* GPLMUX52 */
1, /* GPLMUX53 */
1, /* GPLMUX54 */
1, /* GPLMUX55 */
1, /* GPLMUX56 */
1, /* GPLMUX57 */
1, /* GPLMUX58 */
1, /* GPLMUX59 */
1, /* GPLMUX60 */
1, /* GPLMUX61 */
1, /* GPLMUX62 */
1, /* GPLMUX63 */
1, /* GPLMUX64 */
1, /* GPLMUX65 */
1, /* GPLMUX66 */
1, /* GPLMUX67 */
1, /* GPLMUX68 */
1, /* GPLMUX69 */
1, /* GPLMUX70 */
0, /* NANDUSEFPGA */
0, /* UART0USEFPGA */
0, /* RGMII1USEFPGA */
0, /* SPIS0USEFPGA */
0, /* CAN0USEFPGA */
0, /* I2C0USEFPGA */
0, /* SDMMCUSEFPGA */
0, /* QSPIUSEFPGA */
0, /* SPIS1USEFPGA */
0, /* RGMII0USEFPGA */
0, /* UART1USEFPGA */
0, /* CAN1USEFPGA */
0, /* USB1USEFPGA */
0, /* I2C3USEFPGA */
0, /* I2C2USEFPGA */
0, /* I2C1USEFPGA */
1, /* SPIM1USEFPGA */
0, /* USB0USEFPGA */
0 /* SPIM0USEFPGA */
};
#endif /* __SOCFPGA_PINMUX_CONFIG_H__ */
|
/* Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
/* Read the contents of the symbolic link PATH into no more than
LEN bytes of BUF. The contents are not null-terminated.
Returns the number of characters read, or -1 for errors. */
ssize_t
__readlink (const char *path, char *buf, size_t len)
{
return INLINE_SYSCALL (readlinkat, 4, AT_FDCWD, path, buf, len);
}
weak_alias (__readlink, readlink)
|
/****************************************************************************************
* arch/arm/include/samd/irq.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 NuttX 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.
*
****************************************************************************************/
/* This file should never be included directed but, rather, only indirectly through
* nuttx/irq.h
*/
#ifndef __ARCH_ARM_INCLUDE_SAMD_IRQ_H
#define __ARCH_ARM_INCLUDE_SAMD_IRQ_H
/****************************************************************************************
* Included Files
****************************************************************************************/
#include <nuttx/config.h>
#include <arch/samd/chip.h>
/****************************************************************************************
* Pre-processor Definitions
****************************************************************************************/
/* IRQ numbers. The IRQ number corresponds vector number and hence map directly to
* bits in the NVIC. This does, however, waste several words of memory in the IRQ
* to handle mapping tables.
*/
/* Processor Exceptions (vectors 0-15) */
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
/* Vector 0: Reset stack pointer value */
/* Vector 1: Reset (not handler as an IRQ) */
#define SAM_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
#define SAM_IRQ_HARDFAULT (3) /* Vector 3: Hard fault */
/* Vector 4-10: Reserved */
#define SAM_IRQ_SVCALL (11) /* Vector 11: SVC call */
/* Vector 12-13: Reserved */
#define SAM_IRQ_PENDSV (14) /* Vector 14: Pendable system service request */
#define SAM_IRQ_SYSTICK (15) /* Vector 15: System tick */
/* External interrupts (vectors >= 16). These definitions are chip-specific */
#define SAM_IRQ_INTERRUPT (16) /* Vector number of the first external interrupt */
/* Chip-Specific External interrupts */
#if defined(SAMD20)
# include <arch/samd/samd20_irq.h>
#else
# error "Unrecognized/unsupported SAMD chip"
#endif
/****************************************************************************************
* Public Types
****************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************
* Public Data
****************************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************************
* Public Function Prototypes
****************************************************************************************/
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* __ARCH_ARM_INCLUDE_SAMD_IRQ_H */
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsITableLayout_h__
#define nsITableLayout_h__
#include "nsQueryFrame.h"
class nsIDOMElement;
/**
* nsITableLayout
* interface for layout objects that act like tables.
* initially, we use this to get cell info
*
* @author sclark
*/
class nsITableLayout
{
public:
NS_DECL_QUERYFRAME_TARGET(nsITableLayout)
/** return all the relevant layout information about a cell.
* @param aRowIndex a row which the cell intersects
* @param aColIndex a col which the cell intersects
* @param aCell [OUT] the content representing the cell at (aRowIndex, aColIndex)
* @param aStartRowIndex [IN/OUT] the row in which aCell starts
* @param aStartColIndex [IN/OUT] the col in which aCell starts
* Initialize these with the "candidate" start indexes to use
* for searching through the table when a cell isn't found
* because of "holes" in the cellmap
* when ROWSPAN and/or COLSPAN > 1
* @param aRowSpan [OUT] the value of the ROWSPAN attribute (may be 0 or actual number)
* @param aColSpan [OUT] the value of the COLSPAN attribute (may be 0 or actual number)
* @param aActualRowSpan [OUT] the actual number of rows aCell spans
* @param aActualColSpan [OUT] the acutal number of cols aCell spans
* @param aIsSelected [OUT] PR_TRUE if the frame that maps aCell is selected
* in the presentation shell that owns this.
*/
NS_IMETHOD GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
nsIDOMElement* &aCell, //out params
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
PRInt32& aRowSpan, PRInt32& aColSpan,
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
PRBool& aIsSelected)=0;
/** Get the number of rows and column for a table from the frame's cellmap
* Some rows may not have enough cells (the number returned is the maximum possible),
* which displays as a ragged-right edge table
*/
NS_IMETHOD GetTableSize(PRInt32& aRowCount, PRInt32& aColCount)=0;
/**
* Retrieves the index of the cell at the given coordinates.
*
* @note The index is the order number of the cell calculated from top left
* cell to the right bottom cell of the table.
*
* @param aRow [in] the row the cell is in
* @param aColumn [in] the column the cell is in
* @param aIndex [out] the index to be returned
*/
NS_IMETHOD GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn,
PRInt32 *aIndex) = 0;
/**
* Retrieves the coordinates of the cell at the given index.
*
* @see nsITableLayout::GetIndexByRowAndColumn()
*
* @param aIndex [in] the index for which the coordinates are to be retrieved
* @param aRow [out] the resulting row coordinate
* @param aColumn [out] the resulting column coordinate
*/
NS_IMETHOD GetRowAndColumnByIndex(PRInt32 aIndex,
PRInt32 *aRow, PRInt32 *aColumn) = 0;
};
#endif
|
/* include/graphics/SkPathEffect.h
**
** Copyright 2006, 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.
*/
#ifndef SkPathEffect_DEFINED
#define SkPathEffect_DEFINED
#include "SkFlattenable.h"
class SkPath;
/** \class SkPathEffect
SkPathEffect is the base class for objects in the SkPaint that affect
the geometry of a drawing primitive before it is transformed by the
canvas' matrix and drawn.
Dashing is implemented as a subclass of SkPathEffect.
*/
class SkPathEffect : public SkFlattenable {
public:
// This method is not exported to java.
SkPathEffect() {}
/** Given a src path and a width value, return true if the patheffect
has produced a new path (dst) and a new width value. If false is returned,
ignore dst and width.
On input, width >= 0 means the src should be stroked
On output, width >= 0 means the dst should be stroked
*/
// This method is not exported to java.
virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
/** overrides for SkFlattenable.
Subclasses should override this to (re)create their subclass.
*/
// This method is not exported to java.
virtual Factory getFactory();
protected:
// visible to our subclasses
SkPathEffect(SkRBuffer&) {}
private:
// illegal
SkPathEffect(const SkPathEffect&);
SkPathEffect& operator=(const SkPathEffect&);
};
/** \class SkPairPathEffect
Common baseclass for Compose and Sum. This subclass manages two pathEffects,
including flattening them. It does nothing in filterPath, and is only useful
for managing the lifetimes of its two arguments.
*/
class SkPairPathEffect : public SkPathEffect {
public:
SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
virtual ~SkPairPathEffect();
// overrides
// This method is not exported to java.
virtual void flatten(SkWBuffer&);
protected:
// these are visible to our subclasses
SkPathEffect* fPE0, *fPE1;
SkPairPathEffect(SkRBuffer&);
private:
typedef SkPathEffect INHERITED;
};
/** \class SkComposePathEffect
This subclass of SkPathEffect composes its two arguments, to create
a compound pathEffect.
*/
class SkComposePathEffect : public SkPairPathEffect {
public:
/** Construct a pathEffect whose effect is to apply first the inner pathEffect
and the the outer pathEffect (e.g. outer(inner(path)))
The reference counts for outer and inner are both incremented in the constructor,
and decremented in the destructor.
*/
SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
: SkPairPathEffect(outer, inner) {}
// overrides
// This method is not exported to java.
virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
// overrides for SkFlattenable
// This method is not exported to java.
virtual Factory getFactory();
private:
SkPathEffect* fOuter, *fInner;
static SkFlattenable* CreateProc(SkRBuffer&);
SkComposePathEffect(SkRBuffer& buffer) : SkPairPathEffect(buffer) {}
// illegal
SkComposePathEffect(const SkComposePathEffect&);
SkComposePathEffect& operator=(const SkComposePathEffect&);
typedef SkPairPathEffect INHERITED;
};
/** \class SkSumPathEffect
This subclass of SkPathEffect applies two pathEffects, one after the other.
Its filterPath() returns true if either of the effects succeeded.
*/
class SkSumPathEffect : public SkPairPathEffect {
public:
/** Construct a pathEffect whose effect is to apply two effects, in sequence.
(e.g. first(path) + second(path))
The reference counts for first and second are both incremented in the constructor,
and decremented in the destructor.
*/
SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
: SkPairPathEffect(first, second) {}
// overrides
// This method is not exported to java.
virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
// overrides for SkFlattenable
// This method is not exported to java.
virtual Factory getFactory();
private:
SkPathEffect* fFirst, *fSecond;
static SkFlattenable* CreateProc(SkRBuffer&);
SkSumPathEffect(SkRBuffer& buffer) : SkPairPathEffect(buffer) {}
// illegal
SkSumPathEffect(const SkSumPathEffect&);
SkSumPathEffect& operator=(const SkSumPathEffect&);
typedef SkPairPathEffect INHERITED;
};
#endif
|
// 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 PPAPI_PROXY_FILE_IO_RESOURCE_H_
#define PPAPI_PROXY_FILE_IO_RESOURCE_H_
#include <string>
#include "ppapi/c/private/pp_file_handle.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/file_io_state_manager.h"
#include "ppapi/thunk/ppb_file_io_api.h"
namespace ppapi {
class TrackedCallback;
namespace proxy {
class PPAPI_PROXY_EXPORT FileIOResource
: public PluginResource,
public thunk::PPB_FileIO_API {
public:
FileIOResource(Connection connection, PP_Instance instance);
virtual ~FileIOResource();
// Resource overrides.
virtual thunk::PPB_FileIO_API* AsPPB_FileIO_API() OVERRIDE;
// PPB_FileIO_API implementation.
virtual int32_t Open(PP_Resource file_ref,
int32_t open_flags,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Query(PP_FileInfo* info,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Touch(PP_Time last_access_time,
PP_Time last_modified_time,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Read(int64_t offset,
char* buffer,
int32_t bytes_to_read,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t ReadToArray(int64_t offset,
int32_t max_read_length,
PP_ArrayOutput* array_output,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Write(int64_t offset,
const char* buffer,
int32_t bytes_to_write,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t SetLength(int64_t length,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual void Close() OVERRIDE;
virtual int32_t GetOSFileDescriptor() OVERRIDE;
virtual int32_t RequestOSFileHandle(
PP_FileHandle* handle,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t WillWrite(int64_t offset,
int32_t bytes_to_write,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t WillSetLength(
int64_t length,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
private:
int32_t ReadValidated(int64_t offset,
int32_t bytes_to_read,
const PP_ArrayOutput& array_output,
scoped_refptr<TrackedCallback> callback);
// Handlers of reply messages. Note that all of them have a callback
// parameters bound when call to the host.
void OnPluginMsgGeneralComplete(scoped_refptr<TrackedCallback> callback,
const ResourceMessageReplyParams& params);
void OnPluginMsgOpenFileComplete(scoped_refptr<TrackedCallback> callback,
const ResourceMessageReplyParams& params);
void OnPluginMsgQueryComplete(scoped_refptr<TrackedCallback> callback,
PP_FileInfo* output_info_,
const ResourceMessageReplyParams& params,
const PP_FileInfo& info);
void OnPluginMsgReadComplete(scoped_refptr<TrackedCallback> callback,
PP_ArrayOutput array_output,
const ResourceMessageReplyParams& params,
const std::string& data);
void OnPluginMsgRequestOSFileHandleComplete(
scoped_refptr<TrackedCallback> callback,
PP_FileHandle* output_handle,
const ResourceMessageReplyParams& params);
FileIOStateManager state_manager_;
DISALLOW_COPY_AND_ASSIGN(FileIOResource);
};
} // namespace proxy
} // namespace ppapi
#endif // PPAPI_PROXY_FILE_IO_RESOURCE_H_
|
//
// ______ _ _ _ _____ _____ _ __
// | ____| | | (_) | | / ____| __ \| |/ /
// | |__ ___| |_ _ _ __ ___ ___ | |_ ___ | (___ | | | | ' /
// | __| / __| __| | '_ ` _ \ / _ \| __/ _ \ \___ \| | | | <
// | |____\__ \ |_| | | | | | | (_) | || __/ ____) | |__| | . \
// |______|___/\__|_|_| |_| |_|\___/ \__\___| |_____/|_____/|_|\_\
//
//
// Copyright © 2015 Estimote. All rights reserved.
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class ESTSettingEddystoneTLMEnable, ESTSettingEddystoneTLMInterval, ESTSettingEddystoneTLMPower, ESTDeviceSettingsCollection;
/**
* ESTSettingsEddystoneTLM represents a group of settings related to Eddystone Telemetry packet.
*/
@interface ESTSettingsEddystoneTLM : NSObject
/**
* Eddystone Telemetry enable setting.
*/
@property (nonatomic, strong, readonly) ESTSettingEddystoneTLMEnable *enable;
/**
* Eddystone Telemetry advertising interval setting.
*/
@property (nonatomic, strong, readonly) ESTSettingEddystoneTLMInterval *interval;
/**
* Eddystone Telemetry power setting.
*/
@property (nonatomic, strong, readonly) ESTSettingEddystoneTLMPower *power;
/**
* Designated initializer.
*
* @param settingsCollection Collection of settings containing Eddystone Telemetry related settings.
*
* @return Initialized object.
*/
- (instancetype)initWithSettingsCollection:(ESTDeviceSettingsCollection *)settingsCollection;
@end
NS_ASSUME_NONNULL_END
|
// 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.
// AudioOutputDispatcherImpl is an implementation of AudioOutputDispatcher.
//
// To avoid opening and closing audio devices more frequently than necessary,
// each dispatcher has a pool of inactive physical streams. A stream is closed
// only if it hasn't been used for a certain period of time (specified via the
// constructor).
//
#ifndef MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_
#define MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_
#include <stddef.h>
#include <map>
#include <memory>
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/timer/timer.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_logging.h"
#include "media/audio/audio_manager.h"
#include "media/audio/audio_output_dispatcher.h"
#include "media/base/audio_parameters.h"
namespace media {
class AudioOutputProxy;
class MEDIA_EXPORT AudioOutputDispatcherImpl : public AudioOutputDispatcher {
public:
// |close_delay| specifies delay after the stream is idle until the audio
// device is closed.
AudioOutputDispatcherImpl(AudioManager* audio_manager,
const AudioParameters& params,
const std::string& output_device_id,
const base::TimeDelta& close_delay);
// Opens a new physical stream if there are no pending streams in
// |idle_streams_|. Do not call Close() or Stop() if this method fails.
bool OpenStream() override;
// If there are pending streams in |idle_streams_| then it reuses one of
// them, otherwise creates a new one.
bool StartStream(AudioOutputStream::AudioSourceCallback* callback,
AudioOutputProxy* stream_proxy) override;
// Stops the stream assigned to the specified proxy and moves it into
// |idle_streams_| for reuse by other proxies.
void StopStream(AudioOutputProxy* stream_proxy) override;
void StreamVolumeSet(AudioOutputProxy* stream_proxy, double volume) override;
// Closes |idle_streams_| until the number of |idle_streams_| is equal to the
// |idle_proxies_| count. If there are no |idle_proxies_| a single stream is
// kept alive until |close_timer_| fires.
void CloseStream(AudioOutputProxy* stream_proxy) override;
void Shutdown() override;
// Returns true if there are any open AudioOutputProxy objects.
bool HasOutputProxies() const;
// Closes all |idle_streams_|.
void CloseAllIdleStreams();
private:
friend class base::RefCountedThreadSafe<AudioOutputDispatcherImpl>;
~AudioOutputDispatcherImpl() override;
// Creates a new physical output stream, opens it and pushes to
// |idle_streams_|. Returns false if the stream couldn't be created or
// opened.
bool CreateAndOpenStream();
// Similar to CloseAllIdleStreams(), but keeps |keep_alive| streams alive.
void CloseIdleStreams(size_t keep_alive);
size_t idle_proxies_;
std::vector<AudioOutputStream*> idle_streams_;
// When streams are stopped they're added to |idle_streams_|, if no stream is
// reused before |close_delay_| elapses |close_timer_| will run
// CloseIdleStreams().
base::DelayTimer close_timer_;
typedef std::map<AudioOutputProxy*, AudioOutputStream*> AudioStreamMap;
AudioStreamMap proxy_to_physical_map_;
std::unique_ptr<AudioLog> audio_log_;
typedef std::map<AudioOutputStream*, int> AudioStreamIDMap;
AudioStreamIDMap audio_stream_ids_;
int audio_stream_id_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl);
};
} // namespace media
#endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_
|
// 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 EXTENSIONS_BROWSER_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
#define EXTENSIONS_BROWSER_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
#include "content/public/browser/readback_types.h"
#include "extensions/browser/extension_function.h"
#include "extensions/common/api/extension_types.h"
class SkBitmap;
namespace content {
class WebContents;
}
namespace extensions {
// Base class for capturing visibile area of a WebContents.
// This is used by both webview.captureVisibleRegion and tabs.captureVisibleTab.
class CaptureWebContentsFunction : public AsyncExtensionFunction {
public:
CaptureWebContentsFunction() {}
protected:
~CaptureWebContentsFunction() override {}
// ExtensionFunction implementation.
bool HasPermission() override;
bool RunAsync() override;
virtual bool IsScreenshotEnabled() = 0;
virtual content::WebContents* GetWebContentsForID(int context_id) = 0;
enum FailureReason {
FAILURE_REASON_UNKNOWN,
FAILURE_REASON_ENCODING_FAILED,
FAILURE_REASON_VIEW_INVISIBLE
};
virtual void OnCaptureFailure(FailureReason reason) = 0;
private:
void CopyFromBackingStoreComplete(const SkBitmap& bitmap,
content::ReadbackResponse response);
void OnCaptureSuccess(const SkBitmap& bitmap);
// |context_id_| is the ID used to find the relevant WebContents. In the
// |tabs.captureVisibleTab()| api, this represents the window-id, and in the
// |webview.captureVisibleRegion()| api, this represents the instance-id of
// the guest.
int context_id_;
// The format (JPEG vs PNG) of the resulting image. Set in RunAsync().
core_api::extension_types::ImageFormat image_format_;
// Quality setting to use when encoding jpegs. Set in RunAsync().
int image_quality_;
DISALLOW_COPY_AND_ASSIGN(CaptureWebContentsFunction);
};
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
|
// -*- tab-width:4 ; indent-tabs-mode:nil -*-
#ifndef PLUGIN_GREYBOX_H
#define PLUGIN_GREYBOX_H
/**
\file dlopen-pins.h
*/
#include <popt.h>
#include <pins-lib/pins.h>
extern struct poptOption pins_plugin_options[];
extern void PINSpluginLoadGreyboxModel(model_t model,const char*name);
#endif
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright (c) 2012, Janrain, 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 the Janrain, 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 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.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#import <Foundation/Foundation.h>
#import "JRCaptureObject.h"
#import "JRCaptureTypes.h"
#import "JRNSDate+ISO8601_CaptureDateTimeString.h"
/**
* @brief A JRPrimaryAddress object
**/
@interface JRPrimaryAddress : JRCaptureObject
@property (nonatomic, copy) NSString *address1; /**< The object's \e address1 property */
@property (nonatomic, copy) NSString *address2; /**< The object's \e address2 property */
@property (nonatomic, copy) NSString *city; /**< The object's \e city property */
@property (nonatomic, copy) NSString *company; /**< The object's \e company property */
@property (nonatomic, copy) NSString *country; /**< The object's \e country property */
@property (nonatomic, copy) NSString *mobile; /**< The object's \e mobile property */
@property (nonatomic, copy) NSString *phone; /**< The object's \e phone property */
@property (nonatomic, copy) NSString *stateAbbreviation; /**< The object's \e stateAbbreviation property */
@property (nonatomic, copy) NSString *zip; /**< The object's \e zip property */
@property (nonatomic, copy) NSString *zipPlus4; /**< The object's \e zipPlus4 property */
/**
* @name Constructors
**/
/*@{*/
/**
* Default instance constructor. Returns an empty JRPrimaryAddress object
*
* @return
* A JRPrimaryAddress object
**/
- (id)init;
/**
* Default class constructor. Returns an empty JRPrimaryAddress object
*
* @return
* A JRPrimaryAddress object
**/
+ (id)primaryAddress;
/*@}*/
/**
* @name Manage Remotely
**/
/*@{*/
/**
* Use this method to determine if the object or element needs to be updated remotely.
* That is, if there are local changes to any of the object/elements's properties or
* sub-objects, then this object will need to be updated on Capture. You can update
* an object on Capture by using the method updateOnCaptureForDelegate:context:().
*
* @return
* \c YES if this object or any of it's sub-objects have any properties that have changed
* locally. This does not include properties that are arrays, if any, or the elements contained
* within the arrays. \c NO if no non-array properties or sub-objects have changed locally.
**/
- (BOOL)needsUpdate;
/**
* TODO: Doxygen doc
**/
- (void)updateOnCaptureForDelegate:(id<JRCaptureObjectDelegate>)delegate context:(NSObject *)context;
/*@}*/
@end
|
#pragma once
#ifndef T_MACHINE_INCLUDED
#define T_MACHINE_INCLUDED
#if defined(_WIN32) || defined(i386)
#define TNZ_MACHINE_CHANNEL_ORDER_BGRM 1
#elif defined(__sgi)
#define TNZ_MACHINE_CHANNEL_ORDER_MBGR 1
#elif defined(LINUX)
#define TNZ_MACHINE_CHANNEL_ORDER_BGRM 1
#elif defined(MACOSX)
#define TNZ_MACHINE_CHANNEL_ORDER_MRGB 1
#else
@UNKNOW PLATFORM @
#endif
#if !defined(TNZ_LITTLE_ENDIAN)
#error "TNZ_LITTLE_ENDIAN not defined!"
#endif
#ifndef WIN32
#ifdef MACOSX
#define _finite isfinite
#else
// verificare che su sgi sia isfinite
#define _finite isfinite
#endif
#endif
#endif
|
//-*- Mode: C++ -*-
// $Id: AliHLTAsyncCalibrationComponent $
#ifndef ALIHLTASYNCCALIBRATIONCOMPONENT_H
#define ALIHLTASYNCCALIBRATIONCOMPONENT_H
/* This file is property of and copyright by the ALICE HLT Project *
* ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/** @file AliHLTAsyncCalibrationComponent.h
@author David Rohr (drohr@cern.ch)
*/
#include "AliHLTProcessor.h"
#include "AliHLTAsyncMemberProcessor.h"
class TList;
class AliESDVZERO;
class AliESDtrackCuts;
class AliHLTCTPData;
class AliHLTMultiplicityCorrelations;
class AliHLTGlobalTriggerDecision;
class AliAnalysisManager;
class AliHLTTestInputHandler;
/**
* @class AliHLTAsyncCalibrationComponent
*/
class AliHLTAsyncCalibrationComponent : public AliHLTProcessor {
public:
/*
* ---------------------------------------------------------------------------------
* Constructor / Destructor
* ---------------------------------------------------------------------------------
*/
/** constructor */
AliHLTAsyncCalibrationComponent();
/** destructor */
virtual ~AliHLTAsyncCalibrationComponent();
/*
* ---------------------------------------------------------------------------------
* Public functions to implement AliHLTComponent's interface.
* These functions are required for the registration process
* ---------------------------------------------------------------------------------
*/
/** interface function, see @ref AliHLTComponent for description */
const Char_t* GetComponentID();
/** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
/** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
/** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize( ULong_t& constBase, Double_t& inputMultiplier );
/** interface function, see @ref AliHLTComponent for description */
void GetOCDBObjectDescription( TMap* const targetMap);
/** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
//Example of async member function
void* CalibrationTask(void* data);
protected:
/*
* ---------------------------------------------------------------------------------
* Protected functions to implement AliHLTComponent's interface.
* These functions provide initialization as well as the actual processing
* capabilities of the component.
* ---------------------------------------------------------------------------------
*/
// AliHLTComponent interface functions
/** interface function, see @ref AliHLTComponent for description */
Int_t DoInit( Int_t /*argc*/, const Char_t** /*argv*/ );
/** interface function, see @ref AliHLTComponent for description */
Int_t DoDeinit();
/** interface function, see @ref AliHLTComponent for description */
Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
using AliHLTProcessor::DoEvent;
/** interface function, see @ref AliHLTComponent for description */
Int_t Reconfigure(const Char_t* cdbEntry, const Char_t* chainId);
/** interface function, see @ref AliHLTComponent for description */
Int_t ReadPreprocessorValues(const Char_t* modules);
///////////////////////////////////////////////////////////////////////////////////
private:
/*
* ---------------------------------------------------------------------------------
* Private functions to implement AliHLTComponent's interface.
* These functions provide initialization as well as the actual processing
* capabilities of the component.
* ---------------------------------------------------------------------------------
*/
/** copy constructor prohibited */
AliHLTAsyncCalibrationComponent(const AliHLTAsyncCalibrationComponent&);
/** assignment operator prohibited */
AliHLTAsyncCalibrationComponent& operator=(const AliHLTAsyncCalibrationComponent&);
int ReadConfigurationString( const char* arguments );
int Configure( const char* cdbEntry, const char* chainId, const char *commandLine );
/*
* ---------------------------------------------------------------------------------
* Helper
* ---------------------------------------------------------------------------------
*/
/*
* ---------------------------------------------------------------------------------
* Members - private
* ---------------------------------------------------------------------------------
*/
AliHLTAsyncMemberProcessor<AliHLTAsyncCalibrationComponent> fAsyncProcessor;
int fAsyncProcessorQueueDepth;
int fNEvents;
ClassDef(AliHLTAsyncCalibrationComponent, 0)
};
#endif
|
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "ctors.h"
/*
* This file originally contained functions only needed on narrow builds of
* Python for converting back and forth between the NumPy Unicode data-type
* (always 4-bytes) and the Python Unicode scalar (2-bytes on a narrow build).
*
* This "narrow" interface is now deprecated in python and unused in NumPy.
*/
/*
* Returns a PyUnicodeObject initialized from a buffer containing
* UCS4 unicode.
*
* Parameters
* ----------
* src: char *
* Pointer to buffer containing UCS4 unicode.
* size: Py_ssize_t
* Size of buffer in bytes.
* swap: int
* If true, the data will be swapped.
* align: int
* If true, the data will be aligned.
*
* Returns
* -------
* new_reference: PyUnicodeObject
*/
NPY_NO_EXPORT PyUnicodeObject *
PyUnicode_FromUCS4(char const *src_char, Py_ssize_t size, int swap, int align)
{
Py_ssize_t ucs4len = size / sizeof(npy_ucs4);
npy_ucs4 const *src = (npy_ucs4 const *)src_char;
npy_ucs4 *buf = NULL;
/* swap and align if needed */
if (swap || align) {
buf = (npy_ucs4 *)malloc(size);
if (buf == NULL) {
PyErr_NoMemory();
return NULL;
}
memcpy(buf, src, size);
if (swap) {
byte_swap_vector(buf, ucs4len, sizeof(npy_ucs4));
}
src = buf;
}
/* trim trailing zeros */
while (ucs4len > 0 && src[ucs4len - 1] == 0) {
ucs4len--;
}
PyUnicodeObject *ret = (PyUnicodeObject *)PyUnicode_FromKindAndData(
PyUnicode_4BYTE_KIND, src, ucs4len);
free(buf);
return ret;
}
|
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// A RowReader describes a Get operation for the specified row and returns
// filtered cells from server.
// User should call RowReader::GetError() to check if operation is successful.
#ifndef TERA_READER_H_
#define TERA_READER_H_
#include <stdint.h>
#include <map>
#include <set>
#include <string>
#include "error_code.h"
#pragma GCC visibility push(default)
namespace tera {
class RowReaderImpl;
class Transaction;
class Table;
class RowReader {
public:
// Set request filter conditions. If none, returns all cells of this row.
// Only returns cells in these columns.
virtual void AddColumnFamily(const std::string& family) = 0;
virtual void AddColumn(const std::string& family, const std::string& qualifier) = 0;
// Set the maximum number of versions of each column.
virtual void SetMaxVersions(uint32_t max_version) = 0;
// If set, only returns cells of which update timestamp is within [ts_start, ts_end].
virtual void SetTimeRange(int64_t ts_start, int64_t ts_end) = 0;
// Access received data.
// Use RowReader as an iterator. While Done() returns false, one cell is
// accessible.
virtual bool Done() = 0;
virtual void Next() = 0;
// Access present cell.
// Only RowKey&Value are effective in key-value storage.
virtual const std::string& RowKey() = 0;
virtual std::string Value() = 0;
virtual std::string Family() = 0;
virtual std::string Qualifier() = 0;
virtual int64_t Timestamp() = 0;
// Returns all cells in this row as a nested std::map.
typedef std::map<int64_t, std::string> TColumn;
typedef std::map<std::string, TColumn> TColumnFamily;
typedef std::map<std::string, TColumnFamily> TRow;
virtual void ToMap(TRow* rowmap) = 0;
// The status of this row reader. Returns kOK on success and a non-OK
// status on error.
virtual ErrorCode GetError() = 0;
// Users are allowed to register a callback/context two-tuples that
// will be invoked when this reader is finished.
typedef void (*Callback)(RowReader* param);
virtual void SetCallBack(Callback callback) = 0;
virtual void SetContext(void* context) = 0;
virtual void* GetContext() = 0;
virtual void SetTimeOut(int64_t timeout_ms) = 0;
// Get column filters map.
typedef std::map<std::string, std::set<std::string> >ReadColumnList;
virtual const ReadColumnList& GetReadColumnList() = 0;
// EXPERIMENTAL
// Returns transaction if exists.
virtual Transaction* GetTransaction() = 0;
// DEVELOPING
virtual void SetSnapshot(uint64_t snapshot_id) = 0;
virtual uint64_t GetSnapshot() = 0;
virtual bool IsFinished() const = 0;
// DEPRECATED
// Use RowKey() instead.
virtual const std::string& RowName() = 0;
// Use SetTimeRange(ts, ts) instead.
virtual void SetTimestamp(int64_t ts) = 0;
virtual int64_t GetTimestamp() = 0;
// Use new ToMap(TRow* rowmap) instead.
typedef std::map< std::string, std::map<int64_t, std::string> > Map;
virtual void ToMap(Map* rowmap) = 0;
// Use 'Family() + ":" + Qualifier()' instead.
virtual std::string ColumnName() = 0;
virtual int64_t ValueInt64() = 0;
virtual void SetAsync() = 0;
virtual uint32_t GetReadColumnNum() = 0;
RowReader() {};
virtual ~RowReader() {};
private:
RowReader(const RowReader&);
void operator=(const RowReader&);
};
} // namespace tera
#pragma GCC visibility pop
#endif // TERA_READER_H_
|
/*
* ACPI Hardware Error Device (PNP0C33) Driver
*
* Copyright (C) 2010, Intel Corp.
* Author: Huang Ying <ying.huang@intel.com>
*
* ACPI Hardware Error Device is used to report some hardware errors
* notified via SCI, mainly the corrected errors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/hed.h>
static struct acpi_device_id acpi_hed_ids[] = {
{"PNP0C33", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, acpi_hed_ids);
static acpi_handle hed_handle;
static BLOCKING_NOTIFIER_HEAD(acpi_hed_notify_list);
int register_acpi_hed_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&acpi_hed_notify_list, nb);
}
EXPORT_SYMBOL_GPL(register_acpi_hed_notifier);
void unregister_acpi_hed_notifier(struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&acpi_hed_notify_list, nb);
}
EXPORT_SYMBOL_GPL(unregister_acpi_hed_notifier);
/*
* SCI to report hardware error is forwarded to the listeners of HED,
* it is used by HEST Generic Hardware Error Source with notify type
* SCI.
*/
static void acpi_hed_notify(struct acpi_device *device, u32 event)
{
blocking_notifier_call_chain(&acpi_hed_notify_list, 0, NULL);
}
static int __devinit acpi_hed_add(struct acpi_device *device)
{
/* Only one hardware error device */
if (hed_handle)
return -EINVAL;
hed_handle = device->handle;
return 0;
}
static int __devexit acpi_hed_remove(struct acpi_device *device, int type)
{
hed_handle = NULL;
return 0;
}
static struct acpi_driver acpi_hed_driver = {
.name = "hardware_error_device",
.class = "hardware_error",
.ids = acpi_hed_ids,
.ops = {
.add = acpi_hed_add,
.remove = acpi_hed_remove,
.notify = acpi_hed_notify,
},
};
static int __init acpi_hed_init(void)
{
if (acpi_disabled)
return -ENODEV;
if (acpi_bus_register_driver(&acpi_hed_driver) < 0)
return -ENODEV;
return 0;
}
static void __exit acpi_hed_exit(void)
{
acpi_bus_unregister_driver(&acpi_hed_driver);
}
module_init(acpi_hed_init);
module_exit(acpi_hed_exit);
ACPI_MODULE_NAME("hed");
MODULE_AUTHOR("Huang Ying");
MODULE_DESCRIPTION("ACPI Hardware Error Device Driver");
MODULE_LICENSE("GPL");
|
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_init(void)
{
printk(KERN_INFO "Hello world!\n");
return 0;
}
static void __exit hello_cleanup(void)
{
printk(KERN_INFO "Cleaning up hellomod.\n");
}
module_init(hello_init);
module_exit(hello_cleanup);
MODULE_LICENSE("GPL");
|
/*
* xfrm4_mode_tunnel.c - Tunnel mode encapsulation for IPv4.
*
* Copyright (c) 2004-2006 Herbert Xu <herbert@gondor.apana.org.au>
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/stringify.h>
#include <net/dst.h>
#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
static inline void ipip_ecn_decapsulate(struct sk_buff *skb)
{
struct iphdr *outer_iph = skb->nh.iph;
struct iphdr *inner_iph = skb->h.ipiph;
if (INET_ECN_is_ce(outer_iph->tos))
IP_ECN_set_ce(inner_iph);
}
/* Add encapsulation header.
*
* The top IP header will be constructed per RFC 2401. The following fields
* in it shall be filled in by x->type->output:
* tot_len
* check
*
* On exit, skb->h will be set to the start of the payload to be processed
* by x->type->output and skb->nh will be set to the top IP header.
*/
static int xfrm4_tunnel_output(struct sk_buff *skb)
{
struct dst_entry *dst = skb->dst;
struct xfrm_state *x = dst->xfrm;
struct iphdr *iph, *top_iph;
int flags;
iph = skb->nh.iph;
skb->h.ipiph = iph;
skb->nh.raw = skb_push(skb, x->props.header_len);
top_iph = skb->nh.iph;
top_iph->ihl = 5;
top_iph->version = 4;
/* DS disclosed */
top_iph->tos = INET_ECN_encapsulate(iph->tos, iph->tos);
flags = x->props.flags;
if (flags & XFRM_STATE_NOECN)
IP_ECN_clear(top_iph);
top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
0 : (iph->frag_off & htons(IP_DF));
if (!top_iph->frag_off)
__ip_select_ident(top_iph, dst->child, 0);
top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);
top_iph->saddr = x->props.saddr.a4;
top_iph->daddr = x->id.daddr.a4;
top_iph->protocol = IPPROTO_IPIP;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
return 0;
}
static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
{
struct iphdr *iph = skb->nh.iph;
int err = -EINVAL;
if (iph->protocol != IPPROTO_IPIP)
goto out;
if (!pskb_may_pull(skb, sizeof(struct iphdr)))
goto out;
if (skb_cloned(skb) &&
(err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
goto out;
if (x->props.flags & XFRM_STATE_DECAP_DSCP)
ipv4_copy_dscp(iph, skb->h.ipiph);
if (!(x->props.flags & XFRM_STATE_NOECN))
ipip_ecn_decapsulate(skb);
skb->mac.raw = memmove(skb->data - skb->mac_len,
skb->mac.raw, skb->mac_len);
skb->nh.raw = skb->data;
err = 0;
out:
return err;
}
static struct xfrm_mode xfrm4_tunnel_mode = {
.input = xfrm4_tunnel_input,
.output = xfrm4_tunnel_output,
.owner = THIS_MODULE,
.encap = XFRM_MODE_TUNNEL,
};
static int __init xfrm4_tunnel_init(void)
{
return xfrm_register_mode(&xfrm4_tunnel_mode, AF_INET);
}
static void __exit xfrm4_tunnel_exit(void)
{
int err;
err = xfrm_unregister_mode(&xfrm4_tunnel_mode, AF_INET);
BUG_ON(err);
}
module_init(xfrm4_tunnel_init);
module_exit(xfrm4_tunnel_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_MODE(AF_INET, XFRM_MODE_TUNNEL);
|
/* { dg-require-effective-target arm_v8_1m_mve_ok } */
/* { dg-add-options arm_v8_1m_mve } */
/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
int16x8_t
foo (int16x8_t a, mve_pred16_t p)
{
return vshlq_x_n_s16 (a, 1, p);
}
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vshlt.s16" } } */
|
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" { target { ! ilp32 } } } } */
/* { dg-additional-options "-march=armv8.6-a+f64mm" } */
/* { dg-require-effective-target aarch64_asm_f64mm_ok } */
#include "test_sve_acle.h"
/*
** ld1ro_f32_base:
** ld1row z0\.s, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ld1ro_f32_base, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0),
z0 = svld1ro (p0, x0))
/*
** ld1ro_f32_index:
** ld1row z0\.s, p0/z, \[x0, x1, lsl 2\]
** ret
*/
TEST_LOAD (ld1ro_f32_index, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + x1),
z0 = svld1ro (p0, x0 + x1))
/*
** ld1ro_f32_1:
** add (x[0-9]+), x0, #?4
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_1, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + 1),
z0 = svld1ro (p0, x0 + 1))
/*
** ld1ro_f32_4:
** add (x[0-9]+), x0, #?16
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_4, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + 4),
z0 = svld1ro (p0, x0 + 4))
/*
** ld1ro_f32_64:
** add (x[0-9]+), x0, #?256
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_64, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + 64),
z0 = svld1ro (p0, x0 + 64))
/*
** ld1ro_f32_m1:
** sub (x[0-9]+), x0, #?4
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_m1, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 - 1),
z0 = svld1ro (p0, x0 - 1))
/*
** ld1ro_f32_m4:
** sub (x[0-9]+), x0, #?16
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_m4, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 - 4),
z0 = svld1ro (p0, x0 - 4))
/*
** ld1ro_f32_m72:
** sub (x[0-9]+), x0, #?288
** ld1row z0\.s, p0/z, \[\1\]
** ret
*/
TEST_LOAD (ld1ro_f32_m72, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 - 72),
z0 = svld1ro (p0, x0 - 72))
/*
** ld1ro_f32_8:
** ld1row z0\.s, p0/z, \[x0, #?32\]
** ret
*/
TEST_LOAD (ld1ro_f32_8, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + 8),
z0 = svld1ro (p0, x0 + 8))
/*
** ld1ro_f32_56:
** ld1row z0\.s, p0/z, \[x0, #?224\]
** ret
*/
TEST_LOAD (ld1ro_f32_56, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 + 56),
z0 = svld1ro (p0, x0 + 56))
/*
** ld1ro_f32_m8:
** ld1row z0\.s, p0/z, \[x0, #?-32\]
** ret
*/
TEST_LOAD (ld1ro_f32_m8, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 - 8),
z0 = svld1ro (p0, x0 - 8))
/*
** ld1ro_f32_m64:
** ld1row z0\.s, p0/z, \[x0, #?-256\]
** ret
*/
TEST_LOAD (ld1ro_f32_m64, svfloat32_t, float32_t,
z0 = svld1ro_f32 (p0, x0 - 64),
z0 = svld1ro (p0, x0 - 64))
|
/*
* Copyright (C) 2011 Martin Willi
* Copyright (C) 2011 revosec AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup main_mode main_mode
* @{ @ingroup tasks_v1
*/
#ifndef MAIN_MODE_H_
#define MAIN_MODE_H_
typedef struct main_mode_t main_mode_t;
#include <library.h>
#include <sa/ike_sa.h>
#include <sa/task.h>
/**
* IKEv1 main mode, establishes a mainmode including authentication.
*/
struct main_mode_t {
/**
* Implements the task_t interface
*/
task_t task;
};
/**
* Create a new main_mode task.
*
* @param ike_sa IKE_SA this task works for
* @param initiator TRUE if task initiated locally
* @return task to handle by the task_manager
*/
main_mode_t *main_mode_create(ike_sa_t *ike_sa, bool initiator);
#endif /** MAIN_MODE_H_ @}*/
|
/**
* 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.
*/
#ifndef __FUSE_CONTEXT_HANDLE_H__
#define __FUSE_CONTEXT_HANDLE_H__
#include <hdfs.h>
#include <stddef.h>
#include <sys/types.h>
//
// Structure to store fuse_dfs specific data
// this will be created and passed to fuse at startup
// and fuse will pass it back to us via the context function
// on every operation.
//
typedef struct dfs_context_struct {
int debug;
char *nn_hostname;
int nn_port;
hdfsFS fs;
int read_only;
int usetrash;
int direct_io;
char **protectedpaths;
size_t rdbuffer_size;
} dfs_context;
#endif
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2014 Couchbase, 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.
*/
#include "simplestring.h"
#include "assert.h"
static void ensure_cstr(lcb_string *str);
int lcb_string_init(lcb_string *str)
{
str->base = NULL;
str->nalloc = 0;
str->nused = 0;
return 0;
}
void lcb_string_release(lcb_string *str)
{
if (str->base == NULL) {
return;
}
free(str->base);
memset(str, 0, sizeof(*str));
}
void lcb_string_clear(lcb_string *str)
{
str->nused = 0;
if (str->nalloc) {
ensure_cstr(str);
}
}
void lcb_string_added(lcb_string *str, lcb_size_t nused)
{
str->nused += nused;
lcb_assert(str->nused <= str->nalloc);
ensure_cstr(str);
}
int lcb_string_reserve(lcb_string *str, lcb_size_t size)
{
lcb_size_t newalloc;
char *newbuf;
/** Set size to one greater, for the terminating NUL */
size++;
if (!size) {
return -1;
}
if (str->nalloc - str->nused >= size) {
return 0;
}
newalloc = str->nalloc;
if (!newalloc) {
newalloc = 1;
}
while (newalloc - str->nused < size) {
if (newalloc * 2 < newalloc) {
return -1;
}
newalloc *= 2;
}
newbuf = realloc(str->base, newalloc);
if (newbuf == NULL) {
return -1;
}
str->base = newbuf;
str->nalloc = newalloc;
return 0;
}
static void ensure_cstr(lcb_string *str)
{
str->base[str->nused] = '\0';
}
int lcb_string_append(lcb_string *str, const void *data, lcb_size_t size)
{
if (lcb_string_reserve(str, size)) {
return -1;
}
memcpy(str->base + str->nused, data, size);
str->nused += size;
ensure_cstr(str);
return 0;
}
int lcb_string_appendz(lcb_string *str, const char *s)
{
return lcb_string_append(str, s, strlen(s));
}
int lcb_string_appendv(lcb_string *str, ...)
{
va_list ap;
va_start(ap, str);
while (1) {
size_t len;
int rc;
const char *ptr;
if ((ptr = va_arg(ap, const char *)) == NULL) {
return 0;
}
len = va_arg(ap, size_t);
if (len == (size_t)-1) {
len = strlen(ptr);
}
rc = lcb_string_append(str, ptr, len);
if (rc != 0) {
return -1;
}
}
return 0;
}
int lcb_string_rbappend(lcb_string *str, ringbuffer_t *rb, int rbadvance)
{
lcb_size_t expected, nw;
expected = rb->nbytes;
if (!expected) {
return 0;
}
if (lcb_string_reserve(str, expected)) {
return -1;
}
nw = ringbuffer_peek(rb, lcb_string_tail(str), expected);
if (nw != expected) {
return -1;
}
if (rbadvance) {
ringbuffer_consumed(rb, nw);
}
lcb_string_added(str, nw);
return 0;
}
void lcb_string_erase_end(lcb_string *str, lcb_size_t to_remove)
{
lcb_assert(to_remove <= str->nused);
str->nused -= to_remove;
ensure_cstr(str);
}
void lcb_string_erase_beginning(lcb_string *str, lcb_size_t to_remove)
{
lcb_assert(to_remove <= str->nused);
if (!to_remove) {
str->nused = 0;
return;
}
memmove(str->base, str->base + to_remove, str->nused - to_remove);
str->nused -= to_remove;
ensure_cstr(str);
}
void lcb_string_transfer(lcb_string *from, lcb_string *to)
{
lcb_assert(to->base == NULL);
*to = *from;
memset(from, 0, sizeof(*from));
}
|
#ifndef _WIN32
#include <stdlib.h>
#endif
/* _GSSAPI_ALLOC_C: Includes C sources for this module */
#define _GSSAPI_ALLOC_C
#include "gssapi_alloc.h"
|
/*
Author: Vytautas Vislavicius
Extention of Generic Flow (https://arxiv.org/abs/1312.3572 by A. Bilandzic et al.)
Class steers the initialization and calculation of n-particle correlations. Uses recursive function, all terms are calculated only once.
Latest version includes the calculation of any number of gaps and any combination of harmonics (including eg symmetric cumulants, etc.)
If used, modified, or distributed, please aknowledge the author of this code.
*/
#ifndef AliGFW__H
#define AliGFW__H
#include "AliGFWCumulant.h"
#include <vector>
#include <utility>
#include <algorithm>
#include "TString.h"
#include "TObjArray.h"
using std::vector;
class AliGFW {
public:
struct Region {
Int_t Nhar, Npar, NpT;
vector<Int_t> NparVec;
Double_t EtaMin=-999;
Double_t EtaMax=-999;
Int_t BitMask=1;
TString rName="";
bool operator<(const Region& a) const {
return EtaMin < a.EtaMin;
};
Region operator=(const Region& a) {
Nhar=a.Nhar;
Npar=a.Npar;
NparVec=a.NparVec;
NpT =a.NpT;
EtaMin=a.EtaMin;
EtaMax=a.EtaMax;
rName=a.rName;
BitMask=a.BitMask;
return *this;
};
void PrintStructure() {printf("%s: eta [%f.. %f].",rName.Data(),EtaMin,EtaMax); };
};
struct CorrConfig {
vector<vector<Int_t>> Regs {};
vector<vector<Int_t>> Hars {};
vector<Int_t> Overlap;
/*vector<Int_t> Regs {};
vector<Int_t> Hars {};
vector<Int_t> Regs2 {};
vector<Int_t> Hars2 {};
Int_t Overlap1=-1;
Int_t Overlap2=-1;*/
Bool_t pTDif=kFALSE;
TString Head="";
};
AliGFW();
~AliGFW();
vector<Region> fRegions;
vector<AliGFWCumulant> fCumulants;
vector<Int_t> fEmptyInt;
void AddRegion(TString refName, Int_t lNhar, Int_t lNpar, Double_t lEtaMin, Double_t lEtaMax, Int_t lNpT=1, Int_t BitMask=1);
void AddRegion(TString refName, Int_t lNhar, Int_t *lNparVec, Double_t lEtaMin, Double_t lEtaMax, Int_t lNpT=1, Int_t BitMask=1);
Int_t CreateRegions();
void Fill(Double_t eta, Int_t ptin, Double_t phi, Double_t weight, Int_t mask, Double_t secondWeight=-1);
void Clear();// { for(auto ptr = fCumulants.begin(); ptr!=fCumulants.end(); ++ptr) ptr->ResetQs(); };
AliGFWCumulant GetCumulant(Int_t index) { return fCumulants.at(index); };
TComplex Calculate(TString config, Bool_t SetHarmsToZero=kFALSE);
CorrConfig GetCorrelatorConfig(TString config, TString head = "", Bool_t ptdif=kFALSE);
TComplex Calculate(CorrConfig corconf, Int_t ptbin, Bool_t SetHarmsToZero, Bool_t DisableOverlap=kFALSE);
private:
Bool_t fInitialized;
void SplitRegions();
AliGFWCumulant fEmptyCumulant;
TComplex TwoRec(Int_t n1, Int_t n2, Int_t p1, Int_t p2, Int_t ptbin, AliGFWCumulant*, AliGFWCumulant*, AliGFWCumulant*);
TComplex RecursiveCorr(AliGFWCumulant *qpoi, AliGFWCumulant *qref, AliGFWCumulant *qol, Int_t ptbin, vector<Int_t> &hars, vector<Int_t> &pows); //POI, Ref. flow, overlapping region
TComplex RecursiveCorr(AliGFWCumulant *qpoi, AliGFWCumulant *qref, AliGFWCumulant *qol, Int_t ptbin, vector<Int_t> &hars); //POI, Ref. flow, overlapping region
//Deprecated and not used (for now):
void AddRegion(Region inreg) { fRegions.push_back(inreg); };
Region GetRegion(Int_t index) { return fRegions.at(index); };
Int_t FindRegionByName(TString refName);
vector<TString> fCalculatedNames;
vector<TComplex> fCalculatedQs;
Int_t FindCalculated(TString identifier);
//Calculateing functions:
TComplex Calculate(Int_t poi, Int_t ref, vector<Int_t> hars, Int_t ptbin=0); //For differential, need POI and reference
TComplex Calculate(Int_t poi, vector<Int_t> hars); //For integrated case
//Process one string (= one region)
TComplex CalculateSingle(TString config);
Bool_t SetHarmonicsToZero(TString &instr);
};
#endif
|
/****************************************************************/
/* stripsh.c
/* strip off section headers from a.out
/*
/* (c) T.Matsui, 1986
/****************************************************************/
#include <signal.h>
#include <ctype.h>
#include <sys/file.h>
#include <fcntl.h>
#include <unistd.h>
#include <libelf.h>
#define min(a,b) (a<b)?a:b
main(argc,argv)
int argc;
char *argv[];
{ int infd, outfd;
int count, size, sh_off;
int zero=0;
char buf[8192];
infd=open(argv[1], O_RDONLY);
outfd=open(argv[2], O_WRONLY | O_CREAT,0755);
read(infd, buf, 0x20);
write(outfd,buf,0x20);
read(infd, &count, 4);
write(outfd, &zero, 4);
count=count-0x24;
printf("%x\n", count);
while (count>0) {
size=read(infd,buf,min(8192,count));
count-=size;
write(outfd, buf, size);}
close(infd); close(outfd);
}
|
// 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 CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_KIDS_MANAGEMENT_API_H_
#define CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_KIDS_MANAGEMENT_API_H_
#include <string>
class GURL;
namespace kids_management_api {
GURL GetBaseURL();
GURL GetURL(const std::string& path);
} // namespace kids_management_api
#endif // CHROME_BROWSER_SUPERVISED_USER_CHILD_ACCOUNTS_KIDS_MANAGEMENT_API_H_
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/modal/ModalHostViewComponentDescriptor.h>
#include <react/renderer/components/root/RootComponentDescriptor.h>
#include <react/renderer/components/scrollview/ScrollViewComponentDescriptor.h>
#include <react/renderer/components/text/ParagraphComponentDescriptor.h>
#include <react/renderer/components/text/RawTextComponentDescriptor.h>
#include <react/renderer/components/text/TextComponentDescriptor.h>
#include <react/renderer/components/view/ViewComponentDescriptor.h>
#include <react/renderer/element/ComponentBuilder.h>
namespace facebook {
namespace react {
inline ComponentBuilder simpleComponentBuilder() {
ComponentDescriptorProviderRegistry componentDescriptorProviderRegistry{};
auto eventDispatcher = EventDispatcher::Shared{};
auto componentDescriptorRegistry =
componentDescriptorProviderRegistry.createComponentDescriptorRegistry(
ComponentDescriptorParameters{eventDispatcher, nullptr, nullptr});
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<RootComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<ViewComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<ScrollViewComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<ParagraphComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<TextComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<RawTextComponentDescriptor>());
componentDescriptorProviderRegistry.add(
concreteComponentDescriptorProvider<ModalHostViewComponentDescriptor>());
return ComponentBuilder{componentDescriptorRegistry};
}
} // namespace react
} // namespace facebook
|
/***********************************************************************
Copyright (c) 2006-2011, Skype Limited. 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 Internet Society, IETF or IETF Trust, nor the
names of specific 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.
***********************************************************************/
#ifdef OPUS_HAVE_CONFIG_H
#include "opus_config.h"
#endif
#include "SigProc_FIX.h"
#include "resampler_private.h"
/* Upsample by a factor 2, high quality */
/* Uses 2nd order allpass filters for the 2x upsampling, followed by a */
/* notch filter just above Nyquist. */
void silk_resampler_private_up2_HQ(
opus_int32 *S, /* I/O Resampler state [ 6 ] */
opus_int16 *out, /* O Output signal [ 2 * len ] */
const opus_int16 *in, /* I Input signal [ len ] */
opus_int32 len /* I Number of input samples */
)
{
opus_int32 k;
opus_int32 in32, out32_1, out32_2, Y, X;
silk_assert( silk_resampler_up2_hq_0[ 0 ] > 0 );
silk_assert( silk_resampler_up2_hq_0[ 1 ] > 0 );
silk_assert( silk_resampler_up2_hq_0[ 2 ] < 0 );
silk_assert( silk_resampler_up2_hq_1[ 0 ] > 0 );
silk_assert( silk_resampler_up2_hq_1[ 1 ] > 0 );
silk_assert( silk_resampler_up2_hq_1[ 2 ] < 0 );
/* Internal variables and state are in Q10 format */
for( k = 0; k < len; k++ ) {
/* Convert to Q10 */
in32 = silk_LSHIFT( (opus_int32)in[ k ], 10 );
/* First all-pass section for even output sample */
Y = silk_SUB32( in32, S[ 0 ] );
X = silk_SMULWB( Y, silk_resampler_up2_hq_0[ 0 ] );
out32_1 = silk_ADD32( S[ 0 ], X );
S[ 0 ] = silk_ADD32( in32, X );
/* Second all-pass section for even output sample */
Y = silk_SUB32( out32_1, S[ 1 ] );
X = silk_SMULWB( Y, silk_resampler_up2_hq_0[ 1 ] );
out32_2 = silk_ADD32( S[ 1 ], X );
S[ 1 ] = silk_ADD32( out32_1, X );
/* Third all-pass section for even output sample */
Y = silk_SUB32( out32_2, S[ 2 ] );
X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_0[ 2 ] );
out32_1 = silk_ADD32( S[ 2 ], X );
S[ 2 ] = silk_ADD32( out32_2, X );
/* Apply gain in Q15, convert back to int16 and store to output */
out[ 2 * k ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( out32_1, 10 ) );
/* First all-pass section for odd output sample */
Y = silk_SUB32( in32, S[ 3 ] );
X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 0 ] );
out32_1 = silk_ADD32( S[ 3 ], X );
S[ 3 ] = silk_ADD32( in32, X );
/* Second all-pass section for odd output sample */
Y = silk_SUB32( out32_1, S[ 4 ] );
X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 1 ] );
out32_2 = silk_ADD32( S[ 4 ], X );
S[ 4 ] = silk_ADD32( out32_1, X );
/* Third all-pass section for odd output sample */
Y = silk_SUB32( out32_2, S[ 5 ] );
X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_1[ 2 ] );
out32_1 = silk_ADD32( S[ 5 ], X );
S[ 5 ] = silk_ADD32( out32_2, X );
/* Apply gain in Q15, convert back to int16 and store to output */
out[ 2 * k + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( out32_1, 10 ) );
}
}
void silk_resampler_private_up2_HQ_wrapper(
void *SS, /* I/O Resampler state (unused) */
opus_int16 *out, /* O Output signal [ 2 * len ] */
const opus_int16 *in, /* I Input signal [ len ] */
opus_int32 len /* I Number of input samples */
)
{
silk_resampler_state_struct *S = (silk_resampler_state_struct *)SS;
silk_resampler_private_up2_HQ( S->sIIR, out, in, len );
}
|
/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fpic -ftls-model=local-dynamic" } */
/* { dg-require-effective-target tls } */
/* { dg-skip-if "" { arc*-*-elf* } } */
/* Check if tls local dynamic is correctly generated. */
extern __thread int e2;
int *ae2 (void)
{
return &e2;
}
/* { dg-final { scan-assembler "add r0,pcl,@.tbss@tlsgd" } } */
/* { dg-final { scan-assembler "bl @__tls_get_addr@plt" } } */
/* { dg-final { scan-assembler "add_s r0,r0,@e2@dtpoff" } } */
|
/* Copyright (C) 1992,93,94,95,96,97,98,99 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 Library General Public License as
published by the Free Software Foundation; either version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is
done in software; there is no need to change the state of the terminal
hardware. */
#ifndef TCSASOFT
#define TCSASOFT 0
#endif
#define PWD_BUFFER_SIZE 256
char *
getpass (prompt)
const char *prompt;
{
FILE *in, *out;
struct termios s, t;
int tty_changed;
static char buf[PWD_BUFFER_SIZE];
int nread;
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */
in = fopen ("/dev/tty", "r+");
if (in == NULL)
{
in = stdin;
out = stderr;
}
else
out = in;
/* Turn echoing off if it is on now. */
if (tcgetattr (fileno (in), &t) == 0)
{
/* Save the old one. */
s = t;
/* Tricky, tricky. */
t.c_lflag &= ~(ECHO|ISIG);
tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
if (in != stdin) {
/* Disable buffering for read/write FILE to prevent problems with
* fseek and buffering for read/write auto-transitioning. */
setvbuf(in, NULL, _IONBF, 0);
}
}
else
tty_changed = 0;
/* Write the prompt. */
fputs(prompt, out);
fflush(out);
/* Read the password. */
fgets (buf, PWD_BUFFER_SIZE-1, in);
if (buf != NULL)
{
nread = strlen(buf);
if (nread < 0)
buf[0] = '\0';
else if (buf[nread - 1] == '\n')
{
/* Remove the newline. */
buf[nread - 1] = '\0';
if (tty_changed)
/* Write the newline that was not echoed. */
putc('\n', out);
}
}
/* Restore the original setting. */
if (tty_changed) {
(void) tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &s);
}
if (in != stdin)
/* We opened the terminal; now close it. */
fclose (in);
return buf;
}
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* opcodes-virt.h: Opcode definitions for the ARM virtualization extensions
* Copyright (C) 2012 Linaro Limited
*/
#ifndef __ASM_ARM_OPCODES_VIRT_H
#define __ASM_ARM_OPCODES_VIRT_H
#include <asm/opcodes.h>
#define __HVC(imm16) __inst_arm_thumb32( \
0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F), \
0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) & 0x0FFF) \
)
#define __ERET __inst_arm_thumb32( \
0xE160006E, \
0xF3DE8F00 \
)
#define __MSR_ELR_HYP(regnum) __inst_arm_thumb32( \
0xE12EF300 | regnum, \
0xF3808E30 | (regnum << 16) \
)
#endif /* ! __ASM_ARM_OPCODES_VIRT_H */
|
#include <linux/apq8064.h>
#ifdef CONFIG_LEDS_LM3533
#include <linux/kernel.h>
#include <linux/gpio.h>
#include "board-8064.h"
#include <linux/leds-lm3533_ng.h>
#define LM3533_HWEN_PM_GPIO 26
#define LM3533_HWEN_GPIO PM8921_GPIO_PM_TO_SYS(LM3533_HWEN_PM_GPIO)
#define ALS_VREG_ID "lm3533_als"
static struct regulator *lm3533_als_vreg;
static int lm3533_setup(struct device *dev)
{
int rc = gpio_request(LM3533_HWEN_GPIO, "lm3533_hwen");
if (rc) {
dev_err(dev, "failed to request gpio %d\n", LM3533_HWEN_GPIO);
goto err_gpio;
}
lm3533_als_vreg = regulator_get(dev, ALS_VREG_ID);
if (IS_ERR_OR_NULL(lm3533_als_vreg)) {
dev_err(dev, "failed to get vreg '%s'\n", ALS_VREG_ID);
rc = -ENODEV;
goto err_no_vreg;
}
rc = regulator_set_voltage(lm3533_als_vreg, 2850000, 2850000);
if (rc) {
dev_err(dev, "failed to set voltage '%s'\n", ALS_VREG_ID);
goto err_set_volt;
}
return 0;
err_set_volt:
regulator_put(lm3533_als_vreg);
lm3533_als_vreg = NULL;
err_no_vreg:
gpio_free(LM3533_HWEN_GPIO);
err_gpio:
return rc;
}
static void lm3533_teardown(struct device *dev)
{
if (!IS_ERR_OR_NULL(lm3533_als_vreg)) {
regulator_put(lm3533_als_vreg);
lm3533_als_vreg = NULL;
}
gpio_free(LM3533_HWEN_GPIO);
return;
}
static int lm3533_power_on(struct device *dev)
{
gpio_set_value_cansleep(LM3533_HWEN_GPIO, 1);
return 0;
}
static int lm3533_power_off(struct device *dev)
{
gpio_set_value_cansleep(LM3533_HWEN_GPIO, 0);
return 0;
}
static int lm3533_als_power_on(struct device *dev)
{
int rc = regulator_enable(lm3533_als_vreg);
if (rc && regulator_is_enabled(lm3533_als_vreg) <= 0) {
dev_err(dev, "failed to enable vreg '%s\n", ALS_VREG_ID);
return rc;
}
return 0;
}
static int lm3533_als_power_off(struct device *dev)
{
int rc = regulator_disable(lm3533_als_vreg);
if (rc && regulator_is_enabled(lm3533_als_vreg) != 0) {
dev_err(dev, "failed to disable vreg '%s\n", ALS_VREG_ID);
return rc;
}
return 0;
}
static struct lm3533_startup_brightenss lm3533_startup_brightnesses[] = {
[0] = {"lm3533-lcd-bl", 255},
[1] = {"lm3533-red", 0},
[2] = { NULL, 0} };
struct lm3533_platform_data lm3533_pdata = {
.b_cnf = {
[LM3533_CBNKA] = {
.pwm = 0, /* TDOD: set 0x3f when DBC is present */
.ctl = LM3533_HVA_MAP_LIN | LM3533_HVA_BR_CTL,
.fsc = I_UA_TO_FSC(20200),
.iname = "lm3533-lcd-bl",
},
[LM3533_CBNKB] = {
.pwm = 0, /* TDOD: set 0x3f when DBC is present */
.ctl = LM3533_HVB_MAP_LIN | LM3533_HVB_BR_CTL,
.fsc = I_UA_TO_FSC(0),
.iname = "not-connected",
},
[LM3533_CBNKC] = {
.pwm = 0,
.ctl = LM3533_LV_MAP_LIN | LM3533_LV_BR_CTL,
/* 1ma in spec, but this is not possible */
.fsc = I_UA_TO_FSC(5000),
.iname = "lm3533-red",
},
[LM3533_CBNKD] = {
.pwm = 0,
.ctl = LM3533_LV_MAP_LIN | LM3533_LV_BR_CTL,
/* 1ma in spec, but this is not possible */
.fsc = I_UA_TO_FSC(5000),
.iname = "lm3533-green",
},
[LM3533_CBNKE] = {
.pwm = 0,
.ctl = LM3533_LV_MAP_LIN | LM3533_LV_BR_CTL,
/* 1ma in spec, but this is not possible */
.fsc = I_UA_TO_FSC(5000),
.iname = "lm3533-blue",
},
[LM3533_CBNKF] = {
.pwm = 0,
.ctl = LM3533_LV_MAP_LIN | LM3533_LV_BR_CTL,
.fsc = I_UA_TO_FSC(0),
.iname = "not-connected",
},
},
.l_cnf = {
[LM3533_HVLED1] = {
.connected = true,
.cpout = true,
.bank = LM3533_CBNKA,
},
[LM3533_HVLED2] = {
.connected = true,
.cpout = true,
.bank = LM3533_CBNKA,
},
[LM3533_LVLED1] = {
.connected = true,
.cpout = true,
.bank = LM3533_CBNKC,
},
[LM3533_LVLED2] = {
.connected = true,
.cpout = true,
.bank = LM3533_CBNKD,
},
[LM3533_LVLED3] = {
.connected = true,
.cpout = true,
.bank = LM3533_CBNKE,
},
[LM3533_LVLED4] = {
.connected = false,
.cpout = true,
.bank = LM3533_CBNKF,
},
[LM3533_LVLED5] = {
.connected = false,
.cpout = true,
.bank = LM3533_CBNKF,
},
},
.ovp_boost_pwm = LM3533_BOOST_500KHZ | LM3533_OVP_24V | LM3533_PWM_HIGH,
.led_fault = LM3533_OPEN_DISABLED | LM3533_SHORT_DISABLED,
.setup = lm3533_setup,
.teardown = lm3533_teardown,
.power_on = lm3533_power_on,
.power_off = lm3533_power_off,
.als_on = lm3533_als_power_on,
.als_off = lm3533_als_power_off,
.als_control = LM3533_ALS_143360,
.als_input_current = ALS_CUR_UA_TO_REG(0),
.startup_brightness = lm3533_startup_brightnesses,
};
int usb_phy_init_seq_host[] = {
0x74, 0x80, /* PARAMETER_OVERRIDE_A */
0x30, 0x81, /* PARAMETER_OVERRIDE_B */
0x30, 0x82, /* PARAMETER_OVERRIDE_C */
0x33, 0x83, /* PARAMETER_OVERRIDE_D */
-1
};
#define VBUS_BIT 0x04
static int __init startup_rgb(char *str)
{
int vbus;
if (get_option(&str, &vbus)) {
if (vbus & VBUS_BIT)
lm3533_startup_brightnesses[1].brightness = 50;
return 0;
}
return -EINVAL;
}
early_param("startup", startup_rgb);
#endif
struct apq8064_data apq8064_data = {
.v_hs_max = 2450,
.hs_detect_extn_cable = true,
};
|
/* long double square root in software floating-point emulation.
Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdlib.h>
#include <soft-fp.h>
#include <quad.h>
long double
__ieee754_sqrtl (const long double a)
{
FP_DECL_EX;
FP_DECL_Q(A); FP_DECL_Q(C);
long double c;
long _round = 4; /* dynamic rounding */
FP_INIT_ROUNDMODE;
FP_UNPACK_Q(A, a);
FP_SQRT_Q(C, A);
FP_PACK_Q(c, C);
FP_HANDLE_EXCEPTIONS;
return c;
}
|
#pragma once
/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string>
#include "../Engine/State.h"
#include "../Savegame/Production.h"
namespace OpenXcom
{
class TextButton;
class Window;
class Text;
class Base;
class GeoscapeState;
/**
* Window used to notify the player when
* a production is completed.
*/
class ProductionCompleteState : public State
{
private:
Base *_base;
GeoscapeState *_state;
TextButton *_btnOk, *_btnGotoBase;
Window *_window;
Text *_txtMessage;
productionProgress_e _endType;
public:
/// Creates the Production Complete state.
ProductionCompleteState(Base *base, const std::string &item, GeoscapeState *state, productionProgress_e endType = PROGRESS_COMPLETE);
/// Cleans up the Production Complete state.
~ProductionCompleteState();
/// Handler for clicking the OK button.
void btnOkClick(Action *action);
/// Handler for clicking the Go To Base button.
void btnGotoBaseClick(Action *action);
};
}
|
/* -*- c++ -*- */
/*
* Copyright 2004,2007,2011,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
#include <gnuradio/digital/api.h>
#include <gnuradio/block.h>
namespace gr {
namespace digital {
/*!
* \brief This block takes care of receiving M-PSK modulated
* signals through phase, frequency, and symbol synchronization.
* \ingroup synchronizers_blk
*
* \details
* It performs carrier frequency and phase locking as well as
* symbol timing recovery. It works with (D)BPSK, (D)QPSK, and
* (D)8PSK as tested currently. It should also work for OQPSK and
* PI/4 DQPSK.
*
* The phase and frequency synchronization are based on a Costas
* loop that finds the error of the incoming signal point compared
* to its nearest constellation point. The frequency and phase of
* the NCO are updated according to this error. There are
* optimized phase error detectors for BPSK and QPSK, but 8PSK is
* done using a brute-force computation of the constellation
* points to find the minimum.
*
* The symbol synchronization is done using a modified Mueller and
* Muller circuit from the paper:
*
* "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller
* and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22
* June 1995, pp. 1032 - 1033."
*
* This circuit interpolates the downconverted sample (using the
* NCO developed by the Costas loop) every mu samples, then it
* finds the sampling error based on this and the past symbols and
* the decision made on the samples. Like the phase error
* detector, there are optimized decision algorithms for BPSK and
* QPKS, but 8PSK uses another brute force computation against all
* possible symbols. The modifications to the M&M used here reduce
* self-noise.
*
*/
class DIGITAL_API mpsk_receiver_cc : virtual public block
{
public:
// gr::digital::mpsk_receiver_cc::sptr
typedef boost::shared_ptr<mpsk_receiver_cc> sptr;
/*!
* \brief Make a M-PSK receiver block.
*
* \param M modulation order of the M-PSK modulation
* \param theta any constant phase rotation from the real axis of the constellation
* \param loop_bw Loop bandwidth to set gains of phase/freq tracking loop
* \param fmin minimum normalized frequency value the loop can achieve
* \param fmax maximum normalized frequency value the loop can achieve
* \param mu initial parameter for the interpolator [0,1]
* \param gain_mu gain parameter of the M&M error signal to adjust mu (~0.05)
* \param omega initial value for the number of symbols between samples (~number of samples/symbol)
* \param gain_omega gain parameter to adjust omega based on the error (~omega^2/4)
* \param omega_rel sets the maximum (omega*(1+omega_rel)) and minimum (omega*(1+omega_rel)) omega (~0.005)
*
* The constructor also chooses which phase detector and
* decision maker to use in the work loop based on the value of
* M.
*/
static sptr make(unsigned int M, float theta,
float loop_bw,
float fmin, float fmax,
float mu, float gain_mu,
float omega, float gain_omega, float omega_rel);
//! Returns the modulation order (M) currently set
virtual float modulation_order() const = 0;
//! Returns current value of theta
virtual float theta() const = 0;
//! Returns current value of mu
virtual float mu() const = 0;
//! Returns current value of omega
virtual float omega() const = 0;
//! Returns mu gain factor
virtual float gain_mu() const = 0;
//! Returns omega gain factor
virtual float gain_omega() const = 0;
//! Returns the relative omega limit
virtual float gain_omega_rel() const = 0;
//! Sets the modulation order (M) currently
virtual void set_modulation_order(unsigned int M) = 0;
//! Sets value of theta
virtual void set_theta(float theta) = 0;
//! Sets value of mu
virtual void set_mu(float mu) = 0;
//! Sets value of omega and its min and max values
virtual void set_omega(float omega) = 0;
//! Sets value for mu gain factor
virtual void set_gain_mu(float gain_mu) = 0;
//! Sets value for omega gain factor
virtual void set_gain_omega(float gain_omega) = 0;
//! Sets the relative omega limit and resets omega min/max values
virtual void set_gain_omega_rel(float omega_rel) = 0;
};
} /* namespace digital */
} /* namespace gr */
#endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H */
|
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file hal_dac_lld.c
* @brief PLATFORM DAC subsystem low level driver source.
*
* @addtogroup DAC
* @{
*/
#include "hal.h"
#if (HAL_USE_DAC == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/** @brief DAC1 driver identifier.*/
#if (PLATFORM_DAC_USE_DAC1 == TRUE) || defined(__DOXYGEN__)
DACDriver DACD1;
#endif
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/**
* @brief Low level DAC driver initialization.
*
* @notapi
*/
void dac_lld_init(void) {
#if PLATFORM_DAC_USE_DAC1 == TRUE
dacObjectInit(&DACD1);
#endif
}
/**
* @brief Configures and activates the DAC peripheral.
*
* @param[in] dacp pointer to the @p DACDriver object
*
* @notapi
*/
void dac_lld_start(DACDriver *dacp) {
/* If the driver is in DAC_STOP state then a full initialization is
required.*/
if (dacp->state == DAC_STOP) {
/* Enabling the clock source.*/
#if PLATFORM_DAC_USE_DAC1 == TRUE
if (&DACD1 == dacp) {
}
#endif
}
}
/**
* @brief Deactivates the DAC peripheral.
*
* @param[in] dacp pointer to the @p DACDriver object
*
* @notapi
*/
void dac_lld_stop(DACDriver *dacp) {
/* If in ready state then disables the DAC clock.*/
if (dacp->state == DAC_READY) {
/* Disabling DAC.*/
dacp->params->dac->CR &= dacp->params->regmask;
#if PLATFORM_DAC_USE_DAC1 == TRUE
if (&DACD1 == dacp) {
}
#endif
}
}
/**
* @brief Outputs a value directly on a DAC channel.
*
* @param[in] dacp pointer to the @p DACDriver object
* @param[in] channel DAC channel number
* @param[in] sample value to be output
*
* @api
*/
void dac_lld_put_channel(DACDriver *dacp,
dacchannel_t channel,
dacsample_t sample) {
(void)dacp;
(void)channel;
(void)sample;
}
/**
* @brief Starts a DAC conversion.
* @details Starts an asynchronous conversion operation.
* @note In @p DAC_DHRM_8BIT_RIGHT mode the parameters passed to the
* callback are wrong because two samples are packed in a single
* dacsample_t element. This will not be corrected, do not rely
* on those parameters.
* @note In @p DAC_DHRM_8BIT_RIGHT_DUAL mode two samples are treated
* as a single 16 bits sample and packed into a single dacsample_t
* element. The num_channels must be set to one in the group
* conversion configuration structure.
*
* @param[in] dacp pointer to the @p DACDriver object
*
* @notapi
*/
void dac_lld_start_conversion(DACDriver *dacp) {
(void)dacp;
}
/**
* @brief Stops an ongoing conversion.
* @details This function stops the currently ongoing conversion and returns
* the driver in the @p DAC_READY state. If there was no conversion
* being processed then the function does nothing.
*
* @param[in] dacp pointer to the @p DACDriver object
*
* @iclass
*/
void dac_lld_stop_conversion(DACDriver *dacp) {
(void)dacp;
}
#endif /* HAL_USE_DAC == TRUE */
/** @} */
|
/*-------------------------------------------------------------------------
*
* path.h
*
*
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2010-2012 Postgres-XC Development Group
*
* $PostgreSQL$
*
*-------------------------------------------------------------------------
*/
#ifndef _PATH_H
#define _PATH_H
#include "gtm/gtm_c.h"
extern void canonicalize_path(char *path);
extern char *make_absolute_path(const char *path);
extern void get_parent_directory(char *path);
extern void join_path_components(char *ret_path, const char *head, const char *tail);
#endif
|
/*
* Copyright (C) Koen Zandberg <koen@bergzand.net>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_shell_commands
* @{
*
* @file
* @brief Shell commands for displaying neighbor statistics
*
* @author Koen Zandberg <koen@bergzand.net>
* @author Benjamin Valentin <benpicco@beuth-hochschule.de>
*
* @}
*/
#include <stdio.h>
#include "net/gnrc/netif.h"
#include "net/netstats.h"
#include "net/netstats/neighbor.h"
static void _print_neighbors(netif_t *dev)
{
netstats_nb_t *stats = &dev->neighbors.pstats[0];
unsigned header_len = 0;
char l2addr_str[3 * L2UTIL_ADDR_MAX_LEN];
puts("Neighbor link layer stats:");
header_len += printf("L2 address fresh");
if (IS_USED(MODULE_NETSTATS_NEIGHBOR_ETX)) {
header_len += printf(" etx");
}
if (IS_USED(MODULE_NETSTATS_NEIGHBOR_COUNT)) {
header_len += printf(" sent received");
}
if (IS_USED(MODULE_NETSTATS_NEIGHBOR_RSSI)) {
header_len += printf(" rssi ");
}
if (IS_USED(MODULE_NETSTATS_NEIGHBOR_LQI)) {
header_len += printf(" lqi");
}
if (IS_USED(MODULE_NETSTATS_NEIGHBOR_TX_TIME)) {
header_len += printf(" avg tx time");
}
printf("\n");
while (header_len--) {
printf("-");
}
printf("\n");
for (unsigned i = 0; i < NETSTATS_NB_SIZE; ++i) {
netstats_nb_t *entry = &stats[i];
if (entry->l2_addr_len == 0) {
continue;
}
printf("%-24s ",
gnrc_netif_addr_to_str(entry->l2_addr, entry->l2_addr_len, l2addr_str));
if (netstats_nb_isfresh(dev, entry)) {
printf("%5u", (unsigned)entry->freshness);
} else {
printf("STALE");
}
#if IS_USED(MODULE_NETSTATS_NEIGHBOR_ETX)
printf(" %3u%%", (100 * entry->etx) / NETSTATS_NB_ETX_DIVISOR);
#endif
#if IS_USED(MODULE_NETSTATS_NEIGHBOR_COUNT)
printf(" %4"PRIu16" %8"PRIu16, entry->tx_count, entry->rx_count);
#endif
#if IS_USED(MODULE_NETSTATS_NEIGHBOR_RSSI)
printf(" %4i dBm", (int8_t) entry->rssi);
#endif
#if IS_USED(MODULE_NETSTATS_NEIGHBOR_LQI)
printf(" %u", entry->lqi);
#endif
#if IS_USED(MODULE_NETSTATS_NEIGHBOR_TX_TIME)
printf(" %7"PRIu32" µs", entry->time_tx_avg);
#endif
printf("\n");
}
}
int _netstats_nb(int argc, char **argv)
{
(void) argc;
(void) argv;
gnrc_netif_t *netif = NULL;
while ((netif = gnrc_netif_iter(netif))) {
_print_neighbors(&netif->netif);
}
return 0;
}
|
/*
*
* Copyright 2015, 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.
*
*/
#include <stdio.h>
#include <string.h>
#include "src/core/security/credentials.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
#include <grpc/support/sync.h>
typedef struct {
gpr_cv cv;
gpr_mu mu;
int is_done;
} synchronizer;
static void on_metadata_response(void *user_data, grpc_mdelem **md_elems,
size_t num_md,
grpc_credentials_status status) {
synchronizer *sync = user_data;
if (status == GRPC_CREDENTIALS_ERROR) {
fprintf(stderr, "Fetching token failed.\n");
} else {
GPR_ASSERT(num_md == 1);
printf("\nGot token: %s\n\n",
(const char *)GPR_SLICE_START_PTR(md_elems[0]->value->slice));
}
gpr_mu_lock(&sync->mu);
sync->is_done = 1;
gpr_mu_unlock(&sync->mu);
gpr_cv_signal(&sync->cv);
}
int main(int argc, char **argv) {
int result = 0;
synchronizer sync;
grpc_credentials *creds = NULL;
char *service_url = "https://test.foo.google.com/Foo";
gpr_cmdline *cl = gpr_cmdline_create("print_google_default_creds_token");
gpr_cmdline_add_string(cl, "service_url",
"Service URL for the token request.", &service_url);
gpr_cmdline_parse(cl, argc, argv);
grpc_init();
creds = grpc_google_default_credentials_create();
if (creds == NULL) {
fprintf(stderr, "\nCould not find default credentials.\n\n");
result = 1;
goto end;
}
gpr_mu_init(&sync.mu);
gpr_cv_init(&sync.cv);
sync.is_done = 0;
grpc_credentials_get_request_metadata(creds, "", on_metadata_response, &sync);
gpr_mu_lock(&sync.mu);
while (!sync.is_done) gpr_cv_wait(&sync.cv, &sync.mu, gpr_inf_future);
gpr_mu_unlock(&sync.mu);
gpr_mu_destroy(&sync.mu);
gpr_cv_destroy(&sync.cv);
grpc_credentials_release(creds);
end:
gpr_cmdline_destroy(cl);
grpc_shutdown();
return result;
}
|
// Copyright 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 CC_OUTPUT_PROGRAM_BINDING_H_
#define CC_OUTPUT_PROGRAM_BINDING_H_
#include <string>
#include "base/logging.h"
#include "cc/output/context_provider.h"
#include "cc/output/shader.h"
namespace gpu {
namespace gles2 {
class GLES2Interface;
}
}
namespace cc {
class ProgramBindingBase {
public:
ProgramBindingBase();
~ProgramBindingBase();
bool Init(gpu::gles2::GLES2Interface* context,
const std::string& vertex_shader,
const std::string& fragment_shader);
bool Link(gpu::gles2::GLES2Interface* context);
void Cleanup(gpu::gles2::GLES2Interface* context);
unsigned program() const { return program_; }
bool initialized() const { return initialized_; }
protected:
unsigned LoadShader(gpu::gles2::GLES2Interface* context,
unsigned type,
const std::string& shader_source);
unsigned CreateShaderProgram(gpu::gles2::GLES2Interface* context,
unsigned vertex_shader,
unsigned fragment_shader);
void CleanupShaders(gpu::gles2::GLES2Interface* context);
unsigned program_;
unsigned vertex_shader_id_;
unsigned fragment_shader_id_;
bool initialized_;
private:
DISALLOW_COPY_AND_ASSIGN(ProgramBindingBase);
};
template <class VertexShader, class FragmentShader>
class ProgramBinding : public ProgramBindingBase {
public:
ProgramBinding() {}
void Initialize(ContextProvider* context_provider,
TexCoordPrecision precision,
SamplerType sampler) {
return Initialize(
context_provider, precision, sampler, BLEND_MODE_NONE, false);
}
void Initialize(ContextProvider* context_provider,
TexCoordPrecision precision,
SamplerType sampler,
BlendMode blend_mode) {
return Initialize(
context_provider, precision, sampler, blend_mode, false);
}
void Initialize(ContextProvider* context_provider,
TexCoordPrecision precision,
SamplerType sampler,
BlendMode blend_mode,
bool mask_for_background) {
DCHECK(context_provider);
DCHECK(!initialized_);
if (context_provider->IsContextLost())
return;
fragment_shader_.set_blend_mode(blend_mode);
fragment_shader_.set_mask_for_background(mask_for_background);
if (!ProgramBindingBase::Init(
context_provider->ContextGL(),
vertex_shader_.GetShaderString(),
fragment_shader_.GetShaderString(precision, sampler))) {
DCHECK(context_provider->IsContextLost());
return;
}
int base_uniform_index = 0;
vertex_shader_.Init(context_provider->ContextGL(),
program_, &base_uniform_index);
fragment_shader_.Init(context_provider->ContextGL(),
program_, &base_uniform_index);
// Link after binding uniforms
if (!Link(context_provider->ContextGL())) {
DCHECK(context_provider->IsContextLost());
return;
}
initialized_ = true;
}
const VertexShader& vertex_shader() const { return vertex_shader_; }
const FragmentShader& fragment_shader() const { return fragment_shader_; }
private:
VertexShader vertex_shader_;
FragmentShader fragment_shader_;
DISALLOW_COPY_AND_ASSIGN(ProgramBinding);
};
} // namespace cc
#endif // CC_OUTPUT_PROGRAM_BINDING_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 WEBKIT_BASE_FILE_PATH_STRING_CONVERSIONS_H_
#define WEBKIT_BASE_FILE_PATH_STRING_CONVERSIONS_H_
#include "base/files/file_path.h"
#include "webkit/base/webkit_base_export.h"
namespace WebKit {
class WebString;
}
namespace webkit_base {
WEBKIT_BASE_EXPORT base::FilePath::StringType WebStringToFilePathString(
const WebKit::WebString& str);
WEBKIT_BASE_EXPORT WebKit::WebString FilePathStringToWebString(
const base::FilePath::StringType& str);
WEBKIT_BASE_EXPORT base::FilePath WebStringToFilePath(const WebKit::WebString& str);
WEBKIT_BASE_EXPORT WebKit::WebString FilePathToWebString(
const base::FilePath& file_path);
} // namespace webkit_base
#endif // WEBKIT_BASE_FILE_PATH_STRING_CONVERSIONS_H_
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto
#ifndef PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
#define PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3003000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace google {
namespace protobuf {
class Empty;
class EmptyDefaultTypeInternal;
LIBPROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_;
} // namespace protobuf
} // namespace google
namespace google {
namespace protobuf {
namespace protobuf_google_2fprotobuf_2fempty_2eproto {
// Internal implementation detail -- do not call these.
struct LIBPROTOBUF_EXPORT TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[];
static const ::google::protobuf::uint32 offsets[];
static void InitDefaultsImpl();
static void Shutdown();
};
void LIBPROTOBUF_EXPORT AddDescriptors();
void LIBPROTOBUF_EXPORT InitDefaults();
} // namespace protobuf_google_2fprotobuf_2fempty_2eproto
// ===================================================================
class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
public:
Empty();
virtual ~Empty();
Empty(const Empty& from);
inline Empty& operator=(const Empty& from) {
CopyFrom(from);
return *this;
}
inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
return GetArenaNoVirtual();
}
inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Empty& default_instance();
static inline const Empty* internal_default_instance() {
return reinterpret_cast<const Empty*>(
&_Empty_default_instance_);
}
static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
0;
void UnsafeArenaSwap(Empty* other);
void Swap(Empty* other);
// implements Message ----------------------------------------------
inline Empty* New() const PROTOBUF_FINAL { return New(NULL); }
Empty* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
void CopyFrom(const Empty& from);
void MergeFrom(const Empty& from);
void Clear() PROTOBUF_FINAL;
bool IsInitialized() const PROTOBUF_FINAL;
size_t ByteSizeLong() const PROTOBUF_FINAL;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const PROTOBUF_FINAL;
void InternalSwap(Empty* other);
protected:
explicit Empty(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:google.protobuf.Empty)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
mutable int _cached_size_;
friend struct protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
// Empty
#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
|
#include <stdio.h>
#include "crypto_box.h"
#include "randombytes.h"
unsigned char alicesk[crypto_box_SECRETKEYBYTES];
unsigned char alicepk[crypto_box_PUBLICKEYBYTES];
unsigned char bobsk[crypto_box_SECRETKEYBYTES];
unsigned char bobpk[crypto_box_PUBLICKEYBYTES];
unsigned char n[crypto_box_NONCEBYTES];
unsigned char m[10000];
unsigned char c[10000];
unsigned char m2[10000];
main()
{
int mlen;
int i;
int caught;
for (mlen = 0;mlen < 1000 && mlen + crypto_box_ZEROBYTES < sizeof m;++mlen) {
crypto_box_keypair(alicepk,alicesk);
crypto_box_keypair(bobpk,bobsk);
randombytes(n,crypto_box_NONCEBYTES);
randombytes(m + crypto_box_ZEROBYTES,mlen);
crypto_box(c,m,mlen + crypto_box_ZEROBYTES,n,bobpk,alicesk);
caught = 0;
while (caught < 10) {
c[random() % (mlen + crypto_box_ZEROBYTES)] = random();
if (crypto_box_open(m2,c,mlen + crypto_box_ZEROBYTES,n,alicepk,bobsk) == 0) {
for (i = 0;i < mlen + crypto_box_ZEROBYTES;++i)
if (m2[i] != m[i]) {
printf("forgery\n");
return 100;
}
} else {
++caught;
}
}
}
return 0;
}
|
//
// WDPaletteBackgroundView.h
// Brushes
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2010-2013 Steve Sprang
//
#import <UIKit/UIKit.h>
#import "WDUtilities.h"
@interface WDPaletteBackgroundView : UIView
@property (nonatomic, assign) float cornerRadius;
@property (nonatomic, assign) UIRectCorner roundedCorners;
@end
|
/** @file
The abs, labs, and llabs functions compute the absolute value of an integer j.
If the result cannot be represented, the behavior is undefined.
The abs, labs, and llabs, functions return the absolute value of their
parameter.
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <LibConfig.h>
#include <sys/EfiCdefs.h>
int
abs(int j)
{
return(j < 0 ? -j : j);
}
long
labs(long j)
{
return(j < 0 ? -j : j);
}
long long
llabs(long long j)
{
return (j < 0 ? -j : j);
}
|
/*
* $Id$
*
* 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 "ahrs_aligner.h"
#include <stdlib.h> /* for abs() */
#include "subsystems/imu.h"
#include "led.h"
struct AhrsAligner ahrs_aligner;
#define SAMPLES_NB PERIODIC_FREQUENCY
static struct Int32Rates gyro_sum;
static struct Int32Vect3 accel_sum;
static struct Int32Vect3 mag_sum;
static int32_t ref_sensor_samples[SAMPLES_NB];
static uint32_t samples_idx;
void ahrs_aligner_init(void) {
ahrs_aligner.status = AHRS_ALIGNER_RUNNING;
INT_RATES_ZERO(gyro_sum);
INT_VECT3_ZERO(accel_sum);
INT_VECT3_ZERO(mag_sum);
samples_idx = 0;
ahrs_aligner.noise = 0;
ahrs_aligner.low_noise_cnt = 0;
}
#ifndef LOW_NOISE_THRESHOLD
#define LOW_NOISE_THRESHOLD 90000
#endif
#ifndef LOW_NOISE_TIME
#define LOW_NOISE_TIME 5
#endif
void ahrs_aligner_run(void) {
RATES_ADD(gyro_sum, imu.gyro);
VECT3_ADD(accel_sum, imu.accel);
VECT3_ADD(mag_sum, imu.mag);
ref_sensor_samples[samples_idx] = imu.accel.z;
samples_idx++;
#ifdef AHRS_ALIGNER_LED
RunOnceEvery(50, {LED_TOGGLE(AHRS_ALIGNER_LED);});
#endif
if (samples_idx >= SAMPLES_NB) {
int32_t avg_ref_sensor = accel_sum.z;
if ( avg_ref_sensor >= 0)
avg_ref_sensor += SAMPLES_NB / 2;
else
avg_ref_sensor -= SAMPLES_NB / 2;
avg_ref_sensor /= SAMPLES_NB;
ahrs_aligner.noise = 0;
int i;
for (i=0; i<SAMPLES_NB; i++) {
int32_t diff = ref_sensor_samples[i] - avg_ref_sensor;
ahrs_aligner.noise += abs(diff);
}
RATES_SDIV(ahrs_aligner.lp_gyro, gyro_sum, SAMPLES_NB);
VECT3_SDIV(ahrs_aligner.lp_accel, accel_sum, SAMPLES_NB);
VECT3_SDIV(ahrs_aligner.lp_mag, mag_sum, SAMPLES_NB);
INT_RATES_ZERO(gyro_sum);
INT_VECT3_ZERO(accel_sum);
INT_VECT3_ZERO(mag_sum);
samples_idx = 0;
if (ahrs_aligner.noise < LOW_NOISE_THRESHOLD)
ahrs_aligner.low_noise_cnt++;
else
if ( ahrs_aligner.low_noise_cnt > 0)
ahrs_aligner.low_noise_cnt--;
if (ahrs_aligner.low_noise_cnt > LOW_NOISE_TIME) {
ahrs_aligner.status = AHRS_ALIGNER_LOCKED;
#ifdef AHRS_ALIGNER_LED
LED_ON(AHRS_ALIGNER_LED);
#endif
}
}
}
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/msgdlgg.h
// Purpose: Generic wxMessageDialog
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_MSGDLGG_H_
#define _WX_GENERIC_MSGDLGG_H_
class WXDLLIMPEXP_CORE wxGenericMessageDialog : public wxMessageDialogBase
{
public:
wxGenericMessageDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
virtual int ShowModal();
protected:
void OnYes(wxCommandEvent& event);
void OnNo(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
private:
void DoCreateMsgdialog();
wxPoint m_pos;
bool m_created;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
};
#endif // _WX_GENERIC_MSGDLGG_H_
|
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef POLARITY_HEADERFILE_IS_INCLUDED
#define POLARITY_HEADERFILE_IS_INCLUDED
#ifdef USE_POLARITY
#ifdef BUILDING_DLL
#define POLARITY __declspec(dllexport)
#else
#define POLARITY __declspec(dllimport)
#endif
#else
#define POLARITY
#endif
#endif
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2011, 2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/msg.h>
#include <stdio.h>
#include <pthread.h>
#include <arpa/inet.h>
#include <sys/socket.h>
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *
thread_proc (void *args)
{
pthread_mutex_lock (&mutex);
pthread_mutex_unlock (&mutex);
}
int
main (void)
{
const int flags = IPC_CREAT | 0666;
key_t shmkey = 3925, semkey = 7428, msgkey = 5294;
int shmid, semid, msqid;
FILE *fd;
pthread_t thread;
struct sockaddr_in sock_addr;
int sock;
unsigned short port;
socklen_t size;
int status, try, retries = 1000;
for (try = 0; try < retries; ++try)
{
shmid = shmget (shmkey, 4096, flags | IPC_EXCL);
if (shmid >= 0)
break;
++shmkey;
}
if (shmid < 0)
{
printf ("Cannot create shared-memory region after %d tries.\n", retries);
return 1;
}
for (try = 0; try < retries; ++try)
{
semid = semget (semkey, 1, flags | IPC_EXCL);
if (semid >= 0)
break;
++semkey;
}
if (semid < 0)
{
printf ("Cannot create semaphore after %d tries.\n", retries);
return 1;
}
for (try = 0; try < retries; ++try)
{
msqid = msgget (msgkey, flags | IPC_EXCL);
if (msqid >= 0)
break;
++msgkey;
}
if (msqid < 0)
{
printf ("Cannot create message queue after %d tries.\n", retries);
return 1;
}
fd = fopen ("/dev/null", "r");
/* Lock the mutex to prevent the new thread from finishing immediately. */
pthread_mutex_lock (&mutex);
pthread_create (&thread, NULL, thread_proc, 0);
sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0)
{
printf ("Cannot create socket.\n");
return 1;
}
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = 0; /* Bind to a free port. */
sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
status = bind (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr));
if (status < 0)
{
printf ("Cannot bind socket.\n");
return 1;
}
/* Find the assigned port number of the socket. */
size = sizeof (sock_addr);
status = getsockname (sock, (struct sockaddr *) &sock_addr, &size);
if (status < 0)
{
printf ("Cannot find name of socket.\n");
return 1;
}
port = ntohs (sock_addr.sin_port);
status = listen (sock, 1);
if (status < 0)
{
printf ("Cannot listen on socket.\n");
return 1;
}
/* Set breakpoint here. */
shmctl (shmid, IPC_RMID, NULL);
semctl (semid, 0, IPC_RMID, NULL);
msgctl (msqid, IPC_RMID, NULL);
fclose (fd);
close (sock);
pthread_mutex_unlock (&mutex);
pthread_join (thread, NULL);
return 0;
}
|
/* Copyright (c) 2014-2015, 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.
*/
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/suspend.h>
#include "smp2p_private.h"
#define SET_DELAY (2 * HZ)
#define PROC_AWAKE_ID 12 /* 12th bit */
int slst_gpio_base_id;
/**
* sleepstate_pm_notifier() - PM notifier callback function.
* @nb: Pointer to the notifier block.
* @event: Suspend state event from PM module.
* @unused: Null pointer from PM module.
*
* This function is register as callback function to get notifications
* from the PM module on the system suspend state.
*/
static int sleepstate_pm_notifier(struct notifier_block *nb,
unsigned long event, void *unused)
{
switch (event) {
case PM_SUSPEND_PREPARE:
break;
case PM_POST_SUSPEND:
break;
}
return NOTIFY_DONE;
}
static struct notifier_block sleepstate_pm_nb = {
.notifier_call = sleepstate_pm_notifier,
};
static int smp2p_sleepstate_probe(struct platform_device *pdev)
{
int ret;
struct device_node *node = pdev->dev.of_node;
slst_gpio_base_id = of_get_gpio(node, 0);
if (slst_gpio_base_id == -EPROBE_DEFER) {
return slst_gpio_base_id;
} else if (slst_gpio_base_id < 0) {
SMP2P_ERR("%s: Error to get gpio %d\n",
__func__, slst_gpio_base_id);
return slst_gpio_base_id;
}
gpio_set_value(slst_gpio_base_id + PROC_AWAKE_ID, 1);
ret = register_pm_notifier(&sleepstate_pm_nb);
if (ret)
SMP2P_ERR("%s: power state notif error %d\n", __func__, ret);
return 0;
}
static struct of_device_id msm_smp2p_slst_match_table[] = {
{.compatible = "qcom,smp2pgpio_sleepstate_3_out"},
{},
};
static struct platform_driver smp2p_sleepstate_driver = {
.probe = smp2p_sleepstate_probe,
.driver = {
.name = "smp2p_sleepstate",
.owner = THIS_MODULE,
.of_match_table = msm_smp2p_slst_match_table,
},
};
static int __init smp2p_sleepstate_init(void)
{
int ret;
ret = platform_driver_register(&smp2p_sleepstate_driver);
if (ret) {
SMP2P_ERR("%s: smp2p_sleepstate_driver register failed %d\n",
__func__, ret);
return ret;
}
return 0;
}
module_init(smp2p_sleepstate_init);
MODULE_DESCRIPTION("SMP2P SLEEP STATE");
MODULE_LICENSE("GPL v2");
|
/* APPLE LOCAL file non lvalue assign */
/* Allow assignments to conditional expressions, as long as the second and third
operands are already lvalues. */
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-options "-fnon-lvalue-assign" } */
/* { dg-do run } */
#include <stdlib.h>
int g1 = 3, g2 = 5;
void assign_val1 (int which, int value) {
(which ? g1 : g2) = value; /* { dg-warning "target of assignment not really an lvalue" } */
}
void assign_val2 (int which) {
(which ? g1 : g2)++; /* { dg-warning "target of assignment not really an lvalue" } */
}
int main(void) {
assign_val1 (0, 15);
if (g1 != 3 || g2 != 15)
abort ();
assign_val2 (1);
if (g1 != 4 || g2 != 15)
abort ();
return 0;
}
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef MYST_SCRIPTS_SELENITIC_H
#define MYST_SCRIPTS_SELENITIC_H
#include "common/scummsys.h"
#include "common/util.h"
#include "mohawk/myst_scripts.h"
namespace Mohawk {
class MystResourceType8;
struct MystScriptEntry;
namespace MystStacks {
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv)
class Selenitic : public MystScriptParser {
public:
Selenitic(MohawkEngine_Myst *vm);
~Selenitic();
void disablePersistentScripts();
void runPersistentScripts();
private:
void setupOpcodes();
uint16 getVar(uint16 var);
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
virtual uint16 getMap() { return 9930; }
DECLARE_OPCODE(o_mazeRunnerMove);
DECLARE_OPCODE(o_mazeRunnerSoundRepeat);
DECLARE_OPCODE(o_soundReceiverSigma);
DECLARE_OPCODE(o_soundReceiverRight);
DECLARE_OPCODE(o_soundReceiverLeft);
DECLARE_OPCODE(o_soundReceiverSource);
DECLARE_OPCODE(o_mazeRunnerDoorButton);
DECLARE_OPCODE(o_soundReceiverUpdateSound);
DECLARE_OPCODE(o_soundLockMove);
DECLARE_OPCODE(o_soundLockStartMove);
DECLARE_OPCODE(o_soundLockEndMove);
DECLARE_OPCODE(o_soundLockButton);
DECLARE_OPCODE(o_soundReceiverEndMove);
DECLARE_OPCODE(o_mazeRunnerCompass_init);
DECLARE_OPCODE(o_mazeRunnerWindow_init);
DECLARE_OPCODE(o_mazeRunnerLight_init);
DECLARE_OPCODE(o_soundReceiver_init);
DECLARE_OPCODE(o_soundLock_init);
DECLARE_OPCODE(o_mazeRunnerRight_init);
DECLARE_OPCODE(o_mazeRunnerLeft_init);
void soundReceiver_run();
MystGameState::Selenitic &_state;
bool _soundReceiverRunning;
bool _soundReceiverSigmaPressed; // 6
MystResourceType8 *_soundReceiverSources[5]; // 92 -> 108
MystResourceType8 *_soundReceiverCurrentSource; // 112
uint16 *_soundReceiverPosition; // 116
uint16 _soundReceiverDirection; // 120
uint16 _soundReceiverSpeed; // 122
uint32 _soundReceiverStartTime; //124
MystResourceType8 *_soundReceiverViewer; // 128
MystResourceType8 *_soundReceiverRightButton; // 132
MystResourceType8 *_soundReceiverLeftButton; // 136
MystResourceType8 *_soundReceiverAngle1; // 140
MystResourceType8 *_soundReceiverAngle2; // 144
MystResourceType8 *_soundReceiverAngle3; // 148
MystResourceType8 *_soundReceiverAngle4; // 152
MystResourceType8 *_soundReceiverSigmaButton; // 156
static const uint16 _mazeRunnerMap[300][4];
static const uint8 _mazeRunnerVideos[300][4];
uint16 _mazeRunnerPosition; // 56
uint16 _mazeRunnerDirection; // 58
MystResourceType8 *_mazeRunnerWindow; // 68
MystResourceType8 *_mazeRunnerCompass; // 72
MystResourceType8 *_mazeRunnerLight; // 76
MystResourceType8 *_mazeRunnerRightButton; // 80
MystResourceType8 *_mazeRunnerLeftButton; // 84
bool _mazeRunnerDoorOpened; // 160
uint16 _soundLockSoundId;
MystResourceType10 *_soundLockSlider1; // 164
MystResourceType10 *_soundLockSlider2; // 168
MystResourceType10 *_soundLockSlider3; // 172
MystResourceType10 *_soundLockSlider4; // 176
MystResourceType10 *_soundLockSlider5; // 180
MystResourceType8 *_soundLockButton; // 184
void soundReceiverLeftRight(uint direction);
void soundReceiverUpdate();
void soundReceiverDrawView();
void soundReceiverDrawAngle();
void soundReceiverIncreaseSpeed();
void soundReceiverUpdateSound();
uint16 soundReceiverCurrentSound(uint16 source, uint16 position);
void soundReceiverSolution(uint16 source, uint16 &solution, bool &enabled);
uint16 soundLockCurrentSound(uint16 position, bool pixels);
MystResourceType10 *soundLockSliderFromVar(uint16 var);
void soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved);
bool mazeRunnerForwardAllowed(uint16 position);
void mazeRunnerUpdateCompass();
void mazeRunnerPlaySoundHelp();
void mazeRunnerPlayVideo(uint16 video, uint16 pos);
void mazeRunnerBacktrack(uint16 &oldPosition);
};
} // End of namespace MystStacks
}
#undef DECLARE_OPCODE
#endif
|
#ifndef FILE_ZIP_H_
#define FILE_ZIP_H_
/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include "IFile.h"
#include <zlib.h>
#include "utils/log.h"
#include "File.h"
#include "ZipManager.h"
namespace XFILE
{
class CZipFile : public IFile
{
public:
CZipFile();
virtual ~CZipFile();
virtual int64_t GetPosition();
virtual int64_t GetLength();
virtual bool Open(const CURL& url);
virtual bool Exists(const CURL& url);
virtual int Stat(struct __stat64* buffer);
virtual int Stat(const CURL& url, struct __stat64* buffer);
virtual unsigned int Read(void* lpBuf, int64_t uiBufSize);
//virtual bool ReadString(char *szLine, int iLineLength);
virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET);
virtual void Close();
int UnpackFromMemory(std::string& strDest, const std::string& strInput, bool isGZ=false);
private:
bool InitDecompress();
bool FillBuffer();
void DestroyBuffer(void* lpBuffer, int iBufSize);
CFile mFile;
SZipEntry mZipItem;
int64_t m_iFilePos; // position in _uncompressed_ data read
int64_t m_iZipFilePos; // position in _compressed_ data
int m_iAvailBuffer;
z_stream m_ZStream;
char m_szBuffer[65535]; // 64k buffer for compressed data
char* m_szStringBuffer;
char* m_szStartOfStringBuffer; // never allocated!
int m_iDataInStringBuffer;
int m_iRead;
bool m_bFlush;
bool m_bCached;
};
}
#endif
|
/*
Copyright (C) 2008- The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#include "int_sizes.h"
#include "stringtools.h"
#include "parrot_client.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
int main( int argc, char *argv[] )
{
INT64_T size;
if(argc!=3) {
printf("use: parrot_mkalloc <path> <size>\n");
return 0;
}
size = string_metric_parse(argv[2]);
if(parrot_mkalloc(argv[1],size,0777)==0) {
return 0;
} else {
if(errno==ENOSYS || errno==EINVAL) {
fprintf(stderr,"parrot_mkalloc: This filesystem does not support allocations.\n");
} else {
fprintf(stderr,"parrot_mkalloc: %s\n",strerror(errno));
}
return 1;
}
}
/* vim: set noexpandtab tabstop=4: */
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
* H5F package. Including this header means that the source file
* is part of the H5F package.
*/
#ifndef _H5Fmodule_H
#define _H5Fmodule_H
/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error
* reporting macros.
*/
#define H5F_MODULE
#define H5_MY_PKG H5F
#define H5_MY_PKG_ERR H5E_FILE
#define H5_MY_PKG_INIT YES
#endif /* _H5Fmodule_H */
|
/*
* Copyright (c) 2016 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _ARM_CLOCK_CONTROL_H_
#define _ARM_CLOCK_CONTROL_H_
#include <clock_control.h>
/**
* @file
*
* @brief Clock subsystem IDs for ARM family SoCs
*/
/* CMSDK BUS Mapping */
enum arm_bus_type_t {
CMSDK_AHB = 0,
CMSDK_APB,
};
/* CPU States */
enum arm_soc_state_t {
SOC_ACTIVE = 0,
SOC_SLEEP,
SOC_DEEPSLEEP,
};
struct arm_clock_control_t {
/* ARM family SoCs supported Bus types */
enum arm_bus_type_t bus;
/* Clock can be configured for 3 states: Active, Sleep, Deep Sleep */
enum arm_soc_state_t state;
/* Identifies the device on the bus */
u32_t device;
};
#endif /* _ARM_CLOCK_CONTROL_H_ */
|
//===---- MipsOs16.h for Mips Option -Os16 --------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines an optimization phase for the MIPS target.
//
//===----------------------------------------------------------------------===//
#include "MCTargetDesc/MipsMCTargetDesc.h"
#include "MipsTargetMachine.h"
#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"
#ifndef MIPSOS16_H
#define MIPSOS16_H
using namespace llvm;
namespace llvm {
class MipsOs16 : public ModulePass {
public:
static char ID;
MipsOs16() : ModulePass(ID) {
}
const char *getPassName() const override {
return "MIPS Os16 Optimization";
}
bool runOnModule(Module &M) override;
};
ModulePass *createMipsOs16(MipsTargetMachine &TM);
}
#endif
|
#ifndef _CAMERA_SENSOR_PARA_MT9V115_YUV_H
#define _CAMERA_SENSOR_PARA_MT9V115_YUV_H
typedef enum
{
ISP_DRIVING_2MA=0,
ISP_DRIVING_4MA,
ISP_DRIVING_6MA,
ISP_DRIVING_8MA
} ISP_DRIVING_CURRENT_ENUM;
/* STRUCT: SENSOR */
#define MT9V114_YUV_CAMERA_SENSOR_REG_DEFAULT_VALUE \
/* ARRAY: SENSOR.reg[11] */\
{\
/* STRUCT: SENSOR.reg[0] */\
{\
/* SENSOR.reg[0].addr */ 0xFFFFFFFF, /* SENSOR.reg[0].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[1] */\
{\
/* SENSOR.reg[1].addr */ 0xFFFFFFFF, /* SENSOR.reg[1].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[2] */\
{\
/* SENSOR.reg[2].addr */ 0xFFFFFFFF, /* SENSOR.reg[2].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[3] */\
{\
/* SENSOR.reg[3].addr */ 0xFFFFFFFF, /* SENSOR.reg[3].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[4] */\
{\
/* SENSOR.reg[4].addr */ 0xFFFFFFFF, /* SENSOR.reg[4].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[5] */\
{\
/* SENSOR.reg[5].addr */ 0xFFFFFFFF, /* SENSOR.reg[5].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[6] */\
{\
/* SENSOR.reg[6].addr */ 0xFFFFFFFF, /* SENSOR.reg[6].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[7] */\
{\
/* SENSOR.reg[7].addr */ 0xFFFFFFFF, /* SENSOR.reg[7].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[8] */\
{\
/* SENSOR.reg[8].addr */ 0xFFFFFFFF, /* SENSOR.reg[8].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[9] */\
{\
/* SENSOR.reg[9].addr */ 0xFFFFFFFF, /* SENSOR.reg[9].para */ 0xFFFFFFFF\
},\
/* STRUCT: SENSOR.reg[10] */\
{\
/* SENSOR.reg[10].addr */ 0xFFFFFFFF, /* SENSOR.reg[10].para */ 0xFFFFFFFF\
}\
}
#define MT9V114_YUV_CAMERA_SENSOR_CCT_DEFAULT_VALUE {{0x30a1,0x00},{0x3000,0x1B}}
#endif//#ifndef _CAMERA_SENSOR_PARA_MT9V114_YUV_H
|
/*
* arch/arm/mach-tegra/odm_kit/query/etna/subboards/nvodm_query_discovery_e936_peripherals.h
*
* Specifies the peripheral connectivity database peripheral entries for the E936 module
*
* Copyright (c) 2009 NVIDIA 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; 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.
*/
// Murata tuner source
{
NV_ODM_GUID('m','u','r','a','t','a','5','7'),
s_ffaVIPBitstreamAddresses,
NV_ARRAY_SIZE(s_ffaVIPBitstreamAddresses),
NvOdmPeripheralClass_Other
},
// NOTE: This list *must* end with a trailing comma.
|
/*
* Copyright (c) 2014 Daniel Ramirez. (javamonn@gmail.com)
*
* This file's license is 2-clause BSD as in this distribution's LICENSE file.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <timesys.h>
#include <rtems/btimer.h>
const char rtems_test_name[] = "RHMLATENCY";
#define MESSAGE_SIZE (sizeof(long) * 4)
#define BENCHMARKS 50000
rtems_task Init( rtems_task_argument ignored );
rtems_task Task01( rtems_task_argument ignored );
rtems_task Task02( rtems_task_argument ignored );
uint32_t telapsed;
uint32_t tloop_overhead;
uint32_t treceive_overhead;
uint32_t count;
rtems_id Task_id[2];
rtems_name Task_name[2];
rtems_id Queue_id;
long Buffer[4];
void Init(
rtems_task_argument argument
)
{
rtems_status_code status;
Print_Warning();
TEST_BEGIN();
status = rtems_message_queue_create(
rtems_build_name( 'M', 'Q', '1', ' ' ),
1,
MESSAGE_SIZE,
RTEMS_DEFAULT_ATTRIBUTES,
&Queue_id
);
directive_failed( status, "rtems_message_queue_create" );
Task_name[0] = rtems_build_name( 'T','A','0','1' );
status = rtems_task_create(
Task_name[0],
30, /* TA01 is low priority task */
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[0]
);
directive_failed( status, "rtems_task_create of TA01");
Task_name[1] = rtems_build_name( 'T','A','0','2' );
status = rtems_task_create(
Task_name[1],
28, /* High priority task */
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[1]
);
directive_failed( status, "rtems_task_create of TA01" );
benchmark_timer_initialize();
for ( count = 0; count < BENCHMARKS - 1; count++ ) {
/* message send/recieve */
}
tloop_overhead = benchmark_timer_read();
status = rtems_task_start( Task_id[0], Task01, 0 );
directive_failed( status, "rtems_task_start of TA01" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
rtems_task Task01( rtems_task_argument ignored )
{
rtems_status_code status;
/* Put a message in the queue so recieve overhead can be found. */
(void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE );
/* Start up second task, get preempted */
status = rtems_task_start( Task_id[1], Task02, 0 );
directive_failed( status, "rtems_task_start" );
for ( ; count < BENCHMARKS; count++ ) {
(void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE );
}
/* Should never reach here */
rtems_test_assert( false );
}
rtems_task Task02( rtems_task_argument ignored )
{
size_t size;
/* find recieve overhead - no preempt or task switch */
benchmark_timer_initialize();
(void) rtems_message_queue_receive(
Queue_id,
(long (*)[4]) Buffer,
&size,
RTEMS_DEFAULT_OPTIONS,
RTEMS_NO_TIMEOUT
);
treceive_overhead = benchmark_timer_read();
/* Benchmark code */
benchmark_timer_initialize();
for ( count = 0; count < BENCHMARKS - 1; count++ ) {
(void) rtems_message_queue_receive(
Queue_id,
(long (*)[4]) Buffer,
&size,
RTEMS_DEFAULT_OPTIONS,
RTEMS_NO_TIMEOUT
);
}
telapsed = benchmark_timer_read();
put_time(
"Rhealstone: Intertask Message Latency",
telapsed, /* Total time of all benchmarks */
BENCHMARKS - 1, /* Total benchmarks */
tloop_overhead, /* Overhead of loops */
treceive_overhead /* Overhead of recieve call and task switch */
);
TEST_END();
rtems_test_exit( 0 );
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 3
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1, MESSAGE_SIZE)
#define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
|
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __INCLUDE_PIPELINE_ROUTING_H__
#define __INCLUDE_PIPELINE_ROUTING_H__
#include "pipeline.h"
#include "pipeline_routing_be.h"
/*
* Route
*/
int
app_pipeline_routing_add_route(struct app_params *app,
uint32_t pipeline_id,
struct pipeline_routing_route_key *key,
struct pipeline_routing_route_data *data);
int
app_pipeline_routing_delete_route(struct app_params *app,
uint32_t pipeline_id,
struct pipeline_routing_route_key *key);
int
app_pipeline_routing_add_default_route(struct app_params *app,
uint32_t pipeline_id,
uint32_t port_id);
int
app_pipeline_routing_delete_default_route(struct app_params *app,
uint32_t pipeline_id);
/*
* ARP
*/
int
app_pipeline_routing_add_arp_entry(struct app_params *app,
uint32_t pipeline_id,
struct pipeline_routing_arp_key *key,
struct ether_addr *macaddr);
int
app_pipeline_routing_delete_arp_entry(struct app_params *app,
uint32_t pipeline_id,
struct pipeline_routing_arp_key *key);
int
app_pipeline_routing_add_default_arp_entry(struct app_params *app,
uint32_t pipeline_id,
uint32_t port_id);
int
app_pipeline_routing_delete_default_arp_entry(struct app_params *app,
uint32_t pipeline_id);
/*
* Pipeline type
*/
extern struct pipeline_type pipeline_routing;
#endif
|
/*
* ledtrig-cpu.c - LED trigger based on CPU activity
*
* This LED trigger will be registered for each possible CPU and named as
* cpu0, cpu1, cpu2, cpu3, etc.
*
* It can be bound to any LED just like other triggers using either a
* board file or via sysfs interface.
*
* An API named ledtrig_cpu is exported for any user, who want to add CPU
* activity indication in their code
*
* Copyright 2011 Linus Walleij <linus.walleij@linaro.org>
* Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
*
* 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/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/percpu.h>
#include <linux/syscore_ops.h>
#include <linux/rwsem.h>
#include "leds.h"
#define MAX_NAME_LEN 8
struct led_trigger_cpu {
char name[MAX_NAME_LEN];
struct led_trigger *_trig;
struct mutex lock;
int lock_is_inited;
};
static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig);
/**
* ledtrig_cpu - emit a CPU event as a trigger
* @evt: CPU event to be emitted
*
* Emit a CPU event on a CPU core, which will trigger a
* binded LED to turn on or turn off.
*/
void ledtrig_cpu(enum cpu_led_event ledevt)
{
struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig);
/* mutex lock should be initialized before calling mutex_call() */
if (!trig->lock_is_inited)
return;
mutex_lock(&trig->lock);
/* Locate the correct CPU LED */
switch (ledevt) {
case CPU_LED_IDLE_END:
case CPU_LED_START:
/* Will turn the LED on, max brightness */
led_trigger_event(trig->_trig, LED_FULL);
break;
case CPU_LED_IDLE_START:
case CPU_LED_STOP:
case CPU_LED_HALTED:
/* Will turn the LED off */
led_trigger_event(trig->_trig, LED_OFF);
break;
default:
/* Will leave the LED as it is */
break;
}
mutex_unlock(&trig->lock);
}
EXPORT_SYMBOL(ledtrig_cpu);
static int ledtrig_cpu_syscore_suspend(void)
{
ledtrig_cpu(CPU_LED_STOP);
return 0;
}
static void ledtrig_cpu_syscore_resume(void)
{
ledtrig_cpu(CPU_LED_START);
}
static void ledtrig_cpu_syscore_shutdown(void)
{
ledtrig_cpu(CPU_LED_HALTED);
}
static struct syscore_ops ledtrig_cpu_syscore_ops = {
.shutdown = ledtrig_cpu_syscore_shutdown,
.suspend = ledtrig_cpu_syscore_suspend,
.resume = ledtrig_cpu_syscore_resume,
};
static int __init ledtrig_cpu_init(void)
{
int cpu;
/* Supports up to 9999 cpu cores */
BUILD_BUG_ON(CONFIG_NR_CPUS > 9999);
/*
* Registering CPU led trigger for each CPU core here
* ignores CPU hotplug, but after this CPU hotplug works
* fine with this trigger.
*/
for_each_possible_cpu(cpu) {
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
mutex_init(&trig->lock);
snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
mutex_lock(&trig->lock);
led_trigger_register_simple(trig->name, &trig->_trig);
trig->lock_is_inited = 1;
mutex_unlock(&trig->lock);
}
register_syscore_ops(&ledtrig_cpu_syscore_ops);
pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n");
return 0;
}
module_init(ledtrig_cpu_init);
static void __exit ledtrig_cpu_exit(void)
{
int cpu;
for_each_possible_cpu(cpu) {
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
mutex_lock(&trig->lock);
led_trigger_unregister_simple(trig->_trig);
trig->_trig = NULL;
memset(trig->name, 0, MAX_NAME_LEN);
trig->lock_is_inited = 0;
mutex_unlock(&trig->lock);
mutex_destroy(&trig->lock);
}
unregister_syscore_ops(&ledtrig_cpu_syscore_ops);
}
module_exit(ledtrig_cpu_exit);
MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
MODULE_AUTHOR("Bryan Wu <bryan.wu@canonical.com>");
MODULE_DESCRIPTION("CPU LED trigger");
MODULE_LICENSE("GPL");
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
/**
* Class outside the Moose hierarchy that contains common
* functionality for computing derivatives of the viscous
* stress tensor.
*
* This class is templated so that it can be used by either
* a Kernel object or a BC object.
*/
template <class T>
class NSViscStressTensorDerivs
{
public:
NSViscStressTensorDerivs(T & x);
/**
* The primary interface for computing viscous stress
* tensor derivatives. Requires access to protected data
* from the the underlying data. Uses index notation from
* the notes.
*/
Real dtau(unsigned k, unsigned ell, unsigned m);
private:
T & _data;
};
template <class T>
NSViscStressTensorDerivs<T>::NSViscStressTensorDerivs(T & x) : _data(x)
{
}
template <class T>
Real
NSViscStressTensorDerivs<T>::dtau(unsigned k, unsigned ell, unsigned m)
{
// Try to access underlying data. Since this class is a friend, we can
// directly access _qp and other protected data. This only works if the
// individual variables have the **same names** in all types T which may
// be used to construct this class.
//
// Some error checking on input indices...
//
// 0 <= k,ell <= 2
if (k > 2 || ell > 2)
mooseError("Error, 0 <= k,ell <= 2 violated!");
// 0 <= m <= 4
if (m >= 5)
mooseError("Error, m <= 4 violated!");
//
// Convenience variables
//
const Real rho = _data._rho[_data._qp];
const Real rho2 = rho * rho;
const Real phij = _data._phi[_data._j][_data._qp];
const Real mu = _data._dynamic_viscosity[_data._qp];
const Real nu = mu / rho;
const RealVectorValue U(
_data._rho_u[_data._qp], _data._rho_v[_data._qp], _data._rho_w[_data._qp]);
const Real divU = _data._grad_rho_u[_data._qp](0) + _data._grad_rho_v[_data._qp](1) +
_data._grad_rho_w[_data._qp](2);
// This makes a copy...but the resulting code is cleaner
std::vector<RealVectorValue> gradU(3);
gradU[0] = _data._grad_rho_u[_data._qp];
gradU[1] = _data._grad_rho_v[_data._qp];
gradU[2] = _data._grad_rho_w[_data._qp];
// So we can refer to gradients without repeated indexing.
const RealVectorValue & grad_phij = _data._grad_phi[_data._j][_data._qp];
const RealVectorValue & grad_rho = _data._grad_rho[_data._qp];
switch (m)
{
case 0: // density
{
const Real term1 = 2.0 / rho2 * (U(k) * grad_rho(ell) + U(ell) * grad_rho(k)) * phij;
const Real term2 = -1.0 / rho *
((gradU[k](ell) + gradU[ell](k)) * phij +
(U(k) * grad_phij(ell) + U(ell) * grad_phij(k)));
// Kronecker delta terms
Real term3 = 0.0;
Real term4 = 0.0;
if (k == ell)
{
term3 = -4.0 / 3.0 / rho2 * (U * grad_rho) * phij;
term4 = 2.0 / 3.0 / rho * (U * grad_phij + divU * phij);
}
// Sum up result and return
return nu * (term1 + term2 + term3 + term4);
}
// momentums
case 1:
case 2:
case 3:
{
// note: when comparing m to k or ell, or indexing into Points,
// must map m -> 0, 1, 2 by subtracting 1.
const unsigned m_local = m - 1;
// Kronecker delta terms
const Real delta_km = (k == m_local ? 1.0 : 0.0);
const Real delta_ellm = (ell == m_local ? 1.0 : 0.0);
const Real delta_kell = (k == ell ? 1.0 : 0.0);
return nu *
(
/* */ delta_km * (grad_phij(ell) - (phij / rho) * grad_rho(ell)) +
/* */ delta_ellm * (grad_phij(k) - (phij / rho) * grad_rho(k)) -
(2. / 3.) * delta_kell * (grad_phij(m_local) - (phij / rho) * grad_rho(m_local)));
} // end case 1,2,3
case 4:
// Derivative wrt to energy variable is zero.
return 0.;
default:
mooseError("Invalid variable requested.");
break;
}
return 0.;
}
|
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that 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.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <alloca.h>
#include <stdio.h>
#include <netdb.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define SA_LEN(_x) __libc_sa_len((_x)->sa_family)
extern int __libc_sa_len(sa_family_t __af) __THROW attribute_hidden;
/* int rexecoptions; - google does not know it */
static char ahostbuf[NI_MAXHOST];
int
rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
{
struct sockaddr_storage sa2, from;
struct addrinfo hints, *res0;
const char *orig_name = name;
const char *orig_pass = pass;
u_short port = 0;
int s, timo = 1, s3;
char c;
int gai;
char servbuff[NI_MAXSERV];
if (sizeof(servbuff) < sizeof(int)*3 + 2) {
snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport));
servbuff[sizeof(servbuff) - 1] = '\0';
} else {
sprintf(servbuff, "%d", ntohs(rport));
}
memset(&hints, '\0', sizeof(hints));
hints.ai_family = af;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
gai = getaddrinfo(*ahost, servbuff, &hints, &res0);
if (gai) {
/* XXX: set errno? */
return -1;
}
if (res0->ai_canonname) {
strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf));
ahostbuf[sizeof(ahostbuf)-1] = '\0';
*ahost = ahostbuf;
}
else {
*ahost = NULL;
__set_errno(ENOENT);
return -1;
}
ruserpass(res0->ai_canonname, &name, &pass);
retry:
s = socket(res0->ai_family, res0->ai_socktype, 0);
if (s < 0) {
perror("rexec: socket");
return -1;
}
if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) {
if (errno == ECONNREFUSED && timo <= 16) {
(void) close(s);
sleep(timo);
timo *= 2;
goto retry;
}
perror(res0->ai_canonname);
return -1;
}
if (fd2p == 0) {
(void) write(s, "", 1);
port = 0;
} else {
char num[32];
int s2;
socklen_t sa2len;
s2 = socket(res0->ai_family, res0->ai_socktype, 0);
if (s2 < 0) {
(void) close(s);
return -1;
}
listen(s2, 1);
sa2len = sizeof(sa2);
if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
perror("getsockname");
(void) close(s2);
goto bad;
} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
__set_errno(EINVAL);
(void) close(s2);
goto bad;
}
port = 0;
if (!getnameinfo((struct sockaddr *)&sa2, sa2len,
NULL, 0, servbuff, sizeof(servbuff),
NI_NUMERICSERV))
port = atoi(servbuff);
(void) sprintf(num, "%u", port);
(void) write(s, num, strlen(num)+1);
{
socklen_t len = sizeof(from);
s3 = TEMP_FAILURE_RETRY(accept(s2,
(struct sockaddr *)&from, &len));
close(s2);
if (s3 < 0) {
perror("accept");
port = 0;
goto bad;
}
}
*fd2p = s3;
}
(void) write(s, name, strlen(name) + 1);
/* should public key encypt the password here */
(void) write(s, pass, strlen(pass) + 1);
(void) write(s, cmd, strlen(cmd) + 1);
/* We don't need the memory allocated for the name and the password
in ruserpass anymore. */
if (name != orig_name)
free((char *) name);
if (pass != orig_pass)
free((char *) pass);
if (read(s, &c, 1) != 1) {
perror(*ahost);
goto bad;
}
if (c != 0) {
while (read(s, &c, 1) == 1) {
(void) write(2, &c, 1);
if (c == '\n')
break;
}
goto bad;
}
freeaddrinfo(res0);
return s;
bad:
if (port)
(void) close(*fd2p);
(void) close(s);
freeaddrinfo(res0);
return -1;
}
libc_hidden_def(rexec_af)
int
rexec(char **ahost, int rport, const char *name, const char *pass,
const char *cmd, int *fd2p)
{
return rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
}
|
/*
* nghttp2 - HTTP/2 C Library
*
* Copyright (c) 2013 Tatsuhiro Tsujikawa
*
* 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 NGHTTP2_HD_HUFFMAN_H
#define NGHTTP2_HD_HUFFMAN_H
#ifdef HAVE_CONFIG_H
#include <nghttp2_config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>
typedef enum {
/* FSA accepts this state as the end of huffman encoding
sequence. */
NGHTTP2_HUFF_ACCEPTED = 1,
/* This state emits symbol */
NGHTTP2_HUFF_SYM = (1 << 1),
/* If state machine reaches this state, decoding fails. */
NGHTTP2_HUFF_FAIL = (1 << 2)
} nghttp2_huff_decode_flag;
typedef struct {
/* huffman decoding state, which is actually the node ID of internal
huffman tree. We have 257 leaf nodes, but they are identical to
root node other than emitting a symbol, so we have 256 internal
nodes [1..255], inclusive. */
uint8_t state;
/* bitwise OR of zero or more of the nghttp2_huff_decode_flag */
uint8_t flags;
/* symbol if NGHTTP2_HUFF_SYM flag set */
uint8_t sym;
} nghttp2_huff_decode;
typedef nghttp2_huff_decode huff_decode_table_type[16];
typedef struct {
/* Current huffman decoding state. We stripped leaf nodes, so the
value range is [0..255], inclusive. */
uint8_t state;
/* nonzero if we can say that the decoding process succeeds at this
state */
uint8_t accept;
} nghttp2_hd_huff_decode_context;
typedef struct {
/* The number of bits in this code */
uint32_t nbits;
/* Huffman code aligned to LSB */
uint32_t code;
} nghttp2_huff_sym;
extern const nghttp2_huff_sym huff_sym_table[];
extern const nghttp2_huff_decode huff_decode_table[][16];
#endif /* NGHTTP2_HD_HUFFMAN_H */
|
//
// NUIPShiftReduceGotoTable.h
// NUIParse
//
// Created by Tom Davie on 05/03/2011.
// Copyright 2011 In The Beginning... All rights reserved.
//
#import <Foundation/Foundation.h>
@class NUIPRule;
@interface NUIPShiftReduceGotoTable : NSObject <NSCoding>
{}
- (id)initWithCapacity:(NSUInteger)capacity;
- (BOOL)setGoto:(NSUInteger)gotoIndex forState:(NSUInteger)state nonTerminalNamed:(NSString *)nonTerminalName;
- (NSUInteger)gotoForState:(NSUInteger)state rule:(NUIPRule *)rule;
@end
|
/*
* Virtual hardware watchdog.
*
* Copyright (C) 2009 Red Hat 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 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/>.
*
* By Richard W.M. Jones (rjones@redhat.com).
*/
#include "qemu-common.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu/queue.h"
#include "qapi/qmp/types.h"
#include "monitor/monitor.h"
#include "sysemu/sysemu.h"
#include "sysemu/watchdog.h"
/* Possible values for action parameter. */
#define WDT_RESET 1 /* Hard reset. */
#define WDT_SHUTDOWN 2 /* Shutdown. */
#define WDT_POWEROFF 3 /* Quit. */
#define WDT_PAUSE 4 /* Pause. */
#define WDT_DEBUG 5 /* Prints a message and continues running. */
#define WDT_NONE 6 /* Do nothing. */
static int watchdog_action = WDT_RESET;
static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
void watchdog_add_model(WatchdogTimerModel *model)
{
QLIST_INSERT_HEAD(&watchdog_list, model, entry);
}
/* Returns:
* 0 = continue
* 1 = exit program with error
* 2 = exit program without error
*/
int select_watchdog(const char *p)
{
WatchdogTimerModel *model;
QemuOpts *opts;
/* -watchdog ? lists available devices and exits cleanly. */
if (is_help_option(p)) {
QLIST_FOREACH(model, &watchdog_list, entry) {
fprintf(stderr, "\t%s\t%s\n",
model->wdt_name, model->wdt_description);
}
return 2;
}
QLIST_FOREACH(model, &watchdog_list, entry) {
if (strcasecmp(model->wdt_name, p) == 0) {
/* add the device */
opts = qemu_opts_create_nofail(qemu_find_opts("device"));
qemu_opt_set(opts, "driver", p);
return 0;
}
}
fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n");
QLIST_FOREACH(model, &watchdog_list, entry) {
fprintf(stderr, "\t%s\t%s\n",
model->wdt_name, model->wdt_description);
}
return 1;
}
int select_watchdog_action(const char *p)
{
if (strcasecmp(p, "reset") == 0)
watchdog_action = WDT_RESET;
else if (strcasecmp(p, "shutdown") == 0)
watchdog_action = WDT_SHUTDOWN;
else if (strcasecmp(p, "poweroff") == 0)
watchdog_action = WDT_POWEROFF;
else if (strcasecmp(p, "pause") == 0)
watchdog_action = WDT_PAUSE;
else if (strcasecmp(p, "debug") == 0)
watchdog_action = WDT_DEBUG;
else if (strcasecmp(p, "none") == 0)
watchdog_action = WDT_NONE;
else
return -1;
return 0;
}
static void watchdog_mon_event(const char *action)
{
QObject *data;
data = qobject_from_jsonf("{ 'action': %s }", action);
monitor_protocol_event(QEVENT_WATCHDOG, data);
qobject_decref(data);
}
/* This actually performs the "action" once a watchdog has expired,
* ie. reboot, shutdown, exit, etc.
*/
void watchdog_perform_action(void)
{
switch(watchdog_action) {
case WDT_RESET: /* same as 'system_reset' in monitor */
watchdog_mon_event("reset");
qemu_system_reset_request();
break;
case WDT_SHUTDOWN: /* same as 'system_powerdown' in monitor */
watchdog_mon_event("shutdown");
qemu_system_powerdown_request();
break;
case WDT_POWEROFF: /* same as 'quit' command in monitor */
watchdog_mon_event("poweroff");
exit(0);
break;
case WDT_PAUSE: /* same as 'stop' command in monitor */
watchdog_mon_event("pause");
vm_stop(RUN_STATE_WATCHDOG);
break;
case WDT_DEBUG:
watchdog_mon_event("debug");
fprintf(stderr, "watchdog: timer fired\n");
break;
case WDT_NONE:
watchdog_mon_event("none");
break;
}
}
|
// Copyright (C) 2008 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_SVm_THREADED_HEADER
#define DLIB_SVm_THREADED_HEADER
#include "svm.h"
#include "svm/svm_threaded.h"
#include "svm/structural_svm_problem_threaded.h"
#include "svm/structural_svm_distributed.h"
#include "svm/structural_svm_object_detection_problem.h"
#include "svm/structural_object_detection_trainer.h"
#include "svm/structural_svm_sequence_labeling_problem.h"
#include "svm/structural_sequence_labeling_trainer.h"
#include "svm/structural_svm_assignment_problem.h"
#include "svm/structural_assignment_trainer.h"
#include "svm/cross_validate_track_association_trainer.h"
#include "svm/structural_track_association_trainer.h"
#include "svm/structural_svm_graph_labeling_problem.h"
#include "svm/structural_graph_labeling_trainer.h"
#include "svm/cross_validate_graph_labeling_trainer.h"
#include "svm/svm_multiclass_linear_trainer.h"
#include "svm/one_vs_one_trainer.h"
#include "svm/one_vs_all_trainer.h"
#include "svm/structural_sequence_segmentation_trainer.h"
#endif // DLIB_SVm_THREADED_HEADER
|
/*
* Copyright (C) 2011-2014 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2014 MaNGOS <http://getmangos.com/>
* Copyright (C) 2006-2014 ScriptDev2 <https://github.com/scriptdev2/scriptdev2/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEF_MAGISTERS_TERRACE_H
#define DEF_MAGISTERS_TERRACE_H
#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
enum Data
{
DATA_SELIN_EVENT,
DATA_VEXALLUS_EVENT,
DATA_DELRISSA_EVENT,
DATA_KAELTHAS_EVENT,
DATA_SELIN,
DATA_FEL_CRYSTAL,
DATA_FEL_CRYSTAL_SIZE,
DATA_VEXALLUS_DOOR,
DATA_DELRISSA,
DATA_DELRISSA_DOOR,
DATA_KAEL_DOOR,
DATA_KAEL_STATUE_LEFT,
DATA_KAEL_STATUE_RIGHT,
DATA_DELRISSA_DEATH_COUNT,
DATA_KAELTHAS_STATUES,
DATA_ESCAPE_ORB
};
#endif
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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/>.
*/
#ifndef _WHOLISTSTORAGE_H
#define _WHOLISTSTORAGE_H
#include "Common.h"
#include "ObjectGuid.h"
class WhoListPlayerInfo
{
public:
WhoListPlayerInfo(ObjectGuid guid, uint32 team, AccountTypes security, uint8 level, uint8 clss, uint8 race, uint32 zoneid, uint8 gender, bool visible, std::wstring const& widePlayerName,
std::wstring const& wideGuildName, std::string const& playerName, std::string const& guildName) :
_guid(guid), _team(team), _security(security), _level(level), _class(clss), _race(race), _zoneid(zoneid), _gender(gender), _visible(visible),
_widePlayerName(widePlayerName), _wideGuildName(wideGuildName), _playerName(playerName), _guildName(guildName) {}
ObjectGuid GetGuid() const { return _guid; }
uint32 GetTeam() const { return _team; }
AccountTypes GetSecurity() const { return _security; }
uint8 GetLevel() const { return _level; }
uint8 GetClass() const { return _class; }
uint8 GetRace() const { return _race; }
uint32 GetZoneId() const { return _zoneid; }
uint8 GetGender() const { return _gender; }
bool IsVisible() const { return _visible; }
std::wstring const& GetWidePlayerName() const { return _widePlayerName; }
std::wstring const& GetWideGuildName() const { return _wideGuildName; }
std::string const& GetPlayerName() const { return _playerName; }
std::string const& GetGuildName() const { return _guildName; }
private:
ObjectGuid _guid;
uint32 _team;
AccountTypes _security;
uint8 _level;
uint8 _class;
uint8 _race;
uint32 _zoneid;
uint8 _gender;
bool _visible;
std::wstring _widePlayerName;
std::wstring _wideGuildName;
std::string _playerName;
std::string _guildName;
};
typedef std::vector<WhoListPlayerInfo> WhoListInfoVector;
class TC_GAME_API WhoListStorageMgr
{
private:
WhoListStorageMgr() { };
~WhoListStorageMgr() { };
public:
static WhoListStorageMgr* instance();
void Update();
WhoListInfoVector const& GetWhoList() const { return _whoListStorage; }
protected:
WhoListInfoVector _whoListStorage;
};
#define sWhoListStorageMgr WhoListStorageMgr::instance()
#endif // _WHOLISTSTORAGE_H
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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/>.
*/
#ifndef MODELHEADERS_H
#define MODELHEADERS_H
/* typedef unsigned char uint8;
typedef char int8;
typedef unsigned short uint16;
typedef short int16;
typedef unsigned int uint32;
typedef int int32; */
#pragma pack(push,1)
struct ModelHeader
{
char id[4];
uint8 version[4];
uint32 nameLength;
uint32 nameOfs;
uint32 type;
uint32 nGlobalSequences;
uint32 ofsGlobalSequences;
uint32 nAnimations;
uint32 ofsAnimations;
uint32 nAnimationLookup;
uint32 ofsAnimationLookup;
uint32 nBones;
uint32 ofsBones;
uint32 nKeyBoneLookup;
uint32 ofsKeyBoneLookup;
uint32 nVertices;
uint32 ofsVertices;
uint32 nViews;
uint32 nColors;
uint32 ofsColors;
uint32 nTextures;
uint32 ofsTextures;
uint32 nTransparency;
uint32 ofsTransparency;
uint32 nTextureanimations;
uint32 ofsTextureanimations;
uint32 nTexReplace;
uint32 ofsTexReplace;
uint32 nRenderFlags;
uint32 ofsRenderFlags;
uint32 nBoneLookupTable;
uint32 ofsBoneLookupTable;
uint32 nTexLookup;
uint32 ofsTexLookup;
uint32 nTexUnits;
uint32 ofsTexUnits;
uint32 nTransLookup;
uint32 ofsTransLookup;
uint32 nTexAnimLookup;
uint32 ofsTexAnimLookup;
float floats[14];
uint32 nBoundingTriangles;
uint32 ofsBoundingTriangles;
uint32 nBoundingVertices;
uint32 ofsBoundingVertices;
uint32 nBoundingNormals;
uint32 ofsBoundingNormals;
uint32 nAttachments;
uint32 ofsAttachments;
uint32 nAttachLookup;
uint32 ofsAttachLookup;
uint32 nAttachments_2;
uint32 ofsAttachments_2;
uint32 nLights;
uint32 ofsLights;
uint32 nCameras;
uint32 ofsCameras;
uint32 nCameraLookup;
uint32 ofsCameraLookup;
uint32 nRibbonEmitters;
uint32 ofsRibbonEmitters;
uint32 nParticleEmitters;
uint32 ofsParticleEmitters;
};
#pragma pack(pop)
#endif
|
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DragData_h
#define DragData_h
#include "Color.h"
#include "DragActions.h"
#include "IntPoint.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <AppKit/NSDragging.h>
typedef id <NSDraggingInfo> DragDataRef;
@class NSPasteboard;
#else
typedef void* DragDataRef;
class NSPasteboard;
#endif
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QMimeData;
QT_END_NAMESPACE
typedef const QMimeData* DragDataRef;
#elif PLATFORM(WIN)
typedef struct IDataObject* DragDataRef;
#include <wtf/text/WTFString.h>
#elif PLATFORM(WX)
typedef class wxDataObject* DragDataRef;
#elif PLATFORM(GTK)
namespace WebCore {
class DataObjectGtk;
}
typedef WebCore::DataObjectGtk* DragDataRef;
#elif defined ANDROID
typedef void* DragDataRef;
#elif PLATFORM(CHROMIUM)
#include "DragDataRef.h"
#elif PLATFORM(HAIKU)
class BMessage;
typedef class BMessage* DragDataRef;
#elif PLATFORM(EFL) || PLATFORM(BREWMP)
typedef void* DragDataRef;
#endif
namespace WebCore {
class Frame;
class DocumentFragment;
class KURL;
class Range;
enum DragApplicationFlags {
DragApplicationNone = 0,
DragApplicationIsModal = 1,
DragApplicationIsSource = 2,
DragApplicationHasAttachedSheet = 4,
DragApplicationIsCopyKeyDown = 8
};
#if PLATFORM(WIN)
typedef HashMap<UINT, Vector<String> > DragDataMap;
#endif
class DragData {
public:
enum FilenameConversionPolicy { DoNotConvertFilenames, ConvertFilenames };
// clientPosition is taken to be the position of the drag event within the target window, with (0,0) at the top left
DragData(DragDataRef, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone);
DragData(const String& dragStorageName, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone);
#if PLATFORM(WIN)
DragData(const DragDataMap&, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation sourceOperationMask, DragApplicationFlags = DragApplicationNone);
const DragDataMap& dragDataMap();
#endif
const IntPoint& clientPosition() const { return m_clientPosition; }
const IntPoint& globalPosition() const { return m_globalPosition; }
DragApplicationFlags flags() { return m_applicationFlags; }
DragDataRef platformData() const { return m_platformDragData; }
DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; }
bool containsURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames) const;
bool containsPlainText() const;
bool containsCompatibleContent() const;
String asURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames, String* title = 0) const;
String asPlainText(Frame*) const;
void asFilenames(Vector<String>&) const;
Color asColor() const;
PassRefPtr<DocumentFragment> asFragment(Frame*, PassRefPtr<Range> context,
bool allowPlainText, bool& chosePlainText) const;
bool canSmartReplace() const;
bool containsColor() const;
bool containsFiles() const;
#if PLATFORM(MAC)
NSPasteboard *pasteboard() { return m_pasteboard.get(); }
#endif
private:
IntPoint m_clientPosition;
IntPoint m_globalPosition;
DragDataRef m_platformDragData;
DragOperation m_draggingSourceOperationMask;
DragApplicationFlags m_applicationFlags;
#if PLATFORM(MAC)
RetainPtr<NSPasteboard> m_pasteboard;
#endif
#if PLATFORM(WIN)
DragDataMap m_dragDataMap;
#endif
};
}
#endif // !DragData_h
|
/*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/metadata.h"
void grpc_chttp2_plugin_init(void) {
grpc_register_tracer(&grpc_http_trace);
grpc_register_tracer(&grpc_flowctl_trace);
#ifndef NDEBUG
grpc_register_tracer(&grpc_trace_chttp2_refcount);
#endif
}
void grpc_chttp2_plugin_shutdown(void) {}
|
// 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 UI_GFX_CANVAS_PAINT_WIN_H_
#define UI_GFX_CANVAS_PAINT_WIN_H_
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/win/dpi.h"
namespace gfx {
// A class designed to help with WM_PAINT operations on Windows. It will create
// the bitmap and canvas with the correct size and transform for the dirty rect.
// The bitmap will be automatically painted to the screen on destruction.
//
// You MUST call isEmpty before painting to determine if anything needs
// painting. Sometimes the dirty rect can actually be empty, and this makes
// the bitmap functions we call unhappy. The caller should not paint in this
// case.
//
// Therefore, all you need to do is:
// case WM_PAINT: {
// PAINTSTRUCT ps;
// HDC hdc = BeginPaint(hwnd, &ps);
// gfx::CanvasSkiaPaint canvas(hwnd, hdc, ps);
// if (!canvas.isEmpty()) {
// ... paint to the canvas ...
// }
// EndPaint(hwnd, &ps);
// return 0;
// }
// Note: The created context is always inialized to (0, 0, 0, 0).
class GFX_EXPORT CanvasSkiaPaint : public Canvas {
public:
// This constructor assumes the canvas is opaque.
CanvasSkiaPaint(HWND hwnd, HDC dc, const PAINTSTRUCT& ps);
virtual ~CanvasSkiaPaint();
// Creates a CanvasSkiaPaint for the specified region that paints to the
// specified dc.
CanvasSkiaPaint(HDC dc, bool opaque, int x, int y, int w, int h);
// Returns the rectangle that is invalid.
virtual gfx::Rect GetInvalidRect() const;
// Returns true if the invalid region is empty. The caller should call this
// function to determine if anything needs painting.
bool is_empty() const {
return ps_.rcPaint.right - ps_.rcPaint.left == 0 ||
ps_.rcPaint.bottom - ps_.rcPaint.top == 0;
};
// Use to access the Windows painting parameters, especially useful for
// getting the bounding rect for painting: paintstruct().rcPaint
const PAINTSTRUCT& paint_struct() const { return ps_; }
// Returns the DC that will be painted to
HDC paint_dc() const { return paint_dc_; }
private:
void Init(bool opaque);
HWND hwnd_;
HDC paint_dc_;
PAINTSTRUCT ps_;
// Disallow copy and assign.
DISALLOW_COPY_AND_ASSIGN(CanvasSkiaPaint);
};
} // namespace gfx
#endif // UI_GFX_CANVAS_PAINT_WIN_H_
|
/*
* Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_PPFLAGS_H_
#define VPX_VP9_COMMON_VP9_PPFLAGS_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
VP9D_NOFILTERING = 0,
VP9D_DEBLOCK = 1 << 0,
VP9D_DEMACROBLOCK = 1 << 1,
VP9D_ADDNOISE = 1 << 2,
VP9D_MFQE = 1 << 3
};
typedef struct {
int post_proc_flag;
int deblocking_level;
int noise_level;
} vp9_ppflags_t;
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VPX_VP9_COMMON_VP9_PPFLAGS_H_
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "threads/Thread.h"
#include "IAddon.h"
#include "addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h"
#include "threads/CriticalSection.h"
#include <string>
namespace ADDON
{
/**
* Class - CAddonStatusHandler
* Used to inform the user about occurred errors and
* changes inside Add-on's, and ask him what to do.
* It can executed in the same thread as the calling
* function or in a separate thread.
*/
class CAddonStatusHandler : private CThread
{
public:
CAddonStatusHandler(const std::string &addonID, ADDON_STATUS status, std::string message, bool sameThread = true);
~CAddonStatusHandler();
/* Thread handling */
virtual void Process();
virtual void OnStartup();
virtual void OnExit();
private:
static CCriticalSection m_critSection;
AddonPtr m_addon;
ADDON_STATUS m_status;
std::string m_message;
};
}
|
/*
* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained from Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __MALI_OSK_PROFILING_H__
#define __MALI_OSK_PROFILING_H__
#if defined(CONFIG_MALI400_PROFILING) && defined (CONFIG_TRACEPOINTS)
#include "mali_linux_trace.h"
#include "mali_profiling_events.h"
#include "mali_profiling_gator_api.h"
#define MALI_PROFILING_MAX_BUFFER_ENTRIES 1048576
#define MALI_PROFILING_NO_HW_COUNTER = ((u32)-1)
/** @defgroup _mali_osk_profiling External profiling connectivity
* @{ */
/**
* Initialize the profiling module.
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
_mali_osk_errcode_t _mali_osk_profiling_init(mali_bool auto_start);
/*
* Terminate the profiling module.
*/
void _mali_osk_profiling_term(void);
/**
* Start recording profiling data
*
* The specified limit will determine how large the capture buffer is.
* MALI_PROFILING_MAX_BUFFER_ENTRIES determines the maximum size allowed by the device driver.
*
* @param limit The desired maximum number of events to record on input, the actual maximum on output.
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
_mali_osk_errcode_t _mali_osk_profiling_start(u32 * limit);
/**
* Add an profiling event
*
* @param event_id The event identificator.
* @param data0 First data parameter, depending on event_id specified.
* @param data1 Second data parameter, depending on event_id specified.
* @param data2 Third data parameter, depending on event_id specified.
* @param data3 Fourth data parameter, depending on event_id specified.
* @param data4 Fifth data parameter, depending on event_id specified.
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
/* Call Linux tracepoint directly */
#define _mali_osk_profiling_add_event(event_id, data0, data1, data2, data3, data4) trace_mali_timeline_event((event_id), (data0), (data1), (data2), (data3), (data4))
/**
* Report a hardware counter event.
*
* @param counter_id The ID of the counter.
* @param value The value of the counter.
*/
/* Call Linux tracepoint directly */
#define _mali_osk_profiling_report_hw_counter(counter_id, value) trace_mali_hw_counter(counter_id, value)
/**
* Report SW counters
*
* @param counters array of counter values
*/
void _mali_osk_profiling_report_sw_counters(u32 *counters);
/**
* Stop recording profiling data
*
* @param count Returns the number of recorded events.
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
_mali_osk_errcode_t _mali_osk_profiling_stop(u32 * count);
/**
* Retrieves the number of events that can be retrieved
*
* @return The number of recorded events that can be retrieved.
*/
u32 _mali_osk_profiling_get_count(void);
/**
* Retrieve an event
*
* @param index Event index (start with 0 and continue until this function fails to retrieve all events)
* @param timestamp The timestamp for the retrieved event will be stored here.
* @param event_id The event ID for the retrieved event will be stored here.
* @param data The 5 data values for the retrieved event will be stored here.
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
_mali_osk_errcode_t _mali_osk_profiling_get_event(u32 index, u64* timestamp, u32* event_id, u32 data[5]);
/**
* Clear the recorded buffer.
*
* This is needed in order to start another recording.
*
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
*/
_mali_osk_errcode_t _mali_osk_profiling_clear(void);
/**
* Checks if a recording of profiling data is in progress
*
* @return MALI_TRUE if recording of profiling data is in progress, MALI_FALSE if not
*/
mali_bool _mali_osk_profiling_is_recording(void);
/**
* Checks if profiling data is available for retrival
*
* @return MALI_TRUE if profiling data is avaiable, MALI_FALSE if not
*/
mali_bool _mali_osk_profiling_have_recording(void);
/** @} */ /* end group _mali_osk_profiling */
#else /* defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_TRACEPOINTS) */
/* Dummy add_event, for when profiling is disabled. */
#define _mali_osk_profiling_add_event(event_id, data0, data1, data2, data3, data4)
#endif /* defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_TRACEPOINTS) */
#endif /* __MALI_OSK_PROFILING_H__ */
|
/* Retrieve information about a FILE stream.
Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Assuming the stream STREAM is open for reading:
Return the number of bytes waiting in the input buffer of STREAM.
This includes both the bytes that have been read from the underlying input
source and the bytes that have been pushed back through 'ungetc'.
If this number is 0 and the stream is not currently writing,
fflush (STREAM) is known to be a no-op.
STREAM must not be wide-character oriented. */
extern size_t freadahead (FILE *stream);
#ifdef __cplusplus
}
#endif
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 Bucknell University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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
*
* Authors: L. Felipe Perrone (perrone@bucknell.edu)
* Tiago G. Rodrigues (tgr002@bucknell.edu)
*
* Modified by: Mitch Watrous (watrous@u.washington.edu)
*/
#ifndef APPLICATION_PACKET_PROBE_H
#define APPLICATION_PACKET_PROBE_H
#include "ns3/object.h"
#include "ns3/callback.h"
#include "ns3/boolean.h"
#include "ns3/nstime.h"
#include "ns3/packet.h"
#include "ns3/application.h"
#include "ns3/traced-value.h"
#include "ns3/simulator.h"
#include "ns3/probe.h"
namespace ns3 {
/**
* This class is designed to probe an underlying ns3 TraceSource
* exporting a packet and a socket address. This probe exports a
* trace source "Output" with arguments of type Ptr<const Packet> and
* const Address&. This probe exports another trace source
* "OutputBytes" with arguments of type uint32_t, which is the number
* of bytes in the packet. The trace sources emit values when either
* the probed trace source emits a new value, or when SetValue () is
* called.
*/
class ApplicationPacketProbe : public Probe
{
public:
static TypeId GetTypeId ();
ApplicationPacketProbe ();
virtual ~ApplicationPacketProbe ();
/**
* \brief Set a probe value
*
* \param packet set the traced packet equal to this
* \param address set the socket address for the traced packet equal to this
*/
void SetValue (Ptr<const Packet> packet, const Address& address);
/**
* \brief Set a probe value by its name in the Config system
*
* \param path config path to access the probe
* \param packet set the traced packet equal to this
* \param address set the socket address for the traced packet equal to this
*/
static void SetValueByPath (std::string path, Ptr<const Packet> packet, const Address& address);
/**
* \brief connect to a trace source attribute provided by a given object
*
* \param traceSource the name of the attribute TraceSource to connect to
* \param obj ns3::Object to connect to
* \return true if the trace source was successfully connected
*/
virtual bool ConnectByObject (std::string traceSource, Ptr<Object> obj);
/**
* \brief connect to a trace source provided by a config path
*
* \param path Config path to bind to
*
* Note, if an invalid path is provided, the probe will not be connected
* to anything.
*/
virtual void ConnectByPath (std::string path);
private:
/**
* \brief Method to connect to an underlying ns3::TraceSource with
* arguments of type Ptr<const Packet> and const Address&
*
* \param packet the traced packet
* \param address the socket address for the traced packet
*
* \internal
*/
void TraceSink (Ptr<const Packet> packet, const Address& address);
TracedCallback<Ptr<const Packet>, const Address&> m_output;
TracedCallback<uint32_t, uint32_t> m_outputBytes;
/// The traced packet.
Ptr<const Packet> m_packet;
/// The socket address for the traced packet.
Address m_address;
/// The size of the traced packet.
uint32_t m_packetSizeOld;
};
} // namespace ns3
#endif // APPLICATION_PACKET_PROBE_H
|
/* Common code for the plugin and lto1.
Copyright (C) 2008-2016 Free Software Foundation, Inc.
Contributed by Rafael Avila de Espindola (espindola@google.com).
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
static const char *lto_resolution_str[10] =
{
"UNKNOWN",
"UNDEF",
"PREVAILING_DEF",
"PREVAILING_DEF_IRONLY",
"PREEMPTED_REG",
"PREEMPTED_IR",
"RESOLVED_IR",
"RESOLVED_EXEC",
"RESOLVED_DYN",
"PREVAILING_DEF_IRONLY_EXP",
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.