text stringlengths 4 6.14k |
|---|
//
// MySQL.h
// MySQL
//
// Created by Alsey Coleman Miller on 10/10/15.
// Copyright © 2015 ColemanCDA. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for MySQL.
FOUNDATION_EXPORT double MySQLVersionNumber;
//! Project version string for MySQL.
FOUNDATION_EXPORT const unsigned char MySQLVersionString[];
|
//***************************************************************************************
//
// File supervisor: Softimage 3D Games & 3D Bridge team
//
// (c) Copyright 2001-2002 Avid Technology, Inc. . All rights reserved.
//
//***************************************************************************************
/****************************************************************************************
THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved.
SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries
or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
trademarks contained herein are the property of their respective owners.
****************************************************************************************/
#ifndef _TIMECONTROL_H
#define _TIMECONTROL_H
#include "Template.h"
#include "Extrapolation.h"
//! Stores the clipping and offset parameters of an action clip (CSLActionClip)
/*! You can add a CSLTimeControl with the CSLActionClip::AddTimeControl
method.
\note CSLTimeControl is not supported by SI3D.
\sa CSLActionClip
\sa CSLExtrapolation
*/
class XSIEXPORT CSLTimeControl
: public CSLTemplate
{
public:
//! Specifies where extrapolation occures while processing an CSLActionClip
enum EExtrapolationPos
{
SI_BEFORE, //!< Extrapolation performed \b before the CSLActionClip
SI_AFTER //!< Extrapolation performed \b after the CSLActionClip
};
/*! Constructor
\param in_pScene Pointer to the scene containing the CSLTimeControl
\param in_pModel Pointer to the model containing the CSLTimeControl
\param in_pTemplate Pointer to the CdotXSITemplate containing the CSLTimeControl data
*/
CSLTimeControl(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
virtual ~CSLTimeControl();
/*! Gets the type of this template
\retval CSLTemplate::XSI_TIMECONTROL
*/
CSLTemplate::ETemplateType Type(){ return CSLTemplate::XSI_TIMECONTROL; }
SI_Error Synchronize();
/*! Gets the first frame of the source that is used by the clip.
\return Frame number
*/
SI_Float GetIn();
/*! Sets the first frame of the source that is used by the clip.
\param in_fNew Frame number
*/
SI_Void SetIn( SI_Float in_fNew );
/*! Gets the last frame of the source that is used by the clip.
\return Frame number
*/
SI_Float GetOut();
/*! Sets the last frame of the source that is used by the clip.
\param in_fNew Frame number
*/
SI_Void SetOut( SI_Float in_fNew );
/*! Gets the scaling of the clip in time.
\return SI_Float The scale value
*/
SI_Float GetScale();
/*! Sets The scaling of the clip in time.
\param in_fNew Scale factor
\note Increasing this value speeds up the relative time of the clip, decreasing the duration.
*/
SI_Void SetScale( SI_Float in_fNew );
/*! Gets the frame where the clip starts in the local time of the CSLActionClip.
\return SI_Float The start offset
*/
SI_Float GetStartOffset();
/*! Sets he frame where the clip starts in the local time of the CSLActionClip.
\param in_fNew The new start offset value
*/
SI_Void SetStartOffset( SI_Float in_fNew );
// extrapolation functionality ////////////////////////////////////////////
/*! Creates a new extrapolation and connect it
\param in_Pos Specifies where the extrapolation must be performed
\param in_Type Type of extrapolation to create
\retval CSLExtrapolation Pointer to the newly created extrapolation.
\retval NULL An extrapolation at \p in_Pos already exists.
*/
CSLExtrapolation* CreateExtrapolation( EExtrapolationPos in_Pos, CSLExtrapolation::EExtrapolationType in_Type = CSLExtrapolation::SI_NO_CONTRIBUTION );
/*! Gets one of the extrapolation
\param in_Pos Specifies the extrapolation position to get
\retval Pointer to the requested extrapolation
\retval NULL There is no extrapolation at the requested position
*/
CSLExtrapolation* GetExtrapolation( EExtrapolationPos in_Pos );
/*! Sets one of the extrapolation position
\param in_Pos The extrapolation position to set.
\param in_pExtrapolation The extrapolation to put at the requested position
\warning This method overwrites any existing extrapolation and might cause
leaks. You either have to free previously allocated extrapolation or use
the non-destructive CSLTimeControl::ConnectExtrapolation method instead.
\sa CSLTimeControl::ConnectExtrapolation
*/
SI_Void SetExtrapolation( EExtrapolationPos in_Pos, CSLExtrapolation *in_pExtrapolation );
/*! Sets one of the extrapolation values if not already set
\param in_Pos Specifies the extrapolation position to set
\param in_pExtrapolation Extrapolation to connect
\sa CSLTimeControl::SetExtrapolation
*/
CSLExtrapolation* ConnectExtrapolation( EExtrapolationPos in_Pos, CSLExtrapolation* in_pExtrapolation );
private:
CSLFloatProxy m_In;
CSLFloatProxy m_Out;
CSLFloatProxy m_StartOffset;
CSLFloatProxy m_Scale;
CSLExtrapolation* m_pExtrapolationBefore;
CSLExtrapolation* m_pExtrapolationAfter;
};
#endif
|
#ifndef __CToggleViewTEST_H__
#define __CToggleViewTEST_H__
#include "../../MenuScene.h"
//////////////////////////////////////////////////////
class CToggleViewTestSceneBase : public BaseTestScene
{
public:
virtual void onNextBtnClick(Ref* pSender);
virtual void onBackBtnClick(Ref* pSender);
virtual void onRefBtnClick(Ref* pSender);
};
//////////////////////////////////////////////////////
class CToggleViewBasicTest : public CToggleViewTestSceneBase
{
public:
CREATE_FUNC(CToggleViewBasicTest);
virtual bool init();
void onClick(Ref* pSender);
CLabel* m_pText;
};
//////////////////////////////////////////////////////
class CToggleViewGroupTest : public CToggleViewTestSceneBase
{
public:
CREATE_FUNC(CToggleViewGroupTest);
virtual bool init();
void onCheck(Ref* pSender, bool bChecked);
};
//////////////////////////////////////////////////////
static int CToggleView_test_idx;
static Scene* getCToggleViewTestScene()
{
switch(CToggleView_test_idx)
{
case 0:
return CToggleViewBasicTest::create();
case 1:
return CToggleViewGroupTest::create();
default:
CToggleView_test_idx = 0;
return CToggleViewBasicTest::create();
}
return NULL;
}
static Scene* pushCToggleViewTestScene()
{
CToggleView_test_idx = 0;
Scene* pScene = getCToggleViewTestScene();
Director::getInstance()->pushScene(pScene);
return pScene;
}
static void nextCToggleViewTestScene()
{
CToggleView_test_idx++;
Scene* pScene = getCToggleViewTestScene();
Director::getInstance()->replaceScene(pScene);
}
static void backCToggleViewTestScene()
{
CToggleView_test_idx--;
Scene* pScene = getCToggleViewTestScene();
Director::getInstance()->replaceScene(pScene);
}
static void refCToggleViewTestScene()
{
Scene* pScene = getCToggleViewTestScene();
Director::getInstance()->replaceScene(pScene);
}
#endif //__CToggleViewTEST_H__ |
//*****************************************************************************
/*!
\file xsi_proxyparameter.h
\brief ProxyParameter class declaration.
© Copyright 1998-2002 Avid Technology, Inc. and its licensors. All rights
reserved. This file contains confidential and proprietary information of
Avid Technology, Inc., and is subject to the terms of the SOFTIMAGE|XSI
end user license agreement (or EULA).
*/
//*****************************************************************************
#if (_MSC_VER > 1000) || defined(SGI_COMPILER)
#pragma once
#endif
#ifndef __XSIPROXYPARAMETER_H__
#define __XSIPROXYPARAMETER_H__
#include <xsi_parameter.h>
#include <xsi_value.h>
#include <xsi_status.h>
namespace XSI {
//*****************************************************************************
/*! \class ProxyParameter xsi_proxyparameter.h
\brief A ProxyParameter is a kind of Parameter that can be created on a CustomProperty
which is "linked" with the value of another Parameter somewhere else in the Scene.
Both the "Master Parameter" and the %ProxyParameter always have the same value and
changing the value of the proxy parameter is equivalent to changing the value of the
master parameter.
\sa CustomProperty::AddProxyParameter
\eg
\code
using namespace XSI;
Application app;
Model root = app.GetActiveSceneRoot();
CustomProperty cpset;
root.AddCustomProperty(L"MyCustomPSet", false, cpset );
// For demonstration purposes,
// get reference to rotx on the default scene camera
CRef crefProxiedParam;
crefProxiedParam.Set(L"Camera_Root.kine.local.rotx");
// Create proxy parameter to this camera parameter
ProxyParameter returnedProxyParam = cpset.AddProxyParameter(Parameter(crefProxiedParam)) ;
// Changing the proxy parameter will update the value on the camera object
returnedProxyParam.PutValue( 47.0 ) ;
CString strRotX = Parameter( crefProxiedParam ).GetValue().GetAsText() ;
app.LogMessage( L"After changing proxy param value the rot X is " + strRotX ) ;
// You can remove a proxy parameter like this
cpset.RemoveParameter( returnedProxyParam ) ;
\endcode
*/
//*****************************************************************************
class SICPPSDKDECL ProxyParameter : public Parameter
{
public:
/*! Default constructor. */
ProxyParameter();
/*! Default destructor. */
~ProxyParameter();
/*! Constructor.
\param in_ref constant reference object.
*/
ProxyParameter(const CRef& in_ref);
/*! Copy constructor.
\param in_obj constant class object.
*/
ProxyParameter(const ProxyParameter& in_obj);
/*! Returns true if a given class type is compatible with this API class.
\param in_ClassID class type.
\return true if the class is compatible, false otherwise.
*/
bool IsA( siClassID in_ClassID) const;
/*! Returns the type of the API class.
\return The class type.
*/
siClassID GetClassID() const;
/*! Creates an object from another object. The newly created object is set to
empty if the input object is not compatible.
\param in_obj constant class object.
\return The new ProxyParameter object.
*/
ProxyParameter& operator=(const ProxyParameter& in_obj);
/*! Creates an object from a reference object. The newly created object is
set to empty if the input reference object is not compatible.
\param in_ref constant class object.
\return The new ProxyParameter object.
*/
ProxyParameter& operator=(const CRef& in_ref);
/*! Returns the parameter that is referenced by a proxy parameter. If this parameter
is not a proxy parameter then an empty object is returned.
\return The real Parameter that the ProxyParameter clones.
*/
Parameter GetMasterParameter() const;
private:
ProxyParameter * operator&() const;
ProxyParameter * operator&();
};
};
#endif // __XSIPROXYPARAMETER_H__
|
/*************************************************************\
* Trigger.h *
* This file was created by Jeremy Greenburg *
* As part of The God Core game for the University of *
* Tennessee at Martin's University Scholars Organization *
* *
* This file contains the declaration of the Trigger class *
* Which can be bound to a trigger-object that, upon use, *
* Will activate a designated target-object. *
\*************************************************************/
#ifndef TRIGGER_H
#define TRIGGER_H
#include "Terminal.h"
#include "Switch.h"
#include "GCTypes.h"
class Trigger
{
private:
void* trigger; // The object that activates the target
void* target; // The object that is activated by the target
GCtype triggerType; // The type (defined from GCtypes.h) of the trigger
GCtype targetType; // The type(defined from GCtypes.h) of the target
void activateTarget();
public:
// Get the object type of the trigger
int getTriggerType();
// Attempts to trigger the target
bool tryToTrigger(void* input, GCtype type);
// Binds the triggering object
void bindTrigger(void* _trigger);
// Binds the target object
void bindTarget(void* _target);
// Constructor takes in trigger type and target type
Trigger(GCtype _triggerType, GCtype _targetType);
};
#endif |
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef JNI_ANDROID_P_H
#define JNI_ANDROID_P_H
#include <QtAndroidExtras/QAndroidJniEnvironment>
#include <QtAndroidExtras/QAndroidJniObject>
QT_BEGIN_NAMESPACE
enum JavaNames {
BluetoothAdapter = 0,
BluetoothDevice,
ActionAclConnected,
ActionAclDisconnected,
ActionBondStateChanged,
ActionDiscoveryStarted,
ActionDiscoveryFinished,
ActionFound,
ActionPairingRequest,
ActionScanModeChanged,
ActionUuid,
ExtraBondState,
ExtraDevice,
ExtraPairingKey,
ExtraPairingVariant,
ExtraRssi,
ExtraScanMode,
ExtraUuid
};
QAndroidJniObject valueForStaticField(JavaNames javaName, JavaNames javaFieldName);
QT_END_NAMESPACE
#endif // JNI_ANDROID_P_H
|
//===------------------------ __refstring ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_REFSTRING_H
#define _LIBCPP_REFSTRING_H
#include <__config>
#include <stdexcept>
#include <cstddef>
#include <cstring>
#include "atomic_support.h"
// MacOS and iOS used to ship with libstdc++, and still support old applications
// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed
// to be ABI compatible, such that they can be thrown from one library and caught
// in the other.
//
// For that reason, we must look for libstdc++ in the same process and if found,
// check the string stored in the exception object to see if it is the GCC empty
// string singleton before manipulating the reference count. This is done so that
// if an exception is created with a zero-length string in libstdc++, libc++abi
// won't try to delete the memory.
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
# define _LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE
# include <dlfcn.h>
# include <mach-o/dyld.h>
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
namespace __refstring_imp { namespace {
typedef int count_t;
struct _Rep_base {
std::size_t len;
std::size_t cap;
count_t count;
};
inline _Rep_base* rep_from_data(const char *data_) noexcept {
char *data = const_cast<char *>(data_);
return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
}
inline char * data_from_rep(_Rep_base *rep) noexcept {
char *data = reinterpret_cast<char *>(rep);
return data + sizeof(*rep);
}
#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
inline
const char* compute_gcc_empty_string_storage() _NOEXCEPT
{
void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
if (handle == nullptr)
return nullptr;
void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
if (sym == nullptr)
return nullptr;
return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
}
inline
const char*
get_gcc_empty_string_storage() _NOEXCEPT
{
static const char* p = compute_gcc_empty_string_storage();
return p;
}
#endif
}} // namespace __refstring_imp
using namespace __refstring_imp;
inline
__libcpp_refstring::__libcpp_refstring(const char* msg) {
std::size_t len = strlen(msg);
_Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
rep->len = len;
rep->cap = len;
rep->count = 0;
char *data = data_from_rep(rep);
std::memcpy(data, msg, len + 1);
__imp_ = data;
}
inline
__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
: __imp_(s.__imp_)
{
if (__uses_refcount())
__libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
}
inline
__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT {
bool adjust_old_count = __uses_refcount();
struct _Rep_base *old_rep = rep_from_data(__imp_);
__imp_ = s.__imp_;
if (__uses_refcount())
__libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
if (adjust_old_count)
{
if (__libcpp_atomic_add(&old_rep->count, count_t(-1)) < 0)
{
::operator delete(old_rep);
}
}
return *this;
}
inline
__libcpp_refstring::~__libcpp_refstring() {
if (__uses_refcount()) {
_Rep_base* rep = rep_from_data(__imp_);
if (__libcpp_atomic_add(&rep->count, count_t(-1)) < 0) {
::operator delete(rep);
}
}
}
inline
bool __libcpp_refstring::__uses_refcount() const {
#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
return __imp_ != get_gcc_empty_string_storage();
#else
return true;
#endif
}
_LIBCPP_END_NAMESPACE_STD
#endif //_LIBCPP_REFSTRING_H
|
/* determine latitude angle phi-2 */
#ifndef lint
static const char SCCSID[]="@(#)pj_phi2.c 4.3 93/06/12 GIE REL";
#endif
#include "projects.h"
#define HALFPI 1.5707963267948966
#define TOL 1.0e-10
#define N_ITER 15
double
pj_phi2(double ts, double e) {
double eccnth, Phi, con, dphi;
int i;
eccnth = .5 * e;
Phi = HALFPI - 2. * atan (ts);
i = N_ITER;
do {
con = e * sin (Phi);
dphi = HALFPI - 2. * atan (ts * pow((1. - con) /
(1. + con), eccnth)) - Phi;
Phi += dphi;
} while ( fabs(dphi) > TOL && --i);
if (i <= 0)
pj_errno = -18;
return Phi;
}
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Android\0.19.1\Android\android\webkit\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Android.android.webkit.JsResult.h>
#include <Android.Base.Wrappers.IJWrapper.h>
#include <Uno.IDisposable.h>
namespace g{namespace Android{namespace android{namespace webkit{struct JsPromptResult;}}}}
namespace g{
namespace Android{
namespace android{
namespace webkit{
// public sealed extern class JsPromptResult :2112
// {
::g::Android::java::lang::Object_type* JsPromptResult_typeof();
struct JsPromptResult : ::g::Android::android::webkit::JsResult
{
};
// }
}}}} // ::g::Android::android::webkit
|
#undef NAUT_CONFIG_DEBUG_SYNCH
|
//
// UIImage+Color.h
// 网易彩票2014MJ版
//
// Created by 沐汐 on 14-9-13.
// Copyright (c) 2014年 沐汐. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UIColor+Extend.h"
@interface UIImage (Color)
//给我一种颜色,一个尺寸,我给你返回一个UIImage:不透明
+(UIImage *)imageFromContextWithColor:(UIColor *)color;
+(UIImage *)imageFromContextWithColor:(UIColor *)color size:(CGSize)size;
- (UIImage *) imageWithTintColor:(UIColor *)tintColor;
- (UIImage *) imageWithGradientTintColor:(UIColor *)tintColor;
@end
|
/*------------------------------------------------------------------------
* Copyright 2010 (c) Jeff Brown <spadix@users.sourceforge.net>
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
#import "zbar.h"
#import "ZBarSymbol.h"
#import "ZBarImage.h"
#import "ZBarImageScanner.h"
#import "ZBarReaderView.h"
#import "ZBarReaderViewController.h"
#import "ZBarReaderController.h"
#import "ZBarCaptureReader.h"
#import "ZBarHelpController.h"
|
#ifndef __HDF5IO_H__
#define __HDF5IO_H__
#include <hdf5.h>
#define NAME_BUF_SIZE 256
struct HDF5IO(waveform_file)
{
hid_t waveFid;
size_t nPt;
size_t nCh;
size_t nWfmPerChunk;
size_t nEvents;
};
struct HDF5IO(waveform_event)
{
size_t eventId;
/* wavBuf should point to a contiguous 2D array, mapped as
* ch1..ch2..ch3..ch4 (row-major). Omitting one or more ch? is
* allowed in accordance with chMask.*/
SCOPE_DATA_TYPE *wavBuf;
};
/* nWfmPerChunk: waveforms are stored in 2D arrays. To optimize
* performance, n waveforms are grouped together to be put in the same
* array, then the (n+1)th waveform is put into the next grouped
* array, and so forth. */
struct HDF5IO(waveform_file) *HDF5IO(open_file)(
const char *fname, size_t nWfmPerChunk,
size_t nCh);
struct HDF5IO(waveform_file) *HDF5IO(open_file_for_read)(const char *fname);
int HDF5IO(close_file)(struct HDF5IO(waveform_file) *wavFile);
/* flush also writes nEvents to the file */
int HDF5IO(flush_file)(struct HDF5IO(waveform_file) *wavFile);
int HDF5IO(write_waveform_attribute_in_file_header)(
struct HDF5IO(waveform_file) *wavFile,
struct waveform_attribute *wavAttr);
int HDF5IO(read_waveform_attribute_in_file_header)(
struct HDF5IO(waveform_file) *wavFile,
struct waveform_attribute *wavAttr);
int HDF5IO(write_event)(struct HDF5IO(waveform_file) *wavFile,
struct HDF5IO(waveform_event) *wavEvent);
int HDF5IO(read_event)(struct HDF5IO(waveform_file) *wavFile,
struct HDF5IO(waveform_event) *wavEvent);
size_t HDF5IO(get_number_of_events)(struct HDF5IO(waveform_file) *wavFile);
#endif /* __HDF5IO_H__ */
|
/*
// CYLTabBarController
// CYLTabBarController
//
// Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19.
// Copyright © 2019 https://github.com/ChenYilong . All rights reserved.
*/
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface CYLBaseTableViewController : UITableViewController
@end
NS_ASSUME_NONNULL_END
|
#include <windows.h>
#include <string>
void coutW(wchar_t ch);
void coutW(const wchar_t *ptr);
void coutW(const wchar_t *ptr, int len);
void coutW(const std::wstring &str);
//----------------------------------------------------------------------
// 色定義
#define COL_BLACK 0x00
#define COL_DARK_BLUE 0x01
#define COL_DARK_GREEN 0x02
#define COL_DARK_CYAN 0x03
#define COL_DARK_RED 0x04
#define COL_DARK_VIOLET 0x05
#define COL_DARK_YELLOW 0x06
#define COL_GRAY 0x07
#define COL_LIGHT_GRAY 0x08
#define COL_BLUE 0x09
#define COL_GREEN 0x0a
#define COL_CYAN 0x0b
#define COL_RED 0x0c
#define COL_VIOLET 0x0d
#define COL_YELLOW 0x0e
#define COL_WHITE 0x0f
#define COL_INTENSITY 0x08 // 高輝度マスク
#define COL_RED_MASK 0x04
#define COL_GREEN_MASK 0x02
#define COL_BLUE_MASK 0x01
void setColor(int col);
void setColor(int fg, int bg);
void setCursorPos(int x, int y);
bool isKeyPressed(int vKey);
|
/*=========================================================================
Program: OsiriX
Copyright (c) OsiriX Team
All rights reserved.
Distributed under GNU - LGPL
See http://www.osirix-viewer.com/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#import <Cocoa/Cocoa.h>
#import "DCMPix.h" // An object containing an image, including pixels values
#import "ViewerController.h" // An object representing a 2D Viewer window
#import "DCMView.h" // An object representing the 2D pane, contained in a 2D Viewer window
#import "MyPoint.h" // An object representing a point
#import "ROI.h" // An object representing a ROI
/** \brief Base class for plugins */
@interface PluginFilter : NSObject
{
ViewerController* viewerController; // Current (frontmost and active) 2D viewer containing an image serie
}
+ (PluginFilter *)filter;
// FUNCTIONS TO SUBCLASS
/** This function is called to apply your plugin */
- (long) filterImage: (NSString*) menuName;
/** This function is the entry point of Pre-Process plugins */
- (long) processFiles: (NSMutableArray*) files;
/** This function is the entry point of Report plugins
* action = @"dateReport" -> return NSDate date of creation or modification of the report, nil if no report available
* action = @"deleteReport" -> return nil, delete the report
* action = @"openReport" -> return nil, open and display the report, create a new one if no report available
*/
- (id) report: (NSManagedObject*) study action:(NSString*) action;
/** This function is called at the OsiriX startup, if you need to do some memory allocation, etc. */
- (void) initPlugin;
/** Opportunity for plugins to make Menu changes if necessary */
- (void)setMenus;
// UTILITY FUNCTIONS - Defined in the PluginFilter.m file
/** Return the complete lists of opened studies in OsiriX */
/** NSArray contains an array of ViewerController objects */
- (NSArray*) viewerControllersList;
/** Create a new 2D window, containing a copy of the current series */
- (ViewerController*) duplicateCurrent2DViewerWindow;
// Following stubs are to be subclassed by report filters. Included here to remove compile-time warning messages.
/** Stub is to be subclassed by report filters */
- (id)reportDateForStudy: (NSManagedObject*)study;
/** Stub is to be subclassed by report filters */
- (void)deleteReportForStudy: (NSManagedObject*)study;
/** Stub is to be subclassed by report filters */
- (void)createReportForStudy: (NSManagedObject*)study;
/** PRIVATE FUNCTIONS - DON'T SUBCLASS OR MODIFY */
- (long) prepareFilter:(ViewerController*) vC;
@end
@interface PluginFilter (Optional)
/** Called to pass the plugin all sorts of events sent to a DCMView. */
-(BOOL)handleEvent:(NSEvent*)event forViewer:(id)controller;
@end;
|
#pragma once
#include "../ghoul2/ghoul2_shared.h"
#include "../qcommon/q_shared.h"
#ifdef _G2_GORE
#define MAX_LODS (8)
struct GoreTextureCoordinates
{
float *tex[MAX_LODS];
GoreTextureCoordinates();
~GoreTextureCoordinates();
};
int AllocGoreRecord();
GoreTextureCoordinates *FindGoreRecord(int tag);
void DeleteGoreRecord(int tag);
struct SGoreSurface
{
int shader;
int mGoreTag;
int mDeleteTime;
int mFadeTime;
bool mFadeRGB;
int mGoreGrowStartTime;
int mGoreGrowEndTime; // set this to -1 to disable growing
//curscale = (curtime-mGoreGrowStartTime)*mGoreGrowFactor + mGoreGrowOffset;
float mGoreGrowFactor;
float mGoreGrowOffset;
};
class CGoreSet
{
public:
int mMyGoreSetTag;
unsigned char mRefCount;
multimap<int,SGoreSurface> mGoreRecords; // a map from surface index
CGoreSet(int tag) : mMyGoreSetTag(tag), mRefCount(0) {}
~CGoreSet();
};
CGoreSet *FindGoreSet(int goreSetTag);
CGoreSet *NewGoreSet();
void DeleteGoreSet(int goreSetTag);
#endif // _G2_GORE
//rww - RAGDOLL_BEGIN
/// ragdoll stuff
#ifdef _MSC_VER
#pragma warning(disable: 4512)
#endif
struct SRagDollEffectorCollision
{
vec3_t effectorPosition;
const trace_t &tr;
bool useTracePlane;
SRagDollEffectorCollision(const vec3_t effectorPos,const trace_t &t) :
tr(t),
useTracePlane(false)
{
VectorCopy(effectorPos,effectorPosition);
}
};
class CRagDollUpdateParams
{
public:
vec3_t angles;
vec3_t position;
vec3_t scale;
vec3_t velocity;
//CServerEntity *me;
int me; //index!
int settleFrame;
//at some point I'll want to make VM callbacks in here. For now I am just doing nothing.
virtual void EffectorCollision(const SRagDollEffectorCollision &data)
{
// assert(0); // you probably meant to override this
}
virtual void RagDollBegin()
{
// assert(0); // you probably meant to override this
}
virtual void RagDollSettled()
{
// assert(0); // you probably meant to override this
}
virtual void Collision()
{
// assert(0); // you probably meant to override this
// we had a collision, uhh I guess call SetRagDoll RP_DEATH_COLLISION
}
#ifdef _DEBUG
virtual void DebugLine(const vec3_t p1,const vec3_t p2,bool bbox) {assert(0);}
#endif
};
class CRagDollParams
{
public:
enum ERagPhase
{
RP_START_DEATH_ANIM,
RP_END_DEATH_ANIM,
RP_DEATH_COLLISION,
RP_CORPSE_SHOT,
RP_GET_PELVIS_OFFSET, // this actually does nothing but set the pelvisAnglesOffset, and pelvisPositionOffset
RP_SET_PELVIS_OFFSET, // this actually does nothing but set the pelvisAnglesOffset, and pelvisPositionOffset
RP_DISABLE_EFFECTORS // this removes effectors given by the effectorsToTurnOff member
};
vec3_t angles;
vec3_t position;
vec3_t scale;
vec3_t pelvisAnglesOffset; // always set on return, an argument for RP_SET_PELVIS_OFFSET
vec3_t pelvisPositionOffset; // always set on return, an argument for RP_SET_PELVIS_OFFSET
float fImpactStrength; //should be applicable when RagPhase is RP_DEATH_COLLISION
float fShotStrength; //should be applicable for setting velocity of corpse on shot (probably only on RP_CORPSE_SHOT)
//CServerEntity *me;
int me;
//rww - we have convenient animation/frame access in the game, so just send this info over from there.
int startFrame;
int endFrame;
int collisionType; // 1 = from a fall, 0 from effectors, this will be going away soon, hence no enum
qboolean CallRagDollBegin; // a return value, means that we are now begininng ragdoll and the NPC stuff needs to happen
ERagPhase RagPhase;
// effector control, used for RP_DISABLE_EFFECTORS call
enum ERagEffector
{
RE_MODEL_ROOT= 0x00000001, //"model_root"
RE_PELVIS= 0x00000002, //"pelvis"
RE_LOWER_LUMBAR= 0x00000004, //"lower_lumbar"
RE_UPPER_LUMBAR= 0x00000008, //"upper_lumbar"
RE_THORACIC= 0x00000010, //"thoracic"
RE_CRANIUM= 0x00000020, //"cranium"
RE_RHUMEROUS= 0x00000040, //"rhumerus"
RE_LHUMEROUS= 0x00000080, //"lhumerus"
RE_RRADIUS= 0x00000100, //"rradius"
RE_LRADIUS= 0x00000200, //"lradius"
RE_RFEMURYZ= 0x00000400, //"rfemurYZ"
RE_LFEMURYZ= 0x00000800, //"lfemurYZ"
RE_RTIBIA= 0x00001000, //"rtibia"
RE_LTIBIA= 0x00002000, //"ltibia"
RE_RHAND= 0x00004000, //"rhand"
RE_LHAND= 0x00008000, //"lhand"
RE_RTARSAL= 0x00010000, //"rtarsal"
RE_LTARSAL= 0x00020000, //"ltarsal"
RE_RTALUS= 0x00040000, //"rtalus"
RE_LTALUS= 0x00080000, //"ltalus"
RE_RRADIUSX= 0x00100000, //"rradiusX"
RE_LRADIUSX= 0x00200000, //"lradiusX"
RE_RFEMURX= 0x00400000, //"rfemurX"
RE_LFEMURX= 0x00800000, //"lfemurX"
RE_CEYEBROW= 0x01000000 //"ceyebrow"
};
ERagEffector effectorsToTurnOff; // set this to an | of the above flags for a RP_DISABLE_EFFECTORS
};
//rww - RAGDOLL_END
|
/******************************************************************************
* balloon/common.h
*
* 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; or, when distributed
* separately from the Linux kernel or incorporated into other
* software packages, subject to the following license:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this source file (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 __XEN_BALLOON_COMMON_H__
#define __XEN_BALLOON_COMMON_H__
#define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
struct balloon_stats {
/* We aim for 'current allocation' == 'target allocation'. */
unsigned long current_pages;
unsigned long target_pages;
/* We may hit the hard limit in Xen. If we do then we remember it. */
unsigned long hard_limit;
/*
* Drivers may alter the memory reservation independently, but they
* must inform the balloon driver so we avoid hitting the hard limit.
*/
unsigned long driver_pages;
/* Number of pages in high- and low-memory balloons. */
unsigned long balloon_low;
unsigned long balloon_high;
};
extern struct balloon_stats balloon_stats;
#define bs balloon_stats
int balloon_sysfs_init(void);
void balloon_sysfs_exit(void);
void balloon_set_new_target(unsigned long target);
#endif /* __XEN_BALLOON_COMMON_H__ */
|
/****************************************************************************
(c) SYSTEC electronic GmbH, D-08468 Heinsdorfergrund, Am Windrad 2
www.systec-electronic.com
Project: Board driver for SYSTEC ECUcore-5484
Description: Declarations for board driver
License:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of SYSTEC electronic GmbH nor the names of its
contributors may be used to endorse or promote products derived
from this software without prior written permission. For written
permission, please contact info@systec-electronic.com.
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 HOLDERS 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.
Severability Clause:
If a provision of this License is or becomes illegal, invalid or
unenforceable in any jurisdiction, that shall not affect:
1. the validity or enforceability in that jurisdiction of any other
provision of this License; or
2. the validity or enforceability in other jurisdictions of that or
any other provision of this License.
-------------------------------------------------------------------------
2006/09/27 -rs: Initial Version
2006/10/01 -rs: Support for I/O board PCB 4160.0
2006/10/03 -rs: Support for I/O board PCB 4158.1
2007/02/19 -rs: Support for I/O board PCB 4158.1 with PLD
****************************************************************************/
#ifndef _CF54DEF_H_
#define _CF54DEF_H_
//---------------------------------------------------------------------------
// Constant definitions
//---------------------------------------------------------------------------
#define CF54DRV_RES_OK 0
#define CF54DRV_RES_ERROR -1
#define CF54DRV_RES_NOT_IMPLEMENTED -2
//---------------------------------------------------------------------------
// Commands for <ioctl>
//---------------------------------------------------------------------------
#define CF54DRV_CMD_INITIALIZE 0
#define CF54DRV_CMD_SHUTDOWN 1
#define CF54DRV_CMD_RESET_TARGET 2
#define CF54DRV_CMD_ENABLE_WATCHDOG 3
#define CF54DRV_CMD_SERVICE_WATCHDOG 4
#define CF54DRV_CMD_GET_HARDWARE_INFO 5
#define CF54DRV_CMD_SET_RUN_LED 6
#define CF54DRV_CMD_SET_ERR_LED 7
#define CF54DRV_CMD_GET_RSM_SWITCH 8
#define CF54DRV_CMD_GET_HEX_SWITCH 9
#define CF54DRV_CMD_GET_DIP_SWITCH 10
#define CF54DRV_CMD_GET_DIGI_IN 11
#define CF54DRV_CMD_SET_DIGI_OUT 12
#endif // #ifndef _CF54DEF_H_
|
/* SQLite natural sort collation function
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __NATURALSORT_H__
#define __NATURALSORT_H__
int naturalsort(void *arg, int len1, const void *data1, int len2, const void *data2);
#endif /* __NATURALSORT_H__ */
|
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCD_Private.h
Purpose : To be used only by the display drivers
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2
*
* 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 LCD_Private_H
#define LCD_Private_H
#include "LCDConf.h"
#include "LCD_Protected.h"
#include "GUI.h"
/*********************************************************************
*
* API functions
*/
extern const struct tLCDDEV_APIList_struct * /* const */ LCD_aAPI[GUI_NUM_LAYERS];
/*********************************************************************
*
* Support for Segment/COMLUTs
*/
#define LCD_TYPE_SEGTRANS U16
#define LCD_TYPE_COMTRANS U16
#ifdef LCD_LUT_COM
extern LCD_TYPE_COMTRANS LCD__aLine2Com0[LCD_YSIZE];
#endif
#ifdef LCD_LUT_SEG
extern LCD_TYPE_COMTRANS LCD__aCol2Seg0[LCD_XSIZE];
#endif
/*********************************************************************
*
* Support for multiple display controllers
*/
#define DECLARE_PROTOTYPES(DISTX) \
void LCD_##DISTX##_SetPixelIndex(int x, int y, int PixelIndex); \
unsigned LCD_##DISTX##_GetPixelIndex(int x, int y); \
void LCD_##DISTX##_XorPixel (int x, int y); \
void LCD_##DISTX##_DrawHLine (int x0, int y, int x1); \
void LCD_##DISTX##_DrawVLine (int x, int y0, int y1); \
void LCD_##DISTX##_FillRect (int x0, int y0, int x1, int y1); \
void LCD_##DISTX##_DrawBitmap (int x0, int y0, int xsize, int ysize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); \
void LCD_##DISTX##_SetOrg (int x, int y); \
void LCD_##DISTX##_On (void); \
void LCD_##DISTX##_Off (void); \
int LCD_##DISTX##_Init (void); \
void LCD_##DISTX##_SetLUTEntry (U8 Pos, LCD_COLOR Color); \
void * LCD_##DISTX##_GetDevFunc (int Index); \
void LCD_##DISTX##_ReInit (void)
DECLARE_PROTOTYPES(DIST0);
DECLARE_PROTOTYPES(DIST1);
DECLARE_PROTOTYPES(DIST2);
DECLARE_PROTOTYPES(DIST3);
#endif /* Avoid multiple inclusion */
/*************************** End of file ****************************/
|
#pragma once
class Pravets
{
public:
Pravets(void);
~Pravets(void){}
void Reset(void);
void ToggleP8ACapsLock(void) { P8CAPS_ON = !P8CAPS_ON; }
BYTE SetCapsLockAllowed(BYTE value);
BYTE GetKeycode(BYTE floatingBus);
BYTE ConvertToKeycode(WPARAM key, BYTE keycode);
BYTE ConvertToPrinterChar(BYTE value);
private:
bool g_CapsLockAllowed;
bool P8CAPS_ON;
bool P8Shift;
};
|
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
#include <u.h>
#include <libc.h>
/*
* After a fork with fd's copied, both fd's are pointing to
* the same Chan structure. Since the offset is kept in the Chan
* structure, the seek's and read's in the two processes can
* compete at moving the offset around. Hence the unusual loop
* in the middle of this routine.
*/
static long
oldtime(long *tp)
{
char b[20];
static int f = -1;
int i, retries;
long t;
memset(b, 0, sizeof(b));
for(retries = 0; retries < 100; retries++){
if(f < 0)
f = open("/dev/time", OREAD|OCEXEC);
if(f < 0)
break;
if(seek(f, 0, 0) < 0 || (i = read(f, b, sizeof(b))) < 0){
close(f);
f = -1;
} else {
if(i != 0)
break;
}
}
t = atol(b);
if(tp)
*tp = t;
return t;
}
long
time(long *tp)
{
vlong t;
t = nsec()/1000000000LL;
if(t == 0)
t = oldtime(0);
if(tp != nil)
*tp = t;
return t;
}
|
/*
* Copyright (c) 2002, Intel Corporation. All rights reserved.
* Created by: rolla.n.selbak REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
*
* void pthread_cleanup_pop(int execution);
*
* Shall remove the routine at the top of the calling thread's cancelation cleanup stack and
* optionally invoke it (if execute is non-zero).
*
* STEPS:
* 1. Create a thread
* 2. The thread will push 3 cleanup handler routines, then it will call the pop function 3
* times.
* 3. Verify that the cleanup handlers are popped in order.
*
*/
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "posixtest.h"
#define CLEANUP_NOTCALLED 0
#define CLEANUP_CALLED 1
static int cleanup_flag[3]; /* Array to hold the cleanup flags for the 3 cleanup handlers */
static int i;
/* 3 Cleanup handlers */
static void a_cleanup_func1(void *flag_val PTS_ATTRIBUTE_UNUSED)
{
cleanup_flag[i] = 1;
i++;
return;
}
static void a_cleanup_func2(void *flag_val PTS_ATTRIBUTE_UNUSED)
{
cleanup_flag[i] = 2;
i++;
return;
}
static void a_cleanup_func3(void *flag_val PTS_ATTRIBUTE_UNUSED)
{
cleanup_flag[i] = 3;
i++;
return;
}
/* Function that the thread executes upon its creation */
static void *a_thread_func()
{
pthread_cleanup_push(a_cleanup_func1, NULL);
pthread_cleanup_push(a_cleanup_func2, NULL);
pthread_cleanup_push(a_cleanup_func3, NULL);
pthread_cleanup_pop(1);
pthread_cleanup_pop(1);
pthread_cleanup_pop(1);
pthread_exit(0);
return NULL;
}
int main(void)
{
pthread_t new_th;
/* Initializing values */
for (i = 0; i < 3; i++)
cleanup_flag[i] = 0;
i = 0;
/* Create a new thread. */
if (pthread_create(&new_th, NULL, a_thread_func, NULL) != 0) {
perror("Error creating thread\n");
return PTS_UNRESOLVED;
}
/* Wait for thread to end execution */
if (pthread_join(new_th, NULL) != 0) {
perror("Error in pthread_join()\n");
return PTS_UNRESOLVED;
}
/* Verify that the cancellation handlers are popped in order, that is:
* 3, 2, then 1. */
if ((cleanup_flag[0] != 3) || (cleanup_flag[1] != 2)
|| (cleanup_flag[2] != 1)) {
printf
("Test FAILED: Cleanup handlers not popped in order, expected 3,2,1, but got:\n");
printf("%d, %d, %d\n", cleanup_flag[0], cleanup_flag[1],
cleanup_flag[2]);
return PTS_FAIL;
}
printf("Test PASSED\n");
return PTS_PASS;
}
|
/* $Id: mainOverlayNoCKey.c $ */
void vboxCConv();
void main(void)
{
vboxCConv();
}
|
/**********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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.
***********************************************************************/
/***************************************************************************
connectdlg.h - description
-------------------
begin : Mon Jul 1 2002
copyright : (C) 2002 by Rafał Bursig
email : Rafał Bursig <bursig@poczta.fm>
***************************************************************************/
#ifndef FC__CONNECTDLG_H
#define FC__CONNECTDLG_H
#include "connectdlg_g.h"
void popup_connection_dialog(bool lan_scan);
void popup_join_game_dialog(void);
#endif /* FC__CONNECTDLG_H */
|
/*******************************************************************************
Copyright © 2015, STMicroelectronics International N.V.
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 STMicroelectronics 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, FITNESS FOR A PARTICULAR PURPOSE, AND
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. 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 VL6180x_TYPES_H_
#define VL6180x_TYPES_H_
#include <linux/types.h>
#ifndef NULL
#error "TODO review NULL definition or add required include "
#define NULL 0
#endif
/** use where fractional values are expected
*
* Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/
typedef unsigned int FixPoint1616_t;
#if !defined(STDINT_H) && !defined(_GCC_STDINT_H) \
&& !defined(_STDINT_H) && !defined(_LINUX_TYPES_H)
#pragma message("Please review type definition of STDINT define for your \
platform and add to list above ")
/*
* target platform do not provide stdint or use a different #define than above
* to avoid seeing the message below addapt the #define list above or implement
* all type and delete these pragma
*/
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
#endif /* _STDINT_H */
#endif /* VL6180x_TYPES_H_ */
|
/* BSD-License:
Copyright (c) 2007 by Nils Springob, nicai-systems, Germany
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 nicai-systems 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.
*/
/*! @file line.c
* @brief Zuordnung der physikalischen Pins zu symbolischen Namen
* @author Nils Springob (nils@nicai-systems.de)
* @date 2009-08-19
*/
#include "nibobee/iodefs.h"
#include "nibobee/line.h"
#include "nibobee/base.h"
#include "nibobee/delay.h"
#include <avr/eeprom.h>
#define LINE_EEPROM ((void *)0)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint16_t black[3];
uint16_t white[3];
} line_cal_t;
line_cal_t line_cal;
void line_init() {
if (!(nibobee_initialization & NIBOBEE_ANALOG_INITIALIZED)) {
analog_init();
}
line_readPersistent();
activate_output_bit(IO_LINE_EN);
}
void line_writePersistent() {
eeprom_write_block (&line_cal, LINE_EEPROM, sizeof(line_cal_t));
}
void line_readPersistent() {
eeprom_read_block (&line_cal, LINE_EEPROM, sizeof(line_cal_t));
if (line_cal.white[0]==0xffff) {
line_cal.white[0]=0x200;
line_cal.white[1]=0x300;
line_cal.white[2]=0x200;
line_cal.black[0]=4;
line_cal.black[1]=4;
line_cal.black[2]=4;
}
}
uint16_t line_get(uint8_t idx) {
if (idx<3) {
int16_t val16 = (int16_t)analog_getValue(ANALOG_L1+idx)-(int16_t)analog_getValue(ANALOG_L0+idx);
if (val16<0) val16=0;
uint32_t val = val16;
val *= 1024;
val /= line_cal.white[idx];
if (val > line_cal.black[idx]) {
val -= line_cal.black[idx];
} else {
return 0;
}
if (val>INT16_MAX) {
return INT16_MAX;
}
return val;
}
return 0;
}
static void do_calibrateWhite(uint8_t idx) {
if (idx<3) {
int16_t val16 = (int16_t)analog_getValue(ANALOG_L1+idx)-(int16_t)analog_getValue(ANALOG_L0+idx);
if (val16<0) val16=0;
line_cal.white[idx] = val16;
}
}
static void do_calibrateBlack(uint8_t idx) {
if (idx<3) {
int16_t val16 = (int16_t)analog_getValue(ANALOG_L1+idx)-(int16_t)analog_getValue(ANALOG_L0+idx);
if (val16<0) val16=0;
uint32_t val = val16;
val *= 1024;
val /= line_cal.white[idx];
line_cal.black[idx] = val;
}
}
void line_calibrateWhite() {
delay(100);
do_calibrateWhite(LINE_L);
do_calibrateWhite(LINE_C);
do_calibrateWhite(LINE_R);
}
void line_calibrateBlack() {
delay(100);
do_calibrateBlack(LINE_L);
do_calibrateBlack(LINE_C);
do_calibrateBlack(LINE_R);
}
#ifdef __cplusplus
} // extern "C"
#endif
|
// **********************************************************************
//
// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICEPY_UTIL_H
#define ICEPY_UTIL_H
#include <Config.h>
#include <Ice/BuiltinSequences.h>
#include <Ice/Current.h>
#include <Ice/Exception.h>
//
// These macros replace Py_RETURN_FALSE and Py_RETURN TRUE. We use these
// instead of the standard ones in order to avoid GCC warnings about
// strict aliasing and type punning.
//
#define PyRETURN_FALSE return Py_INCREF(getFalse()), getFalse()
#define PyRETURN_TRUE return Py_INCREF(getTrue()), getTrue()
#define PyRETURN_BOOL(b) if(b) PyRETURN_TRUE; else PyRETURN_FALSE
namespace IcePy
{
//
// This should be used instead of Py_False to avoid GCC compiler warnings.
//
inline PyObject* getFalse()
{
#if PY_VERSION_HEX >= 0x03000000
PyLongObject* i = &_Py_FalseStruct;
return reinterpret_cast<PyObject*>(i);
#else
PyIntObject* i = &_Py_ZeroStruct;
return reinterpret_cast<PyObject*>(i);
#endif
}
//
// This should be used instead of Py_True to avoid GCC compiler warnings.
//
inline PyObject* getTrue()
{
#if PY_VERSION_HEX >= 0x03000000
PyLongObject* i = &_Py_TrueStruct;
return reinterpret_cast<PyObject*>(i);
#else
PyIntObject* i = &_Py_TrueStruct;
return reinterpret_cast<PyObject*>(i);
#endif
}
//
// Create a string object.
//
inline PyObject* createString(const std::string& str)
{
#if PY_VERSION_HEX >= 0x03000000
//
// PyUnicode_FromStringAndSize interprets the argument as UTF-8.
//
return PyUnicode_FromStringAndSize(str.c_str(), static_cast<Py_ssize_t>(str.size()));
#else
return PyString_FromStringAndSize(str.c_str(), static_cast<Py_ssize_t>(str.size()));
#endif
}
//
// Obtain a string from a string object; None is also legal.
//
std::string getString(PyObject*);
//
// Verify that the object is a string; None is NOT legal.
//
inline bool checkString(PyObject* p)
{
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_Check(p) ? true : false;
#else
return PyString_Check(p) ? true : false;
#endif
}
//
// Validate and retrieve a string argument; None is also legal.
//
bool getStringArg(PyObject*, const std::string&, std::string&);
//
// Get the name of the current Python function.
//
std::string getFunction();
//
// Invokes Py_DECREF on a Python object.
//
class PyObjectHandle
{
public:
PyObjectHandle(PyObject* = 0);
PyObjectHandle(const PyObjectHandle&);
~PyObjectHandle();
void operator=(PyObject*);
void operator=(const PyObjectHandle&);
PyObject* get() const;
PyObject* release();
private:
PyObject* _p;
};
//
// Manages the interpreter's exception.
//
class PyException
{
public:
//
// Retrieves the interpreter's current exception.
//
PyException();
//
// Uses the given exception.
//
PyException(PyObject*);
//
// Convert the Python exception to its C++ equivalent.
//
void raise();
//
// If the Python exception is SystemExit, act on it. May not return.
//
void checkSystemExit();
PyObjectHandle ex;
private:
void raiseLocalException();
std::string getTraceback();
std::string getTypeName();
PyObjectHandle _type;
PyObjectHandle _tb;
};
//
// Convert Ice::StringSeq to and from a Python list.
//
bool listToStringSeq(PyObject*, Ice::StringSeq&);
bool stringSeqToList(const Ice::StringSeq&, PyObject*);
//
// Convert a tuple to Ice::StringSeq.
//
bool tupleToStringSeq(PyObject*, Ice::StringSeq&);
//
// Convert Ice::Context to and from a Python dictionary.
//
bool dictionaryToContext(PyObject*, Ice::Context&);
bool contextToDictionary(const Ice::Context&, PyObject*);
//
// Returns a borrowed reference to the Python type object corresponding
// to the given Python type name.
//
PyObject* lookupType(const std::string&);
//
// Creates an exception instance of the given type.
//
PyObject* createExceptionInstance(PyObject*);
//
// Converts an Ice exception into a Python exception.
//
PyObject* convertException(const Ice::Exception&);
//
// Converts an Ice exception into a Python exception and sets it in the Python environment.
//
void setPythonException(const Ice::Exception&);
//
// Sets an exception in the Python environment.
//
void setPythonException(PyObject*);
//
// Converts the interpreter's current exception into an Ice exception
// and throws it.
//
void throwPythonException();
//
// Handle the SystemExit exception.
//
void handleSystemExit(PyObject*);
//
// Create a Python instance of Ice.Identity.
//
PyObject* createIdentity(const Ice::Identity&);
//
// Verify that the object is Ice.Identity.
//
bool checkIdentity(PyObject*);
//
// Assign values to members of an instance of Ice.Identity.
//
bool setIdentity(PyObject*, const Ice::Identity&);
//
// Extract the members of Ice.Identity.
//
bool getIdentity(PyObject*, Ice::Identity&);
//
// Create a Python instance of Ice.ProtocolVersion.
//
PyObject* createProtocolVersion(const Ice::ProtocolVersion&);
//
// Create a Python instance of Ice.EncodingVersion.
//
PyObject* createEncodingVersion(const Ice::EncodingVersion&);
//
// Extracts the members of an encoding version.
//
bool getEncodingVersion(PyObject*, Ice::EncodingVersion&);
}
extern "C" PyObject* IcePy_stringVersion(PyObject*);
extern "C" PyObject* IcePy_intVersion(PyObject*);
extern "C" PyObject* IcePy_currentProtocol(PyObject*);
extern "C" PyObject* IcePy_currentProtocolEncoding(PyObject*);
extern "C" PyObject* IcePy_currentEncoding(PyObject*);
extern "C" PyObject* IcePy_protocolVersionToString(PyObject*, PyObject*);
extern "C" PyObject* IcePy_stringToProtocolVersion(PyObject*, PyObject*);
extern "C" PyObject* IcePy_encodingVersionToString(PyObject*, PyObject*);
extern "C" PyObject* IcePy_stringToEncodingVersion(PyObject*, PyObject*);
extern "C" PyObject* IcePy_generateUUID(PyObject*);
#endif
|
/*
* ppc64 version of atomic_dec_and_lock() using cmpxchg
*
* 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.
*/
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/atomic.h>
int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
{
int counter;
int newcount;
repeat:
counter = atomic_read(atomic);
newcount = counter-1;
if (!newcount)
goto slow_path;
newcount = cmpxchg(&atomic->counter, counter, newcount);
if (newcount != counter)
goto repeat;
return 0;
slow_path:
spin_lock(lock);
if (atomic_dec_and_test(atomic))
return 1;
spin_unlock(lock);
return 0;
}
|
////////////////////////////////////////////////////////////////////////////
//
// This file is part of the HSoundplane library
//
// Copyright (c) 2015, www.icst.net
//
// 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 _DRV2667_H
#define _DRV2667_H
// Resigster definitions of the TI DRV2667 piezo driver
#define DRV2667_I2C_ADDRESS 0x59
// Register addresses
#define DRV2667_REG00 0x00
#define DRV2667_REG01 0x01
#define DRV2667_REG02 0x02
#define DRV2667_REG03 0x03
#define DRV2667_REG04 0x04
#define DRV2667_REG05 0x05
#define DRV2667_REG06 0x06
#define DRV2667_REG07 0x07
#define DRV2667_REG08 0x08
#define DRV2667_REG09 0x09
#define DRV2667_REG0A 0x0A
#define DRV2667_REG0B 0x0B
#define DRV2667_REGFF 0xFF
// Register 0x00 (Status)
#define ILLEGAL_ADDR (1 << 2)
#define FIFO_EMPTY (1 << 1)
#define FIFO_FULL (1 << 0)
// Register 0x01 (Control 1)
#define ID_3 (1 << 6)
#define ID_2 (1 << 5)
#define ID_1 (1 << 4)
#define ID_0 (1 << 3)
#define INPUT_MUX (1 << 2)
#define GAIN_1 (1 << 1)
#define GAIN_0 (1 << 0)
// Register 0x02 (Control 2)
#define DEV_RST (1 << 7)
#define STANDBY (1 << 6)
#define TIMEOUT_1 (1 << 3)
#define TIMEOUT_0 (1 << 2)
#define EN_OVERRIDE (1 << 1)
#define GO (1 << 0)
// Register 0x03 to 0x0A (Waveform sequencer)
// ...TBD
// Register 0x0B (FIFO)
#define FIFODATA_7 (1 << 7)
#define FIFODATA_6 (1 << 6)
#define FIFODATA_5 (1 << 5)
#define FIFODATA_4 (1 << 4)
#define FIFODATA_3 (1 << 3)
#define FIFODATA_2 (1 << 2)
#define FIFODATA_1 (1 << 1)
#define FIFODATA_0 (1 << 0)
// Register 0xFF (Page)
#define PAGE_7 (1 << 7)
#define PAGE_6 (1 << 6)
#define PAGE_5 (1 << 5)
#define PAGE_4 (1 << 4)
#define PAGE_3 (1 << 3)
#define PAGE_2 (1 << 2)
#define PAGE_1 (1 << 1)
#define PAGE_0 (1 << 0)
#endif
|
/*
* Copyright (c) 1989, 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/gen/pwcache.c,v 1.11 2007/01/09 00:27:55 imp Exp $");
#include <sys/types.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <string.h>
//#include <utmp.h>
#define UT_NAMESIZE 64
#define NCACHE 64 /* power of 2 */
#define MASK (NCACHE - 1) /* bits to store with */
const char *
user_from_uid(uid_t uid, int nouser)
{
static struct ncache {
uid_t uid;
int found;
char name[UT_NAMESIZE + 1];
} c_uid[NCACHE];
static int pwopen;
struct passwd *pw;
struct ncache *cp;
cp = c_uid + (uid & MASK);
if (cp->uid != uid || !*cp->name) {
if (pwopen == 0) {
//setpassent(1);
pwopen = 1;
}
pw = getpwuid(uid);
cp->uid = uid;
if (pw != NULL) {
cp->found = 1;
(void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE);
cp->name[UT_NAMESIZE] = '\0';
} else {
cp->found = 0;
(void)snprintf(cp->name, UT_NAMESIZE, "%u", uid);
if (nouser)
return (NULL);
}
}
return ((nouser && !cp->found) ? NULL : cp->name);
}
char *
group_from_gid(gid_t gid, int nogroup)
{
static struct ncache {
gid_t gid;
int found;
char name[UT_NAMESIZE + 1];
} c_gid[NCACHE];
static int gropen;
struct group *gr;
struct ncache *cp;
cp = c_gid + (gid & MASK);
if (cp->gid != gid || !*cp->name) {
if (gropen == 0) {
//setgroupent(1);
gropen = 1;
}
gr = getgrgid(gid);
cp->gid = gid;
if (gr != NULL) {
cp->found = 1;
(void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE);
cp->name[UT_NAMESIZE] = '\0';
} else {
cp->found = 0;
(void)snprintf(cp->name, UT_NAMESIZE, "%u", gid);
if (nogroup)
return (NULL);
}
}
return ((nogroup && !cp->found) ? NULL : cp->name);
}
|
#define HW_MAX_ACM_INSTANCES 4
struct hw_acm_function_config {
int instances;
int instances_on;
struct usb_function *f_acm[HW_MAX_ACM_INSTANCES];
struct usb_function_instance *f_acm_inst[HW_MAX_ACM_INSTANCES];
};
static int
hw_acm_function_init(struct android_usb_function *f,
struct usb_composite_dev *cdev)
{
int i;
int ret;
struct hw_acm_function_config *config;
config = kzalloc(sizeof(struct hw_acm_function_config), GFP_KERNEL);
if (!config)
return -ENOMEM;
f->config = config;
for (i = 0; i < HW_MAX_ACM_INSTANCES; i++) {
config->f_acm_inst[i] = usb_get_function_instance("hw_acm");
if (IS_ERR(config->f_acm_inst[i])) {
ret = PTR_ERR(config->f_acm_inst[i]);
goto err_usb_get_function_instance;
}
config->f_acm[i] = usb_get_function(config->f_acm_inst[i]);
if (IS_ERR(config->f_acm[i])) {
ret = PTR_ERR(config->f_acm[i]);
goto err_usb_get_function;
}
}
return 0;
err_usb_get_function_instance:
while (i-- > 0) {
usb_put_function(config->f_acm[i]);
err_usb_get_function:
usb_put_function_instance(config->f_acm_inst[i]);
}
return ret;
}
static void hw_acm_function_cleanup(struct android_usb_function *f)
{
int i;
struct hw_acm_function_config *config = f->config;
for (i = 0; i < HW_MAX_ACM_INSTANCES; i++) {
usb_put_function(config->f_acm[i]);
usb_put_function_instance(config->f_acm_inst[i]);
}
kfree(f->config);
f->config = NULL;
}
static int
hw_acm_function_bind_config(struct android_usb_function *f,
struct usb_configuration *c)
{
int i;
int ret = 0;
struct hw_acm_function_config *config = f->config;
config->instances_on = config->instances;
for (i = 0; i < config->instances_on; i++) {
ret = usb_add_function(c, config->f_acm[i]);
if (ret) {
pr_err("Could not bind acm%u config\n", i);
goto err_usb_add_function;
}
}
return 0;
err_usb_add_function:
while (i-- > 0)
usb_remove_function(c, config->f_acm[i]);
return ret;
}
/*
static void hw_acm_function_unbind_config(struct android_usb_function *f,
struct usb_configuration *c)
{
int i;
struct hw_acm_function_config *config = f->config;
for (i = 0; i < config->instances_on; i++)
usb_remove_function(c, config->f_acm[i]);
}
*/
static ssize_t hw_acm_instances_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct android_usb_function *f = dev_get_drvdata(dev);
struct hw_acm_function_config *config = f->config;
return sprintf(buf, "%d\n", config->instances);
}
static ssize_t hw_acm_instances_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
struct android_usb_function *f = dev_get_drvdata(dev);
struct hw_acm_function_config *config = f->config;
int value;
sscanf(buf, "%d", &value);
if (value > HW_MAX_ACM_INSTANCES)
value = HW_MAX_ACM_INSTANCES;
config->instances = value;
return size;
}
static DEVICE_ATTR(hw_instances, S_IRUGO | S_IWUSR, hw_acm_instances_show,
hw_acm_instances_store);
static struct device_attribute *hw_acm_function_attributes[] = {
&dev_attr_hw_instances,
NULL
};
static struct android_usb_function hw_acm_function = {
.name = "hw_acm",
.init = hw_acm_function_init,
.cleanup = hw_acm_function_cleanup,
.bind_config = hw_acm_function_bind_config,
.ctrlrequest = acm_function_ctrlrequest,
// .unbind_config = hw_acm_function_unbind_config,
.attributes = hw_acm_function_attributes,
};
|
/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
void usage(char *prog)
{
printf("usage: %s owner filenamefmt count\n", prog);
printf(" %s owner filenamefmt start count\n", prog);
}
int main(int argc, char ** argv)
{
int i, rc = 0, mask = 0;
char format[4096], *fmt;
char filename[4096];
long start, last;
long begin = 0, count;
if (argc < 4 || argc > 5) {
usage(argv[0]);
return 1;
}
mask = strtol(argv[1], NULL, 0);
if (strlen(argv[2]) > 4080) {
printf("name too long\n");
return 1;
}
start = last = time(0);
if (argc == 4) {
count = strtol(argv[3], NULL, 0);
if (count < 1) {
printf("count must be at least one\n");
return 1;
}
} else {
begin = strtol(argv[3], NULL, 0);
count = strtol(argv[4], NULL, 0);
}
if (strchr(argv[2], '%')) {
fmt = argv[2];
} else {
sprintf(format, "%s%%d", argv[2]);
fmt = format;
}
for (i = 0; i < count; i++, begin++) {
sprintf(filename, fmt, begin);
rc = chown(filename, mask, -1);
if (rc) {
printf("chown (%s) error: %s\n",
filename, strerror(errno));
rc = errno;
break;
}
if ((i % 10000) == 0) {
printf(" - chowned %d (time %ld ; total %ld ; last "
"%ld)\n", i, time(0), time(0) - start,
time(0) - last);
last = time(0);
}
}
printf("total: %d chowns in %ld seconds: %f chowns/second\n", i,
time(0) - start, ((float)i / (time(0) - start)));
return rc;
}
|
/***************************************************************************
* Copyright (C) 2009 by David Brownell *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef ARMV7A_H
#define ARMV7A_H
#include "arm_adi_v5.h"
#include "arm.h"
#include "armv4_5_mmu.h"
#include "armv4_5_cache.h"
#include "arm_dpm.h"
enum {
ARM_PC = 15,
ARM_CPSR = 16
};
#define ARMV7_COMMON_MAGIC 0x0A450999
/* VA to PA translation operations opc2 values*/
#define V2PCWPR 0
#define V2PCWPW 1
#define V2PCWUR 2
#define V2PCWUW 3
#define V2POWPR 4
#define V2POWPW 5
#define V2POWUR 6
#define V2POWUW 7
/* L210/L220 cache controller support */
struct armv7a_l2x_cache {
uint32_t base;
uint32_t way;
};
struct armv7a_cachesize {
uint32_t level_num;
/* cache dimensionning */
uint32_t linelen;
uint32_t associativity;
uint32_t nsets;
uint32_t cachesize;
/* info for set way operation on cache */
uint32_t index;
uint32_t index_shift;
uint32_t way;
uint32_t way_shift;
};
struct armv7a_cache_common {
int ctype;
struct armv7a_cachesize d_u_size; /* data cache */
struct armv7a_cachesize i_size; /* instruction cache */
int i_cache_enabled;
int d_u_cache_enabled;
/* l2 external unified cache if some */
void *l2_cache;
int (*flush_all_data_cache)(struct target *target);
int (*display_cache_info)(struct command_context *cmd_ctx,
struct armv7a_cache_common *armv7a_cache);
};
struct armv7a_mmu_common {
/* following field mmu working way */
int32_t ttbr1_used; /* -1 not initialized, 0 no ttbr1 1 ttbr1 used and */
uint32_t ttbr0_mask;/* masked to be used */
uint32_t os_border;
int (*read_physical_memory)(struct target *target, uint32_t address, uint32_t size,
uint32_t count, uint8_t *buffer);
struct armv7a_cache_common armv7a_cache;
uint32_t mmu_enabled;
};
struct armv7a_common {
struct arm arm;
int common_magic;
struct reg_cache *core_cache;
struct adiv5_dap dap;
/* Core Debug Unit */
struct arm_dpm dpm;
uint32_t debug_base;
uint8_t debug_ap;
uint8_t memory_ap;
bool memory_ap_available;
/* mdir */
uint8_t multi_processor_system;
uint8_t cluster_id;
uint8_t cpu_id;
bool is_armv7r;
/* cache specific to V7 Memory Management Unit compatible with v4_5*/
struct armv7a_mmu_common armv7a_mmu;
int (*examine_debug_reason)(struct target *target);
int (*post_debug_entry)(struct target *target);
void (*pre_restore_context)(struct target *target);
};
static inline struct armv7a_common *
target_to_armv7a(struct target *target)
{
return container_of(target->arch_info, struct armv7a_common, arm);
}
/* register offsets from armv7a.debug_base */
/* See ARMv7a arch spec section C10.2 */
#define CPUDBG_DIDR 0x000
/* See ARMv7a arch spec section C10.3 */
#define CPUDBG_WFAR 0x018
/* PCSR at 0x084 -or- 0x0a0 -or- both ... based on flags in DIDR */
#define CPUDBG_DSCR 0x088
#define CPUDBG_DRCR 0x090
#define CPUDBG_PRCR 0x310
#define CPUDBG_PRSR 0x314
/* See ARMv7a arch spec section C10.4 */
#define CPUDBG_DTRRX 0x080
#define CPUDBG_ITR 0x084
#define CPUDBG_DTRTX 0x08c
/* See ARMv7a arch spec section C10.5 */
#define CPUDBG_BVR_BASE 0x100
#define CPUDBG_BCR_BASE 0x140
#define CPUDBG_WVR_BASE 0x180
#define CPUDBG_WCR_BASE 0x1C0
#define CPUDBG_VCR 0x01C
/* See ARMv7a arch spec section C10.6 */
#define CPUDBG_OSLAR 0x300
#define CPUDBG_OSLSR 0x304
#define CPUDBG_OSSRR 0x308
#define CPUDBG_ECR 0x024
/* See ARMv7a arch spec section C10.7 */
#define CPUDBG_DSCCR 0x028
/* See ARMv7a arch spec section C10.8 */
#define CPUDBG_AUTHSTATUS 0xFB8
int armv7a_arch_state(struct target *target);
int armv7a_identify_cache(struct target *target);
int armv7a_init_arch_info(struct target *target, struct armv7a_common *armv7a);
int armv7a_mmu_translate_va_pa(struct target *target, uint32_t va,
uint32_t *val, int meminfo);
int armv7a_mmu_translate_va(struct target *target, uint32_t va, uint32_t *val);
int armv7a_handle_cache_info_command(struct command_context *cmd_ctx,
struct armv7a_cache_common *armv7a_cache);
extern const struct command_registration armv7a_command_handlers[];
#endif /* ARMV4_5_H */
|
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999-2001, 2007, 2009-2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PARTED_H_INCLUDED
#define PARTED_H_INCLUDED
#define PED_DEFAULT_ALIGNMENT (1024 * 1024)
#ifdef __cplusplus
extern "C" {
#endif
#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
# define __attribute(arg) __attribute__ (arg)
#else
# define __attribute(arg)
#endif
#include <parted/constraint.h>
#include <parted/device.h>
#include <parted/disk.h>
#include <parted/exception.h>
#include <parted/filesys.h>
#include <parted/natmath.h>
#include <parted/unit.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
extern const char *ped_get_version ()
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
__attribute ((__const__))
#endif
;
extern void* ped_malloc (size_t size);
extern void* ped_calloc (size_t size);
extern void free (void* ptr);
#ifdef __cplusplus
}
#endif
#endif /* PARTED_H_INCLUDED */
|
/* Openswan config file parser (parser.h)
* Copyright (C) 2006 Michael Richardson <mcr@xelerance.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. 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.
*/
#ifndef _OECONNS_H_
#define _OECONNS_H_
extern void add_any_oeconns(struct starter_config *cfg,
struct config_parsed *cfgp);
#endif /* _OECONNS_H_ */
|
/*
* sound/arm/omap-alsa-aic23.h
*
* Alsa Driver for AIC23 codec on OSK5912 platform board
*
* Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
* Written by Daniel Petrini, David Cohen, Anderson Briglia
* {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
*
* Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifndef __OMAP_ALSA_AIC23_H
#define __OMAP_ALSA_AIC23_H
#include <mach/dma.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <mach/mcbsp.h>
/* Define to set the AIC23 as the master w.r.t McBSP */
#define AIC23_MASTER
#define NUMBER_SAMPLE_RATES_SUPPORTED 10
/*
* AUDIO related MACROS
*/
#ifndef DEFAULT_BITPERSAMPLE
#define DEFAULT_BITPERSAMPLE 16
#endif
#define DEFAULT_SAMPLE_RATE 44100
#define CODEC_CLOCK 12000000
#define AUDIO_MCBSP OMAP_MCBSP1
#define DEFAULT_OUTPUT_VOLUME 0x60
#define DEFAULT_INPUT_VOLUME 0x00 /* 0 ==> mute line in */
#define OUTPUT_VOLUME_MIN LHV_MIN
#define OUTPUT_VOLUME_MAX LHV_MAX
#define OUTPUT_VOLUME_RANGE (OUTPUT_VOLUME_MAX - OUTPUT_VOLUME_MIN)
#define OUTPUT_VOLUME_MASK OUTPUT_VOLUME_MAX
#define INPUT_VOLUME_MIN LIV_MIN
#define INPUT_VOLUME_MAX LIV_MAX
#define INPUT_VOLUME_RANGE (INPUT_VOLUME_MAX - INPUT_VOLUME_MIN)
#define INPUT_VOLUME_MASK INPUT_VOLUME_MAX
#define SIDETONE_MASK 0x1c0
#define SIDETONE_0 0x100
#define SIDETONE_6 0x000
#define SIDETONE_9 0x040
#define SIDETONE_12 0x080
#define SIDETONE_18 0x0c0
#define DEFAULT_ANALOG_AUDIO_CONTROL (DAC_SELECTED | STE_ENABLED | \
BYPASS_ON | INSEL_MIC | MICB_20DB)
struct aic23_samplerate_reg_info {
u32 sample_rate;
u8 control; /* SR3, SR2, SR1, SR0 and BOSR */
u8 divider; /* if 0 CLKIN = MCLK, if 1 CLKIN = MCLK/2 */
};
extern int aic23_write_value(u8 reg, u16 value);
/*
* Defines codec specific function pointers that can be used from the
* common omap-alsa base driver for all omap codecs. (tsc2101 and aic23)
*/
void audio_aic23_write(u8 address, u16 data);
void define_codec_functions(struct omap_alsa_codec_config *codec_config);
inline void aic23_configure(void);
void aic23_set_samplerate(long rate);
void aic23_clock_setup(void);
int aic23_clock_on(void);
int aic23_clock_off(void);
int aic23_get_default_samplerate(void);
#endif
|
/*
* indy_sc.c: Indy cache management functions.
*
* Copyright (C) 1997 Ralf Baechle (ralf@gnu.org),
* derived from r4xx0.c by David S. Miller (dm@engr.sgi.com).
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <asm/bcache.h>
#include <asm/sgi/sgimc.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/bootinfo.h>
#include <asm/mmu_context.h>
/* Secondary cache size in bytes, if present. */
static unsigned long scache_size;
#undef DEBUG_CACHE
#define SC_SIZE 0x00080000
#define SC_LINE 32
#define CI_MASK (SC_SIZE - SC_LINE)
#define SC_INDEX(n) ((n) & CI_MASK)
static inline void indy_sc_wipe(unsigned long first, unsigned long last)
{
__asm__ __volatile__(
".set\tnoreorder\n\t"
"or\t%0, %4\t\t\t# first line to flush\n\t"
"or\t%1, %4\t\t\t# last line to flush\n"
"1:\tsw $0, 0(%0)\n\t"
"bne\t%0, %1, 1b\n\t"
"daddu\t%0, 32\n\t"
".set reorder"
: "=r" (first), "=r" (last)
: "0" (first), "1" (last), "r" (0x9000000080000000)
: "$1");
}
static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size)
{
unsigned long first_line, last_line;
unsigned int flags;
#ifdef DEBUG_CACHE
printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size);
#endif
if (!size)
return;
/* Which lines to flush? */
first_line = SC_INDEX(addr);
last_line = SC_INDEX(addr + size - 1);
__save_and_cli(flags);
if (first_line <= last_line) {
indy_sc_wipe(first_line, last_line);
goto out;
}
indy_sc_wipe(first_line, SC_SIZE - SC_LINE);
indy_sc_wipe(0, last_line);
out:
__restore_flags(flags);
}
static void inline indy_sc_enable(void)
{
#ifdef DEBUG_CACHE
printk("Enabling R4600 SCACHE\n");
#endif
*(volatile unsigned char *) 0x9000000080000000 = 0;
}
static void indy_sc_disable(void)
{
#ifdef DEBUG_CACHE
printk("Disabling R4600 SCACHE\n");
#endif
*(volatile unsigned short *) 0x9000000080000000 = 0;
}
static inline __init int indy_sc_probe(void)
{
volatile u32 *cpu_control;
unsigned short cmd = 0xc220;
unsigned long data = 0;
int i, n;
#ifdef __MIPSEB__
cpu_control = (volatile u32 *) KSEG1ADDR(0x1fa00034);
#else
cpu_control = (volatile u32 *) KSEG1ADDR(0x1fa00030);
#endif
#define DEASSERT(bit) (*(cpu_control) &= (~(bit)))
#define ASSERT(bit) (*(cpu_control) |= (bit))
#define DELAY for(n = 0; n < 100000; n++) __asm__ __volatile__("")
DEASSERT(SGIMC_EEPROM_PRE);
DEASSERT(SGIMC_EEPROM_SDATAO);
DEASSERT(SGIMC_EEPROM_SECLOCK);
DEASSERT(SGIMC_EEPROM_PRE);
DELAY;
ASSERT(SGIMC_EEPROM_CSEL); ASSERT(SGIMC_EEPROM_SECLOCK);
for(i = 0; i < 11; i++) {
if(cmd & (1<<15))
ASSERT(SGIMC_EEPROM_SDATAO);
else
DEASSERT(SGIMC_EEPROM_SDATAO);
DEASSERT(SGIMC_EEPROM_SECLOCK);
ASSERT(SGIMC_EEPROM_SECLOCK);
cmd <<= 1;
}
DEASSERT(SGIMC_EEPROM_SDATAO);
for(i = 0; i < (sizeof(unsigned short) * 8); i++) {
unsigned int tmp;
DEASSERT(SGIMC_EEPROM_SECLOCK);
DELAY;
ASSERT(SGIMC_EEPROM_SECLOCK);
DELAY;
data <<= 1;
tmp = *cpu_control;
if(tmp & SGIMC_EEPROM_SDATAI)
data |= 1;
}
DEASSERT(SGIMC_EEPROM_SECLOCK);
DEASSERT(SGIMC_EEPROM_CSEL);
ASSERT(SGIMC_EEPROM_PRE);
ASSERT(SGIMC_EEPROM_SECLOCK);
data <<= PAGE_SHIFT;
if (data == 0)
return 0;
scache_size = data;
printk("R4600/R5000 SCACHE size %ldK, linesize 32 bytes.\n",
scache_size >> 10);
return 1;
}
/* XXX Check with wje if the Indy caches can differenciate between
writeback + invalidate and just invalidate. */
static struct bcache_ops indy_sc_ops = {
indy_sc_enable,
indy_sc_disable,
indy_sc_wback_invalidate,
indy_sc_wback_invalidate
};
void __init indy_sc_init(void)
{
if (indy_sc_probe()) {
indy_sc_enable();
bcops = &indy_sc_ops;
}
}
|
/* This file is part of the KDE project
Copyright (C) 2002, The Karbon Developers
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __EPSEXPORT_H__
#define __EPSEXPORT_H__
#include <KoFilter.h>
#include "vvisitor.h"
//Added by qt3to4:
#include <QTextStream>
#include <Q3CString>
#include <QVariantList>
class QTextStream;
class VColor;
class VPath;
class KarbonDocument;
class VFill;
class VGroup;
class VLayer;
class VSubpath;
class VStroke;
class VText;
class EpsExport : public KoFilter, private VVisitor
{
Q_OBJECT
public:
EpsExport(QObject* parent, const QVariantList&);
virtual ~EpsExport() {}
virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
private:
virtual void visitVPath(VPath& composite);
virtual void visitVDocument(KarbonDocument& document);
virtual void visitVSubpath(VSubpath& path);
virtual void visitVText(VText& text);
void getStroke(const VStroke& stroke);
void getFill(const VFill& fill);
void getColor(const VColor& color);
QTextStream* m_stream;
uint m_psLevel;
};
#endif
|
#ifndef UNWINDOWS_H
#define UNWINDOWS_H
// JMW hack
#include <windows.h>
#endif
|
/*
* $Revision: 3.4 $
* $Date: 1999/07/09 21:35:39 $
*/
#ifndef _ALLDEFS
#define _ALLDEFS
typedef struct proplist * plptr;
typedef struct propn * propptr;
typedef struct argslist * aptr;
typedef struct pair * pptr;
typedef struct operator_ * opptr;
typedef struct type_decls * tpptr;
typedef struct operator_set * oplistptr;
typedef struct domain * domptr;
typedef struct uneqlistnode * uneqlist;
typedef struct predcell * predlist;
typedef struct efflist * effptr;
struct efflist {
plptr adds;
plptr dels;
};
struct uneqlistnode {
tpptr uneq;
uneqlist next;
};
struct pair {
char * varname;
char * type_name;
int type[2];
int used; /* Used in build
to track
whether a var
is already
instantiated
In constants we'll use it to
indicate whether a constant
appears in an operator or not. */
int sgnum;
int sindex;
/* New field added to distinguish precondition paramters. */
int isInPre;
};
struct type_decls {
tpptr tps;
pptr type;
uneqlist uneqs;
};
struct operator_set {
opptr op;
oplistptr ops;
};
struct operator_ {
tpptr vars;
tpptr vars_shadow;
plptr precs;
plptr statics;
plptr adds;
plptr dels;
propptr thename;
};
struct propn {
pptr nm;
propptr as;
};
struct proplist {
plptr rest;
propptr prop;
};
struct domain {
oplistptr ops;
plptr initial_state;
plptr goal_state;
tpptr obs;
plptr statics;
};
struct predcell {
char * name;
int numargs;
int fr;
int ar;
opptr op;
plptr initially;
predlist next;
};
#endif
|
/*
alarm.h.
Created by CrakerNano, May 27, 2015. Released into the public domain.
*/
#ifndef alarm_h
#define alarm_h
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class alarm{
public:alarm(int LEDpin, int altavozPin);
void typeAlarm(int type);
void soundAlarm(int t);
void soundAlarm(int t, int frecuency);
void ligthAlarm(int t, int d);
void soundAlarm(int t1, int frecuency, int repeat);
private:
int _altavozPin;
int _LEDpin;
int fireLight[];
int gasLight[];
int COLight[];
int COOLight[];
int smokeLight[];
int tempLight[];
int vccLight[];
int modeLight[];
int lowEnergyModeLight[];
int disableLight[];
int SDfailLight[];
int fireSound;
int gasSound;
int COSound;
int COOSound;
int smokeSound;
int tempSound;
int vccSound;
int modeSound;
int lowEnergyModeSound;
int disableSound;
int SDfailSound;
int t;
int d;
int frecuency;
int repeat;
};
#endif
|
/*
* Testing task switching.
*/
#include "runtime/lib.h"
#include "kernel/uos.h"
ARRAY (task, 0x200);
void hello (void *arg)
{
for (;;) {
debug_printf ("Hello from `%s'! (Press Enter)\n", arg);
debug_getchar ();
}
}
void uos_init (void)
{
debug_puts ("\nTesting task.\n");
task_create (hello, "task", "hello", 1, task, sizeof (task));
}
|
/************************************************************
°üº¬ÆäËüÄ£¿éµÄÍ·Îļþ
************************************************************/
/************************************************************
ºê¶¨Òå
************************************************************/
/************************************************************
Êý¾Ý½á¹¹¶¨Òå
************************************************************/
/************************************************************
½Ó¿Úº¯ÊýÉùÃ÷
************************************************************/
#ifndef __DRX_OM_DEF_H__
#define __DRX_OM_DEF_H__
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */
typedef enum
{
LPHY_DEBUG_DRX = OM_CMD_ID(LPHY_DRX_MID, OM_TYPE_DEBUG, 0x1),
}LPHY_DEBUG_DRX_ENUM;
typedef enum
{
LPHY_ERR_DRX = OM_CMD_ID(LPHY_DRX_MID, OM_TYPE_ERROR, 0x1),
}LPHY_ERR_DRX_ENUM;
/* BEGIN: Added by h00130263, 2013/10/6 PN:tds_debug*/
typedef struct __TDS_DEBUG_INFO_STRU__
{
UINT32 ulTdsTraceHead; /*107*/
UINT16 usLastSfn;
UINT16 usLastSlot; /*108*/
UINT16 usLastIntFuncIdx;
UINT16 usLastTrigFuncIdx; /*109*/
UINT16 usLastTaskFuncIdx;
UINT16 usRsv; /*110*/
UINT32 ulProcessCnt[32]; /*142*/
UINT32 ulDmaTraceCnt; /*143*/
UINT32 ulDmaTraceInfo[16][4]; /*207*/
}TDS_DRX_DEBUG_INFO_STRU;
/* END: Added by h00130263, 2013/10/6 */
typedef struct
{
UINT32 ulLteTraceHead; /*/1*/
UINT32 ulAllResetCnt; /*/2*/
UINT32 ulInitPowUpCnt; /*/3*/
UINT32 ulLpcResetCnt; /*/4*/
UINT32 ulTaskLoopCnt[16]; /*20*/
UINT32 epc[4]; /*24*/
UINT32 eps[4]; /*28*/
/*UINT32 ulWakeTimer;*/
/*UINT32 ulSlwwpTimer;*/
/*UINT32 ulMeasResult;*/
UINT32 ulWakeResumeFunc; /*29*/
UINT32 ulTaskInfo; /*30*/
UINT32 ulDrxCurStatus; /*31*/
UINT32 ulExcLoc; /*32*/
UINT16 usExcID;
UINT16 usSysFrame; /*33*/
UINT16 usSubFrame;
UINT16 usMeasCalcCnt; /*34*/
UINT16 usWakeCnt;
UINT16 usSleepCnt; /*35*/
UINT16 usCdrxSleepCnt;
UINT16 usCdrxWakeCnt; /*36*/
/*UINT16 usWakeValid;*/
UINT16 usSlaveWakeUpCnt;
UINT16 usSlaveSleepCnt; /*37*/
UINT16 usCdrxOnlyRfSleepCnt;
UINT16 usCdrxOnlyRfWakeCnt; /*38*/
UINT16 usRsvd[6]; /*41*/
UINT32 usMailTraceCnt; /*42*/
UINT32 usMailTraceInfo[16][4]; /*106*/
}LTE_DRX_DEBUG_INFO_STRU;
typedef struct
{
LTE_DRX_DEBUG_INFO_STRU stLteDrxDebugInfo;
TDS_DRX_DEBUG_INFO_STRU stTdsDrxDebugInfo;
}TL_DRX_DEBUG_STRU;
/* BEGIN: Added by xueqiuyan, 2012/9/18 PN:CMCC_DT*/
typedef enum
{
LPHY_DT_DRX_STATUS_INFO_REQ = OM_CMD_ID(LPHY_DRX_MID, OM_TYPE_REQ, 0x1),
}LPHY_DT_DRX_REQ_ENUM;
typedef enum
{
LPHY_DT_DRX_STATUS_INFO_IND = OM_CMD_ID(LPHY_DRX_MID, OM_TYPE_SG, 0x1),
}LPHY_DT_DRX_IND_ENUM;
typedef enum
{
DRX_TIMER_INACTIVE = 0,
DRX_TIMER_ACTIVE
}DRX_TIMER_STATUS_ENUM;
typedef UINT16 DRX_TIMER_STATUS_ENUM_UINT16;
typedef struct
{
OM_REQ_ENABLE_ENUM_UINT16 enEn;
UINT16 usRsv;
} LPHY_DT_DRX_STATUS_INFO_REQ_STRU;
typedef struct
{
DRX_TIMER_STATUS_ENUM_UINT16 aenDlRttTimer[15];
DRX_TIMER_STATUS_ENUM_UINT16 aenDlRetranTimer[15];
} DRX_DL_HARQ_TIMER_INFO_STRU;
typedef struct __LPHY_DT_DRX_STATUS_INFO_IND_STRU__
{
UINT16 usSFN;
UINT16 usSubFn;
UINT16 usDrxCycleType;
UINT16 usActiveState;
DRX_TIMER_STATUS_ENUM_UINT16 enOndurationTimerState;
DRX_TIMER_STATUS_ENUM_UINT16 enInactivityTimer;
DRX_TIMER_STATUS_ENUM_UINT16 enShortTimer;
UINT16 usRsv;
DRX_DL_HARQ_TIMER_INFO_STRU stDlHarqTimer;
} LPHY_DT_DRX_STATUS_INFO_IND_STRU;
/* END: Added by xueqiuyan, 2012/9/18 */
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __DRX_OM_DEF_H__ */
|
/*
* $Id$
*
* Copyright (C) 2005 - 2007 Stephen F. Booth <me@sbooth.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import <Cocoa/Cocoa.h>
@interface AdvancedPreferencesController : NSWindowController
{
IBOutlet NSTextField *_audioSlicesInBufferTextField;
IBOutlet NSTextField *_audioFramesPerSliceTextField;
}
@end
|
/*
* common keywest i2c layer
*
* Copyright (c) by Takashi Iwai <tiwai@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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 <sound/driver.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <sound/core.h>
#include "pmac.h"
/*
* we have to keep a static variable here since i2c attach_adapter
* callback cannot pass a private data.
*/
static struct pmac_keywest *keywest_ctx;
#define I2C_DRIVERID_KEYWEST 0xFEBA
static int keywest_attach_adapter(struct i2c_adapter *adapter);
static int keywest_detach_client(struct i2c_client *client);
struct i2c_driver keywest_driver = {
.driver = {
.name = "PMac Keywest Audio",
},
.id = I2C_DRIVERID_KEYWEST,
.attach_adapter = &keywest_attach_adapter,
.detach_client = &keywest_detach_client,
};
#ifndef i2c_device_name
#define i2c_device_name(x) ((x)->name)
#endif
static int keywest_attach_adapter(struct i2c_adapter *adapter)
{
int err;
struct i2c_client *new_client;
if (! keywest_ctx)
return -EINVAL;
if (strncmp(i2c_device_name(adapter), "mac-io", 6))
return 0; /* ignored */
new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
if (! new_client)
return -ENOMEM;
memset(new_client, 0, sizeof(*new_client));
new_client->addr = keywest_ctx->addr;
i2c_set_clientdata(new_client, keywest_ctx);
new_client->adapter = adapter;
new_client->driver = &keywest_driver;
new_client->flags = 0;
strcpy(i2c_device_name(new_client), keywest_ctx->name);
keywest_ctx->client = new_client;
/* Tell the i2c layer a new client has arrived */
if (i2c_attach_client(new_client)) {
snd_printk(KERN_ERR "tumbler: cannot attach i2c client\n");
err = -ENODEV;
goto __err;
}
return 0;
__err:
kfree(new_client);
keywest_ctx->client = NULL;
return err;
}
static int keywest_detach_client(struct i2c_client *client)
{
if (! keywest_ctx)
return 0;
if (client == keywest_ctx->client)
keywest_ctx->client = NULL;
i2c_detach_client(client);
kfree(client);
return 0;
}
/* exported */
void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c)
{
if (keywest_ctx && keywest_ctx == i2c) {
i2c_del_driver(&keywest_driver);
keywest_ctx = NULL;
}
}
int __init snd_pmac_tumbler_post_init(void)
{
int err;
if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
snd_printk(KERN_ERR "tumbler: %i :cannot initialize the MCS\n", err);
return err;
}
return 0;
}
/* exported */
int __init snd_pmac_keywest_init(struct pmac_keywest *i2c)
{
int err;
if (keywest_ctx)
return -EBUSY;
keywest_ctx = i2c;
if ((err = i2c_add_driver(&keywest_driver))) {
snd_printk(KERN_ERR "cannot register keywest i2c driver\n");
return err;
}
return 0;
}
|
/*
*
* Copyright (c) International Business Machines Corp., 2001
*
* 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
*/
/*
* Test Name: fchmod03
*
* Test Description:
* Verify that, fchmod(2) will succeed to change the mode of a file
* and set the sticky bit on it if invoked by non-root (uid != 0)
* process with the following constraints,
* - the process is the owner of the file.
* - the effective group ID or one of the supplementary group ID's of the
* process is equal to the group ID of the file.
*
* Expected Result:
* fchmod() should return value 0 on success and succeeds to change
* the mode of specified file, sets sticky bit on it.
*
* Algorithm:
* Setup:
* Setup signal handling.
* Create temporary directory.
* Pause for SIGUSR1 if option specified.
*
* Test:
* Loop if the proper options are given.
* Execute system call
* Check return code, if system call failed (return=-1)
* Log the errno and Issue a FAIL message.
* Otherwise,
* Verify the Functionality of system call
* if successful,
* Issue Functionality-Pass message.
* Otherwise,
* Issue Functionality-Fail message.
* Cleanup:
* Print errno log and/or timing stats if options given
* Delete the temporary directory created.
*
* Usage: <for command-line>
* fchmod03 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
* where, -c n : Run n copies concurrently.
* -f : Turn off functionality Testing.
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
*
* HISTORY
* 07/2001 Ported by Wayne Boyer
*
* RESTRICTIONS:
* This test should be run by 'non-super-user' only.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <pwd.h>
#include "test.h"
#include "usctest.h"
#define FILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
#define PERMS 01777
#define TESTFILE "testfile"
int fd; /* file descriptor for test file */
char *TCID = "fchmod03";
int TST_TOTAL = 1;
char nobody_uid[] = "nobody";
struct passwd *ltpuser;
void setup(); /* Main setup function for the test */
void cleanup(); /* Main cleanup function for the test */
int main(int ac, char **av)
{
struct stat stat_buf; /* stat struct. */
int lc;
char *msg;
mode_t file_mode; /* mode permissions set on testfile */
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
tst_count = 0;
TEST(fchmod(fd, PERMS));
if (TEST_RETURN == -1) {
tst_resm(TFAIL | TTERRNO, "fchmod failed");
continue;
}
/*
* Perform functional verification if test
* executed without (-f) option.
*/
if (STD_FUNCTIONAL_TEST) {
/*
* Get the file information using
* fstat(2).
*/
if (fstat(fd, &stat_buf) == -1)
tst_brkm(TFAIL | TERRNO, cleanup,
"fstat failed");
file_mode = stat_buf.st_mode;
/* Verify STICKY BIT set on testfile */
if ((file_mode & PERMS) != PERMS)
tst_resm(TFAIL, "%s: Incorrect modes 0%3o, "
"Expected 0777", TESTFILE, file_mode);
else
tst_resm(TPASS, "Functionality of fchmod(%d, "
"%#o) successful", fd, PERMS);
} else
tst_resm(TPASS, "call succeeded");
}
cleanup();
tst_exit();
}
void setup()
{
tst_sig(NOFORK, DEF_HANDLER, cleanup);
tst_require_root(NULL);
ltpuser = getpwnam(nobody_uid);
if (ltpuser == NULL)
tst_brkm(TBROK | TERRNO, NULL, "getpwnam failed");
if (seteuid(ltpuser->pw_uid) == -1)
tst_brkm(TBROK | TERRNO, NULL, "seteuid failed");
TEST_PAUSE;
tst_tmpdir();
/*
* Create a test file under temporary directory with specified
* mode permissios and set the ownership of the test file to the
* uid/gid of guest user.
*/
if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1)
tst_brkm(TBROK | TERRNO, cleanup, "open failed");
}
void cleanup()
{
TEST_CLEANUP;
if (close(fd) == -1)
tst_resm(TWARN | TERRNO, "close failed");
tst_rmdir();
}
|
//###########################################################################
//
// FILE: DSP2833x_Device.h
//
// TITLE: DSP2833x Device Definitions.
//
//###########################################################################
// $TI Release: 2833x/2823x Header Files and Peripheral Examples V133 $
// $Release Date: June 8, 2012 $
//###########################################################################
#ifndef DSP2833x_DEVICE_H
#define DSP2833x_DEVICE_H
#ifdef __cplusplus
extern "C" {
#endif
#define TARGET 1
//---------------------------------------------------------------------------
// User To Select Target Device:
#define DSP28_28335 TARGET // Selects '28335/'28235
#define DSP28_28334 0 // Selects '28334/'28234
#define DSP28_28332 0 // Selects '28332/'28232
//---------------------------------------------------------------------------
// Common CPU Definitions:
//
extern cregister volatile unsigned int IFR;
extern cregister volatile unsigned int IER;
#define EINT asm(" clrc INTM")
#define DINT asm(" setc INTM")
#define ERTM asm(" clrc DBGM")
#define DRTM asm(" setc DBGM")
#define EALLOW asm(" EALLOW")
#define EDIS asm(" EDIS")
#define ESTOP0 asm(" ESTOP0")
#define M_INT1 0x0001
#define M_INT2 0x0002
#define M_INT3 0x0004
#define M_INT4 0x0008
#define M_INT5 0x0010
#define M_INT6 0x0020
#define M_INT7 0x0040
#define M_INT8 0x0080
#define M_INT9 0x0100
#define M_INT10 0x0200
#define M_INT11 0x0400
#define M_INT12 0x0800
#define M_INT13 0x1000
#define M_INT14 0x2000
#define M_DLOG 0x4000
#define M_RTOS 0x8000
#define BIT0 0x0001
#define BIT1 0x0002
#define BIT2 0x0004
#define BIT3 0x0008
#define BIT4 0x0010
#define BIT5 0x0020
#define BIT6 0x0040
#define BIT7 0x0080
#define BIT8 0x0100
#define BIT9 0x0200
#define BIT10 0x0400
#define BIT11 0x0800
#define BIT12 0x1000
#define BIT13 0x2000
#define BIT14 0x4000
#define BIT15 0x8000
//---------------------------------------------------------------------------
// For Portability, User Is Recommended To Use Following Data Type Size
// Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
//
#ifndef DSP28_DATA_TYPES
#define DSP28_DATA_TYPES
typedef int int16;
typedef long int32;
typedef long long int64;
typedef unsigned int Uint16;
typedef unsigned long Uint32;
typedef unsigned long long Uint64;
typedef float float32;
typedef long double float64;
#endif
//---------------------------------------------------------------------------
// Include All Peripheral Header Files:
//
#include "DSP2833x_Adc.h" // ADC Registers
#include "DSP2833x_DevEmu.h" // Device Emulation Registers
#include "DSP2833x_CpuTimers.h" // 32-bit CPU Timers
#include "DSP2833x_ECan.h" // Enhanced eCAN Registers
#include "DSP2833x_ECap.h" // Enhanced Capture
#include "DSP2833x_DMA.h" // DMA Registers
#include "DSP2833x_EPwm.h" // Enhanced PWM
#include "DSP2833x_EQep.h" // Enhanced QEP
#include "DSP2833x_Gpio.h" // General Purpose I/O Registers
#include "DSP2833x_I2c.h" // I2C Registers
#include "DSP2833x_McBSP.h" // McBSP
#include "DSP2833x_PieCtrl.h" // PIE Control Registers
#include "DSP2833x_PieVect.h" // PIE Vector Table
#include "DSP2833x_Spi.h" // SPI Registers
#include "DSP2833x_Sci.h" // SCI Registers
#include "DSP2833x_SysCtrl.h" // System Control/Power Modes
#include "DSP2833x_XIntrupt.h" // External Interrupts
#include "DSP2833x_Xintf.h" // XINTF External Interface
#if DSP28_28335
#define DSP28_EPWM1 1
#define DSP28_EPWM2 1
#define DSP28_EPWM3 1
#define DSP28_EPWM4 1
#define DSP28_EPWM5 1
#define DSP28_EPWM6 1
#define DSP28_ECAP1 1
#define DSP28_ECAP2 1
#define DSP28_ECAP3 1
#define DSP28_ECAP4 1
#define DSP28_ECAP5 1
#define DSP28_ECAP6 1
#define DSP28_EQEP1 1
#define DSP28_EQEP2 1
#define DSP28_ECANA 1
#define DSP28_ECANB 1
#define DSP28_MCBSPA 1
#define DSP28_MCBSPB 1
#define DSP28_SPIA 1
#define DSP28_SCIA 1
#define DSP28_SCIB 1
#define DSP28_SCIC 1
#define DSP28_I2CA 1
#endif // end DSP28_28335
#if DSP28_28334
#define DSP28_EPWM1 1
#define DSP28_EPWM2 1
#define DSP28_EPWM3 1
#define DSP28_EPWM4 1
#define DSP28_EPWM5 1
#define DSP28_EPWM6 1
#define DSP28_ECAP1 1
#define DSP28_ECAP2 1
#define DSP28_ECAP3 1
#define DSP28_ECAP4 1
#define DSP28_ECAP5 0
#define DSP28_ECAP6 0
#define DSP28_EQEP1 1
#define DSP28_EQEP2 1
#define DSP28_ECANA 1
#define DSP28_ECANB 1
#define DSP28_MCBSPA 1
#define DSP28_MCBSPB 1
#define DSP28_SPIA 1
#define DSP28_SCIA 1
#define DSP28_SCIB 1
#define DSP28_SCIC 1
#define DSP28_I2CA 1
#endif // end DSP28_28334
#if DSP28_28332
#define DSP28_EPWM1 1
#define DSP28_EPWM2 1
#define DSP28_EPWM3 1
#define DSP28_EPWM4 1
#define DSP28_EPWM5 1
#define DSP28_EPWM6 1
#define DSP28_ECAP1 1
#define DSP28_ECAP2 1
#define DSP28_ECAP3 1
#define DSP28_ECAP4 1
#define DSP28_ECAP5 0
#define DSP28_ECAP6 0
#define DSP28_EQEP1 1
#define DSP28_EQEP2 1
#define DSP28_ECANA 1
#define DSP28_ECANB 1
#define DSP28_MCBSPA 1
#define DSP28_MCBSPB 0
#define DSP28_SPIA 1
#define DSP28_SCIA 1
#define DSP28_SCIB 1
#define DSP28_SCIC 0
#define DSP28_I2CA 1
#endif // end DSP28_28332
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif // end of DSP2833x_DEVICE_H definition
//===========================================================================
// End of file.
//===========================================================================
|
/*
Prototypes for ADC based function select
A Block of Code 5/21/15
*/
#include <inttypes.h>
void setup_adc(void);
uint8_t read_adc(void); |
/*
* Copyright © 2013 Intel Corporation
*
* 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 (including the next
* paragraph) 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.
*
* Author: Jani Nikula <jani.nikula@intel.com>
* Shobhit Kumar <shobhit.kumar@intel.com>
*
*
*/
#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/i915_drm.h>
#include <linux/slab.h>
#include <video/mipi_display.h>
#include <asm/intel-mid.h>
#include "i915_drv.h"
#include "intel_drv.h"
#include "intel_dsi.h"
#include "intel_dsi_cmd.h"
#include "dsi_mod_panasonic_vvx09f006a00.h"
static void vvx09f006a00_get_panel_info(int pipe,
struct drm_connector *connector)
{
if (!connector) {
DRM_DEBUG_KMS("Panasonic: Invalid input to get_info\n");
return;
}
if (pipe == 0) {
connector->display_info.width_mm = 192;
connector->display_info.height_mm = 120;
}
return;
}
static void vvx09f006a00_destroy(struct intel_dsi_device *dsi)
{
}
static void vvx09f006a00_dump_regs(struct intel_dsi_device *dsi)
{
}
static void vvx09f006a00_create_resources(struct intel_dsi_device *dsi)
{
}
static struct drm_display_mode *vvx09f006a00_get_modes(
struct intel_dsi_device *dsi)
{
struct drm_display_mode *mode = NULL;
/* Allocate */
mode = kzalloc(sizeof(*mode), GFP_KERNEL);
if (!mode) {
DRM_DEBUG_KMS("Panasonic panel: No memory\n");
return NULL;
}
/* Hardcode 1920x1200 */
mode->hdisplay = 1920;
mode->hsync_start = mode->hdisplay + 110;
mode->hsync_end = mode->hsync_start + 38;
mode->htotal = mode->hsync_end + 90;
mode->vdisplay = 1200;
mode->vsync_start = mode->vdisplay + 15;
mode->vsync_end = mode->vsync_start + 10;
mode->vtotal = mode->vsync_end + 10;
mode->vrefresh = 60;
mode->clock = mode->vrefresh * mode->vtotal *
mode->htotal / 1000;
/* Configure */
drm_mode_set_name(mode);
drm_mode_set_crtcinfo(mode, 0);
mode->type |= DRM_MODE_TYPE_PREFERRED;
return mode;
}
static bool vvx09f006a00_get_hw_state(struct intel_dsi_device *dev)
{
return true;
}
static enum drm_connector_status vvx09f006a00_detect(
struct intel_dsi_device *dsi)
{
struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
struct drm_device *dev = intel_dsi->base.base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
dev_priv->is_mipi = true;
return connector_status_connected;
}
static bool vvx09f006a00_mode_fixup(struct intel_dsi_device *dsi,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) {
return true;
}
static int vvx09f006a00_mode_valid(struct intel_dsi_device *dsi,
struct drm_display_mode *mode)
{
return MODE_OK;
}
static void vvx09f006a00_dpms(struct intel_dsi_device *dsi, bool enable)
{
struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
DRM_DEBUG_KMS("\n");
if (enable) {
dsi_vc_dcs_write_0(intel_dsi, 0, MIPI_DCS_EXIT_SLEEP_MODE);
dsi_vc_dcs_write_1(intel_dsi, 0, MIPI_DCS_SET_TEAR_ON, 0x00);
dsi_vc_dcs_write_0(intel_dsi, 0, MIPI_DCS_SET_DISPLAY_ON);
dsi_vc_dcs_write_1(intel_dsi, 0, 0x14, 0x55);
} else {
dsi_vc_dcs_write_0(intel_dsi, 0, MIPI_DCS_SET_DISPLAY_OFF);
dsi_vc_dcs_write_0(intel_dsi, 0, MIPI_DCS_ENTER_SLEEP_MODE);
}
}
bool vvx09f006a00_init(struct intel_dsi_device *dsi)
{
/* create private data, slam to dsi->dev_priv. could support many panels
* based on dsi->name. This panal supports both command and video mode,
* so check the type. */
/* where to get all the board info style stuff:
*
* - gpio numbers, if any (external te, reset)
* - pin config, mipi lanes
* - dsi backlight? (->create another bl device if needed)
* - esd interval, ulps timeout
*
*/
DRM_DEBUG_KMS("Init: Panasonic panel\n");
if (!dsi) {
DRM_DEBUG_KMS("Init: Invalid input to panasonic_init\n");
return false;
}
dsi->eotp_pkt = 1;
dsi->operation_mode = DSI_VIDEO_MODE;
dsi->video_mode_type = DSI_VIDEO_NBURST_SPULSE;
dsi->pixel_format = VID_MODE_FORMAT_RGB888;
dsi->port_bits = 0;
dsi->turn_arnd_val = 0x14;
dsi->rst_timer_val = 0xffff;
dsi->hs_to_lp_count = 0x46;
dsi->lp_byte_clk = 1;
dsi->bw_timer = 0x820;
dsi->clk_lp_to_hs_count = 0xa;
dsi->clk_hs_to_lp_count = 0x14;
dsi->video_frmt_cfg_bits = 0;
dsi->dphy_reg = 0x3c1fc51f;
dsi->backlight_off_delay = 20;
dsi->send_shutdown = true;
dsi->shutdown_pkt_delay = 20;
return true;
}
/* Callbacks. We might not need them all. */
struct intel_dsi_dev_ops panasonic_vvx09f006a00_dsi_display_ops = {
.init = vvx09f006a00_init,
.get_info = vvx09f006a00_get_panel_info,
.create_resources = vvx09f006a00_create_resources,
.dpms = vvx09f006a00_dpms,
.mode_valid = vvx09f006a00_mode_valid,
.mode_fixup = vvx09f006a00_mode_fixup,
.detect = vvx09f006a00_detect,
.get_hw_state = vvx09f006a00_get_hw_state,
.get_modes = vvx09f006a00_get_modes,
.destroy = vvx09f006a00_destroy,
.dump_regs = vvx09f006a00_dump_regs,
};
|
/*****************************************************************************
*
* Copyright (C) 2011 Thomas Volkert <thomas@homer-conferencing.com>
*
* This software is free software.
* Your are allowed to 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 source is published in the hope that it will be useful, but
* WITHOUT ANY WARRANTY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License version 2 for more details.
*
* You should have received a copy of the GNU General Public License version 2
* along with this program. Otherwise, you can write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
* Alternatively, you find an online version of the license text under
* http://www.gnu.org/licenses/gpl-2.0.html.
*
*****************************************************************************/
/*
* Purpose: CoreVideo capture for OSX
* Since: 2011-11-16
*/
#if defined(APPLE)
#ifndef _MULTIMEDIA_MEDIA_SOURCE_CORE_VIDEO_
#define _MULTIMEDIA_MEDIA_SOURCE_CORE_VIDEO_
#include <MediaSource.h>
#include <Header_CoreVideo.h>
#include <string.h>
namespace Homer { namespace Multimedia {
///////////////////////////////////////////////////////////////////////////////
// de/activate debugging of grabbed packets
//#define MSCV_DEBUG_PACKETS
///////////////////////////////////////////////////////////////////////////////
class MediaSourceCoreVideo:
public MediaSource
{
public:
MediaSourceCoreVideo(std::string pDesiredDevice = "");
~MediaSourceCoreVideo();
/* device control */
virtual void getVideoDevices(VideoDevices &pVList);
/* recording */
virtual bool SupportsRecording();
/* video grabbing control */
//virtual GrabResolutions GetSupportedVideoGrabResolutions();
/* grabbing control */
virtual std::string GetSourceCodecStr();
virtual std::string GetSourceCodecDescription();
public:
virtual bool OpenVideoGrabDevice(int pResX = 352, int pResY = 288, float pFps = 29.97);
virtual bool OpenAudioGrabDevice(int pSampleRate = 44100, int pChannels = 2);
virtual bool CloseGrabDevice();
virtual int GrabChunk(void* pChunkBuffer, int& pChunkSize, bool pDropFrame = false);
private:
// int mSampleBufferSize;
};
///////////////////////////////////////////////////////////////////////////////
}} //namespaces
#endif
#endif
|
/* Kernel object name space definitions
*
* Copyright (c) 2002-2003 Patrick Mochel
* Copyright (c) 2002-2003 Open Source Development Labs
* Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (c) 2006-2008 Novell Inc.
*
* Split from kobject.h by David Howells (dhowells@redhat.com)
*
* This file is released under the GPLv2.
*
* Please read Documentation/kobject.txt before using the kobject
* interface, ESPECIALLY the parts about reference counts and object
* destructors.
*/
#ifndef _LINUX_KOBJECT_NS_H
#define _LINUX_KOBJECT_NS_H
struct sock;
struct kobject;
struct path;
/*
* Namespace types which are used to tag kobjects and sysfs entries.
* Network namespace will likely be the first.
*/
enum kobj_ns_type {
KOBJ_NS_TYPE_NONE = 0,
KOBJ_NS_TYPE_NET,
KOBJ_NS_TYPE_VE,
KOBJ_NS_TYPES
};
/*
* Callbacks so sysfs can determine namespaces
* @grab_current_ns: return a new reference to calling task's namespace
* @netlink_ns: return namespace to which a sock belongs (right?)
* @initial_ns: return the initial namespace (i.e. init_net_ns)
* @drop_ns: drops a reference to namespace
*/
struct kobj_ns_type_operations {
enum kobj_ns_type type;
void *(*grab_current_ns)(void);
const void *(*netlink_ns)(struct sock *sk);
const void *(*initial_ns)(void);
void (*drop_ns)(void *);
const struct path *(*devtmpfs)(const struct kobject *);
};
int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
int kobj_ns_type_registered(enum kobj_ns_type type);
const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
void *kobj_ns_grab_current(enum kobj_ns_type type);
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
const void *kobj_ns_initial(enum kobj_ns_type type);
void kobj_ns_drop(enum kobj_ns_type type, void *ns);
#endif /* _LINUX_KOBJECT_NS_H */
|
/*
*
* Copyright (c) International Business Machines Corp., 2001
*
* 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
*/
/*
* NAME
* msgget01.c
*
* DESCRIPTION
* msgget01 - create a message queue, write a message to it and
* read it back.
*
* ALGORITHM
* loop if that option was specified
* create a message queue
* check the return code
* if failure, issue a FAIL message.
* otherwise,
* if doing functionality testing by writting a message to the queue,
* reading it back and comparing the two.
* if the messages are the same,
* issue a PASS message
* otherwise
* issue a FAIL message
* call cleanup
*
* USAGE: <for command-line>
* msgget01 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
* where, -c n : Run n copies concurrently.
* -f : Turn off functionality Testing.
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
*
* HISTORY
* 03/2001 - Written by Wayne Boyer
*
* RESTRICTIONS
* none
*/
#include "ipcmsg.h"
#include <string.h>
char *TCID = "msgget01";
int TST_TOTAL = 1;
int msg_q_1 = -1; /* to hold the message queue ID */
int main(int ac, char **av)
{
int lc;
char *msg;
void check_functionality(void);
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
}
setup(); /* global setup */
/* The following loop checks looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset tst_count in case we are looping */
tst_count = 0;
/*
* Use TEST macro to make the call to create the message queue
*/
TEST(msgget(msgkey, IPC_CREAT | IPC_EXCL | MSG_RD | MSG_WR));
if (TEST_RETURN == -1) {
tst_resm(TFAIL, "%s call failed - errno = %d : %s",
TCID, TEST_ERRNO, strerror(TEST_ERRNO));
} else {
msg_q_1 = TEST_RETURN;
if (STD_FUNCTIONAL_TEST) {
/*
* write a message to the queue.
* read back the message.
* PASS the test if they are the same.
*/
check_functionality();
} else {
tst_resm(TPASS, "message queue was created");
}
}
/*
* remove the message queue that was created and mark the ID
* as invalid.
*/
if (msg_q_1 != -1) {
rm_queue(msg_q_1);
msg_q_1 = -1;
}
}
cleanup();
tst_exit();
}
/*
* check_functionality() - check the functionality of the tested system call.
*/
void check_functionality()
{
int i = 0;
MSGBUF snd_buf, rcv_buf;
/* EAGLE: Houston, Tranquility Base here. The Eagle has landed! */
char *queue_msg =
"Qston, check_functionality here. The message has queued!";
/*
* copy our message into the buffer and then set the type.
*/
do {
snd_buf.mtext[i++] = *queue_msg;
} while (*queue_msg++ != '\0');
snd_buf.mtype = MSGTYPE;
/* send the message */
if (msgsnd(msg_q_1, &snd_buf, MSGSIZE, 0) == -1) {
tst_brkm(TBROK, cleanup, "Could not send a message in the "
"check_functionality() routine.");
}
/* receive the message */
if (msgrcv(msg_q_1, &rcv_buf, MSGSIZE, MSGTYPE, IPC_NOWAIT) == -1) {
tst_brkm(TBROK, cleanup, "Could not read a messages in the "
"check_functionality() routine.");
}
if (strcmp(snd_buf.mtext, rcv_buf.mtext) == 0) {
tst_resm(TPASS, "message received = message sent");
} else {
tst_resm(TFAIL, "message received != message sent");
}
}
/*
* setup() - performs all the ONE TIME setup for this test.
*/
void setup(void)
{
tst_sig(NOFORK, DEF_HANDLER, cleanup);
TEST_PAUSE;
/*
* Create a temporary directory and cd into it.
* This helps to ensure that a unique msgkey is created.
* See ../lib/libipc.c for more information.
*/
tst_tmpdir();
msgkey = getipckey();
}
/*
* cleanup() - performs all the ONE TIME cleanup for this test at completion
* or premature exit.
*/
void cleanup(void)
{
/* if it exists, remove the message queue that was created */
rm_queue(msg_q_1);
tst_rmdir();
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
}
|
// Copyright (c) 2005 - 2017 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots 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.
//
// Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>.
#ifndef iwBUILDINGPRODUCTIVITIES_H_
#define iwBUILDINGPRODUCTIVITIES_H_
#include "IngameWindow.h"
class GamePlayer;
/// Fenster, welches die Anzahl aller Gebäude und der Baustellen auflistet
class iwBuildingProductivities : public IngameWindow
{
const GamePlayer& player;
/// Prozentzahlen der einzelnen Gebäude
std::vector<unsigned short> percents;
public:
iwBuildingProductivities(const GamePlayer& player);
private:
/// Aktualisieren der Prozente
void UpdatePercents();
/// Produktivitäts-Progressbars aktualisieren
void Msg_PaintAfter() override;
};
#endif //! iwBUILDINGPRODUCTIVITIES_H_
|
/*
* Copyright (C) 2010 Guillermo Biset, FuDePAN
*
* File: counter_processor.h
* System: FuD
*
* Homepage: <http://fud.googlecode.com/>
* Language: C++
*
* Author: Guillermo Biset
* E-Mail: billybiset AT gmail.com
*
* FuD 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.
*
* FuD 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 FuD. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef COUNTER_PROCESSOR_H
#define COUNTER_PROCESSOR_H
#include <fud/fud_client.h>
namespace fud
{
class CounterProcessor : ClientProcessor
{
public:
CounterProcessor();
virtual bool process(InputMessage& input, OutputMessage& output);
};
}
#endif
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "InformationElements"
* found in "../asn/InformationElements.asn"
* `asn1c -fcompound-names -fnative-types`
*/
#ifndef _NAS_Message_H_
#define _NAS_Message_H_
#include <asn_application.h>
/* Including external dependencies */
#include <OCTET_STRING.h>
#ifdef __cplusplus
extern "C" {
#endif
/* NAS-Message */
typedef OCTET_STRING_t NAS_Message_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_NAS_Message;
asn_struct_free_f NAS_Message_free;
asn_struct_print_f NAS_Message_print;
asn_constr_check_f NAS_Message_constraint;
ber_type_decoder_f NAS_Message_decode_ber;
der_type_encoder_f NAS_Message_encode_der;
xer_type_decoder_f NAS_Message_decode_xer;
xer_type_encoder_f NAS_Message_encode_xer;
per_type_decoder_f NAS_Message_decode_uper;
per_type_encoder_f NAS_Message_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _NAS_Message_H_ */
#include <asn_internal.h>
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Jerome Loyet <jerome@loyet.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "../fpm_config.h"
#include "../fpm_events.h"
#include "../fpm.h"
#include "../zlog.h"
#if HAVE_DEVPOLL
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <sys/devpoll.h>
#include <errno.h>
static int fpm_event_devpoll_init(int max);
static int fpm_event_devpoll_clean();
static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout);
static int fpm_event_devpoll_add(struct fpm_event_s *ev);
static int fpm_event_devpoll_remove(struct fpm_event_s *ev);
static struct fpm_event_module_s devpoll_module = {
.name = "/dev/poll",
.support_edge_trigger = 0,
.init = fpm_event_devpoll_init,
.clean = fpm_event_devpoll_clean,
.wait = fpm_event_devpoll_wait,
.add = fpm_event_devpoll_add,
.remove = fpm_event_devpoll_remove,
};
int dpfd = -1;
static struct pollfd *pollfds = NULL;
static struct pollfd *active_pollfds = NULL;
static int npollfds = 0;
#endif /* HAVE_DEVPOLL */
struct fpm_event_module_s *fpm_event_devpoll_module() /* {{{ */
{
#if HAVE_DEVPOLL
return &devpoll_module;
#else
return NULL;
#endif /* HAVE_DEVPOLL */
}
/* }}} */
#if HAVE_DEVPOLL
/*
* Init module
*/
static int fpm_event_devpoll_init(int max) /* {{{ */
{
int i;
/* open /dev/poll for future usages */
dpfd = open("/dev/poll", O_RDWR);
if (dpfd < 0) {
zlog(ZLOG_ERROR, "Unable to open /dev/poll");
return -1;
}
if (max < 1) {
return 0;
}
/* alloc and clear pollfds */
pollfds = malloc(sizeof(struct pollfd) * max);
if (!pollfds) {
zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max);
return -1;
}
memset(pollfds, 0, sizeof(struct pollfd) * max);
/* set all fd to -1 in order to ensure it's not set */
for (i = 0; i < max; i++) {
pollfds[i].fd = -1;
}
/* alloc and clear active_pollfds */
active_pollfds = malloc(sizeof(struct pollfd) * max);
if (!active_pollfds) {
free(pollfds);
zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max);
return -1;
}
memset(active_pollfds, 0, sizeof(struct pollfd) * max);
/* save max */
npollfds = max;
return 0;
}
/* }}} */
/*
* Clean the module
*/
static int fpm_event_devpoll_clean() /* {{{ */
{
/* close /dev/poll if open */
if (dpfd > -1) {
close(dpfd);
dpfd = -1;
}
/* free pollfds */
if (pollfds) {
free(pollfds);
pollfds = NULL;
}
/* free active_pollfds */
if (active_pollfds) {
free(active_pollfds);
active_pollfds = NULL;
}
npollfds = 0;
return 0;
}
/* }}} */
/*
* wait for events or timeout
*/
static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */
{
int ret, i;
struct fpm_event_queue_s *q;
struct dvpoll dopoll;
/* setup /dev/poll */
dopoll.dp_fds = active_pollfds;
dopoll.dp_nfds = npollfds;
dopoll.dp_timeout = (int)timeout;
/* wait for inconming event or timeout */
ret = ioctl(dpfd, DP_POLL, &dopoll);
if (ret < 0) {
/* trigger error unless signal interrupt */
if (errno != EINTR) {
zlog(ZLOG_WARNING, "/dev/poll: ioctl() returns %d", errno);
return -1;
}
}
/* iterate throught triggered events */
for (i = 0; i < ret; i++) {
/* find the corresponding event */
q = queue;
while (q) {
/* found */
if (q->ev && q->ev->fd == active_pollfds[i].fd) {
/* fire the event */
fpm_event_fire(q->ev);
/* sanity check */
if (fpm_globals.parent_pid != getpid()) {
return -2;
}
break; /* next triggered event */
}
q = q->next; /* iterate */
}
}
return ret;
}
/* }}} */
/*
* Add a FD from the fd set
*/
static int fpm_event_devpoll_add(struct fpm_event_s *ev) /* {{{ */
{
struct pollfd pollfd;
/* fill pollfd with event informations */
pollfd.fd = ev->fd;
pollfd.events = POLLIN;
pollfd.revents = 0;
/* add the event to the internal queue */
if (write(dpfd, &pollfd, sizeof(struct pollfd)) != sizeof(struct pollfd)) {
zlog(ZLOG_ERROR, "/dev/poll: Unable to add the event in the internal queue");
return -1;
}
/* mark the event as registered */
ev->index = ev->fd;
return 0;
}
/* }}} */
/*
* Remove a FD from the fd set
*/
static int fpm_event_devpoll_remove(struct fpm_event_s *ev) /* {{{ */
{
struct pollfd pollfd;
/* fill pollfd with the same informations as fpm_event_devpoll_add */
pollfd.fd = ev->fd;
pollfd.events = POLLIN | POLLREMOVE;
pollfd.revents = 0;
/* add the event to the internal queue */
if (write(dpfd, &pollfd, sizeof(struct pollfd)) != sizeof(struct pollfd)) {
zlog(ZLOG_ERROR, "/dev/poll: Unable to remove the event in the internal queue");
return -1;
}
/* mark the event as registered */
ev->index = -1;
return 0;
}
/* }}} */
#endif /* HAVE_DEVPOLL */
|
#pragma once
#include <limits>
#include <QAbstractItemModel>
#include <QTest>
void checkHeaderData(const QAbstractItemModel *model, const std::vector<QString> &strings, Qt::Orientation orientation)
{
const int sections = (orientation == Qt::Horizontal) ? model->columnCount(QModelIndex()) : model->rowCount(QModelIndex());
for (int i = 0; i < sections; i++) {
QCOMPARE(model->headerData(i, orientation, Qt::DisplayRole).toString(), strings.at(i));
QCOMPARE(model->headerData(i, orientation, Qt::EditRole), QVariant());
}
QCOMPARE(model->headerData(sections, orientation, Qt::DisplayRole), QVariant());
QCOMPARE(model->headerData(- 1, orientation, Qt::DisplayRole), QVariant());
}
void checkHeaderDataEmpty(const QAbstractItemModel *model, Qt::Orientation orientation)
{
const int sections = (orientation == Qt::Horizontal) ? model->columnCount(QModelIndex()) : model->rowCount(QModelIndex());
for (int i = -1; i <= sections; i++) {
QCOMPARE(model->headerData(i, orientation, Qt::DisplayRole), QVariant());
QCOMPARE(model->headerData(i, orientation, Qt::EditRole), QVariant());
}
}
|
/*
** Taiga
** Copyright (C) 2010-2014, Eren Okka
**
** 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 TAIGA_UI_THEME_H
#define TAIGA_UI_THEME_H
#include <string>
#include <vector>
#include "win/ctrl/win_ctrl.h"
#include "win/win_gdi.h"
namespace ui {
enum Icons16px {
kIcon16_Green,
kIcon16_Blue,
kIcon16_Red,
kIcon16_Gray,
kIcon16_Play,
kIcon16_Search,
kIcon16_Folder,
kIcon16_AppBlue,
kIcon16_AppGray,
kIcon16_Refresh,
kIcon16_Download,
kIcon16_Settings,
kIcon16_Cross,
kIcon16_Plus,
kIcon16_Minus,
kIcon16_ArrowUp,
kIcon16_ArrowDown,
kIcon16_Funnel,
kIcon16_FunnelCross,
kIcon16_FunnelTick,
kIcon16_FunnelPlus,
kIcon16_FunnelPencil,
kIcon16_Calendar,
kIcon16_Category,
kIcon16_Sort,
kIcon16_Balloon,
kIcon16_Clock,
kIcon16_Home,
kIcon16_DocumentA,
kIcon16_Chart,
kIcon16_Feed,
kIcon16_Details,
kIcon16_Import,
kIcon16_Export,
kIconCount16px
};
enum Icons24px {
kIcon24_Sync,
kIcon24_Folders,
kIcon24_Tools,
kIcon24_Settings,
kIcon24_About,
kIcon24_Globe,
kIcon24_Library,
kIcon24_Application,
kIcon24_Recognition,
kIcon24_Sharing,
kIcon24_Feed,
kIconCount24px
};
enum ListProgressType {
kListProgressAired,
kListProgressAvailable,
kListProgressBackground,
kListProgressBorder,
kListProgressButton,
kListProgressCompleted,
kListProgressDropped,
kListProgressOnHold,
kListProgressPlanToWatch,
kListProgressSeparator,
kListProgressWatching
};
const COLORREF kColorDarkBlue = RGB(46, 81, 162);
const COLORREF kColorGray = RGB(230, 230, 230);
const COLORREF kColorLightBlue = RGB(225, 231, 245);
const COLORREF kColorLightGray = RGB(248, 248, 248);
const COLORREF kColorLightGreen = RGB(225, 245, 231);
const COLORREF kColorLightRed = RGB(245, 225, 231);
const COLORREF kColorMainInstruction = RGB(0x00, 0x33, 0x99);
class ThemeManager {
public:
ThemeManager();
~ThemeManager() {}
bool Load();
void CreateBrushes();
void CreateFonts(HDC hdc);
HBRUSH GetBackgroundBrush() const;
HFONT GetBoldFont() const;
HFONT GetHeaderFont() const;
win::ImageList& GetImageList16();
win::ImageList& GetImageList24();
void DrawListProgress(HDC hdc, const LPRECT rect, ListProgressType type);
COLORREF GetListProgressColor(ListProgressType type);
private:
win::Brush brush_background_;
win::Font font_bold_;
win::Font font_header_;
win::ImageList icons16_;
win::ImageList icons24_;
struct Progress {
COLORREF value[3];
std::wstring type;
};
std::map<ListProgressType, Progress> list_progress_;
};
extern ThemeManager Theme;
} // namespace ui
#endif // TAIGA_UI_THEME_H |
/**
* This file is part of the "FnordMetric" project
* Copyright (c) 2011-2014 Paul Asmuth, Google Inc.
*
* FnordMetric is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License v3.0. 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 _FNORDMETRIC_UTIL_JSONOUTPUTSTREAM_H
#define _FNORDMETRIC_UTIL_JSONOUTPUTSTREAM_H
#include <fnordmetric/util/outputstream.h>
#include <fnordmetric/util/runtimeexception.h>
namespace fnordmetric {
namespace util {
class JSONOutputStream {
public:
JSONOutputStream(std::shared_ptr<OutputStream> output_stream);
void beginObject();
void endObject();
void addObjectEntry(const std::string& key);
void beginArray();
void endArray();
void addComma();
void addString(const std::string& string);
void addFloat(double value);
template <typename T>
void addLiteral(T integer) {
output_->write(std::to_string(integer));
}
protected:
std::string escapeString(const std::string& string) const;
std::shared_ptr<util::OutputStream> output_;
};
}
}
#endif
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* 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 software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "platform.h"
#ifdef USE_PINIOBOX
#include "drivers/io.h"
#include "msp/msp_box.h"
#include "pg/pg_ids.h"
#include "piniobox.h"
PG_REGISTER_WITH_RESET_TEMPLATE(pinioBoxConfig_t, pinioBoxConfig, PG_PINIOBOX_CONFIG, 1);
PG_RESET_TEMPLATE(pinioBoxConfig_t, pinioBoxConfig,
{ PERMANENT_ID_NONE, PERMANENT_ID_NONE, PERMANENT_ID_NONE, PERMANENT_ID_NONE },
);
#endif
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../addresses.h"
#include "../game.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../peep/peep.h"
#include "../peep/staff.h"
#include "../sprites.h"
#include "../world/sprite.h"
#include "../interface/themes.h"
#define WW 200
#define WH 100
enum WINDOW_STAFF_FIRE_WIDGET_IDX {
WIDX_BACKGROUND,
WIDX_TITLE,
WIDX_CLOSE,
WIDX_YES,
WIDX_CANCEL
};
// 0x9AFB4C
static rct_widget window_staff_fire_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE },
{ WWT_CAPTION, 0, 1, WW - 2, 1, 14, STR_SACK_STAFF, STR_WINDOW_TITLE_TIP },
{ WWT_CLOSEBOX, 0, WW-13, WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP },
{ WWT_DROPDOWN_BUTTON, 0, 10, 94, WH - 20, WH - 9, STR_YES, STR_NONE },
{ WWT_DROPDOWN_BUTTON, 0, WW - 95, WW - 11, WH - 20, WH - 9, STR_SAVE_PROMPT_CANCEL, STR_NONE },
{ WIDGETS_END }
};
static void window_staff_fire_mouseup(rct_window *w, int widgetIndex);
static void window_staff_fire_invalidate(rct_window *w);
static void window_staff_fire_paint(rct_window *w, rct_drawpixelinfo *dpi);
//0x9A3F7C
static rct_window_event_list window_staff_fire_events = {
NULL,
window_staff_fire_mouseup,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
window_staff_fire_invalidate,
window_staff_fire_paint,
NULL
};
/** Based off of rct2: 0x6C0A77 */
void window_staff_fire_prompt_open(rct_peep* peep)
{
// Check if the confirm window already exists.
if (window_bring_to_front_by_number(WC_FIRE_PROMPT, peep->sprite_index)) {
return;
}
rct_window* w = window_create_centred(WW, WH, &window_staff_fire_events, WC_FIRE_PROMPT, WF_TRANSPARENT);
w->widgets = window_staff_fire_widgets;
w->enabled_widgets |= (1 << WIDX_CLOSE) | (1 << WIDX_YES) | (1 << WIDX_CANCEL);
window_init_scroll_widgets(w);
colour_scheme_update(w);
w->number = peep->sprite_index;
}
/**
*
* rct2: 0x006C0B40
*/
static void window_staff_fire_mouseup(rct_window *w, int widgetIndex)
{
rct_peep* peep = &g_sprite_list[w->number].peep;
switch (widgetIndex){
case WIDX_YES:
game_do_command(peep->x, 1, peep->y, w->number, GAME_COMMAND_FIRE_STAFF_MEMBER, 0, 0);
break;
case WIDX_CANCEL:
case WIDX_CLOSE:
window_close(w);
}
}
static void window_staff_fire_invalidate(rct_window *w)
{
colour_scheme_update(w);
}
/**
*
* rct2: 0x006C0AF2
*/
static void window_staff_fire_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
window_draw_widgets(w, dpi);
rct_peep* peep = &g_sprite_list[w->number].peep;
set_format_arg(0, uint16, peep->name_string_idx);
set_format_arg(2, uint32, peep->id);
int x = w->x + WW / 2;
int y = w->y + (WH / 2) - 3;
gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, WW - 4, STR_FIRE_STAFF_ID, 0);
}
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "InformationElements"
* found in "../asn/InformationElements.asn"
* `asn1c -fcompound-names -fnative-types`
*/
#include "InterRAT-UE-SecurityCapability.h"
static asn_per_constraints_t asn_PER_type_InterRAT_UE_SecurityCapability_constr_1 = {
{ APC_CONSTRAINED, 0, 0, 0, 0 } /* (0..0) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_gsm_2[] = {
{ ATF_NOFLAGS, 0, offsetof(struct InterRAT_UE_SecurityCapability__gsm, gsmSecurityCapability),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_GsmSecurityCapability,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"gsmSecurityCapability"
},
};
static ber_tlv_tag_t asn_DEF_gsm_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_gsm_tag2el_2[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gsmSecurityCapability at 20317 */
};
static asn_SEQUENCE_specifics_t asn_SPC_gsm_specs_2 = {
sizeof(struct InterRAT_UE_SecurityCapability__gsm),
offsetof(struct InterRAT_UE_SecurityCapability__gsm, _asn_ctx),
asn_MAP_gsm_tag2el_2,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_gsm_2 = {
"gsm",
"gsm",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_gsm_tags_2,
sizeof(asn_DEF_gsm_tags_2)
/sizeof(asn_DEF_gsm_tags_2[0]) - 1, /* 1 */
asn_DEF_gsm_tags_2, /* Same as above */
sizeof(asn_DEF_gsm_tags_2)
/sizeof(asn_DEF_gsm_tags_2[0]), /* 2 */
0, /* No PER visible constraints */
asn_MBR_gsm_2,
1, /* Elements count */
&asn_SPC_gsm_specs_2 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_InterRAT_UE_SecurityCapability_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct InterRAT_UE_SecurityCapability, choice.gsm),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_gsm_2,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"gsm"
},
};
static asn_TYPE_tag2member_t asn_MAP_InterRAT_UE_SecurityCapability_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gsm at 20317 */
};
static asn_CHOICE_specifics_t asn_SPC_InterRAT_UE_SecurityCapability_specs_1 = {
sizeof(struct InterRAT_UE_SecurityCapability),
offsetof(struct InterRAT_UE_SecurityCapability, _asn_ctx),
offsetof(struct InterRAT_UE_SecurityCapability, present),
sizeof(((struct InterRAT_UE_SecurityCapability *)0)->present),
asn_MAP_InterRAT_UE_SecurityCapability_tag2el_1,
1, /* Count of tags in the map */
0,
-1 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_InterRAT_UE_SecurityCapability = {
"InterRAT-UE-SecurityCapability",
"InterRAT-UE-SecurityCapability",
CHOICE_free,
CHOICE_print,
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
CHOICE_decode_xer,
CHOICE_encode_xer,
CHOICE_decode_uper,
CHOICE_encode_uper,
CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
&asn_PER_type_InterRAT_UE_SecurityCapability_constr_1,
asn_MBR_InterRAT_UE_SecurityCapability_1,
1, /* Elements count */
&asn_SPC_InterRAT_UE_SecurityCapability_specs_1 /* Additional specs */
};
|
/*
* uhub - A tiny ADC p2p connection hub
* Copyright (C) 2007-2014, Jan Vidar Krey
*
* 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 HAVE_UHUB_PLUGIN_MESSAGE_API_H
#define HAVE_UHUB_PLUGIN_MESSAGE_API_H
/**
* Send an informal message to a user.
* The user will see the message as if the hub sent it.
*/
extern int plugin_send_message(struct plugin_handle*, struct plugin_user* to, const char* message);
/**
* Send a status message to a user.
*/
extern int plugin_send_status(struct plugin_handle* struct plugin_user* to, int code, const char* message);
#endif /* HAVE_UHUB_PLUGIN_API_H */
|
/* radare - LGPL - Copyright 2009-2014 - nibble */
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_util.h>
#include <r_asm.h>
#include "dis-asm.h"
#include <mybfd.h>
static unsigned long Offset = 0;
static char *buf_global = NULL;
static unsigned char bytes[4];
static int sparc_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info) {
memcpy (myaddr, bytes, length);
return 0;
}
static int symbol_at_address(bfd_vma addr, struct disassemble_info * info) {
return 0;
}
static void memory_error_func(int status, bfd_vma memaddr, struct disassemble_info *info) {
//--
}
static void print_address(bfd_vma address, struct disassemble_info *info) {
char tmp[32];
if (buf_global == NULL)
return;
sprintf (tmp, "0x%08"PFMT64x"", (ut64)address);
strcat (buf_global, tmp);
}
static int buf_fprintf(void *stream, const char *format, ...) {
va_list ap;
char tmp[1024];
if (buf_global == NULL)
return 0;
va_start (ap, format);
vsnprintf (tmp, sizeof (tmp), format, ap);
strcat (buf_global, tmp);
va_end (ap);
return 0;
}
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
static struct disassemble_info disasm_obj;
if (len<4) return -1;
buf_global = op->buf_asm;
Offset = a->pc;
memcpy (bytes, buf, 4); // TODO handle thumb
/* prepare disassembler */
memset (&disasm_obj,'\0', sizeof (struct disassemble_info));
disasm_obj.buffer = bytes;
disasm_obj.read_memory_func = &sparc_buffer_read_memory;
disasm_obj.symbol_at_address_func = &symbol_at_address;
disasm_obj.memory_error_func = &memory_error_func;
disasm_obj.print_address_func = &print_address;
disasm_obj.endian = !a->big_endian;
disasm_obj.fprintf_func = &buf_fprintf;
disasm_obj.stream = stdout;
disasm_obj.mach = ((a->bits == 64)
? bfd_mach_sparc_v9b
: 0);
op->buf_asm[0]='\0';
op->size = print_insn_sparc ((bfd_vma)Offset, &disasm_obj);
if (op->size == -1)
strncpy (op->buf_asm, " (data)", R_ASM_BUFSIZE);
return op->size;
}
RAsmPlugin r_asm_plugin_sparc_gnu = {
.name = "sparc.gnu",
.arch = "sparc",
.bits = 32|64,
.license = "GPL3",
.desc = "Scalable Processor Architecture",
.disassemble = &disassemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_sparc_gnu,
.version = R2_VERSION
};
#endif
|
//
// Created by fedor on 04/03/16.
//
#ifndef PROBREACH_CSVPARSER_H
#define PROBREACH_CSVPARSER_H
#include <capd/intervals/lib.h>
#include <map>
#include "model.h"
using namespace std;
namespace csvparser
{
map<string, vector<pair<pdrh::node*, pdrh::node*>>> parse(string);
}
#endif //PROBREACH_CSVPARSER_H
|
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SWSCALE_VERSION_H
#define SWSCALE_VERSION_H
/**
* @file
* swscale version macros
*/
#include "libavutil/avutil.h"
#define LIBSWSCALE_VERSION_MAJOR 2
#define LIBSWSCALE_VERSION_MINOR 4
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
LIBSWSCALE_VERSION_MICRO)
#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
LIBSWSCALE_VERSION_MICRO)
#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
/**
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*/
#ifndef FF_API_SWS_GETCONTEXT
#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#ifndef FF_API_SWS_CPU_CAPS
#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#ifndef FF_API_SWS_FORMAT_NAME
#define FF_API_SWS_FORMAT_NAME (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#endif /* SWSCALE_VERSION_H */
|
/*
* PLUTO: An automatic parallelizer and locality optimizer
*
* Copyright (C) 2007 Uday Bondhugula
*
* 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.
*
* A copy of the GNU General Public Licence can be found in the
* top-level directory of this program (`COPYING')
*
*/
#ifndef _TRANSFORMS_H_
#define _TRANSFORMS_H_
#include "pluto.h"
void pluto_sink_statement(Stmt *stmt, int depth, int val, PlutoProg *prog);
void pluto_stripmine(Stmt *stmt, int dim, int factor, char *supernode, PlutoProg *prog);
void pluto_tile_scattering_dims(PlutoProg *prog, Band **bands, int nbands, int l2);
void pluto_reschedule_tile(PlutoProg *prog);
void pluto_interchange(PlutoProg *prog, int level1, int level2);
void pluto_sink_transformation(Stmt *stmt, int pos, PlutoProg *prog);
void pluto_make_innermost(Ploop *loop, PlutoProg *prog);
#endif
|
/*
* Utils.h
*
* Copyright (C) 2012 Simon Lehmann
*
* This file is part of Actracktive.
*
* Actracktive 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.
*
* Actracktive 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLUITUTILS_H_
#define GLUITUTILS_H_
#include <boost/function.hpp>
#include <boost/numeric/conversion/cast.hpp>
namespace gluit
{
template<typename T>
T clamp(T value, T min, T max)
{
if (value < min) {
return min;
} else if (value > max) {
return max;
} else {
return value;
}
}
template<typename T>
T round(T value)
{
return (value > 0) ? std::floor(value + 0.5) : std::ceil(value - 0.5);
}
template<typename R, typename T>
R round(T value)
{
return boost::numeric_cast<R>(round(value));
}
template<typename T>
class SafeHandle
{
public:
typedef boost::function<void(T)> Destructor;
SafeHandle(Destructor destructor)
: value(NULL), destructor(destructor)
{
}
virtual ~SafeHandle()
{
clear();
}
T get()
{
return value;
}
T release()
{
T value = this->value;
this->value = NULL;
return value;
}
void clear()
{
if (value != NULL) {
destructor(value);
value = NULL;
}
}
SafeHandle<T>& operator=(SafeHandle<T>& assign)
{
if (&assign != this) {
value = assign.release();
destructor = assign.destructor;
}
return *this;
}
SafeHandle<T>& operator=(T value)
{
if (value != this->value) {
clear();
this->value = value;
}
return *this;
}
T* operator &()
{
return &value;
}
T const* operator &() const
{
return &value;
}
T operator->()
{
return value;
}
const T operator->() const
{
return value;
}
operator T()
{
return value;
}
operator const T() const
{
return value;
}
operator bool() const
{
return value != NULL;
}
private:
T value;
Destructor destructor;
SafeHandle(SafeHandle<T>& copy); // Non-copyable
};
}
#endif
|
#ifndef DYNAMITEwisefileHEADERFILE
#define DYNAMITEwisefileHEADERFILE
#ifdef _cplusplus
extern "C" {
#endif
#include "wisebase.h"
#define MAXPATHLEN 1024
#ifdef FILE_DEBUG
#define fclose myfclose
#endif
#ifdef NOERROR
#define ERRORSTR "No error available"
#else
#define ERRORSTR strerror(errno)
#endif
/***************************************************/
/* Callable functions */
/* These are the functions you are expected to use */
/***************************************************/
/* Function: set_config_dir(path,*path)
*
* Descrip: Programmatically set systemconfigdir to override
* any value set (or not) by env.var. WISECONFIGDIR.
*
* Added by arve.
*
*
* Arg: path [UNKN ] path that WISECONFIGDIR is set to [NullString]
* Arg: *path [UNKN ] Undocumented argument [char]
*
*/
void bp_sw_set_config_dir(char *path) ;
#define set_config_dir bp_sw_set_config_dir
/* Function: myfclose(ofp)
*
* Descrip: reports the fclose type etc
*
*
* Arg: ofp [UNKN ] Undocumented argument [FILE *]
*
* Return [UNKN ] Undocumented return value [int]
*
*/
int bp_sw_myfclose(FILE * ofp);
#define myfclose bp_sw_myfclose
/* Function: remove_file(filename)
*
* Descrip: silly function to provide a boolean wrapper
* around remove.
*
*
* Arg: filename [UNKN ] Undocumented argument [char *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean bp_sw_remove_file(char * filename);
#define remove_file bp_sw_remove_file
/* Function: move_file(from,to)
*
* Descrip: silly function to provide a boolean wrapper
* around rename
*
*
* Arg: from [UNKN ] Undocumented argument [char *]
* Arg: to [UNKN ] Undocumented argument [char *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean bp_sw_move_file(char * from,char * to);
#define move_file bp_sw_move_file
/* Function: touchfile(filename)
*
* Descrip: sees if filename exists
*
*
* Arg: filename [UNKN ] Undocumented argument [char *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean bp_sw_touchfile(char * filename);
#define touchfile bp_sw_touchfile
/* Function: openfile(filename,passedprot)
*
* Descrip: Every file open goes through this.
*
* It opens for reading in the following order
* .
* WISEPERSONALDIR
* WISECONFIGDIR
*
* For writing it opens in .
*
* Filenames with ~'s are expanded to HOME/filename
*
*
* Arg: filename [UNKN ] filename to open for read/writing [const char *]
* Arg: passedprot [UNKN ] string representing standard fopen attributes [const char *]
*
* Return [UNKN ] open'd filehandle, NULL on error [FILE *]
*
*/
FILE * bp_sw_openfile(const char * filename,const char * passedprot);
#define openfile bp_sw_openfile
/* Function: envopenfile(envname,filename,name,env)
*
* Descrip: This function basically mirrors the function in file.c
* in HMMer2. You call it as
*
* fp = Envfile(filename,envname);
*
* where envname looks like "BLASTDB" etc.
*
*
*
* Arg: envname [READ ] enviroment variable to read from [NullString]
* Arg: filename [UNKN ] Undocumented argument [char *]
* Arg: name [READ ] filename to open [NullString]
* Arg: env [UNKN ] Undocumented argument [char *]
*
* Return [UNKN ] a valid file pointer or NULL [FILE *]
*
*/
FILE * bp_sw_envopenfile(char * filename,char * env);
#define envopenfile bp_sw_envopenfile
/* Unplaced functions */
/* There has been no indication of the use of these functions */
/***************************************************/
/* Internal functions */
/* you are not expected to have to call these */
/***************************************************/
void bp_sw_try_to_load(void);
#define try_to_load bp_sw_try_to_load
boolean bp_sw_append_file_to_path(char * buffer,int len,const char * file,char * path);
#define append_file_to_path bp_sw_append_file_to_path
#ifdef _cplusplus
}
#endif
#endif
|
#ifndef SAUCE_TEXTURE_H
#define SAUCE_TEXTURE_H
#include <Sauce/Common.h>
#include <Sauce/Graphics/Pixmap.h>
BEGIN_SAUCE_NAMESPACE
class SAUCE_API Texture2D
{
friend class RenderTarget2D;
friend class GraphicsContext;
friend class Shader;
public:
Texture2D();
virtual ~Texture2D();
// Mipmapping
void enableMipmaps();
void disableMipmaps();
bool isMipmapsEnabled() const;
// Texture filtering
enum TextureFilter
{
NEAREST = GL_NEAREST,
LINEAR = GL_LINEAR
};
void setFiltering(const TextureFilter filter);
TextureFilter getFiltering() const;
// Texture wrapping
enum TextureWrapping
{
CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER,
CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE,
REPEAT = GL_REPEAT,
MIRRORED_REPEAT = GL_MIRRORED_REPEAT
};
void setWrapping(const TextureWrapping wrapping);
TextureWrapping getWrapping() const;
// Size
uint getWidth() const;
uint getHeight() const;
Vector2I getSize() const { return Vector2I(getWidth(), getHeight()); }
// Texture data functions
virtual Pixmap getPixmap() const = 0;
virtual void updatePixmap(const Pixmap &pixmap) = 0;
virtual void updatePixmap(const uint x, const uint y, const Pixmap &pixmap) = 0;
virtual void clear() = 0;
void exportToFile(string path);
protected:
virtual void updateFiltering() = 0;
TextureFilter m_filter;
TextureWrapping m_wrapping;
bool m_mipmaps;
bool m_mipmapsGenerated;
uint m_width;
uint m_height;
PixelFormat m_pixelFormat;
};
template class SAUCE_API shared_ptr<Texture2D>;
class TextureResourceDesc : public ResourceDesc
{
public:
TextureResourceDesc(const string &name, const string &path, const bool premultiplyAlpha) :
ResourceDesc(RESOURCE_TYPE_TEXTURE, name),
m_premultiplyAlpha(premultiplyAlpha),
m_path(path)
{
}
void *create() const;
private:
const bool m_premultiplyAlpha;
const string m_path;
};
END_SAUCE_NAMESPACE
#endif // SAUCE_TEXTURE_H
|
/*
* Copyright (c) 2010 Wind River Systems; see
* guts/COPYRIGHT for information.
*
* static int
* wrap_chroot(const char *path) {
* int rc = -1;
*/
pseudo_debug(PDBGF_CLIENT | PDBGF_CHROOT, "chroot: %s\n", path);
if (!pseudo_client_op(OP_CHROOT, 0, -1, -1, path, 0)) {
pseudo_debug(PDBGF_OP | PDBGF_CHROOT, "chroot failed: %s\n", strerror(errno));
rc = -1;
} else {
rc = 0;
}
/* return rc;
* }
*/
|
/*
* Motif
*
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* HISTORY
*/
/* $XConsortium: SeparatoG.h /main/11 1995/07/13 17:58:45 drk $ */
/*
* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
/* Separator Gadget */
#ifndef _XmSeparatorGadget_h
#define _XmSeparatorGadget_h
#include <Xm/Xm.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef XmIsSeparatorGadget
#define XmIsSeparatorGadget(w) XtIsSubclass(w, xmSeparatorGadgetClass)
#endif /* XmIsSeparator */
externalref WidgetClass xmSeparatorGadgetClass;
typedef struct _XmSeparatorGadgetClassRec * XmSeparatorGadgetClass;
typedef struct _XmSeparatorGadgetRec * XmSeparatorGadget;
typedef struct _XmSeparatorGCacheObjRec * XmSeparatorGCacheObject;
/******** Public Function Declarations ********/
Widget XmCreateSeparatorGadget(
Widget parent,
char *name,
ArgList arglist,
Cardinal argcount) ;
Widget XmVaCreateSeparatorGadget(
Widget parent,
char *name,
...);
Widget XmVaCreateManagedSeparatorGadget(
Widget parent,
char *name,
...);
/******** End Public Function Declarations ********/
#ifdef __cplusplus
} /* Close scope of 'extern "C"' declaration which encloses file. */
#endif
#endif /* _XmSeparatorGadget_h */
/* DON'T ADD STUFF AFTER THIS #endif */
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef FORMEDITORGRAPHICSVIEW_H
#define FORMEDITORGRAPHICSVIEW_H
#include <QGraphicsView>
#include <qmlitemnode.h>
namespace QmlDesigner {
class FormEditorGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
explicit FormEditorGraphicsView(QWidget *parent = 0);
void setFeedbackNode(const QmlItemNode &node);
void setRootItemRect(const QRectF &rect);
QRectF rootItemRect() const;
protected:
void drawForeground(QPainter *painter, const QRectF &rect );
void drawBackground(QPainter *painter, const QRectF &rect);
void wheelEvent(QWheelEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void leaveEvent(QEvent *);
void keyPressEvent(QKeyEvent *event);
private:
QmlItemNode m_feedbackNode;
QmlObjectNode m_parentNode;
QVariant m_beginX;
QVariant m_beginY;
QVariant m_beginWidth;
QVariant m_beginHeight;
QVariant m_beginLeftMargin;
QVariant m_beginRightMargin;
QVariant m_beginTopMargin;
QVariant m_beginBottomMargin;
bool m_beginXHasExpression;
bool m_beginYHasExpression;
bool m_beginWidthHasExpression;
bool m_beginHeightHasExpression;
QPoint m_feedbackOriginPoint;
QPixmap m_bubblePixmap;
QRectF m_rootItemRect;
};
} // namespace QmlDesigner
#endif // FORMEDITORGRAPHICSVIEW_H
|
/*
Copyright (c) 1994 - 2010, Lawrence Livermore National Security, LLC.
LLNL-CODE-425250.
All rights reserved.
This file is part of Silo. For details, see silo.llnl.gov.
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 disclaimer below.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the disclaimer (as noted
below) in the documentation and/or other materials provided with
the distribution.
* Neither the name of the LLNS/LLNL 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 LAWRENCE
LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY 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 work was produced at Lawrence Livermore National Laboratory under
Contract No. DE-AC52-07NA27344 with the DOE. Neither the United
States Government nor Lawrence Livermore National Security, LLC nor
any of their employees, makes any warranty, express or implied, or
assumes any liability or responsibility for the accuracy,
completeness, or usefulness of any information, apparatus, product, or
process disclosed, or represents that its use would not infringe
privately-owned rights. Any reference herein to any specific
commercial products, process, or services by trade name, trademark,
manufacturer or otherwise does not necessarily constitute or imply its
endorsement, recommendation, or favoring by the United States
Government or Lawrence Livermore National Security, LLC. The views and
opinions of authors expressed herein do not necessarily state or
reflect those of the United States Government or Lawrence Livermore
National Security, LLC, and shall not be used for advertising or
product endorsement purposes.
*/
typedef enum _ioflags_t
{
IO_WRITE = 0x00000001,
IO_READ = 0x00000002,
IO_APPEND = 0x00000004,
IO_TRUNCATE = 0x00000008
} ioflags_t;
/* if you define members such that a value of 0 serves
as a suitable default, then you don't have to worry
about an special initialization. */
typedef struct _options_t
{
const char *io_interface;
int request_size_in_bytes;
int num_requests;
int initial_file_size;
int seek_noise;
int size_noise;
int test_read;
ioflags_t flags;
int print_details;
int alignment;
int rand_file_name;
int no_mpi;
int mpi_rank;
int mpi_size;
} options_t;
typedef enum _ioop_t
{
OP_WRITE,
OP_READ,
OP_OPEN,
OP_CLOSE,
OP_SEEK,
OP_ERROR,
OP_OUTPUT_TIMINGS,
OP_OUTPUT_SUMMARY
} ioop_t;
typedef int (*OpenFunc)(ioflags_t flags);
typedef int (*WriteFunc)(void *buf, size_t nbytes);
typedef int (*ReadFunc)(void *buf, size_t nbytes);
typedef int (*CloseFunc)(void);
typedef int (*SeekFunc)(size_t offset);
typedef double (*TimeFunc)(void);
typedef struct _iointerface_t
{
TimeFunc Time; /* A default is provided but can be overridden by plugin */
OpenFunc Open;
WriteFunc Write;
ReadFunc Read;
CloseFunc Close;
SeekFunc Seek;
void *dlhandle;
} iointerface_t;
typedef iointerface_t* (*CreateInterfaceFunc)(int argi, int argc, char *argv[], const char *filename, const options_t *opts);
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/os2/statbmp.h
// Purpose: wxStaticBitmap class
// Author: David Webster
// Modified by:
// Created: 11/27/99
// RCS-ID: $Id$
// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STATBMP_H_
#define _WX_STATBMP_H_
#include "wx/control.h"
#include "wx/icon.h"
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
{
public:
inline wxStaticBitmap() { Init(); }
inline wxStaticBitmap( wxWindow* pParent
,wxWindowID nId
,const wxGDIImage& rLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rName = wxStaticBitmapNameStr
)
{
Create(pParent, nId, rLabel, rPos, rSize, lStyle, rName);
}
bool Create( wxWindow* pParent
,wxWindowID nId
,const wxGDIImage& rLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rName = wxStaticBitmapNameStr
);
inline virtual ~wxStaticBitmap() { Free(); }
virtual void SetIcon(const wxIcon& rIcon) { SetImage(rIcon); }
virtual void SetBitmap(const wxBitmap& rBitmap) { SetImage(rBitmap); }
// assert failure is provoked by an attempt to get an icon from bitmap or
// vice versa
wxIcon GetIcon() const
{ wxASSERT( m_bIsIcon ); return *(wxIcon *)m_pImage; }
wxBitmap GetBitmap() const
{ wxASSERT( !m_bIsIcon ); return *(wxBitmap *)m_pImage; }
// overridden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
virtual MRESULT OS2WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
);
void OnPaint(wxPaintEvent& rEvent);
protected:
virtual wxSize DoGetBestSize() const;
void Init() { m_bIsIcon = TRUE; m_pImage = NULL; }
void Free();
// TRUE if icon/bitmap is valid
bool ImageIsOk() const;
void SetImage(const wxGDIImage& rImage);
// we can have either an icon or a bitmap
bool m_bIsIcon;
wxGDIImage* m_pImage;
private:
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
DECLARE_EVENT_TABLE()
}; // end of wxStaticBitmap
#endif
// _WX_STATBMP_H_
|
#include <stdio.h>
#include <string.h>
#include <gst/gst.h>
#include <gst/video/video.h>
static gboolean use_postproc;
static GOptionEntry g_options[] = {
{"postproc", 'p', 0, G_OPTION_ARG_NONE, &use_postproc,
"use vaapipostproc to rotate rather than vaapisink", NULL},
{NULL,}
};
typedef struct _CustomData
{
GstElement *pipeline;
GstElement *rotator;
GMainLoop *loop;
gboolean orient_automatic;
} AppData;
static void
send_rotate_event (AppData * data)
{
gboolean res = FALSE;
GstEvent *event;
static gint counter = 0;
const static gchar *tags[] = { "rotate-90", "rotate-180", "rotate-270",
"rotate-0", "flip-rotate-0", "flip-rotate-90", "flip-rotate-180",
"flip-rotate-270",
};
event = gst_event_new_tag (gst_tag_list_new (GST_TAG_IMAGE_ORIENTATION,
tags[counter++ % G_N_ELEMENTS (tags)], NULL));
/* Send the event */
g_print ("Sending event %" GST_PTR_FORMAT ": ", event);
res = gst_element_send_event (data->pipeline, event);
g_print ("%s\n", res ? "ok" : "failed");
}
static void
keyboard_cb (const gchar * key, AppData * data)
{
switch (g_ascii_tolower (key[0])) {
case 'r':
send_rotate_event (data);
break;
case 's':{
if (use_postproc) {
g_object_set (G_OBJECT (data->rotator), "video-direction",
GST_VIDEO_ORIENTATION_AUTO, NULL);
} else {
/* rotation=360 means auto for vaapisnk */
g_object_set (G_OBJECT (data->rotator), "rotation", 360, NULL);
}
break;
}
case 'q':
g_main_loop_quit (data->loop);
break;
default:
break;
}
}
static gboolean
bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
{
AppData *data = user_data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_ELEMENT:
{
GstNavigationMessageType mtype = gst_navigation_message_get_type (msg);
if (mtype == GST_NAVIGATION_MESSAGE_EVENT) {
GstEvent *ev = NULL;
if (gst_navigation_message_parse_event (msg, &ev)) {
GstNavigationEventType type = gst_navigation_event_get_type (ev);
if (type == GST_NAVIGATION_EVENT_KEY_PRESS) {
const gchar *key;
if (gst_navigation_event_parse_key_event (ev, &key))
keyboard_cb (key, data);
}
}
if (ev)
gst_event_unref (ev);
}
break;
}
default:
break;
}
return TRUE;
}
/* Process keyboard input */
static gboolean
handle_keyboard (GIOChannel * source, GIOCondition cond, AppData * data)
{
gchar *str = NULL;
if (g_io_channel_read_line (source, &str, NULL, NULL,
NULL) != G_IO_STATUS_NORMAL) {
return TRUE;
}
keyboard_cb (str, data);
g_free (str);
return TRUE;
}
int
main (int argc, char *argv[])
{
AppData data;
GstStateChangeReturn ret;
GIOChannel *io_stdin;
GOptionContext *ctx;
GError *err = NULL;
guint srcid;
/* Initialize GStreamer */
ctx = g_option_context_new ("- test options");
if (!ctx)
return -1;
g_option_context_add_group (ctx, gst_init_get_option_group ());
g_option_context_add_main_entries (ctx, g_options, NULL);
if (!g_option_context_parse (ctx, &argc, &argv, NULL))
return -1;
g_option_context_free (ctx);
/* Print usage map */
g_print ("USAGE: Choose one of the following options, then press enter:\n"
" 'r' to send image-orientation tag event\n"
" 's' to set orient-automatic\n" " 'Q' to quit\n");
if (use_postproc) {
data.pipeline =
gst_parse_launch ("videotestsrc ! vaapipostproc name=pp ! xvimagesink",
&err);
} else {
data.pipeline =
gst_parse_launch ("videotestsrc ! vaapisink name=sink", &err);
}
if (err) {
g_printerr ("failed to create pipeline: %s\n", err->message);
g_error_free (err);
return -1;
}
if (use_postproc)
data.rotator = gst_bin_get_by_name (GST_BIN (data.pipeline), "pp");
else
data.rotator = gst_bin_get_by_name (GST_BIN (data.pipeline), "sink");
srcid = gst_bus_add_watch (GST_ELEMENT_BUS (data.pipeline), bus_msg, &data);
/* Add a keyboard watch so we get notified of keystrokes */
io_stdin = g_io_channel_unix_new (fileno (stdin));
g_io_add_watch (io_stdin, G_IO_IN, (GIOFunc) handle_keyboard, &data);
/* Start playing */
ret = gst_element_set_state (data.pipeline, GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE) {
g_printerr ("Unable to set the pipeline to the playing state.\n");
goto bail;
}
/* Create a GLib Main Loop and set it to run */
data.loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (data.loop);
gst_element_set_state (data.pipeline, GST_STATE_NULL);
bail:
/* Free resources */
g_source_remove (srcid);
g_main_loop_unref (data.loop);
g_io_channel_unref (io_stdin);
gst_object_unref (data.rotator);
gst_object_unref (data.pipeline);
return 0;
}
|
/*
* Copyright (C) 2017 Ken Rabold
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup cpu_fe310
* @{
*
* @file
* @brief CPU specific definitions for internal peripheral handling
*
* @author Ken Rabold
*/
#ifndef PERIPH_CPU_H
#define PERIPH_CPU_H
#include <inttypes.h>
#include "cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Power management configuration
* @{
*/
#define PROVIDES_PM_SET_LOWEST
/** @} */
/**
* @brief Length of the CPU_ID in octets
*/
#define CPUID_LEN (12U)
#ifndef DOXYGEN
/**
* @brief Overwrite the default gpio_t type definition
*/
#define HAVE_GPIO_T
typedef uint8_t gpio_t;
#endif
/**
* @brief Definition of a fitting UNDEF value
*/
#define GPIO_UNDEF (0xff)
/**
* @brief Define a CPU specific GPIO pin generator macro
*/
#define GPIO_PIN(x, y) (x | y)
/**
* @brief GPIO interrupt priority
*/
#define GPIO_INTR_PRIORITY (3)
/**
* @brief Structure for UART configuration data
*/
typedef struct {
uint32_t addr; /**< UART control register address */
gpio_t rx; /**< RX pin */
gpio_t tx; /**< TX pin */
plic_source isr_num; /**< ISR source number */
} uart_conf_t;
/**
* @brief UART interrupt priority
*/
#define UART_ISR_PRIO (2)
/**
* @name This CPU makes use of the following shared SPI functions
* @{
*/
#define PERIPH_SPI_NEEDS_TRANSFER_BYTE 1
#define PERIPH_SPI_NEEDS_TRANSFER_REG 1
#define PERIPH_SPI_NEEDS_TRANSFER_REGS 1
/** @} */
/**
* @brief Structure for SPI configuration data
*/
typedef struct {
uint32_t addr; /**< SPI control register address */
gpio_t mosi; /**< MOSI pin */
gpio_t miso; /**< MISO pin */
gpio_t sclk; /**< SCLK pin */
} spi_conf_t;
/**
* @brief Prevent shared timer functions from being used
*/
#define PERIPH_TIMER_PROVIDES_SET
/**
* @name Use the shared I2C functions
* @{
*/
/** Use read reg function from periph common */
#define PERIPH_I2C_NEED_READ_REG
/** Use write reg function from periph common */
#define PERIPH_I2C_NEED_WRITE_REG
/** Use read regs function from periph common */
#define PERIPH_I2C_NEED_READ_REGS
/** Use write regs function from periph common */
#define PERIPH_I2C_NEED_WRITE_REGS
/** @} */
#ifndef DOXYGEN
/**
* @brief Default mapping of I2C bus speed values
* @{
*/
#define HAVE_I2C_SPEED_T
typedef enum {
I2C_SPEED_NORMAL, /**< normal mode: ~100kbit/s */
I2C_SPEED_FAST, /**< fast mode: ~400kbit/s */
} i2c_speed_t;
/** @} */
#endif /* ndef DOXYGEN */
/**
* @brief I2C configuration options
*/
typedef struct {
uint32_t addr; /**< device base address */
gpio_t scl; /**< SCL pin */
gpio_t sda; /**< SDA pin */
i2c_speed_t speed; /**< I2C speed */
} i2c_conf_t;
/**
* @name WDT upper and lower bound times in ms
* @{
*/
#define NWDT_TIME_LOWER_LIMIT (1)
/* Ensure the internal "count" variable stays within the uint32 bounds.
This variable corresponds to max_time * RTC_FREQ / MS_PER_SEC. On fe310,
RTC_FREQ is 32768Hz. The 15 right shift is equivalent to a division by RTC_FREQ.
*/
#define NWDT_TIME_UPPER_LIMIT ((UINT32_MAX >> 15) * MS_PER_SEC + 1)
/** @} */
/**
* @brief WDT interrupt priority: use highest priority
*/
#define WDT_INTR_PRIORITY (PLIC_NUM_PRIORITIES)
/**
* @brief WDT can be stopped
*/
#define WDT_HAS_STOP (1)
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CPU_H */
/** @} */
|
/*
* powerpc/openbsd2/md.h
* OpenBSD PowerPC configuration information.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
#ifndef __powerpc_openbsd2_md_h
#define __powerpc_openbsd2_md_h
#include "powerpc/common.h"
#include "powerpc/threads.h"
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
#if defined(HAVE_SYS_RESOURCE_H)
#include <sys/resource.h>
#endif
#if defined(HAVE_SYS_SIGNAL_H)
#include <sys/signal.h>
#endif
#undef SP_OFFSET
#define SP_OFFSET 1
#define SIGNAL_ARGS(sig, sc) int sig, siginfo_t *__si, struct sigcontext *sc
#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext *scp
#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
#define STACK_POINTER(scp) ((scp)->sc_frame.fixreg[1])
#undef HAVE_SIGALTSTACK
/* align data types to their size */
#define ALIGNMENT_OF_SIZE(S) (S)
#if defined(KAFFE_SYSTEM_UNIX_PTHREADS)
#define KAFFEMD_STACK_ERROR 0
#define KAFFEMD_STACK_INFINITE KAFFEMD_STACK_ERROR
#define KAFFEMD_STACKSIZE
extern size_t mdGetStackSize(void);
/* this is only used for the main thread and is ok for that */
/* this may change with rthreads when thats done */
static inline void mdSetStackSize(rlim_t limit)
{
struct rlimit rl;
getrlimit(RLIMIT_STACK, &rl);
rl.rlim_cur = limit;
setrlimit(RLIMIT_STACK, &rl);
}
#define KAFFEMD_STACKEND
extern void *mdGetStackEnd(void);
#else /* KAFFE_SYSTEM_UNIX_PTHREADS */
#include "kaffe-unix-stack.h"
#endif /* KAFFE_SYSTEM_UNIX_PTHREADS */
#endif
|
#ifndef ELM_SYS_NOTIFY_H
#define ELM_SYS_NOTIFY_H
/**
* The reason the notification was closed
*
* @since 1.8
*/
typedef enum _Elm_Sys_Notify_Closed_Reason
{
ELM_SYS_NOTIFY_CLOSED_EXPIRED, /** The notification expired. */
ELM_SYS_NOTIFY_CLOSED_DISMISSED, /** The notification was dismissed by the user. */
ELM_SYS_NOTIFY_CLOSED_REQUESTED, /** The notification was closed by a call to CloseNotification method. */
ELM_SYS_NOTIFY_CLOSED_UNDEFINED /** Undefined/reserved reasons. */
} Elm_Sys_Notify_Closed_Reason;
/**
* Urgency levels of a notification
*
* @see elm_sys_notify_send()
*
* @since 1.8
*/
typedef enum _Elm_Sys_Notify_Urgency
{
ELM_SYS_NOTIFY_URGENCY_LOW,
ELM_SYS_NOTIFY_URGENCY_NORMAL,
ELM_SYS_NOTIFY_URGENCY_CRITICAL
} Elm_Sys_Notify_Urgency;
typedef void (*Elm_Sys_Notify_Send_Cb)(void *data, unsigned int id);
/**
* Emitted when the signal NotificationClosed is received.
*/
EAPI extern int ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED;
/**
* Emitted when the signal ActionInvoked is received.
*/
EAPI extern int ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED; /**< A Action has been invoked. */
/**
* Data on event when Notification Closed is emitted.
*
* @since 1.8
*/
typedef struct _Elm_Sys_Notify_Notification_Closed
{
unsigned int id; /**< ID of the notification. */
Elm_Sys_Notify_Closed_Reason reason; /**< The Reason the notification was closed. */
} Elm_Sys_Notify_Notification_Closed;
/**
* Data on event when Action Invoked is emitted.
*
* @since 1.8
*/
typedef struct _Elm_Sys_Notify_Action_Invoked
{
unsigned int id; /**< ID of the notification. */
char *action_key; /**< The key of the action invoked. These match the keys sent over in the list of actions. */
} Elm_Sys_Notify_Action_Invoked;
/**
* @def elm_sys_notify_simple_send
*
* Create a new notification just with Icon, Body and Summary.
*
* @param[in] icon
* @param[in] summary
* @param[in] body
*
* @see elm_sys_notify_send()
*
* @since 1.8
*/
#define elm_sys_notify_simple_send(icon, summary, body) \
elm_sys_notify_send(0, icon, summary, body, \
ELM_SYS_NOTIFY_URGENCY_NORMAL, \
-1, NULL, NULL)
/**
* Causes a notification to be forcefully closed and removed from the user's
* view. It can be used, for example, in the event that what the notification
* pertains to is no longer relevant, or to cancel a notification * with no
* expiration time.
*
* @param id Notification id
*
* @note If the notification no longer exists,
* an empty D-BUS Error message is sent back.
*
* @since 1.8
*/
EAPI void elm_sys_notify_close(unsigned int id);
/**
* Sends a notification to the notification server.
*
* @param replaces_id Notification ID that this notification replaces.
* The value 0 means a new notification.
* @param icon The optional program icon of the calling application.
* @param summary The summary text briefly describing the notification.
* @param body The optional detailed body text. Can be empty.
* @param urgency The urgency level.
* @param timeout Timeout display in milliseconds.
* @param cb Callback used to retrieve the notification id
* return by the Notification Server.
* @param cb_data Optional context data
*
* @since 1.8
*/
EAPI void elm_sys_notify_send(unsigned int replaces_id,
const char *icon,
const char *summary,
const char *body,
Elm_Sys_Notify_Urgency urgency,
int timeout,
Elm_Sys_Notify_Send_Cb cb,
const void *cb_data);
#endif
|
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef JSCSSPageRule_h
#define JSCSSPageRule_h
#include "JSCSSRule.h"
namespace WebCore {
class CSSPageRule;
class JSCSSPageRule : public JSCSSRule {
typedef JSCSSRule Base;
public:
JSCSSPageRule(PassRefPtr<JSC::Structure>, PassRefPtr<CSSPageRule>);
static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValuePtr, JSC::PutPropertySlot&);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValuePtr prototype)
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType));
}
static JSC::JSValuePtr getConstructor(JSC::ExecState*);
};
class JSCSSPageRulePrototype : public JSC::JSObject {
public:
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
JSCSSPageRulePrototype(PassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
};
// Attributes
JSC::JSValuePtr jsCSSPageRuleSelectorText(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
void setJSCSSPageRuleSelectorText(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
JSC::JSValuePtr jsCSSPageRuleStyle(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
JSC::JSValuePtr jsCSSPageRuleConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
} // namespace WebCore
#endif
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_riscosvideo.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
int w;
int h;
int hot_x;
int hot_y;
Uint8 *data;
};
/* Functions to be exported */
void RISCOS_FreeWMCursor(_THIS, WMcursor * cursor);
WMcursor *RISCOS_CreateWMCursor(_THIS, Uint8 * data, Uint8 * mask, int w,
int h, int hot_x, int hot_y);
int RISCOS_ShowWMCursor(_THIS, WMcursor * cursor);
void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
int WIMP_ShowWMCursor(_THIS, WMcursor * cursor);
void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
/* vi: set ts=4 sw=4 expandtab: */
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/cocoa/dcclient.h
// Purpose: wxClientDCImpl, wxPaintDCImpl and wxWindowDCImpl classes
// Author: David Elliott
// Modified by:
// Created: 2003/04/01
// Copyright: (c) 2003 David Elliott
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_COCOA_DCCLIENT_H__
#define __WX_COCOA_DCCLIENT_H__
#include "wx/cocoa/dc.h"
// DFE: A while ago I stumbled upon the fact that retrieving the parent
// NSView of the content view seems to return the entire window rectangle
// (including decorations). Of course, that is not at all part of the
// Cocoa or OpenStep APIs, but it might be a neat hack.
class WXDLLIMPEXP_CORE wxWindowDCImpl: public wxCocoaDCImpl
{
DECLARE_DYNAMIC_CLASS(wxWindowDCImpl)
public:
wxWindowDCImpl(wxDC *owner);
// Create a DC corresponding to a window
wxWindowDCImpl(wxDC *owner, wxWindow *win);
virtual ~wxWindowDCImpl(void);
protected:
wxWindow *m_window;
WX_NSView m_lockedNSView;
// DC stack
virtual bool CocoaLockFocus();
virtual bool CocoaUnlockFocus();
bool CocoaLockFocusOnNSView(WX_NSView nsview);
bool CocoaUnlockFocusOnNSView();
virtual bool CocoaGetBounds(void *rectData);
};
class WXDLLIMPEXP_CORE wxClientDCImpl: public wxWindowDCImpl
{
DECLARE_DYNAMIC_CLASS(wxClientDCImpl)
public:
wxClientDCImpl(wxDC *owner);
// Create a DC corresponding to a window
wxClientDCImpl(wxDC *owner, wxWindow *win);
virtual ~wxClientDCImpl(void);
protected:
// DC stack
virtual bool CocoaLockFocus();
virtual bool CocoaUnlockFocus();
};
class WXDLLIMPEXP_CORE wxPaintDCImpl: public wxWindowDCImpl
{
DECLARE_DYNAMIC_CLASS(wxPaintDCImpl)
public:
wxPaintDCImpl(wxDC *owner);
// Create a DC corresponding to a window
wxPaintDCImpl(wxDC *owner, wxWindow *win);
virtual ~wxPaintDCImpl(void);
protected:
// DC stack
virtual bool CocoaLockFocus();
virtual bool CocoaUnlockFocus();
};
#endif
// __WX_COCOA_DCCLIENT_H__
|
#ifndef R2_BP_H
#define R2_BP_H
#include <r_types.h>
#include <r_lib.h>
#include <r_io.h>
#include <r_list.h>
#ifdef __cplusplus
extern "C" {
#endif
R_LIB_VERSION_HEADER(r_bp);
#define R_BP_MAXPIDS 10
#define R_BP_CONT_NORMAL 0
#define R_BP_CONT_NORMAL 0
typedef struct r_bp_arch_t {
int bits;
int length;
int endian;
const ut8 *bytes;
} RBreakpointArch;
enum {
R_BP_TYPE_SW,
R_BP_TYPE_HW,
R_BP_TYPE_COND,
R_BP_TYPE_FAULT,
R_BP_TYPE_DELETE,
};
typedef struct r_bp_plugin_t {
char *name;
char *arch;
int type; // R_BP_TYPE_SW
int nbps;
RBreakpointArch *bps;
} RBreakpointPlugin;
typedef struct r_bp_item_t {
char *name;
char *module_name; /*module where you get the base address*/
st64 module_delta; /*delta to apply to module */
ut64 addr;
int size; /* size of breakpoint area */
int recoil; /* recoil */
bool swstep; /* is this breakpoint from a swstep? */
int rwx;
int hw;
int trace;
int internal; /* used for internal purposes */
int enabled;
int hits;
ut8 *obytes; /* original bytes */
ut8 *bbytes; /* breakpoint bytes */
int pids[R_BP_MAXPIDS];
char *data;
} RBreakpointItem;
typedef int (*RBreakpointCallback)(RBreakpointItem *bp, int set, void *user);
typedef struct r_bp_t {
void *user;
int stepcont;
int endian;
int bits;
RIOBind iob; // compile time dependency
RBreakpointPlugin *cur;
RList *traces; // XXX
RList *plugins;
PrintfCallback cb_printf;
RBreakpointCallback breakpoint;
/* storage of breakpoints */
int nbps;
RList *bps; // list of breakpoints
RBreakpointItem **bps_idx;
int bps_idx_count;
st64 delta;
} RBreakpoint;
enum {
R_BP_PROT_READ = 1,
R_BP_PROT_WRITE = 2,
R_BP_PROT_EXEC = 4,
};
typedef struct r_bp_trace_t {
ut64 addr;
ut64 addr_end;
ut8 *traps;
ut8 *buffer;
ut8 *bits;
int length;
int bitlen;
} RBreakpointTrace;
#ifdef R_API
R_API RBreakpoint *r_bp_new(void);
R_API RBreakpoint *r_bp_free(RBreakpoint *bp);
R_API int r_bp_del(RBreakpoint *bp, ut64 addr);
R_API int r_bp_del_all(RBreakpoint *bp);
R_API int r_bp_plugin_add(RBreakpoint *bp, RBreakpointPlugin *foo);
R_API int r_bp_use(RBreakpoint *bp, const char *name, int bits);
R_API int r_bp_plugin_del(RBreakpoint *bp, const char *name);
R_API void r_bp_plugin_list(RBreakpoint *bp);
R_API int r_bp_in(RBreakpoint *bp, ut64 addr, int rwx);
// deprecate?
R_API int r_bp_list(RBreakpoint *bp, int rad);
/* bp item attribs setters */
R_API int r_bp_get_bytes(RBreakpoint *bp, ut8 *buf, int len, int endian, int idx);
R_API int r_bp_set_trace(RBreakpoint *bp, ut64 addr, int set);
R_API int r_bp_set_trace_all(RBreakpoint *bp, int set);
R_API RBreakpointItem *r_bp_enable(RBreakpoint *bp, ut64 addr, int set);
R_API int r_bp_enable_all(RBreakpoint *bp, int set);
/* index api */
R_API int r_bp_del_index(RBreakpoint *bp, int idx);
R_API RBreakpointItem *r_bp_get_index(RBreakpoint *bp, int idx);
R_API RBreakpointItem *r_bp_item_new (RBreakpoint *bp);
R_API RBreakpointItem *r_bp_get_at (RBreakpoint *bp, ut64 addr);
R_API RBreakpointItem *r_bp_get_in (RBreakpoint *bp, ut64 addr, int rwx);
R_API int r_bp_add_cond(RBreakpoint *bp, const char *cond);
R_API int r_bp_del_cond(RBreakpoint *bp, int idx);
R_API int r_bp_add_fault(RBreakpoint *bp, ut64 addr, int size, int rwx);
R_API RBreakpointItem *r_bp_add_sw(RBreakpoint *bp, ut64 addr, int size, int rwx);
R_API RBreakpointItem *r_bp_add_hw(RBreakpoint *bp, ut64 addr, int size, int rwx);
R_API void r_bp_restore_one(RBreakpoint *bp, RBreakpointItem *b, bool set);
R_API int r_bp_restore(RBreakpoint *bp, bool set);
R_API bool r_bp_restore_except(RBreakpoint *bp, bool set, ut64 addr);
/* traptrace */
R_API void r_bp_traptrace_free(void *ptr);
R_API void r_bp_traptrace_enable(RBreakpoint *bp, int enable);
R_API void r_bp_traptrace_reset(RBreakpoint *bp, int hard);
R_API ut64 r_bp_traptrace_next(RBreakpoint *bp, ut64 addr);
R_API int r_bp_traptrace_add(RBreakpoint *bp, ut64 from, ut64 to);
R_API int r_bp_traptrace_free_at(RBreakpoint *bp, ut64 from);
R_API void r_bp_traptrace_list(RBreakpoint *bp);
R_API int r_bp_traptrace_at(RBreakpoint *bp, ut64 from, int len);
R_API RList *r_bp_traptrace_new(void);
R_API void r_bp_traptrace_enable(RBreakpoint *bp, int enable);
/* plugin pointers */
extern RBreakpointPlugin r_bp_plugin_x86;
extern RBreakpointPlugin r_bp_plugin_arm;
extern RBreakpointPlugin r_bp_plugin_mips;
extern RBreakpointPlugin r_bp_plugin_ppc;
extern RBreakpointPlugin r_bp_plugin_sh;
extern RBreakpointPlugin r_bp_plugin_bf;
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/*
Copyright (C) 2018-2019 SUSE LLC
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) version 3.0 of the License. This library
is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details. You should have received a copy of the GNU
Lesser General Public License along with this library; if not, write
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor, Boston, MA 02110-1301 USA
*/
/*-/
File: NCHttpWidgetFactory.h
Purpose: Introducing rest-api related changes to ncurses libyui library
We need to override NCDialog dialog methods to handle rest api
events, so have to override creation of those too.
/-*/
#ifndef NCHttpWidgetFactory_h
#define NCHttpWidgetFactory_h
#include <yui/ncurses/NCWidgetFactory.h>
/**
* Concrete widget factory for mandatory widgets.
**/
class NCHttpWidgetFactory: public NCWidgetFactory
{
public:
// Need to override just single method to use NCHttpDialog instead of
// just NCDialog.
//
// Dialogs
//
virtual NCDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
};
#endif //NCHttpWidgetFactory_h
|
/**
* @file websocket.h
* @brief Defines the WebSocket class.
*
* \note Currently, only V13 (RFC6455) is supported.
* \note Both text and binary websockets are supported.
* \note The secure version (wss) is currently not implemented.
* @author Kurt Pattyn (pattyn.kurt@gmail.com)
*/
#ifndef WEBSOCKET_H
#define WEBSOCKET_H
#include <QUrl>
#include <QAbstractSocket>
#include <QHostAddress>
#include "websocketprotocol.h"
#include "dataprocessor.h"
#include <QNetworkProxy>
#include <QTime>
class HandshakeRequest;
class HandshakeResponse;
class QTcpSocket;
class WebSocket:public QObject
{
Q_OBJECT
public:
explicit WebSocket(QString origin = QString(), WebSocketProtocol::Version version = WebSocketProtocol::V_LATEST, QObject *parent = 0);
virtual ~WebSocket();
void abort();
QAbstractSocket::SocketError error() const;
QString errorString() const;
bool flush();
bool isValid();
QHostAddress localAddress() const;
quint16 localPort() const;
QHostAddress peerAddress() const;
QString peerName() const;
quint16 peerPort() const;
QNetworkProxy proxy() const;
qint64 readBufferSize() const;
void setProxy(const QNetworkProxy &networkProxy);
void setReadBufferSize(qint64 size);
void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
QVariant socketOption(QAbstractSocket::SocketOption option);
QAbstractSocket::SocketState state() const;
bool waitForConnected(int msecs = 30000);
bool waitForDisconnected(int msecs = 30000);
WebSocketProtocol::Version getVersion();
QString getResourceName();
QUrl getRequestUrl();
QString getOrigin();
QString getProtocol();
QString getExtension();
qint64 send(const char *message);
qint64 send(const QString &message); //send data as text
qint64 send(const QByteArray &data); //send data as binary
public Q_SLOTS:
virtual void close(WebSocketProtocol::CloseCode closeCode = WebSocketProtocol::CC_NORMAL, QString reason = QString());
virtual void open(const QUrl &url, bool mask = true);
void ping();
Q_SIGNALS:
void aboutToClose();
void connected();
void disconnected();
void stateChanged(QAbstractSocket::SocketState state);
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *pAuthenticator);
void readChannelFinished();
void textFrameReceived(QString frame, bool isLastFrame);
void binaryFrameReceived(QByteArray frame, bool isLastFrame);
void textMessageReceived(QString message);
void binaryMessageReceived(QByteArray message);
void error(QAbstractSocket::SocketError error);
void pong(quint64 elapsedTime);
private Q_SLOTS:
void processData();
void processControlFrame(WebSocketProtocol::OpCode opCode, QByteArray frame);
void processHandshake(QTcpSocket *pSocket);
void processStateChanged(QAbstractSocket::SocketState socketState);
private:
Q_DISABLE_COPY(WebSocket)
WebSocket(QTcpSocket *pTcpSocket, WebSocketProtocol::Version version, QObject *parent = 0);
void setVersion(WebSocketProtocol::Version version);
void setResourceName(QString resourceName);
void setRequestUrl(QUrl requestUrl);
void setOrigin(QString origin);
void setProtocol(QString protocol);
void setExtension(QString extension);
void enableMasking(bool enable);
void setSocketState(QAbstractSocket::SocketState state);
void setErrorString(QString errorString);
qint64 doWriteData(const QByteArray &data, bool isBinary);
qint64 doWriteFrames(const QByteArray &data, bool isBinary);
void makeConnections(const QTcpSocket *pTcpSocket);
void releaseConnections(const QTcpSocket *pTcpSocket);
QByteArray getFrameHeader(WebSocketProtocol::OpCode opCode, quint64 payloadLength, quint32 maskingKey, bool lastFrame) const;
QString calculateAcceptKey(const QString &key) const;
QString createHandShakeRequest(QString resourceName,
QString host,
QString origin,
QString extensions,
QString protocols,
QByteArray key);
quint32 generateMaskingKey() const;
QByteArray generateKey() const;
quint32 generateRandomNumber() const;
qint64 writeFrames(const QList<QByteArray> &frames);
qint64 writeFrame(const QByteArray &frame);
static WebSocket *upgradeFrom(QTcpSocket *tcpSocket,
const HandshakeRequest &request,
const HandshakeResponse &response,
QObject *parent = 0);
friend class WebSocketServer;
QTcpSocket *m_pSocket;
QString m_errorString;
WebSocketProtocol::Version m_version;
QUrl m_resource;
QString m_resourceName;
QUrl m_requestUrl;
QString m_origin;
QString m_protocol;
QString m_extension;
QAbstractSocket::SocketState m_socketState;
QByteArray m_key; //identification key used in handshake requests
bool m_mustMask; //a server must not mask the frames it sends
bool m_isClosingHandshakeSent;
bool m_isClosingHandshakeReceived;
QTime m_pingTimer;
DataProcessor m_dataProcessor;
};
#endif // WEBSOCKET_H
|
/**
* \file components/gpp/phy/FileRawWriter/FileRawWriterComponent.h
* \version 1.0
*
* \section COPYRIGHT
*
* Copyright 2012-2013 The Iris Project Developers. See the
* COPYRIGHT file at the top-level directory of this distribution
* and at http://www.softwareradiosystems.com/iris/copyright.html.
*
* \section LICENSE
*
* This file is part of the Iris Project.
*
* Iris is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Iris 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.
*
* A copy of the GNU Lesser General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
* \section DESCRIPTION
*
* Sink component to write data to file.
*/
#ifndef PHY_FILERAWWRITERCOMPONENT_H_
#define PHY_FILERAWWRITERCOMPONENT_H_
#include <fstream>
#include "irisapi/PhyComponent.h"
namespace iris
{
namespace phy
{
/** A PhyComponent to write data to a named file.
*
* The name of the file to write and the endianness of the data can
* be specified using parameters.
*/
class FileRawWriterComponent: public PhyComponent
{
public:
FileRawWriterComponent(std::string name);
~FileRawWriterComponent();
virtual void calculateOutputTypes(
std::map<std::string, int>& inputTypes,
std::map<std::string, int>& outputTypes);
virtual void registerPorts();
virtual void initialize();
virtual void process();
private:
/// template function to write data
template<typename T> void writeBlock();
std::string fileName_x; ///< Name of file to write to
std::string endian_x; ///< Endianness of data
std::ofstream hOutFile_; ///< The output file stream
};
} // namespace phy
} // namespace iris
#endif // PHY_FILERAWWRITERCOMPONENT_H_
|
// Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers
//
// This file is part of Bytecoin.
//
// Bytecoin is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Bytecoin 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 Bytecoin. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "ILogger.h"
#include "LoggerMessage.h"
namespace Logging {
class LoggerRef {
public:
LoggerRef(ILogger& logger, const std::string& category);
LoggerMessage operator()(Level level = INFO, const std::string& color = DEFAULT) const;
ILogger& getLogger() const;
private:
ILogger* logger;
std::string category;
};
}
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/colordlg.h
// Purpose: wxColourDialog
// Author: Vaclav Slavik
// Modified by:
// Created: 2004/06/04
// Copyright: (c) Vaclav Slavik, 2004
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_COLORDLG_H_
#define _WX_GTK_COLORDLG_H_
#include "wx/dialog.h"
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
{
public:
wxColourDialog() {}
wxColourDialog(wxWindow *parent,
wxColourData *data = NULL);
virtual ~wxColourDialog() {}
bool Create(wxWindow *parent, wxColourData *data = NULL);
wxColourData &GetColourData() { return m_data; }
virtual int ShowModal();
protected:
// implement some base class methods to do nothing to avoid asserts and
// GTK warnings, since this is not a real wxDialog.
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
virtual void DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height)) {}
// copy data between the dialog and m_colourData:
void ColourDataToDialog();
void DialogToColourData();
wxColourData m_data;
DECLARE_DYNAMIC_CLASS(wxColourDialog)
};
#endif
|
/* Test file for mpfr_log10.
Copyright 2001-2016 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
The GNU MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "mpfr-test.h"
#ifdef CHECK_EXTERNAL
static int
test_log10 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
{
int res;
int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53;
if (ok)
{
mpfr_print_raw (b);
}
res = mpfr_log10 (a, b, rnd_mode);
if (ok)
{
printf (" ");
mpfr_print_raw (a);
printf ("\n");
}
return res;
}
#else
#define test_log10 mpfr_log10
#endif
#define TEST_FUNCTION test_log10
#define TEST_RANDOM_POS 8
#include "tgeneric.c"
int
main (int argc, char *argv[])
{
mpfr_t x, y;
unsigned int n;
int inex;
tests_start_mpfr ();
test_generic (2, 100, 20);
mpfr_init2 (x, 53);
mpfr_init2 (y, 53);
/* check NaN */
mpfr_set_nan (x);
inex = test_log10 (y, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_nan_p (y) && inex == 0);
/* check Inf */
mpfr_set_inf (x, -1);
inex = test_log10 (y, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_nan_p (y) && inex == 0);
mpfr_set_inf (x, 1);
inex = test_log10 (y, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_inf_p (y) && mpfr_sgn (y) > 0 && inex == 0);
mpfr_set_ui (x, 0, MPFR_RNDN);
inex = test_log10 (x, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_inf_p (x) && mpfr_sgn (x) < 0 && inex == 0);
mpfr_set_ui (x, 0, MPFR_RNDN);
mpfr_neg (x, x, MPFR_RNDN);
inex = test_log10 (x, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_inf_p (x) && mpfr_sgn (x) < 0 && inex == 0);
/* check negative argument */
mpfr_set_si (x, -1, MPFR_RNDN);
inex = test_log10 (y, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_nan_p (y) && inex == 0);
/* check log10(1) = 0 */
mpfr_set_ui (x, 1, MPFR_RNDN);
inex = test_log10 (y, x, MPFR_RNDN);
MPFR_ASSERTN (mpfr_cmp_ui (y, 0) == 0 && MPFR_IS_POS (y) && inex == 0);
/* check log10(10^n)=n */
mpfr_set_ui (x, 1, MPFR_RNDN);
for (n = 1; n <= 15; n++)
{
mpfr_mul_ui (x, x, 10, MPFR_RNDN); /* x = 10^n */
inex = test_log10 (y, x, MPFR_RNDN);
if (mpfr_cmp_ui (y, n))
{
printf ("log10(10^n) <> n for n=%u\n", n);
exit (1);
}
MPFR_ASSERTN (inex == 0);
}
mpfr_clear (x);
mpfr_clear (y);
data_check ("data/log10", mpfr_log10, "mpfr_log10");
tests_end_mpfr ();
return 0;
}
|
/*
* Copyright (C) 2017 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 CORE_STATIC_ARRAY_H
#define CORE_STATIC_ARRAY_H
#include "assert.h"
namespace core {
// StaticArray represents a fixed size array with implicit conversions to and
// from T[N].
template <typename T, int N>
class StaticArray {
typedef T ARRAY_TY[N];
public:
inline StaticArray();
inline StaticArray(const StaticArray<T, N>& other);
inline StaticArray(T arr[N]);
inline StaticArray(std::initializer_list<T> l);
inline operator T*();
inline operator const T*() const;
private:
T mData[N];
};
template <typename T, int N>
inline StaticArray<T, N>::StaticArray() : mData{} {}
template <typename T, int N>
inline StaticArray<T, N>::StaticArray(const StaticArray<T, N>& other) {
for (int i = 0; i < N; i++) {
mData[i] = other[i];
}
}
template <typename T, int N>
inline StaticArray<T, N>::StaticArray(T arr[N]) : mData{} {
for (int i = 0; i < N; i++) {
mData[i] = arr[i];
}
}
template <typename T, int N>
inline StaticArray<T, N>::StaticArray(std::initializer_list<T> l) : mData{} {
GAPID_ASSERT(l.size() == N);
for (int i = 0; i < N; i++) {
mData[i] = l.begin()[i];
}
}
template <typename T, int N>
inline StaticArray<T, N>::operator T*() {
return &mData[0];
}
template <typename T, int N>
inline StaticArray<T, N>::operator const T*() const {
return &mData[0];
}
} // namespace core
#endif // CORE_STATIC_ARRAY_H
|
#ifndef COS_ORDERED_H
#define COS_ORDERED_H
/**
* C Object System
* COS Ordered
*
* Copyright 2006+ Laurent Deniau <laurent.deniau@gmail.com>
*
* 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 <cos/Predicate.h>
defclass(Ordered, Predicate) endclass
defclass(Equal , Ordered ) FINAL_CLASS endclass
defclass(Lesser , Ordered ) FINAL_CLASS endclass
defclass(Greater, Ordered ) FINAL_CLASS endclass
#endif // COS_ORDERED_H
|
/* microbit.c - BBC micro:bit specific hooks */
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <gpio.h>
#include <board.h>
#include <display/mb_display.h>
#include <bluetooth/mesh.h>
#include "board.h"
static u32_t oob_number;
static struct device *gpio;
static void button_pressed(struct device *dev, struct gpio_callback *cb,
uint32_t pins)
{
struct mb_display *disp = mb_display_get();
mb_display_print(disp, MB_DISPLAY_MODE_DEFAULT, K_MSEC(500),
"OOB Number: %u", oob_number);
}
static void configure_button(void)
{
static struct gpio_callback button_cb;
gpio = device_get_binding(SW0_GPIO_NAME);
gpio_pin_configure(gpio, SW0_GPIO_PIN,
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_LOW));
gpio_init_callback(&button_cb, button_pressed, BIT(SW0_GPIO_PIN));
gpio_add_callback(gpio, &button_cb);
}
void board_output_number(bt_mesh_output_action action, uint32_t number)
{
struct mb_display *disp = mb_display_get();
struct mb_image arrow = MB_IMAGE({ 0, 0, 1, 0, 0 },
{ 0, 1, 0, 0, 0 },
{ 1, 1, 1, 1, 1 },
{ 0, 1, 0, 0, 0 },
{ 0, 0, 1, 0, 0 });
oob_number = number;
gpio_pin_enable_callback(gpio, SW0_GPIO_PIN);
mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT, K_FOREVER, &arrow, 1);
}
void board_prov_complete(void)
{
struct mb_display *disp = mb_display_get();
struct mb_image arrow = MB_IMAGE({ 0, 1, 0, 1, 0 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 0 },
{ 1, 0, 0, 0, 1 },
{ 0, 1, 1, 1, 0 });
gpio_pin_disable_callback(gpio, SW0_GPIO_PIN);
mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT, K_SECONDS(10),
&arrow, 1);
}
void board_init(void)
{
struct mb_display *disp = mb_display_get();
static struct mb_image blink[] = {
MB_IMAGE({ 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1 }),
MB_IMAGE({ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 })
};
mb_display_image(disp, MB_DISPLAY_MODE_DEFAULT | MB_DISPLAY_FLAG_LOOP,
K_SECONDS(1), blink, ARRAY_SIZE(blink));
configure_button();
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/license-manager/LicenseManager_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/license-manager/model/LicenseConfiguration.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace LicenseManager
{
namespace Model
{
class AWS_LICENSEMANAGER_API ListLicenseConfigurationsResult
{
public:
ListLicenseConfigurationsResult();
ListLicenseConfigurationsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListLicenseConfigurationsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Information about the license configurations.</p>
*/
inline const Aws::Vector<LicenseConfiguration>& GetLicenseConfigurations() const{ return m_licenseConfigurations; }
/**
* <p>Information about the license configurations.</p>
*/
inline void SetLicenseConfigurations(const Aws::Vector<LicenseConfiguration>& value) { m_licenseConfigurations = value; }
/**
* <p>Information about the license configurations.</p>
*/
inline void SetLicenseConfigurations(Aws::Vector<LicenseConfiguration>&& value) { m_licenseConfigurations = std::move(value); }
/**
* <p>Information about the license configurations.</p>
*/
inline ListLicenseConfigurationsResult& WithLicenseConfigurations(const Aws::Vector<LicenseConfiguration>& value) { SetLicenseConfigurations(value); return *this;}
/**
* <p>Information about the license configurations.</p>
*/
inline ListLicenseConfigurationsResult& WithLicenseConfigurations(Aws::Vector<LicenseConfiguration>&& value) { SetLicenseConfigurations(std::move(value)); return *this;}
/**
* <p>Information about the license configurations.</p>
*/
inline ListLicenseConfigurationsResult& AddLicenseConfigurations(const LicenseConfiguration& value) { m_licenseConfigurations.push_back(value); return *this; }
/**
* <p>Information about the license configurations.</p>
*/
inline ListLicenseConfigurationsResult& AddLicenseConfigurations(LicenseConfiguration&& value) { m_licenseConfigurations.push_back(std::move(value)); return *this; }
/**
* <p>Token for the next set of results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>Token for the next set of results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>Token for the next set of results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>Token for the next set of results.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>Token for the next set of results.</p>
*/
inline ListLicenseConfigurationsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>Token for the next set of results.</p>
*/
inline ListLicenseConfigurationsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>Token for the next set of results.</p>
*/
inline ListLicenseConfigurationsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<LicenseConfiguration> m_licenseConfigurations;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace LicenseManager
} // namespace Aws
|
/*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifdef HEADLESS
#error This file should not be included in headless library
#endif
#include "awt_p.h"
#include "awt_Component.h"
#include "sun_awt_motif_MComponentPeer.h"
#include "jni.h"
#include "jni_util.h"
static jfieldID xID;
static jfieldID yID;
extern struct MComponentPeerIDs mComponentPeerIDs;
extern struct ComponentIDs componentIDs;
extern struct ContainerIDs containerIDs;
extern jobject getCurComponent();
/*
* Class: sun_awt_motif_MGlobalCursorManager
* Method: cacheInit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_awt_motif_MGlobalCursorManager_cacheInit
(JNIEnv *env, jclass cls)
{
jclass clsDimension = (*env)->FindClass(env, "java/awt/Point");
xID = (*env)->GetFieldID(env, clsDimension, "x", "I");
yID = (*env)->GetFieldID(env, clsDimension, "y", "I");
}
/*
* Class: sun_awt_motif_MGlobalCursorManager
* Method: getCursorPos
* Signature: (Ljava/awt/Point;)Ljava/awt/Component
*/
JNIEXPORT void JNICALL Java_sun_awt_motif_MGlobalCursorManager_getCursorPos
(JNIEnv *env, jobject this, jobject point)
{
Window root, rw, cw;
int32_t rx, ry, x, y;
uint32_t kbs;
AWT_LOCK();
root = RootWindow(awt_display, DefaultScreen(awt_display));
XQueryPointer(awt_display, root, &rw, &cw, &rx, &ry, &x, &y, &kbs);
(*env)->SetIntField(env, point, xID, rx);
(*env)->SetIntField(env, point, yID, ry);
AWT_FLUSH_UNLOCK();
}
/*
* Class: sun_awt_motif_MGlobalCursorManager
* Method: getCursorPos
* Signature: ()Ljava/awt/Component
*/
JNIEXPORT jobject JNICALL Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor
(JNIEnv *env, jobject this)
{
jobject target;
AWT_LOCK();
target = getCurComponent();
AWT_FLUSH_UNLOCK();
return target;
}
/*
* Class: sun_awt_motif_MGlobalCursorManager
* Method: getLocationOnScreen
* Signature: (Ljava/awt/Component;)Ljava/awt/Point
*/
JNIEXPORT jobject JNICALL Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen
(JNIEnv *env, jobject this, jobject component)
{
jobject point =
(*env)->CallObjectMethod(env, component,
componentIDs.getLocationOnScreen);
return point;
}
/*
* Class: sun_awt_motif_MGlobalCursorManager
* Method: findComponentAt
* Signature: (Ljava/awt/Container;II)Ljava/awt/Component
*/
JNIEXPORT jobject JNICALL
Java_sun_awt_motif_MGlobalCursorManager_findComponentAt
(JNIEnv *env, jobject this, jobject container, jint x, jint y)
{
/*
* Call private version of Container.findComponentAt with the following
* flag set: ignoreEnabled = false (i.e., don't return or recurse into
* disabled Components).
* NOTE: it may return a JRootPane's glass pane as the target Component.
*/
jobject component =
(*env)->CallObjectMethod(env, container, containerIDs.findComponentAt,
x, y, JNI_FALSE);
return component;
}
|
/* mbed Microcontroller Library
* Copyright (c) 2006-2020 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* 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 __BLE_ENVIRONMENTAL_SERVICE_H__
#define __BLE_ENVIRONMENTAL_SERVICE_H__
#include "ble/BLE.h"
#include "ble/Gap.h"
#include "ble/GattServer.h"
#if BLE_FEATURE_GATT_SERVER
/**
* @class EnvironmentalService
* @brief BLE Environmental Service. This service provides temperature, humidity and pressure measurement.
* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.environmental_sensing.xml
* Temperature: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature.xml
* Humidity: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.humidity.xml
* Pressure: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.pressure.xml
*/
class EnvironmentalService {
public:
typedef int16_t TemperatureType_t;
typedef uint16_t HumidityType_t;
typedef uint32_t PressureType_t;
/**
* @brief EnvironmentalService constructor.
* @param _ble Reference to BLE device.
*/
EnvironmentalService(BLE& _ble) :
ble(_ble),
temperatureCharacteristic(GattCharacteristic::UUID_TEMPERATURE_CHAR, &temperature),
humidityCharacteristic(GattCharacteristic::UUID_HUMIDITY_CHAR, &humidity),
pressureCharacteristic(GattCharacteristic::UUID_PRESSURE_CHAR, &pressure)
{
static bool serviceAdded = false; /* We should only ever need to add the information service once. */
if (serviceAdded) {
return;
}
GattCharacteristic *charTable[] = { &humidityCharacteristic,
&pressureCharacteristic,
&temperatureCharacteristic };
GattService environmentalService(GattService::UUID_ENVIRONMENTAL_SERVICE, charTable, sizeof(charTable) / sizeof(charTable[0]));
ble.gattServer().addService(environmentalService);
serviceAdded = true;
}
/**
* @brief Update humidity characteristic.
* @param newHumidityVal New humidity measurement.
*/
void updateHumidity(HumidityType_t newHumidityVal)
{
humidity = (HumidityType_t) (newHumidityVal * 100);
ble.gattServer().write(humidityCharacteristic.getValueHandle(), (uint8_t *) &humidity, sizeof(HumidityType_t));
}
/**
* @brief Update pressure characteristic.
* @param newPressureVal New pressure measurement.
*/
void updatePressure(PressureType_t newPressureVal)
{
pressure = (PressureType_t) (newPressureVal * 10);
ble.gattServer().write(pressureCharacteristic.getValueHandle(), (uint8_t *) &pressure, sizeof(PressureType_t));
}
/**
* @brief Update temperature characteristic.
* @param newTemperatureVal New temperature measurement.
*/
void updateTemperature(float newTemperatureVal)
{
temperature = (TemperatureType_t) (newTemperatureVal * 100);
ble.gattServer().write(temperatureCharacteristic.getValueHandle(), (uint8_t *) &temperature, sizeof(TemperatureType_t));
}
private:
BLE& ble;
TemperatureType_t temperature{};
HumidityType_t humidity{};
PressureType_t pressure{};
ReadOnlyGattCharacteristic<TemperatureType_t> temperatureCharacteristic;
ReadOnlyGattCharacteristic<HumidityType_t> humidityCharacteristic;
ReadOnlyGattCharacteristic<PressureType_t> pressureCharacteristic;
};
#endif // BLE_FEATURE_GATT_SERVER
#endif /* #ifndef __BLE_ENVIRONMENTAL_SERVICE_H__*/
|
/*
* Copyright 2008-2012 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in ctbbliance 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 thrust/system/tbb/vector.h
* \brief A dynamically-sizable array of elements which reside in memory available to
* Thrust's TBB system.
*/
#pragma once
#include <thrust/detail/config.h>
#include <thrust/system/tbb/memory.h>
#include <thrust/detail/vector_base.h>
#include <vector>
namespace thrust
{
namespace system
{
namespace tbb
{
// XXX upon c++11
// template<typename T, typename Allocator = allocator<T> > using vector = thrust::detail::vector_base<T,Allocator>;
/*! \p tbb::vector is a container that supports random access to elements,
* constant time removal of elements at the end, and linear time insertion
* and removal of elements at the beginning or in the middle. The number of
* elements in a \p tbb::vector may vary dynamically; memory management is
* automatic. The elements contained in a \p tbb::vector reside in memory
* available to the \p tbb system.
*
* \tparam T The element type of the \p tbb::vector.
* \tparam Allocator The allocator type of the \p tbb::vector. Defaults to \p tbb::allocator.
*
* \see http://www.sgi.com/tech/stl/Vector.html
* \see host_vector For the documentation of the complete interface which is
* shared by \p tbb::vector
* \see device_vector
*/
template<typename T, typename Allocator = allocator<T> >
class vector
: public thrust::detail::vector_base<T,Allocator>
{
/*! \cond
*/
private:
typedef thrust::detail::vector_base<T,Allocator> super_t;
/*! \endcond
*/
public:
/*! \cond
*/
typedef typename super_t::size_type size_type;
typedef typename super_t::value_type value_type;
/*! \endcond
*/
/*! This constructor creates an empty \p tbb::vector.
*/
vector();
/*! This constructor creates a \p tbb::vector with \p n default-constructed elements.
* \param n The size of the \p tbb::vector to create.
*/
explicit vector(size_type n);
/*! This constructor creates a \p tbb::vector with \p n copies of \p value.
* \param n The size of the \p tbb::vector to create.
* \param value An element to copy.
*/
explicit vector(size_type n, const value_type &value);
/*! Copy constructor copies from another \p tbb::vector.
* \param x The other \p tbb::vector to copy.
*/
vector(const vector &x);
/*! This constructor copies from another Thrust vector-like object.
* \param x The other object to copy from.
*/
template<typename OtherT, typename OtherAllocator>
vector(const thrust::detail::vector_base<OtherT,OtherAllocator> &x);
/*! This constructor copies from a \c std::vector.
* \param x The \c std::vector to copy from.
*/
template<typename OtherT, typename OtherAllocator>
vector(const std::vector<OtherT,OtherAllocator> &x);
/*! This constructor creates a \p tbb::vector by copying from a range.
* \param first The beginning of the range.
* \param last The end of the range.
*/
template<typename InputIterator>
vector(InputIterator first, InputIterator last);
// XXX vector_base should take a Derived type so we don't have to define these superfluous assigns
/*! Assignment operator assigns from a \c std::vector.
* \param x The \c std::vector to assign from.
* \return <tt>*this</tt>
*/
template<typename OtherT, typename OtherAllocator>
vector &operator=(const std::vector<OtherT,OtherAllocator> &x);
/*! Assignment operator assigns from another Thrust vector-like object.
* \param x The other object to assign from.
* \return <tt>*this</tt>
*/
template<typename OtherT, typename OtherAllocator>
vector &operator=(const thrust::detail::vector_base<OtherT,OtherAllocator> &x);
}; // end vector
} // end tbb
} // end system
// alias system::tbb names at top-level
namespace tbb
{
using thrust::system::tbb::vector;
} // end tbb
} // end thrust
#include <thrust/system/tbb/detail/vector.inl>
|
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#ifdef __APPLE__
#include <sys/sysctl.h>
#elif defined(__linux__)
#include <asm/cputable.h>
#include <linux/auxvec.h>
#include <fcntl.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#elif defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#elif defined(__AMIGAOS4__)
#include <exec/exec.h>
#include <interfaces/exec.h>
#include <proto/exec.h>
#endif /* __APPLE__ */
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/cpu_internal.h"
/**
* This function MAY rely on signal() or fork() in order to make sure AltiVec
* is present.
*/
int ff_get_cpu_flags_ppc(void)
{
#if HAVE_ALTIVEC
#ifdef __AMIGAOS4__
ULONG result = 0;
extern struct ExecIFace *IExec;
IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
if (result == VECTORTYPE_ALTIVEC)
return AV_CPU_FLAG_ALTIVEC;
return 0;
#elif defined(__APPLE__) || defined(__OpenBSD__)
#ifdef __OpenBSD__
int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
#else
int sels[2] = {CTL_HW, HW_VECTORUNIT};
#endif
int has_vu = 0;
size_t len = sizeof(has_vu);
int err;
err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
if (err == 0)
return has_vu ? AV_CPU_FLAG_ALTIVEC : 0;
return 0;
#elif defined(__linux__)
// The linux kernel could have the altivec support disabled
// even if the cpu has it.
int i, ret = 0;
int fd = open("/proc/self/auxv", O_RDONLY);
unsigned long buf[64] = { 0 };
ssize_t count;
if (fd < 0)
return 0;
while ((count = read(fd, buf, sizeof(buf))) > 0) {
for (i = 0; i < count / sizeof(*buf); i += 2) {
if (buf[i] == AT_NULL)
goto out;
if (buf[i] == AT_HWCAP) {
if (buf[i + 1] & PPC_FEATURE_HAS_ALTIVEC)
ret = AV_CPU_FLAG_ALTIVEC;
#ifdef PPC_FEATURE_HAS_VSX
if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
ret |= AV_CPU_FLAG_VSX;
#endif
#ifdef PPC_FEATURE_ARCH_2_07
if (buf[i + 1] & PPC_FEATURE_HAS_POWER8)
ret |= AV_CPU_FLAG_POWER8;
#endif
if (ret & AV_CPU_FLAG_VSX)
av_assert0(ret & AV_CPU_FLAG_ALTIVEC);
goto out;
}
}
}
out:
close(fd);
return ret;
#elif CONFIG_RUNTIME_CPUDETECT && defined(__linux__)
#define PVR_G4_7400 0x000C
#define PVR_G5_970 0x0039
#define PVR_G5_970FX 0x003C
#define PVR_G5_970MP 0x0044
#define PVR_G5_970GX 0x0045
#define PVR_POWER6 0x003E
#define PVR_POWER7 0x003F
#define PVR_POWER8 0x004B
#define PVR_CELL_PPU 0x0070
int ret = 0;
int proc_ver;
// Support of mfspr PVR emulation added in Linux 2.6.17.
__asm__ volatile("mfspr %0, 287" : "=r" (proc_ver));
proc_ver >>= 16;
if (proc_ver & 0x8000 ||
proc_ver == PVR_G4_7400 ||
proc_ver == PVR_G5_970 ||
proc_ver == PVR_G5_970FX ||
proc_ver == PVR_G5_970MP ||
proc_ver == PVR_G5_970GX ||
proc_ver == PVR_POWER6 ||
proc_ver == PVR_POWER7 ||
proc_ver == PVR_POWER8 ||
proc_ver == PVR_CELL_PPU)
ret = AV_CPU_FLAG_ALTIVEC;
if (proc_ver == PVR_POWER7 ||
proc_ver == PVR_POWER8)
ret |= AV_CPU_FLAG_VSX;
if (proc_ver == PVR_POWER8)
ret |= AV_CPU_FLAG_POWER8;
return ret;
#else
// Since we were compiled for AltiVec, just assume we have it
// until someone comes up with a proper way (not involving signal hacks).
return AV_CPU_FLAG_ALTIVEC;
#endif /* __AMIGAOS4__ */
#endif /* HAVE_ALTIVEC */
return 0;
}
size_t ff_get_cpu_max_align_ppc(void)
{
int flags = av_get_cpu_flags();
if (flags & (AV_CPU_FLAG_ALTIVEC |
AV_CPU_FLAG_VSX |
AV_CPU_FLAG_POWER8))
return 16;
return 8;
}
|
/*
Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPLv2
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPLv2 as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _MYSQL_CONNECTION_OPTIONS_H_
#define _MYSQL_CONNECTION_OPTIONS_H_
namespace sql
{
namespace mysql
{
enum MySQL_Connection_Options {
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
};
}
}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.