text stringlengths 4 6.14k |
|---|
/*
* Copyright 2000-2015 Rochus Keller <mailto:rkeller@nmr.ch>
*
* This file is part of the CARA (Computer Aided Resonance Assignment,
* see <http://cara.nmr.ch/>) NMR Application Framework (NAF) library.
*
* The following is the license that applies to this copy of the
* library. For a license to use the library under conditions
* other than those described here, please email to rkeller@nmr.ch.
*
* GNU General Public License Usage
* This file may be used under the terms of the GNU General Public
* License (GPL) versions 2.0 or 3.0 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in
* the packaging of this file. Please review the following information
* to ensure GNU General Public Licensing requirements will be met:
* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
* http://www.gnu.org/copyleft/gpl.html.
*/
#if !defined(_QTL_URL)
#define _QTL_URL
typedef struct lua_State lua_State;
namespace Qtl
{
class Url
{
public:
static int init(lua_State * L);
static int addQueryItem ( lua_State * L );// ( const QString & key, const QString & value )
static int allQueryItemValues ( lua_State * L );// ( const QString & key ) const : QStringList
static int authority ( lua_State * L );// const : QString
static int clear ( lua_State * L );
static int encodedQuery ( lua_State * L );// const : QByteArray
static int errorString ( lua_State * L );// const : QString
static int fragment ( lua_State * L );// const : QString
static int hasFragment ( lua_State * L );// const : bool
static int hasQuery ( lua_State * L );// const : bool
static int hasQueryItem ( lua_State * L );// ( const QString & key ) const : bool
static int host ( lua_State * L );// const : QString
static int isEmpty ( lua_State * L );// const : bool
static int isParentOf ( lua_State * L );// ( const QUrl & childUrl ) const : bool
static int isRelative ( lua_State * L );// const : bool
static int isValid ( lua_State * L );// const : bool
static int password ( lua_State * L );// const : QString
static int path ( lua_State * L );// const : QString
static int port ( lua_State * L );// const : int
static int queryItemValue ( lua_State * L );// ( const QString & key ) const : QString
static int queryPairDelimiter ( lua_State * L );// const : char
static int queryValueDelimiter ( lua_State * L );// const : char
static int removeAllQueryItems ( lua_State * L );// ( const QString & key )
static int removeQueryItem ( lua_State * L );// ( const QString & key )
static int resolved ( lua_State * L );// ( const QUrl & relative ) const : QUrl
static int scheme ( lua_State * L );// const : QString
static int setAuthority ( lua_State * L );// ( const QString & authority )
static int setEncodedQuery ( lua_State * L );// ( const QByteArray & query )
static int setEncodedUrl ( lua_State * L );// ( const QByteArray & encodedUrl )
static int setFragment ( lua_State * L );// ( const QString & fragment )
static int setHost ( lua_State * L );// ( const QString & host )
static int setPassword ( lua_State * L );// ( const QString & password )
static int setPath ( lua_State * L );// ( const QString & path )
static int setPort ( lua_State * L );// ( int port )
//static int setQueryDelimiters ( lua_State * L );// ( char valueDelimiter, char pairDelimiter )
static int setScheme ( lua_State * L );// ( const QString & scheme )
static int setUrl ( lua_State * L );// ( const QString & url )
static int setUserInfo ( lua_State * L );// ( const QString & userInfo )
static int setUserName ( lua_State * L );// ( const QString & userName )
static int toEncoded ( lua_State * L );// ( FormattingOptions options = None ) const : QByteArray
static int toLocalFile ( lua_State * L );// const : QString
static int toString ( lua_State * L );// ( FormattingOptions options = None ) const : QString
static int userInfo ( lua_State * L );// const : QString
static int userName ( lua_State * L );// const : QString
static int notEquals ( lua_State * L );// ( const QUrl & url ) const : bool
static int operatorEq ( lua_State * L );// ( const QUrl & url ) const : QUrl
static void install(lua_State * L);
};
}
#endif // !defined(_QTL_URL)
|
#pragma once
/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
#include "cores/AudioRenderers/IAudioRenderer.h"
#include "cores/IAudioCallback.h"
#include "utils/CriticalSection.h"
#ifndef _LINUX
enum CodecID;
#else
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
#include <libavcodec/avcodec.h>
#elif (defined HAVE_FFMPEG_AVCODEC_H)
#include <ffmpeg/avcodec.h>
#endif
#else
#include "libavcodec/avcodec.h"
#endif
}
#endif
typedef struct stDVDAudioFrame DVDAudioFrame;
class CSingleLock;
class CDVDAudio
{
public:
CDVDAudio(volatile bool& bStop);
~CDVDAudio();
void RegisterAudioCallback(IAudioCallback* pCallback);
void UnRegisterAudioCallback();
void SetVolume(int iVolume);
void SetDynamicRangeCompression(long drc);
void Pause();
void Resume();
bool Create(const DVDAudioFrame &audioframe, CodecID codec);
bool IsValidFormat(const DVDAudioFrame &audioframe);
void Destroy();
DWORD AddPackets(const DVDAudioFrame &audioframe);
double GetDelay(); // returns the time it takes to play a packet if we add one at this time
double GetCacheTime(); // returns total amount of data cached in audio output at this time
double GetCacheTotal(); // returns total amount the audio device can buffer
void Flush();
void Finish();
void Drain();
void SetSpeed(int iSpeed);
IAudioRenderer* m_pAudioDecoder;
protected:
DWORD AddPacketsRenderer(unsigned char* data, DWORD len, CSingleLock &lock);
IAudioCallback* m_pCallback;
BYTE* m_pBuffer; // should be [m_dwPacketSize]
DWORD m_iBufferSize;
DWORD m_dwPacketSize;
CCriticalSection m_critSection;
int m_iChannels;
int m_iBitrate;
int m_iBitsPerSample;
bool m_bPassthrough;
int m_iSpeed;
volatile bool& m_bStop;
//counter that will go from 0 to m_iSpeed-1 and reset, data will only be output when speedstep is 0
//int m_iSpeedStep;
};
|
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/sysctl.h>
#include <linux/tick.h>
#include <asm/system.h>
#include <asm/processor.h>
#include <asm/cputable.h>
#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/smp.h>
#ifdef CONFIG_HOTPLUG_CPU
#define cpu_should_die() cpu_is_offline(smp_processor_id())
#else
#define cpu_should_die() 0
#endif
static int __init powersave_off(char *arg)
{
ppc_md.power_save = NULL;
return 0;
}
__setup("powersave=off", powersave_off);
void cpu_idle(void)
{
if (ppc_md.idle_loop)
ppc_md.idle_loop(); /* doesn't return */
set_thread_flag(TIF_POLLING_NRFLAG);
while (1) {
tick_nohz_stop_sched_tick(1);
while (!need_resched() && !cpu_should_die()) {
ppc64_runlatch_off();
if (ppc_md.power_save) {
clear_thread_flag(TIF_POLLING_NRFLAG);
/*
* smp_mb is so clearing of TIF_POLLING_NRFLAG
* is ordered w.r.t. need_resched() test.
*/
smp_mb();
local_irq_disable();
/* Don't trace irqs off for idle */
stop_critical_timings();
/* check again after disabling irqs */
if (!need_resched() && !cpu_should_die())
ppc_md.power_save();
start_critical_timings();
local_irq_enable();
set_thread_flag(TIF_POLLING_NRFLAG);
} else {
/*
* Go into low thread priority and possibly
* low power mode.
*/
HMT_low();
HMT_very_low();
}
}
HMT_medium();
ppc64_runlatch_on();
tick_nohz_restart_sched_tick();
if (cpu_should_die())
cpu_die();
preempt_enable_no_resched();
schedule();
preempt_disable();
}
}
int powersave_nap;
#ifdef CONFIG_SYSCTL
static ctl_table powersave_nap_ctl_table[]={
{
.procname = "powersave-nap",
.data = &powersave_nap,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{}
};
static ctl_table powersave_nap_sysctl_root[] = {
{
.procname = "kernel",
.mode = 0555,
.child = powersave_nap_ctl_table,
},
{}
};
static int __init
register_powersave_nap_sysctl(void)
{
register_sysctl_table(powersave_nap_sysctl_root);
return 0;
}
__initcall(register_powersave_nap_sysctl);
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include "../hashtable.h"
struct aaa{
struct hashheader hash;
int a1;
char name;
int a;
};
struct bbb{
struct hashheader hash;
char name;
int b;
};
int main(){
struct hashtable *tb;
struct aaa *a, *atemp;
struct bbb *b, *btemp;
a=malloc(sizeof(struct aaa));
b=malloc(sizeof(struct bbb));
a->hash.id =1;
a->hash.next = NULL;
a->hash.name = malloc(1);
strcpy(a->hash.name,"a");
a->name = 'a';
a->a1=10;
a->a =1;
b->hash.id =11;
b->hash.next = NULL;
b->hash.name = malloc(1);
strcpy(b->hash.name, "b");
b->name = 'b';
b->b =2;
tb = hashTableCreate(10);
hashTableInsert(tb, (struct hashheader*)a);
hashTableInsert(tb, (struct hashheader*)b);
atemp = hashTableSearch(tb, a->hash.id, a->hash.name);
btemp = hashTableSearch(tb, b->hash.id, a->hash.name);
printf("a:%d %c %d %d\n",atemp->hash.id, atemp->name, atemp->a, atemp->a1);
printf("b:%d %c %d\n",btemp->hash.id, btemp->name, btemp->b);
hashTableDestroy(tb);
return 1;
}
|
/*
* Copyright (C) ST-Ericsson AB 2010
* Author: Sjur Brendeland/sjur.brandeland@stericsson.com
* License terms: GNU General Public License (GPL) version 2
*/
<<<<<<< HEAD
#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
=======
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#include <linux/stddef.h>
#include <linux/slab.h>
#include <net/caif/caif_layer.h>
#include <net/caif/cfsrvl.h>
#include <net/caif/cfpkt.h>
#define VEI_PAYLOAD 0x00
#define VEI_CMD_BIT 0x80
#define VEI_FLOW_OFF 0x81
#define VEI_FLOW_ON 0x80
#define VEI_SET_PIN 0x82
<<<<<<< HEAD
=======
#define VEI_CTRL_PKT_SIZE 1
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#define container_obj(layr) container_of(layr, struct cfsrvl, layer)
static int cfvei_receive(struct cflayer *layr, struct cfpkt *pkt);
static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt);
struct cflayer *cfvei_create(u8 channel_id, struct dev_info *dev_info)
{
struct cfsrvl *vei = kmalloc(sizeof(struct cfsrvl), GFP_ATOMIC);
if (!vei) {
<<<<<<< HEAD
pr_warn("Out of memory\n");
=======
pr_warning("CAIF: %s(): Out of memory\n", __func__);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
return NULL;
}
caif_assert(offsetof(struct cfsrvl, layer) == 0);
memset(vei, 0, sizeof(struct cfsrvl));
<<<<<<< HEAD
cfsrvl_init(vei, channel_id, dev_info, true);
=======
cfsrvl_init(vei, channel_id, dev_info);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
vei->layer.receive = cfvei_receive;
vei->layer.transmit = cfvei_transmit;
snprintf(vei->layer.name, CAIF_LAYER_NAME_SZ - 1, "vei%d", channel_id);
return &vei->layer;
}
static int cfvei_receive(struct cflayer *layr, struct cfpkt *pkt)
{
u8 cmd;
int ret;
caif_assert(layr->up != NULL);
caif_assert(layr->receive != NULL);
caif_assert(layr->ctrlcmd != NULL);
if (cfpkt_extr_head(pkt, &cmd, 1) < 0) {
<<<<<<< HEAD
pr_err("Packet is erroneous!\n");
=======
pr_err("CAIF: %s(): Packet is erroneous!\n", __func__);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
cfpkt_destroy(pkt);
return -EPROTO;
}
switch (cmd) {
case VEI_PAYLOAD:
ret = layr->up->receive(layr->up, pkt);
return ret;
case VEI_FLOW_OFF:
layr->ctrlcmd(layr, CAIF_CTRLCMD_FLOW_OFF_IND, 0);
cfpkt_destroy(pkt);
return 0;
case VEI_FLOW_ON:
layr->ctrlcmd(layr, CAIF_CTRLCMD_FLOW_ON_IND, 0);
cfpkt_destroy(pkt);
return 0;
case VEI_SET_PIN: /* SET RS232 PIN */
cfpkt_destroy(pkt);
return 0;
default: /* SET RS232 PIN */
<<<<<<< HEAD
pr_warn("Unknown VEI control packet %d (0x%x)!\n", cmd, cmd);
=======
pr_warning("CAIF: %s():Unknown VEI control packet %d (0x%x)!\n",
__func__, cmd, cmd);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
cfpkt_destroy(pkt);
return -EPROTO;
}
}
static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt)
{
u8 tmp = 0;
struct caif_payload_info *info;
int ret;
struct cfsrvl *service = container_obj(layr);
if (!cfsrvl_ready(service, &ret))
<<<<<<< HEAD
goto err;
caif_assert(layr->dn != NULL);
caif_assert(layr->dn->transmit != NULL);
if (cfpkt_add_head(pkt, &tmp, 1) < 0) {
pr_err("Packet is erroneous!\n");
ret = -EPROTO;
goto err;
=======
return ret;
caif_assert(layr->dn != NULL);
caif_assert(layr->dn->transmit != NULL);
if (cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) {
pr_warning("CAIF: %s(): Packet too large - size=%d\n",
__func__, cfpkt_getlen(pkt));
return -EOVERFLOW;
}
if (cfpkt_add_head(pkt, &tmp, 1) < 0) {
pr_err("CAIF: %s(): Packet is erroneous!\n", __func__);
return -EPROTO;
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
}
/* Add info-> for MUX-layer to route the packet out. */
info = cfpkt_info(pkt);
info->channel_id = service->layer.id;
info->hdr_len = 1;
info->dev_info = &service->dev_info;
<<<<<<< HEAD
return layr->dn->transmit(layr->dn, pkt);
err:
cfpkt_destroy(pkt);
=======
ret = layr->dn->transmit(layr->dn, pkt);
if (ret < 0)
cfpkt_extr_head(pkt, &tmp, 1);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
return ret;
}
|
/* This file is part of the UniSet project
* Copyright (c) 2002 Free Software Foundation, Inc.
* Copyright (c) 2002 Pavel Vainerman
*
* 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.
*/
// --------------------------------------------------------------------------
/*! \file
* \author Pavel Vainerman
*/
//----------------------------------------------------------------------------
#ifndef SQLiteInterface_H_
#define SQLiteInterface_H_
// ---------------------------------------------------------------------------
#include <string>
#include <list>
#include <vector>
#include <iostream>
#include <sqlite3.h>
#include "PassiveTimer.h"
// ----------------------------------------------------------------------------
class SQLiteResult;
// ----------------------------------------------------------------------------
/*! \page SQLiteIntarface Интерфейс к SQLite
Пример использования:
\code
try
{
SQLiteInterface db;
if( !db.connect("test.db") )
{
cerr << "db connect error: " << db.error() << endl;
return 1;
}
stringstream q;
q << "SELECT * from main_history";
SQLiteResult r = db.query(q.str());
if( !r )
{
cerr << "db connect error: " << db.error() << endl;
return 1;
}
for( SQLiteResult::iterator it=r.begin(); it!=r.end(); it++ )
{
cout << "ROW: ";
SQLiteResult::COL col(*it);
for( SQLiteResult::COL::iterator cit = it->begin(); cit!=it->end(); cit++ )
cout << as_string(cit) << "(" << as_double(cit) << ") | ";
cout << endl;
}
db.close();
}
catch(Exception& ex)
{
cerr << "(test): " << ex << endl;
}
catch(...)
{
cerr << "(test): catch ..." << endl;
}
\endcode
*/
// ----------------------------------------------------------------------------
// Памятка:
// Включение режима для журнала - "вести в памяти" (чтобы поберечь CompactFlash)
// PRAGMA journal_mode = MEMORY
//
// ----------------------------------------------------------------------------
class SQLiteInterface
{
public:
SQLiteInterface();
~SQLiteInterface();
bool connect( const std::string& dbfile, bool create = false );
bool close();
bool isConnection();
bool ping(); // проверка доступности БД
void setOperationTimeout( timeout_t msec );
inline timeout_t getOperationTimeout(){ return opTimeout; }
inline void setOperationCheckPause( timeout_t msec ){ opCheckPause = msec; }
inline timeout_t getOperationCheckPause(){ return opCheckPause; }
SQLiteResult query( const std::string& q );
const std::string lastQuery();
bool insert( const std::string& q );
int insert_id();
std::string error();
protected:
bool wait( sqlite3_stmt* stmt, int result );
static bool checkResult( int rc );
private:
sqlite3* db;
// sqlite3_stmt* curStmt;
std::string lastQ;
std::string lastE;
bool queryok; // успешность текущего запроса
bool connected;
timeout_t opTimeout;
timeout_t opCheckPause;
};
// ----------------------------------------------------------------------------------
class SQLiteResult
{
public:
SQLiteResult(){}
SQLiteResult( sqlite3_stmt* s, bool finalize=true );
~SQLiteResult();
typedef std::vector<std::string> COL;
typedef std::list<COL> ROW;
typedef ROW::iterator iterator;
inline iterator begin(){ return res.begin(); }
inline iterator end(){ return res.end(); }
inline operator bool(){ return !res.empty(); }
inline int size(){ return res.size(); }
inline bool empty(){ return res.empty(); }
protected:
ROW res;
};
// ----------------------------------------------------------------------------
int num_cols( SQLiteResult::iterator& );
// ROW
int as_int( SQLiteResult::iterator&, int col );
double as_double( SQLiteResult::iterator&, int col );
std::string as_string( SQLiteResult::iterator&, int col );
// ----------------------------------------------------------------------------
// COL
int as_int( SQLiteResult::COL::iterator& );
double as_double( SQLiteResult::COL::iterator& );
std::string as_string( SQLiteResult::COL::iterator& );
// ----------------------------------------------------------------------------
#endif
// ----------------------------------------------------------------------------------
|
/* specfunc/gsl_sf_airy.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Author: G. Jungman */
#ifndef __GSL_SF_AIRY_H__
#define __GSL_SF_AIRY_H__
#include <gsl/gsl_mode.h>
#include <gsl/gsl_sf_result.h>
#include "..\\WinGslDll.inl"
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
/* Airy function Ai(x)
*
* exceptions: GSL_EUNDRFLW
*/
WINGSLDLL_API int gsl_sf_airy_Ai_e(const double x, const gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Ai(const double x, gsl_mode_t mode);
/* Airy function Bi(x)
*
* exceptions: GSL_EOVRFLW
*/
WINGSLDLL_API int gsl_sf_airy_Bi_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Bi(const double x, gsl_mode_t mode);
/* scaled Ai(x):
* Ai(x) x < 0
* exp(+2/3 x^{3/2}) Ai(x) x > 0
*
* exceptions: none
*/
WINGSLDLL_API int gsl_sf_airy_Ai_scaled_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Ai_scaled(const double x, gsl_mode_t mode);
/* scaled Bi(x):
* Bi(x) x < 0
* exp(-2/3 x^{3/2}) Bi(x) x > 0
*
* exceptions: none
*/
WINGSLDLL_API int gsl_sf_airy_Bi_scaled_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Bi_scaled(const double x, gsl_mode_t mode);
/* derivative Ai'(x)
*
* exceptions: GSL_EUNDRFLW
*/
WINGSLDLL_API int gsl_sf_airy_Ai_deriv_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Ai_deriv(const double x, gsl_mode_t mode);
/* derivative Bi'(x)
*
* exceptions: GSL_EOVRFLW
*/
WINGSLDLL_API int gsl_sf_airy_Bi_deriv_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Bi_deriv(const double x, gsl_mode_t mode);
/* scaled derivative Ai'(x):
* Ai'(x) x < 0
* exp(+2/3 x^{3/2}) Ai'(x) x > 0
*
* exceptions: none
*/
WINGSLDLL_API int gsl_sf_airy_Ai_deriv_scaled_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Ai_deriv_scaled(const double x, gsl_mode_t mode);
/* scaled derivative:
* Bi'(x) x < 0
* exp(-2/3 x^{3/2}) Bi'(x) x > 0
*
* exceptions: none
*/
WINGSLDLL_API int gsl_sf_airy_Bi_deriv_scaled_e(const double x, gsl_mode_t mode, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_Bi_deriv_scaled(const double x, gsl_mode_t mode);
/* Zeros of Ai(x)
*/
WINGSLDLL_API int gsl_sf_airy_zero_Ai_e(unsigned int s, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_zero_Ai(unsigned int s);
/* Zeros of Bi(x)
*/
WINGSLDLL_API int gsl_sf_airy_zero_Bi_e(unsigned int s, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_zero_Bi(unsigned int s);
/* Zeros of Ai'(x)
*/
WINGSLDLL_API int gsl_sf_airy_zero_Ai_deriv_e(unsigned int s, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_zero_Ai_deriv(unsigned int s);
/* Zeros of Bi'(x)
*/
WINGSLDLL_API int gsl_sf_airy_zero_Bi_deriv_e(unsigned int s, gsl_sf_result * result);
WINGSLDLL_API double gsl_sf_airy_zero_Bi_deriv(unsigned int s);
__END_DECLS
#endif /* __GSL_SF_AIRY_H__ */
|
#ifndef _ASM_MSGBUF_H
#define _ASM_MSGBUF_H
struct msqid64_ds {
struct ipc64_perm msg_perm;
__kernel_time_t msg_stime; /* last msgsnd time */
unsigned long __unused1;
__kernel_time_t msg_rtime; /* last msgrcv time */
unsigned long __unused2;
__kernel_time_t msg_ctime; /* last change time */
unsigned long __unused3;
unsigned long msg_cbytes; /* current number of bytes on queue */
unsigned long msg_qnum; /* number of messages in queue */
unsigned long msg_qbytes; /* max number of bytes on queue */
__kernel_pid_t msg_lspid; /* pid of last msgsnd */
__kernel_pid_t msg_lrpid; /* last receive pid */
unsigned long __unused4;
unsigned long __unused5;
};
#endif /* _ASM_MSGBUF_H */
|
#ifndef GETTEXTFROMC_H
#define GETTEXTFROMC_H
#include <QHash>
#include <QCoreApplication>
extern "C" const char *trGettext(const char *text);
class gettextFromC {
Q_DECLARE_TR_FUNCTIONS(gettextFromC)
public:
static gettextFromC *instance();
const char *trGettext(const char *text);
void reset(void);
QHash<QByteArray, QByteArray> translationCache;
};
#endif // GETTEXTFROMC_H
|
#ifndef MotorControl_h
#define MotorControl_h
#include <inttypes.h>
class MotorControl
{
public:
MotorControl();
void attach(int directionPin, int throttlePin);
void forward(int speed);
void backward(int speed);
void halt();
protected:
uint8_t directionPin;
uint8_t throttlePin;
};
#endif
|
/*************************************************************************
Connect.h - function for connecting Kwave streaming objects
-------------------
begin : Sat Oct 27 2007
copyright : (C) 2007 by Thomas Eschenbacher
email : Thomas.Eschenbacher@gmx.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. *
* *
***************************************************************************/
#ifndef CONNECT_H
#define CONNECT_H
#include "config.h"
#include <QtGlobal>
class QString;
namespace Kwave
{
class StreamObject;
/**
* Connect an output of a Kwave::SampleSource to the input
* of a Kwave::SampleSink. The following combinations of
* single-track and multi-track sources/sinks are allowed.:
* \li single -> single (1:1)
* \li single -> multi (1:N)
* \li multi -> multi (N:N)
*
* @param source a Kwave::SampleSource that produces data
* @param output name of the output, must be formed with the
* Qt macro \c SIGNAL(...) \c out of
* a Qt style signal.
* @param sink a Kwave::SampleSink that can receive data
* @param input name of the inputm must be formed with the
* Qt macro \c SLOT(...) \c out of a Qt style
* (public) slot .
* @return true if successful or false if either
* \li an invalid combination of single/multi track
* source/sink has been passed
* \li a source or sink's track is NULL (missing)
* \li input or output name is zero-length
*/
bool connect(Kwave::StreamObject &source, const char *output,
Kwave::StreamObject &sink, const char *input)
Q_DECL_EXPORT;
}
#endif /* CONNECT_H */
//***************************************************************************
//***************************************************************************
|
/****************************************************************************
*
* Copyright 2010 --2011 Broadcom Corporation.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available at
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
*
*****************************************************************************/
#ifndef __KONA_RESET_REASON_H__
#define __KONA_RESET_REASON_H__
#define REG_EMU_AREA 0x3404BF90
#define AP_ONLY_BOOT 0x4
#define CHARGING_STATE 0x3
#define BOOTLOADER_BOOT 0x5
#define RECOVERY_BOOT 0x6
void do_set_bootloader_boot(void);
void do_set_recovery_boot(void);
void do_set_ap_only_boot(void);
void do_clear_ap_only_boot(void);
unsigned int is_ap_only_boot(void);
extern unsigned int hard_reset_reason;
unsigned int is_charging_state(void);
#endif
|
#ifndef GRAPHICS_OBJECT_FLAT_TEXTURE_H
#define GRAPHICS_OBJECT_FLAT_TEXTURE_H
#include "Azul.h"
class GraphicsObjectFlatTexture :public GraphicsObject
{
public:
GraphicsObjectFlatTexture(Model *model, Texture *text0, Texture *text1=0,Texture *text2=0,Texture *text3=0);
virtual void Render() override;
// data:
Texture *pTexture0;
Texture *pTexture1;
Texture *pTexture2;
Texture *pTexture3;
};
#endif |
/*
* Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
* See COPYING file for license information
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cbtcommon/debug.h>
#include <cbtcommon/text_util.h>
#include "cap.h"
#include "cvs_direct.h"
extern CvsServerCtx * cvs_direct_ctx;
static char client_version[BUFSIZ];
static char server_version[BUFSIZ];
static int check_cvs_version(int, int, int);
static int check_version_string(const char *, int, int, int);
int cvs_check_cap(int cap)
{
int ret;
switch(cap)
{
case CAP_HAVE_RLOG:
if (!(ret = check_cvs_version(1,11,1)))
{
debug(DEBUG_APPERROR,
"WARNING: Your CVS client version:\n[%s]\n"
"and/or server version:\n[%s]\n"
"are too old to properly support the rlog command. \n"
"This command was introduced in 1.11.1. Cvsps\n"
"will use log instead, but PatchSet numbering\n"
"may become unstable due to pruned empty\n"
"directories.\n", client_version, server_version);
}
break;
default:
debug(DEBUG_APPERROR, "unknown cvs capability check %d", cap);
exit(1);
}
return ret;
}
static void get_version_external()
{
FILE * cvsfp;
strcpy(client_version, "(UNKNOWN CLIENT)");
strcpy(server_version, "(UNKNOWN SERVER)");
if (!(cvsfp = popen("cvs version 2>/dev/null", "r")))
{
debug(DEBUG_APPERROR, "cannot popen cvs version. exiting");
exit(1);
}
if (!fgets(client_version, BUFSIZ, cvsfp))
{
debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: no data");
goto out;
}
chop(client_version);
if (strncmp(client_version, "Client", 6) == 0)
{
if (!fgets(server_version, BUFSIZ, cvsfp))
{
debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: no server data");
goto out;
}
chop(server_version);
}
else
{
server_version[0] = 0;
}
out:
pclose(cvsfp);
}
int check_cvs_version(int req_major, int req_minor, int req_extra)
{
if (!client_version[0])
{
if (cvs_direct_ctx)
cvs_version(cvs_direct_ctx, client_version, server_version);
else
get_version_external();
}
return (check_version_string(client_version, req_major, req_minor, req_extra) &&
(!server_version[0] || check_version_string(server_version, req_major, req_minor, req_extra)));
}
int check_version_string(const char * str, int req_major, int req_minor, int req_extra)
{
char * p;
int major, minor, extra;
int skip = 6;
p = strstr(str, "(CVS) ");
if (!p) {
p = strstr(str, "(CVSNT)");
skip = 8;
}
if (!p)
{
debug(DEBUG_APPMSG1, "WARNING: malformed CVS version str: %s", str);
return 0;
}
/* We might have encountered a FreeBSD system which
* has a mucked up version string of:
* Concurrent Versions System (CVS) '1.11.17'-FreeBSD (client/server)
* so re-test just in case
*/
p += skip;
if (sscanf(p, "%d.%d.%d", &major, &minor, &extra) != 3)
{
if (sscanf(p, "'%d.%d.%d'", &major, &minor, &extra) != 3)
{
debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: %s", str);
return 0;
}
}
return (major > req_major ||
(major == req_major && minor > req_minor) ||
(major == req_major && minor == req_minor && extra >= req_extra));
}
|
#include <stdio.h>
static unsigned long test[] ={
0x000000000000000a,
0x000000000000001a,
0x000000000000012a,
0x000000000000123a,
0x000000000001234a,
0x000000000012345a,
0x000000000123456a,
0x000000001234567a,
0x000000012345678a,
0x000000123456789a,
0x000001234567890a,
0x000000000000000b,
0x000000000000001b,
0x000000000000012b,
0x000000000000123b,
0x000000000001234b,
0x000000000012345b,
0x000000000123456b,
0x000000001234567b,
0x000000012345678b,
0x000000123456789b,
0x000001234567890b,
0x000000000000000c,
0x000000000000001c,
0x000000000000012c,
0x000000000000123c,
0x000000000001234c,
0x000000000012345c,
0x000000000123456c,
0x000000001234567c,
0x000000012345678c,
0x000000123456789c,
0x000001234567890c,
0x000000000000000d,
0x000000000000001d,
0x000000000000012d,
0x000000000000123d,
0x000000000001234d,
0x000000000012345d,
0x000000000123456d,
0x000000001234567d,
0x000000012345678d,
0x000000123456789d,
0x000001234567890d,
0x000000000000000e,
0x000000000000001e,
0x000000000000012e,
0x000000000000123e,
0x000000000001234e,
0x000000000012345e,
0x000000000123456e,
0x000000001234567e,
0x000000012345678e,
0x000000123456789e,
0x000001234567890e,
0x000000000000000f,
0x000000000000001f,
0x000000000000012f,
0x000000000000123f,
0x000000000001234f,
0x000000000012345f,
0x000000000123456f,
0x000000001234567f,
0x000000012345678f,
0x000000123456789f,
0x000001234567890f,
0x000002147483647c,
0x000002147483648d,
};
static signed int dec_to_hex(unsigned long *addr)
{
register signed int res asm("2") = 0;
register unsigned long *_addr asm("4") = addr;
asm volatile(
" cvb %0,0(0,%1)"
: "=d" (res) : "d" (_addr) : "memory");
return res & 0xffffffff;
}
int main()
{
int i;
for (i = 0; i < sizeof(test) / sizeof(test[0]); i++)
printf("%d\n", dec_to_hex(&test[i]));
return 0;
}
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*/
#include "tomcrypt_private.h"
/**
@file der_length_short_integer.c
ASN.1 DER, get length of encoding, Tom St Denis
*/
#ifdef LTC_DER
/**
Gets length of DER encoding of num
@param num The integer to get the size of
@param outlen [out] The length of the DER encoding for the given integer
@return CRYPT_OK if successful
*/
int der_length_short_integer(unsigned long num, unsigned long *outlen)
{
unsigned long z, y;
int err;
LTC_ARGCHK(outlen != NULL);
/* force to 32 bits */
num &= 0xFFFFFFFFUL;
/* get the number of bytes */
z = 0;
y = num;
while (y) {
++z;
y >>= 8;
}
/* handle zero */
if (z == 0) {
z = 1;
} else if ((num&(1UL<<((z<<3) - 1))) != 0) {
/* in case msb is set */
++z;
}
if ((err = der_length_asn1_length(z, &y)) != CRYPT_OK) {
return err;
}
*outlen = 1 + y + z;
return CRYPT_OK;
}
#endif
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
|
/*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
# ifndef _STLP_OUTERMOST_HEADER_ID
# define _STLP_OUTERMOST_HEADER_ID 0x262
# include <stl/_prolog.h>
# endif
# ifndef _STLP_WINCE
# include _STLP_NATIVE_C_HEADER(stddef.h)
# endif /* WINCE */
# if (_STLP_OUTERMOST_HEADER_ID == 0x262)
# if ! defined (_STLP_DONT_POP_0x262)
# include <stl/_epilog.h>
# undef _STLP_OUTERMOST_HEADER_ID
# endif
# undef _STLP_DONT_POP_0x262
# endif
// Local Variables:
// mode:C++
// End:
|
/*
* Inline routines shareable across OS platforms.
*
* Copyright (c) 1994-2001 Justin T. Gibbs.
* Copyright (c) 2000-2003 Adaptec Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* 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 MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*
* $Id: //WIFI_SOC/release/SDK_4_1_0_0/source/linux-2.6.36.x/drivers/scsi/aic7xxx/aic79xx_inline.h#1 $
*
* $FreeBSD$
*/
#ifndef _AIC79XX_INLINE_H_
#define _AIC79XX_INLINE_H_
/******************************** Debugging ***********************************/
static inline char *ahd_name(struct ahd_softc *ahd);
static inline char *ahd_name(struct ahd_softc *ahd)
{
return (ahd->name);
}
/************************ Sequencer Execution Control *************************/
static inline void ahd_known_modes(struct ahd_softc *ahd,
ahd_mode src, ahd_mode dst);
static inline ahd_mode_state ahd_build_mode_state(struct ahd_softc *ahd,
ahd_mode src,
ahd_mode dst);
static inline void ahd_extract_mode_state(struct ahd_softc *ahd,
ahd_mode_state state,
ahd_mode *src, ahd_mode *dst);
void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src,
ahd_mode dst);
ahd_mode_state ahd_save_modes(struct ahd_softc *ahd);
void ahd_restore_modes(struct ahd_softc *ahd,
ahd_mode_state state);
int ahd_is_paused(struct ahd_softc *ahd);
void ahd_pause(struct ahd_softc *ahd);
void ahd_unpause(struct ahd_softc *ahd);
static inline void
ahd_known_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
{
ahd->src_mode = src;
ahd->dst_mode = dst;
ahd->saved_src_mode = src;
ahd->saved_dst_mode = dst;
}
static inline ahd_mode_state
ahd_build_mode_state(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
{
return ((src << SRC_MODE_SHIFT) | (dst << DST_MODE_SHIFT));
}
static inline void
ahd_extract_mode_state(struct ahd_softc *ahd, ahd_mode_state state,
ahd_mode *src, ahd_mode *dst)
{
*src = (state & SRC_MODE) >> SRC_MODE_SHIFT;
*dst = (state & DST_MODE) >> DST_MODE_SHIFT;
}
/*********************** Scatter Gather List Handling *************************/
void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
void *sgptr, dma_addr_t addr,
bus_size_t len, int last);
/************************** Memory mapping routines ***************************/
static inline size_t ahd_sg_size(struct ahd_softc *ahd);
void ahd_sync_sglist(struct ahd_softc *ahd,
struct scb *scb, int op);
static inline size_t ahd_sg_size(struct ahd_softc *ahd)
{
if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
return (sizeof(struct ahd_dma64_seg));
return (sizeof(struct ahd_dma_seg));
}
/*********************** Miscellaneous Support Functions ***********************/
struct ahd_initiator_tinfo *
ahd_fetch_transinfo(struct ahd_softc *ahd,
char channel, u_int our_id,
u_int remote_id,
struct ahd_tmode_tstate **tstate);
uint16_t
ahd_inw(struct ahd_softc *ahd, u_int port);
void ahd_outw(struct ahd_softc *ahd, u_int port,
u_int value);
uint32_t
ahd_inl(struct ahd_softc *ahd, u_int port);
void ahd_outl(struct ahd_softc *ahd, u_int port,
uint32_t value);
uint64_t
ahd_inq(struct ahd_softc *ahd, u_int port);
void ahd_outq(struct ahd_softc *ahd, u_int port,
uint64_t value);
u_int ahd_get_scbptr(struct ahd_softc *ahd);
void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr);
u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset);
u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset);
struct scb *
ahd_lookup_scb(struct ahd_softc *ahd, u_int tag);
void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb);
static inline uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd,
struct scb *scb);
static inline uint32_t ahd_get_sense_bufaddr(struct ahd_softc *ahd,
struct scb *scb);
#if 0 /* unused */
#define AHD_COPY_COL_IDX(dst, src) \
do { \
dst->hscb->scsiid = src->hscb->scsiid; \
dst->hscb->lun = src->hscb->lun; \
} while (0)
#endif
static inline uint8_t *
ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb)
{
return (scb->sense_data);
}
static inline uint32_t
ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb)
{
return (scb->sense_busaddr);
}
/************************** Interrupt Processing ******************************/
int ahd_intr(struct ahd_softc *ahd);
#endif /* _AIC79XX_INLINE_H_ */
|
/* { dg-do compile } */
/* { dg-options "-O -fdiagnostics-show-caret" } */
/* This is a collection of unittests for diagnostic_show_locus;
see the overview in diagnostic_plugin_test_show_locus.c.
In particular, note the discussion of why we need a very long line here:
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
and that we can't use macros in this file. */
void test_simple (void)
{
#if 0
myvar = myvar.x; /* { dg-warning "test" } */
/* { dg-begin-multiline-output "" }
myvar = myvar.x;
~~~~~^~
{ dg-end-multiline-output "" } */
#endif
}
void test_simple_2 (void)
{
#if 0
x = first_function () + second_function (); /* { dg-warning "test" } */
/* { dg-begin-multiline-output "" }
x = first_function () + second_function ();
~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_multiline (void)
{
#if 0
x = (first_function ()
+ second_function ()); /* { dg-warning "test" } */
/* { dg-begin-multiline-output "" }
x = (first_function ()
~~~~~~~~~~~~~~~~~
+ second_function ());
^ ~~~~~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_many_lines (void)
{
#if 0
x = (first_function_with_a_very_long_name (lorem, ipsum, dolor, sit, amet,
consectetur, adipiscing, elit,
sed, eiusmod, tempor,
incididunt, ut, labore, et,
dolore, magna, aliqua)
+ second_function_with_a_very_long_name (lorem, ipsum, dolor, sit, /* { dg-warning "test" } */
amet, consectetur,
adipiscing, elit, sed,
eiusmod, tempor, incididunt,
ut, labore, et, dolore,
magna, aliqua));
/* { dg-begin-multiline-output "" }
x = (first_function_with_a_very_long_name (lorem, ipsum, dolor, sit, amet,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
consectetur, adipiscing, elit,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sed, eiusmod, tempor,
~~~~~~~~~~~~~~~~~~~~~
incididunt, ut, labore, et,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
dolore, magna, aliqua)
~~~~~~~~~~~~~~~~~~~~~~
+ second_function_with_a_very_long_name (lorem, ipsum, dolor, sit,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
amet, consectetur,
~~~~~~~~~~~~~~~~~~
adipiscing, elit, sed,
~~~~~~~~~~~~~~~~~~~~~~
eiusmod, tempor, incididunt,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ut, labore, et, dolore,
~~~~~~~~~~~~~~~~~~~~~~~
magna, aliqua));
~~~~~~~~~~~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_richloc_from_proper_range (void)
{
#if 0
float f = 98.6f; /* { dg-warning "test" } */
/* { dg-begin-multiline-output "" }
float f = 98.6f;
^~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_caret_within_proper_range (void)
{
#if 0
float f = foo * bar; /* { dg-warning "17: test" } */
/* { dg-begin-multiline-output "" }
float f = foo * bar;
~~~~^~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_very_wide_line (void)
{
#if 0
float f = foo * bar; /* { dg-warning "95: test" } */
/* { dg-begin-multiline-output "" }
float f = foo * bar;
~~~~^~~~~
{ dg-end-multiline-output "" } */
#endif
}
void test_multiple_carets (void)
{
#if 0
x = x + y /* { dg-warning "8: test" } */
/* { dg-begin-multiline-output "" }
x = x + y
A B
{ dg-end-multiline-output "" } */
#endif
}
void test_caret_on_leading_whitespace (void)
{
#if 0
ASSOCIATE (y => x)
y = 5 /* { dg-warning "6: test" } */
/* { dg-begin-multiline-output "" }
ASSOCIATE (y => x)
2
y = 5
1
{ dg-end-multiline-output "" } */
#endif
}
|
#ifndef FIRST_ENEMY_H
#define FIRST_ENEMY_H
#include "enemy.h"
namespace dos_game
{
class FirstEnemy : public Enemy
{
public:
FirstEnemy(int width, int height, const Point& pos = {200, 40});
// Enemy interface
virtual void act(const Rect& playerPos, const std::vector<Rect>& bullets) override;
virtual void hurt(int amount) override;
virtual Rect getBoundingBox() override;
virtual Point getPos() override { return m_pos; }
virtual bool isDead() override;
private:
Point m_pos;
int m_health = 5;
int m_width;
int m_height;
// speed vector
Point m_speed = {0,0};
};
}
#endif // FIRST_ENEMY_H
|
/* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*
* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
/*
* (C) Copyright 2006
* Stefan Roese, DENX Software Engineering, sr@denx.de.
*
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Marius Groeger <mgroeger@sysgo.de>
*
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Alex Zuepke <azu@sysgo.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/arch/ixp425.h>
#ifdef CONFIG_TIMER_IRQ
#define FREQ 66666666
#define CLOCK_TICK_RATE (((FREQ / CONFIG_SYS_HZ & ~IXP425_OST_RELOAD_MASK) + 1) * CONFIG_SYS_HZ)
#define LATCH ((CLOCK_TICK_RATE + CONFIG_SYS_HZ/2) / CONFIG_SYS_HZ) /* For divider */
/*
* When interrupts are enabled, use timer 2 for time/delay generation...
*/
static volatile ulong timestamp;
static void timer_isr(void *data)
{
unsigned int *pTime = (unsigned int *)data;
(*pTime)++;
/*
* Reset IRQ source
*/
*IXP425_OSST = IXP425_OSST_TIMER_2_PEND;
}
ulong get_timer (ulong base)
{
return timestamp - base;
}
void reset_timer (void)
{
timestamp = 0;
}
int timer_init (void)
{
/* install interrupt handler for timer */
irq_install_handler(IXP425_TIMER_2_IRQ, timer_isr, (void *)×tamp);
/* setup the Timer counter value */
*IXP425_OSRT2 = (LATCH & ~IXP425_OST_RELOAD_MASK) | IXP425_OST_ENABLE;
/* enable timer irq */
*IXP425_ICMR = (1 << IXP425_TIMER_2_IRQ);
return 0;
}
#else
ulong get_timer (ulong base)
{
return get_timer_masked () - base;
}
void ixp425_udelay(unsigned long usec)
{
/*
* This function has a max usec, but since it is called from udelay
* we should not have to worry... be happy
*/
unsigned long usecs = CONFIG_SYS_HZ/1000000L & ~IXP425_OST_RELOAD_MASK;
*IXP425_OSST = IXP425_OSST_TIMER_1_PEND;
usecs |= IXP425_OST_ONE_SHOT | IXP425_OST_ENABLE;
*IXP425_OSRT1 = usecs;
while (!(*IXP425_OSST & IXP425_OSST_TIMER_1_PEND));
}
void __udelay (unsigned long usec)
{
while (usec--) ixp425_udelay(1);
}
static ulong reload_constant = 0xfffffff0;
void reset_timer_masked (void)
{
ulong reload = reload_constant | IXP425_OST_ONE_SHOT | IXP425_OST_ENABLE;
*IXP425_OSST = IXP425_OSST_TIMER_1_PEND;
*IXP425_OSRT1 = reload;
}
ulong get_timer_masked (void)
{
/*
* Note that it is possible for this to wrap!
* In this case we return max.
*/
ulong current = *IXP425_OST1;
if (*IXP425_OSST & IXP425_OSST_TIMER_1_PEND)
{
return reload_constant;
}
return (reload_constant - current);
}
int timer_init(void)
{
return 0;
}
#endif
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SAFE_BROWSING_CHUNK_RANGE_H_
#define CHROME_BROWSER_SAFE_BROWSING_CHUNK_RANGE_H_
#include <string>
#include <vector>
class ChunkRange {
public:
explicit ChunkRange(int start);
ChunkRange(int start, int stop);
ChunkRange(const ChunkRange& rhs);
inline int start() const { return start_; }
inline int stop() const { return stop_; }
bool operator==(const ChunkRange& rhs) const {
return start_ == rhs.start() && stop_ == rhs.stop();
}
private:
int start_;
int stop_;
};
void RangesToChunks(const std::vector<ChunkRange>& ranges,
std::vector<int>* chunks);
bool StringToRanges(const std::string& input,
std::vector<ChunkRange>* ranges);
void ChunksToRangeString(const std::vector<int>& chunks, std::string* result);
bool IsChunkInRange(int chunk_number, const std::vector<ChunkRange>& ranges);
#endif
|
#ifndef JFFS2_SUMMARY_H
#define JFFS2_SUMMARY_H
#define MAX_SUMMARY_SIZE 65536
#include <linux/uio.h>
#include <linux/jffs2.h>
#define BLK_STATE_ALLFF 0
#define BLK_STATE_CLEAN 1
#define BLK_STATE_PARTDIRTY 2
#define BLK_STATE_CLEANMARKER 3
#define BLK_STATE_ALLDIRTY 4
#define BLK_STATE_BADBLOCK 5
#define JFFS2_SUMMARY_NOSUM_SIZE 0xffffffff
#define JFFS2_SUMMARY_INODE_SIZE (sizeof(struct jffs2_sum_inode_flash))
#define JFFS2_SUMMARY_DIRENT_SIZE(x) (sizeof(struct jffs2_sum_dirent_flash) + (x))
#define JFFS2_SUMMARY_XATTR_SIZE (sizeof(struct jffs2_sum_xattr_flash))
#define JFFS2_SUMMARY_XREF_SIZE (sizeof(struct jffs2_sum_xref_flash))
/* Summary structures used on flash */
struct jffs2_sum_unknown_flash
{
jint16_t nodetype; /* node type */
};
struct jffs2_sum_inode_flash
{
jint16_t nodetype; /* node type */
jint32_t inode; /* inode number */
jint32_t version; /* inode version */
jint32_t offset; /* offset on jeb */
jint32_t totlen; /* record length */
} __attribute__((packed));
struct jffs2_sum_dirent_flash
{
jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */
jint32_t totlen; /* record length */
jint32_t offset; /* offset on jeb */
jint32_t pino; /* parent inode */
jint32_t version; /* dirent version */
jint32_t ino; /* == zero for unlink */
uint8_t nsize; /* dirent name size */
uint8_t type; /* dirent type */
uint8_t name[0]; /* dirent name */
} __attribute__((packed));
struct jffs2_sum_xattr_flash
{
jint16_t nodetype; /* == JFFS2_NODETYPE_XATR */
jint32_t xid; /* xattr identifier */
jint32_t version; /* version number */
jint32_t offset; /* offset on jeb */
jint32_t totlen; /* node length */
} __attribute__((packed));
struct jffs2_sum_xref_flash
{
jint16_t nodetype; /* == JFFS2_NODETYPE_XREF */
jint32_t offset; /* offset on jeb */
} __attribute__((packed));
union jffs2_sum_flash
{
struct jffs2_sum_unknown_flash u;
struct jffs2_sum_inode_flash i;
struct jffs2_sum_dirent_flash d;
struct jffs2_sum_xattr_flash x;
struct jffs2_sum_xref_flash r;
};
/* Summary structures used in the memory */
struct jffs2_sum_unknown_mem
{
union jffs2_sum_mem *next;
jint16_t nodetype; /* node type */
};
struct jffs2_sum_inode_mem
{
union jffs2_sum_mem *next;
jint16_t nodetype; /* node type */
jint32_t inode; /* inode number */
jint32_t version; /* inode version */
jint32_t offset; /* offset on jeb */
jint32_t totlen; /* record length */
} __attribute__((packed));
struct jffs2_sum_dirent_mem
{
union jffs2_sum_mem *next;
jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */
jint32_t totlen; /* record length */
jint32_t offset; /* ofset on jeb */
jint32_t pino; /* parent inode */
jint32_t version; /* dirent version */
jint32_t ino; /* == zero for unlink */
uint8_t nsize; /* dirent name size */
uint8_t type; /* dirent type */
uint8_t name[0]; /* dirent name */
} __attribute__((packed));
struct jffs2_sum_xattr_mem
{
union jffs2_sum_mem *next;
jint16_t nodetype;
jint32_t xid;
jint32_t version;
jint32_t offset;
jint32_t totlen;
} __attribute__((packed));
struct jffs2_sum_xref_mem
{
union jffs2_sum_mem *next;
jint16_t nodetype;
jint32_t offset;
} __attribute__((packed));
union jffs2_sum_mem
{
struct jffs2_sum_unknown_mem u;
struct jffs2_sum_inode_mem i;
struct jffs2_sum_dirent_mem d;
struct jffs2_sum_xattr_mem x;
struct jffs2_sum_xref_mem r;
};
/* Summary related information stored in superblock */
struct jffs2_summary
{
uint32_t sum_size; /* collected summary information for nextblock */
uint32_t sum_num;
uint32_t sum_padded;
union jffs2_sum_mem *sum_list_head;
union jffs2_sum_mem *sum_list_tail;
jint32_t *sum_buf; /* buffer for writing out summary */
};
/* Summary marker is stored at the end of every sumarized erase block */
struct jffs2_sum_marker
{
jint32_t offset; /* offset of the summary node in the jeb */
jint32_t magic; /* == JFFS2_SUM_MAGIC */
};
#define JFFS2_SUMMARY_FRAME_SIZE (sizeof(struct jffs2_raw_summary) + sizeof(struct jffs2_sum_marker))
#ifdef CONFIG_JFFS2_SUMMARY /* SUMMARY SUPPORT ENABLED */
#define jffs2_sum_active() (1)
int jffs2_sum_init(struct jffs2_sb_info *c);
void jffs2_sum_exit(struct jffs2_sb_info *c);
void jffs2_sum_disable_collecting(struct jffs2_summary *s);
int jffs2_sum_is_disabled(struct jffs2_summary *s);
void jffs2_sum_reset_collected(struct jffs2_summary *s);
void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s);
int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs,
unsigned long count, uint32_t to);
int jffs2_sum_write_sumnode(struct jffs2_sb_info *c);
int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size);
int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs);
int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, uint32_t ofs);
int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs);
int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs);
int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,
struct jffs2_raw_summary *summary, uint32_t sumlen,
uint32_t *pseudo_random);
#else /* SUMMARY DISABLED */
#define jffs2_sum_active() (0)
#define jffs2_sum_init(a) (0)
#define jffs2_sum_exit(a)
#define jffs2_sum_disable_collecting(a)
#define jffs2_sum_is_disabled(a) (0)
#define jffs2_sum_reset_collected(a)
#define jffs2_sum_add_kvec(a,b,c,d) (0)
#define jffs2_sum_move_collected(a,b)
#define jffs2_sum_write_sumnode(a) (0)
#define jffs2_sum_add_padding_mem(a,b)
#define jffs2_sum_add_inode_mem(a,b,c)
#define jffs2_sum_add_dirent_mem(a,b,c)
#define jffs2_sum_add_xattr_mem(a,b,c)
#define jffs2_sum_add_xref_mem(a,b,c)
#define jffs2_sum_scan_sumnode(a,b,c,d,e) (0)
#endif /* CONFIG_JFFS2_SUMMARY */
#endif /* JFFS2_SUMMARY_H */
|
/****************************************************************************
Copyright (c) 2018 GeometryFactory Sarl (France).
Copyright (C) 2002-2014 Gilles Debunne. All rights reserved.
This file is part of a fork of the QGLViewer library version 2.7.0.
http://www.libqglviewer.com - contact@libqglviewer.com
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 LICENSE file included in the packaging of this file.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/
// $URL: https://github.com/CGAL/cgal/blob/releases/CGAL-4.14.1/GraphicsView/include/CGAL/Qt/mouseGrabber_impl.h $
// $Id: mouseGrabber_impl.h c4b28fd %aI Maxime Gimeno
// SPDX-License-Identifier: GPL-3.0
#ifdef CGAL_HEADER_ONLY
#define CGAL_INLINE_FUNCTION inline
#include <CGAL/license/GraphicsView.h>
#else
#define CGAL_INLINE_FUNCTION
#endif
#include <CGAL/Qt/mouseGrabber.h>
namespace CGAL{
namespace qglviewer{
// Static private variable
CGAL_INLINE_FUNCTION
QList<MouseGrabber *> &MouseGrabber::MouseGrabberPool() {
static QList<MouseGrabber*> MouseGrabberPool_;
void* p = qApp->property("qglviewer mouse grabber pool").value<void*>();
if(p == 0) {
p = (void*)(&MouseGrabberPool_);
qApp->setProperty("qglviewer mouse grabber pool", QVariant::fromValue(p));
}
return *static_cast<QList<MouseGrabber *> * >(p);
}
/*! Default constructor.
Adds the created MouseGrabber in the MouseGrabberPool(). grabsMouse() is set to
\c false. */
CGAL_INLINE_FUNCTION
MouseGrabber::MouseGrabber() : grabsMouse_(false) { addInMouseGrabberPool(); }
/*! Adds the MouseGrabber in the MouseGrabberPool().
All created MouseGrabber are automatically added in the MouseGrabberPool() by
the constructor. Trying to add a MouseGrabber that already
isInMouseGrabberPool() has no effect.
Use removeFromMouseGrabberPool() to remove the MouseGrabber from the list, so
that it is no longer tested with checkIfGrabsMouse() by the CGAL::QGLViewer, and hence
can no longer grab mouse focus. Use isInMouseGrabberPool() to know the current
state of the MouseGrabber. */
CGAL_INLINE_FUNCTION
void MouseGrabber::addInMouseGrabberPool() {
if (!isInMouseGrabberPool())
MouseGrabber::MouseGrabberPool().append(this);
}
/*! Removes the MouseGrabber from the MouseGrabberPool().
See addInMouseGrabberPool() for details. Removing a MouseGrabber that is not in
MouseGrabberPool() has no effect. */
CGAL_INLINE_FUNCTION
void MouseGrabber::removeFromMouseGrabberPool() {
if (isInMouseGrabberPool())
MouseGrabber::MouseGrabberPool().removeAll(const_cast<MouseGrabber *>(this));
}
/*! Clears the MouseGrabberPool().
Use this method only if it is faster to clear the MouseGrabberPool() and then
to add back a few MouseGrabbers than to remove each one independently. Use
CGAL::QGLViewer::setMouseTracking(false) instead if you want to disable mouse
grabbing.
When \p autoDelete is \c true, the MouseGrabbers of the MouseGrabberPool() are
actually deleted (use this only if you're sure of what you do). */
CGAL_INLINE_FUNCTION
void MouseGrabber::clearMouseGrabberPool(bool autoDelete) {
if (autoDelete)
qDeleteAll(MouseGrabber::MouseGrabberPool());
MouseGrabber::MouseGrabberPool().clear();
}
}}
|
/*
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2019 The ManaPlus Developers
* Copyright (C) 2019-2022 Andrei Karas
*
* This file is part of The ManaPlus Client.
*
* 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
* 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 CONST_RENDER_GRAPHICS_H
#define CONST_RENDER_GRAPHICS_H
#include "localconsts.h"
#ifdef __SWITCH__
static const int defaultScreenWidth = 1280;
static const int defaultScreenHeight = 720;
#else
static const int defaultScreenWidth = 800;
static const int defaultScreenHeight = 600;
#endif
#endif // CONST_RENDER_GRAPHICS_H
|
/* $Id: thunar-vfs-config.h.in 22534 2006-07-27 16:16:51Z benny $ */
/*-
* Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __THUNAR_VFS_CONFIG_H__
#define __THUNAR_VFS_CONFIG_H__
#include <exo/exo.h>
#if !defined (THUNAR_VFS_INSIDE_THUNAR_VFS_H) && !defined (THUNAR_VFS_COMPILATION)
#error "Only <thunar-vfs/thunar-vfs.h> can be included directly, this file may disappear or change contents."
#endif
G_BEGIN_DECLS;
/* verify that G_GNUC_WARN_UNUSED_RESULT is defined */
#if !defined(G_GNUC_WARN_UNUSED_RESULT)
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define G_GNUC_WARN_UNUSED_RESULT
#endif /* __GNUC__ */
#endif /* !defined(G_GNUC_WARN_UNUSED_RESULT) */
#define THUNAR_VFS_MAJOR_VERSION 1
#define THUNAR_VFS_MINOR_VERSION 0
#define THUNAR_VFS_MICRO_VERSION 1
#define THUNAR_VFS_CHECK_VERSION(major,minor,micro) \
(THUNAR_VFS_MAJOR_VERSION > (major) \
|| (THUNAR_VFS_MAJOR_VERSION == (major) \
&& THUNAR_VFS_MINOR_VERSION > (minor)) \
|| (THUNAR_VFS_MAJOR_VERSION == (major) \
&& THUNAR_VFS_MINOR_VERSION == (minor) \
&& THUNAR_VFS_MICRO_VERSION >= (micro)))
extern const guint thunar_vfs_major_version;
extern const guint thunar_vfs_minor_version;
extern const guint thunar_vfs_micro_version;
const gchar *thunar_vfs_check_version (guint required_major,
guint required_minor,
guint required_micro) G_GNUC_WARN_UNUSED_RESULT;
G_END_DECLS;
#endif /* !__THUNAR_VFS_CONFIG_H__ */
|
/* include/linux/timed_output.h
*
* Copyright (C) 2008 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _LINUX_TIMED_OUTPUT_H
#define _LINUX_TIMED_OUTPUT_H
struct timed_output_dev {
const char *name;
/* enable the output and set the timer */
void (*enable)(struct timed_output_dev *sdev, int timeout);
/* returns the current number of milliseconds remaining on the timer */
int (*get_time)(struct timed_output_dev *sdev);
/* set and get vibration intensity */
void (*set_duty)(struct timed_output_dev *sdev, int duty);
int (*show_duty)(struct timed_output_dev *sdev);
/* private data */
struct device *dev;
int index;
int state;
};
extern int timed_output_dev_register(struct timed_output_dev *dev);
extern void timed_output_dev_unregister(struct timed_output_dev *dev);
#endif
|
/*
* find_nearby.h - Header for defining static Game_object::find_nearby()
*
* Copyright (C) 2001-2022 The Exult Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FIND_NEARBY_H
#define FIND_NEARBY_H
#include "citerate.h"
#include "chunks.h"
#include "gamemap.h"
#include "gamewin.h"
#include "objs.h"
#include "objiter.h"
#include "ignore_unused_variable_warning.h"
template <typename VecType, typename Cast>
int Game_object::find_nearby(
VecType &vec, // Objects appended to this.
Tile_coord const &pos, // Look near this point.
int shapenum, // Shape to look for.
// -1=any (but always use mask?),
// c_any_shapenum=any.
int delta, // # tiles to look in each direction.
int mask, // See Check_mask() above.
int qual, // Quality, or c_any_qual for any.
int framenum, // Frame #, or c_any_framenum for any.
Cast const &obj_cast, // Cast functor.
bool exclude_okay_to_take
) {
// Check an object in find_nearby() against the mask.
auto Check_mask = [](
Game_object *obj,
int mask
) {
const Shape_info &info = obj->get_info();
if ((mask & (4 | 8)) && // Both seem to be all NPC's.
!info.is_npc())
return false;
Shape_info::Shape_class sclass = info.get_shape_class();
// Egg/barge?
if ((sclass == Shape_info::hatchable || sclass == Shape_info::barge) &&
!(mask & 0x10)) // Only accept if bit 16 set.
return false;
if (info.is_transparent() && // Transparent?
!(mask & 0x80))
return false;
// Invisible object?
if (obj->get_flag(Obj_flags::invisible))
if (!(mask & 0x20)) { // Guess: 0x20 == invisible.
if (!(mask & 0x40)) // Guess: Inv. party member.
return false;
if (!obj->get_flag(Obj_flags::in_party))
return false;
}
return true; // Passed all tests.
};
if (delta < 0) // +++++Until we check all old callers.
delta = 24;
if (shapenum > 0 && mask == 4) // Ignore mask=4 if shape given!
mask = 0;
int vecsize = vec.size();
Game_window *gwin = Game_window::get_instance();
Game_map *gmap = gwin->get_map();
TileRect bounds((pos.tx - delta + c_num_tiles) % c_num_tiles,
(pos.ty - delta + c_num_tiles) % c_num_tiles,
1 + 2 * delta, 1 + 2 * delta);
// Stay within world.
Chunk_intersect_iterator next_chunk(bounds);
TileRect tiles;
int cx;
int cy;
while (next_chunk.get_next(tiles, cx, cy)) {
// Go through objects.
Map_chunk *chunk = gmap->get_chunk(cx, cy);
tiles.x += cx * c_tiles_per_chunk;
tiles.y += cy * c_tiles_per_chunk;
Object_iterator next(chunk->get_objects());
Game_object *obj;
while ((obj = next.get_next()) != nullptr) {
// Check shape.
if (shapenum >= 0) {
if (obj->get_shapenum() != shapenum)
continue;
}
if (qual != c_any_qual && obj->get_quality()
!= qual)
continue;
if (framenum != c_any_framenum &&
obj->get_framenum() != framenum)
continue;
if (!Check_mask(obj, mask))
continue;
if (exclude_okay_to_take && obj->get_flag(Obj_flags::okay_to_take))
continue;
Tile_coord t = obj->get_tile();
if (tiles.has_point(t.tx, t.ty)) {
typename VecType::value_type castobj = obj_cast(obj);
if (castobj) vec.push_back(castobj);
}
}
}
// Return # added.
return vec.size() - vecsize;
}
#endif
|
/* linux/arch/arm/plat-samsung/dma-ops.c
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Samsung DMA Operations
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/amba/pl330.h>
#include <linux/scatterlist.h>
#include <linux/export.h>
#include <mach/dma.h>
static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
struct samsung_dma_info *info)
{
struct dma_chan *chan;
dma_cap_mask_t mask;
struct dma_slave_config slave_config;
void *filter_param;
dma_cap_zero(mask);
dma_cap_set(info->cap, mask);
/*
* If a dma channel property of a device node from device tree is
* specified, use that as the fliter parameter.
*/
filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop :
(void *)dma_ch;
chan = dma_request_channel(mask, pl330_filter, filter_param);
if (info->direction == DMA_DEV_TO_MEM) {
memset(&slave_config, 0, sizeof(struct dma_slave_config));
slave_config.direction = info->direction;
slave_config.src_addr = info->fifo;
slave_config.src_addr_width = info->width;
slave_config.src_maxburst = 1;
dmaengine_slave_config(chan, &slave_config);
} else if (info->direction == DMA_MEM_TO_DEV) {
memset(&slave_config, 0, sizeof(struct dma_slave_config));
slave_config.direction = info->direction;
slave_config.dst_addr = info->fifo;
slave_config.dst_addr_width = info->width;
slave_config.dst_maxburst = 1;
dmaengine_slave_config(chan, &slave_config);
}
return (unsigned)chan;
}
static int samsung_dmadev_release(unsigned ch,
struct s3c2410_dma_client *client)
{
dma_release_channel((struct dma_chan *)ch);
return 0;
}
static int samsung_dmadev_prepare(unsigned ch,
struct samsung_dma_prep_info *info)
{
struct scatterlist sg;
struct dma_chan *chan = (struct dma_chan *)ch;
struct dma_async_tx_descriptor *desc;
switch (info->cap) {
case DMA_SLAVE:
sg_init_table(&sg, 1);
sg_dma_len(&sg) = info->len;
sg_set_page(&sg, pfn_to_page(PFN_DOWN(info->buf)),
info->len, offset_in_page(info->buf));
sg_dma_address(&sg) = info->buf;
desc = dmaengine_prep_slave_sg(chan,
&sg, 1, info->direction, DMA_PREP_INTERRUPT);
break;
case DMA_CYCLIC:
desc = dmaengine_prep_dma_cyclic(chan,
info->buf, info->len, info->period, info->direction);
break;
default:
dev_err(&chan->dev->device, "unsupported format\n");
return -EFAULT;
}
if (!desc) {
dev_err(&chan->dev->device, "cannot prepare cyclic dma\n");
return -EFAULT;
}
desc->callback = info->fp;
desc->callback_param = info->fp_param;
dmaengine_submit((struct dma_async_tx_descriptor *)desc);
return 0;
}
static inline int samsung_dmadev_trigger(unsigned ch)
{
dma_async_issue_pending((struct dma_chan *)ch);
return 0;
}
static inline int samsung_dmadev_flush(unsigned ch)
{
return dmaengine_terminate_all((struct dma_chan *)ch);
}
static struct samsung_dma_ops dmadev_ops = {
.request = samsung_dmadev_request,
.release = samsung_dmadev_release,
.prepare = samsung_dmadev_prepare,
.trigger = samsung_dmadev_trigger,
.started = NULL,
.flush = samsung_dmadev_flush,
.stop = samsung_dmadev_flush,
};
void *samsung_dmadev_get_ops(void)
{
return &dmadev_ops;
}
EXPORT_SYMBOL(samsung_dmadev_get_ops);
|
// SPDX-License-Identifier: GPL-2.0
#ifndef DIVE_QOBJECT_H
#define DIVE_QOBJECT_H
#include "cylinderobjecthelper.h"
#include <QObject>
#include <QString>
#include <QStringList>
#include <QVector>
#include <QVariant>
class DiveObjectHelper {
Q_GADGET
Q_PROPERTY(int number MEMBER number CONSTANT)
Q_PROPERTY(int id MEMBER id CONSTANT)
Q_PROPERTY(int rating MEMBER rating CONSTANT)
Q_PROPERTY(int visibility MEMBER visibility CONSTANT)
Q_PROPERTY(QString date READ date CONSTANT)
Q_PROPERTY(QString time READ time CONSTANT)
Q_PROPERTY(int timestamp MEMBER timestamp CONSTANT)
Q_PROPERTY(QString location MEMBER location CONSTANT)
Q_PROPERTY(QString gps MEMBER gps CONSTANT)
Q_PROPERTY(QString gps_decimal MEMBER gps_decimal CONSTANT)
Q_PROPERTY(QVariant dive_site MEMBER dive_site CONSTANT)
Q_PROPERTY(QString duration MEMBER duration CONSTANT)
Q_PROPERTY(bool noDive MEMBER noDive CONSTANT)
Q_PROPERTY(QString depth MEMBER depth CONSTANT)
Q_PROPERTY(QString divemaster MEMBER divemaster CONSTANT)
Q_PROPERTY(QString buddy MEMBER buddy CONSTANT)
Q_PROPERTY(QString airTemp MEMBER airTemp CONSTANT)
Q_PROPERTY(QString waterTemp MEMBER waterTemp CONSTANT)
Q_PROPERTY(QString notes MEMBER notes CONSTANT)
Q_PROPERTY(QString tags MEMBER tags CONSTANT)
Q_PROPERTY(QString gas MEMBER gas CONSTANT)
Q_PROPERTY(QString sac MEMBER sac CONSTANT)
Q_PROPERTY(QString weightList MEMBER weightList CONSTANT)
Q_PROPERTY(QStringList weights MEMBER weights CONSTANT)
Q_PROPERTY(bool singleWeight MEMBER singleWeight CONSTANT)
Q_PROPERTY(QString suit MEMBER suit CONSTANT)
Q_PROPERTY(QStringList cylinderList READ cylinderList CONSTANT)
Q_PROPERTY(QStringList cylinders MEMBER cylinders CONSTANT)
Q_PROPERTY(int maxcns MEMBER maxcns CONSTANT)
Q_PROPERTY(int otu MEMBER otu CONSTANT)
Q_PROPERTY(QString sumWeight MEMBER sumWeight CONSTANT)
Q_PROPERTY(QStringList getCylinder MEMBER getCylinder CONSTANT)
Q_PROPERTY(QStringList startPressure MEMBER startPressure CONSTANT)
Q_PROPERTY(QStringList endPressure MEMBER endPressure CONSTANT)
Q_PROPERTY(QStringList firstGas MEMBER firstGas CONSTANT)
public:
DiveObjectHelper(); // This is only to be used by Qt's metatype system!
DiveObjectHelper(const struct dive *dive);
int number;
int id;
int rating;
int visibility;
QString date() const;
timestamp_t timestamp;
QString time() const;
QString location;
QString gps;
QString gps_decimal;
QVariant dive_site;
QString duration;
bool noDive;
QString depth;
QString divemaster;
QString buddy;
QString airTemp;
QString waterTemp;
QString notes;
QString tags;
QString gas;
QString sac;
QString weightList;
QStringList weights;
bool singleWeight;
QString suit;
QStringList cylinderList() const;
QStringList cylinders;
int maxcns;
int otu;
QString sumWeight;
QStringList getCylinder;
QStringList startPressure;
QStringList endPressure;
QStringList firstGas;
};
// This is an extended version of DiveObjectHelper that also keeps track of cylinder data.
// It is used by grantlee to display structured cylinder data.
// Note: this grantlee feature is undocumented. If there turns out to be no users, we might
// want to remove this class.
class DiveObjectHelperGrantlee : public DiveObjectHelper {
Q_GADGET
Q_PROPERTY(QVector<CylinderObjectHelper> cylinderObjects MEMBER cylinderObjects CONSTANT)
public:
DiveObjectHelperGrantlee();
DiveObjectHelperGrantlee(const struct dive *dive);
QVector<CylinderObjectHelper> cylinderObjects;
};
Q_DECLARE_METATYPE(DiveObjectHelper)
Q_DECLARE_METATYPE(DiveObjectHelperGrantlee)
#endif
|
#ifndef ENTITE_H
#define ENTITE_H
#define _USE_MATH_DEFINES
#include <math.h>
#include <SDL.h>
#include "Carte.h"
#include "Struct.h"
#include "Texture.h"
#define M_PI_8 M_PI_4 / 2.
/** Classe abstraite qui regroupe toutes les fonctionnalités communes aux entités qui apparaissent dans une arène.
*/
class Entite
{
public:
// Constructeurs
//---------------------------------
/** Constructeur par défaut.
*
* Initialise les attributs à des valeurs par défaut.
*/
Entite();
/** Constructeur avec position de départ.
*
* Appel Entite::Entite(Coordonnees).
*
* Initialise l'image du Joueur.
*
* @param pos_depart La position de départ de l'entité.
*/
Entite(Coordonnees pos_depart);
/** Constructeur de copie.
*
* Permet de créer une nouvelle instance d'Entite identique à celle donnée en paramètre sauf pour l'image qui n'est pas copié et doit être allouée après.
*
* @param entite L'entité à copier.
*/
Entite(Entite const &entite);
//---------------------------------
// Destructeur
//---------------------------------
/** Destructeur par défaut.
*
* Il est virtuel car une classe abstraite ne peut avoir de destructeur.
*/
virtual ~Entite();
//---------------------------------
// Fonctions membres publiques
//---------------------------------
/** Affiche l'image de l'entité si elle est sous la caméra.
*
* @param camera La caméra du niveau.
*/
void render(SDL_Rect const &camera);
/** Met à jour l'entité.
*
* Toutes les actions que l'entité effectue au cours du niveau partent de cette fonction.
*
* @param carte La Carte sur laquelle se situe l'entité.
*/
virtual void update(Carte const &carte) = 0;
/** Retourne la direction de déplacement de l'entité (en radians).
*
* @return #m_direction_deplacement La direction de déplacement de l'entité.
*/
double getDirectionDeplacement() const;
/** Retourne la direction de visée de l'entité (en radians).
*
* @return #m_direction_visee La direction de visée de l'entité.
*/
double getDirectionVisee() const;
/** Retourne la hauteur de l'image de l'entité.
*
* @return La hauteur de #m_image.
*/
int getHauteurImage() const;
/** Retourne la largeur de l'image de l'entité.
*
* @return La largeur de #m_image.
*/
int getLargeurImage() const;
/** Retourne la position de l'entité.
*
* @return #m_position.
*/
Coordonnees getPosition() const;
/** Retourne la structure qui contient les composantes de la vitesse de l'entité.
*
* @return #m_vitesse La vitesse de l'entité.
*/
Coordonnees getVitesse() const;
/** Retourne la vitesse maximum de l'entité.
*
* @return #m_vitesse_max La vitesse maximum de l'entité.
*/
int getVitesseMax() const;
/** Permet de modifier la direction de déplacement de l'entité.
*
* @param p_direction_deplacement La nouvelle direction de déplacement de l'entité.
*/
void setDirectionDeplacement(double p_direction_deplacement);
/** Permet de modifier la position de l'entité.
*
* @param p_position La nouvelle position de l'entité.
*/
void setPosition(Coordonnees p_position);
//---------------------------------
protected:
// Attributs protégés
//---------------------------------
/** La direction dans laquelle se déplace l'entité (en radians).
*
* Comprise entre 0 et 2*Pi radians.
*/
double m_direction_deplacement;
/** La direction vers laquelle pointe l'entité (en radians).
*
* Comprise entre 0 et 2*Pi radians.
*/
double m_direction_visee;
/** L'image de l'entité à afficher à l'écran.
*/
Texture* m_image;
/** Les Coordonnees de l'entité sur la carte (en px).
*/
Coordonnees m_position;
/** Les composantes de la vitesse de l'entité.
*/
Coordonnees m_vitesse;
/** La vitesse maximum de l'entité.
*/
int m_vitesse_max;
//---------------------------------
private:
};
#endif // ENTITE_H |
/*
* BlizzLikeCore integrates as part of this file: CREDITS.md and LICENSE.md
*/
#ifndef BLIZZLIKE_FLEEINGMOVEMENTGENERATOR_H
#define BLIZZLIKE_FLEEINGMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
#include "DestinationHolder.h"
#include "Traveller.h"
#include "MapManager.h"
template<class T>
class FleeingMovementGenerator
: public MovementGeneratorMedium< T, FleeingMovementGenerator<T> >
{
public:
FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {}
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
bool Update(T &, const uint32 &);
bool GetDestination(float &x, float &y, float &z) const;
MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; }
private:
void _setTargetLocation(T &owner);
bool _getPoint(T &owner, float &x, float &y, float &z);
bool _setMoveData(T &owner);
void _Init(T &);
bool is_water_ok :1;
bool is_land_ok :1;
bool i_only_forward:1;
float i_caster_x;
float i_caster_y;
float i_caster_z;
float i_last_distance_from_caster;
float i_to_distance_from_caster;
float i_cur_angle;
uint64 i_frightGUID;
TimeTracker i_nextCheckTime;
DestinationHolder< Traveller<T> > i_destinationHolder;
};
class TimedFleeingMovementGenerator
: public FleeingMovementGenerator<Creature>
{
public:
TimedFleeingMovementGenerator(uint64 fright, uint32 time) :
FleeingMovementGenerator<Creature>(fright),
i_totalFleeTime(time) {}
MovementGeneratorType GetMovementGeneratorType() { return TIMED_FLEEING_MOTION_TYPE; }
bool Update(Unit &, const uint32 &);
void Finalize(Unit &);
private:
TimeTracker i_totalFleeTime;
};
#endif
|
// Copyright 2014 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include "Common/Event.h"
#include "Common/Flag.h"
#include "Core/HW/GCMemcard/GCMemcard.h"
class PointerWrap;
class MemoryCard : public MemoryCardBase
{
public:
MemoryCard(const std::string& filename, int card_index, u16 size_mbits = MemCard2043Mb);
~MemoryCard();
void FlushThread();
void MakeDirty();
s32 Read(u32 src_address, s32 length, u8* dest_address) override;
s32 Write(u32 dest_address, s32 length, const u8* src_address) override;
void ClearBlock(u32 address) override;
void ClearAll() override;
void DoState(PointerWrap& p) override;
private:
std::string m_filename;
std::unique_ptr<u8[]> m_memcard_data;
std::unique_ptr<u8[]> m_flush_buffer;
std::thread m_flush_thread;
std::mutex m_flush_mutex;
Common::Event m_flush_trigger;
Common::Flag m_dirty;
};
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_
#define CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_
#include <string>
#include <vector>
#include "apps/app_shim/app_shim_handler_mac.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
namespace IPC {
struct ChannelHandle;
class ChannelProxy;
class Message;
}
class AppShimHost : public IPC::Listener,
public IPC::Sender,
public apps::AppShimHandler::Host,
public base::NonThreadSafe {
public:
AppShimHost();
virtual ~AppShimHost();
void ServeChannel(const IPC::ChannelHandle& handle);
protected:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnChannelError() OVERRIDE;
virtual bool Send(IPC::Message* message) OVERRIDE;
private:
void OnLaunchApp(const base::FilePath& profile_dir,
const std::string& app_id,
apps::AppShimLaunchType launch_type,
const std::vector<base::FilePath>& files);
void OnFocus(apps::AppShimFocusType focus_type,
const std::vector<base::FilePath>& files);
void OnSetHidden(bool hidden);
void OnQuit();
virtual void OnAppLaunchComplete(apps::AppShimLaunchResult result) OVERRIDE;
virtual void OnAppClosed() OVERRIDE;
virtual void OnAppHide() OVERRIDE;
virtual void OnAppRequestUserAttention() OVERRIDE;
virtual base::FilePath GetProfilePath() const OVERRIDE;
virtual std::string GetAppId() const OVERRIDE;
void Close();
scoped_ptr<IPC::ChannelProxy> channel_;
std::string app_id_;
base::FilePath profile_path_;
bool initial_launch_finished_;
};
#endif
|
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
vtkFoamReader
Description
SourceFiles
vtkFoamReader.cxx
\*---------------------------------------------------------------------------*/
#ifndef vtkFoamReader_h
#define vtkFoamReader_h
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "vtkDataSetSource.h"
#include "vtkFoamData.h"
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
namespace Foam
{
class vtkFoam;
}
class vtkPoints;
class vtkDataArraySelection;
class vtkDataArrayCollection;
class vtkCallbackCommand;
/*---------------------------------------------------------------------------*\
Class vtkFoamReader Declaration
\*---------------------------------------------------------------------------*/
class VTK_IO_EXPORT vtkFoamReader
:
public vtkDataSetSource
{
public:
//- Standard VTK class creation function
static vtkFoamReader *New();
//- Standard VTK class type and revision declaration macro
vtkTypeRevisionMacro(vtkFoamReader,vtkDataSetSource);
//- Standard VTK class print function
void PrintSelf(ostream& os, vtkIndent indent);
// File name of FOAM datafile to read
void SetFileName(const char *);
//vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
// GUI update control
vtkSetMacro(UpdateGUI, int);
vtkGetMacro(UpdateGUI, int);
// FOAM mesh caching control
vtkSetMacro(CacheMesh, int);
vtkGetMacro(CacheMesh, int);
// Time-step slider control
vtkSetMacro(TimeStep, int);
vtkGetMacro(TimeStep, int);
vtkSetVector2Macro(TimeStepRange, int);
vtkGetVector2Macro(TimeStepRange, int);
// Control of the upper and lower limits on the number of times
// displayed in the selection list
vtkSetVector2Macro(TimeStepLimits, int);
vtkGetVector2Macro(TimeStepLimits, int);
// Time selection list control
vtkDataArraySelection* GetTimeSelection();
int GetNumberOfTimeArrays();
const char* GetTimeArrayName(int index);
int GetTimeArrayStatus(const char* name);
void SetTimeArrayStatus(const char* name, int status);
// Region selection list control
vtkDataArraySelection* GetRegionSelection();
int GetNumberOfRegionArrays();
const char* GetRegionArrayName(int index);
int GetRegionArrayStatus(const char* name);
void SetRegionArrayStatus(const char* name, int status);
// volField selection list control
vtkDataArraySelection* GetVolFieldSelection();
int GetNumberOfVolFieldArrays();
const char* GetVolFieldArrayName(int index);
int GetVolFieldArrayStatus(const char* name);
void SetVolFieldArrayStatus(const char* name, int status);
// pointField selection list control
vtkDataArraySelection* GetPointFieldSelection();
int GetNumberOfPointFieldArrays();
const char* GetPointFieldArrayName(int index);
int GetPointFieldArrayStatus(const char* name);
void SetPointFieldArrayStatus(const char* name, int status);
// SetNthOutput provided so that vtkFoam can access it
void SetNthOutput(int num, vtkDataObject *output)
{
vtkDataSetSource::SetNthOutput(num, output);
}
// Standard VTK ExecuteInformation function overriding the base-class.
// Called by ParaView before GUI is displayed.
virtual void ExecuteInformation();
// Callback registered with the SelectionObserver
// for all the selection lists
static void SelectionModifiedCallback
(
vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata
);
void SelectionModified();
protected:
vtkFoamReader();
~vtkFoamReader();
// Standard VTK execute function overriding the base-class.
// Called by ParaView when Accept is pressed.
void Execute();
// Cache for the outputs. These are stored before the end of Execute()
// and re-instated at the beginning because the Outputs would disappear
// otherwise.
vtkFoamData* StoredOutputs;
// FOAM file name (*.foam)
char *FileName;
//BTX
Foam::vtkFoam* foamData_;
//ETX
int CacheMesh;
int UpdateGUI;
int UpdateGUIOld;
int TimeStep;
int TimeStepRange[2];
int TimeStepLimits[2];
vtkDataArraySelection* TimeSelection;
vtkDataArraySelection* RegionSelection;
vtkDataArraySelection* VolFieldSelection;
vtkDataArraySelection* PointFieldSelection;
// The observer to modify this object when the array selections are modified
vtkCallbackCommand* SelectionObserver;
private:
vtkFoamReader(const vtkFoamReader&); // Not implemented.
void operator=(const vtkFoamReader&); // Not implemented.
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
|
#ifndef EFFECT_PARAMETER_H_
#define EFFECT_PARAMETER_H_
#include <Arduino.h>
#include <Effectrino.h>
USING_NAMESPASE_EFFECTRINO
BEGIN_EFFECTRINO_NAMESPACE
class ModuleEffectParameter
{
// TODO hardware bindings
};
END_EFFECTRINO_NAMESPACE
#endif
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#include <avl.h>
#include "flx_instrument.h"
#include "disas.h"
#include "flx_bbl.h"
#include "flx_disas.h"
/*
* Small wrapper around Qemu disassembly functionality
* in order to disassemble a single basic block into
* a buffer.
*/
static uint32_t
flx_disas_bbl_size(uint32_t addr){
flx_bbl* bbl = flx_bbl_search(addr);
if(!bbl){
printf("FATA: flx_disas_bbl could not find basic block\n");
return 0;
}
return bbl->size;
}
static flx_disassembly*
flx_disas_alloc(uint8_t* buf, uint32_t size){
flx_disassembly* disas = malloc(sizeof(flx_disassembly));
disas->s = buf;
disas->size = size;
return disas;
}
flx_disassembly*
flx_disas_bbl(uint32_t addr){
uint32_t size = flx_disas_bbl_size(addr);
if(!size)
return NULL;
uint8_t* buf = malloc(size);
if(cpu_memory_rw_debug(current_environment, addr, buf, size, 0) != 0){
free(buf);
return NULL;
}
int fds[2];
if(pipe(fds)){
free(buf);
return NULL;
}
FILE* disas_read = fdopen(fds[0],"r");
FILE* disas_write = fdopen(fds[1],"w");
disas_relative(disas_write, buf, size, addr);
fclose(disas_write);
free(buf);
const uint8_t buf_size = 128;
uint32_t tmp_size = buf_size;
uint8_t* tmp_buf = malloc(tmp_size);
uint32_t disas_size = 0;
while(fread(&tmp_buf[disas_size], 1, 1, disas_read)){
disas_size++;
if(disas_size >= tmp_size){
tmp_size += buf_size;
tmp_buf = realloc(tmp_buf, tmp_size);
}
}
if(ferror(disas_read)){
free(tmp_buf);
return NULL;
}
fclose(disas_read);
return flx_disas_alloc(tmp_buf, disas_size);
}
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(reax/c/bonds,FixReaxCBonds)
#else
#ifndef LMP_FIX_REAXC_BONDS_H
#define LMP_FIX_REAXC_BONDS_H
#include "stdio.h"
#include "fix.h"
#include "pointers.h"
namespace LAMMPS_NS {
class FixReaxCBonds : public Fix {
public:
FixReaxCBonds(class LAMMPS *, int, char **);
~FixReaxCBonds();
int setmask();
void init();
void setup(int);
void end_of_step();
private:
int me, nprocs, nmax, ntypes, maxsize;
int nrepeat, irepeat, repeat, nfreq;
int *numneigh, **neighid, **tmpid;
double *sbo, *nlp, *avq, **abo, **tmpabo;
FILE *fp;
void allocate();
void destroy();
void Output_ReaxC_Bonds(bigint, FILE *);
void GatherBond(struct _reax_system*, struct _reax_list*);
void FindBond(struct _reax_system*, struct _reax_list*, int &);
void PassBuffer(struct _reax_system*, double *, int &);
void RecvBuffer(struct _reax_system*, double *, int, int, int, int);
int nint(const double &);
double memory_usage();
bigint nvalid, nextvalid();
struct _reax_system *system;
struct _reax_list *lists;
class PairReaxC *reaxc;
class NeighList *list;
};
}
#endif
#endif
|
/*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Copyright (c) 2017, GSI Helmholtz Centre for Heavy Ion Research
*/
/*
* This code is based on the book: Mastering Algorithms with C,
* Kyle London, First Edition 1999.
*/
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "list.h"
#include "chashtable.h"
/* Some known string hash functions */
uint32_t hash_sdbm_str(const void *key)
{
const char *str = key;
uint32_t hash = 0;
while (*str++)
hash = *str + (hash << 6) + (hash << 16) - hash;
return hash;
}
uint32_t hash_dek_str(const void *key)
{
const char *str = key;
uint32_t hash = strlen(str);
while (*str++)
hash = ((hash << 5) ^ (hash >> 27)) ^ *str;
return hash;
}
uint32_t hash_djb_str(const void *key)
{
const char *str = key;
uint32_t hash = 5381;
while (*str++)
hash = ((hash << 5) + hash) + *str;
return hash;
}
int chashtable_init(chashtable_t *chashtable, uint32_t buckets,
uint32_t (*h) (const void *key),
int (*match) (const void *key1, const void *key2),
void (*destroy) (void *data))
{
if (chashtable->table)
return RC_ERROR;
chashtable->table = malloc(buckets * sizeof(list_t));
if (chashtable->table == NULL)
return RC_ERROR;
chashtable->buckets = buckets;
for (uint32_t b = 0; b < chashtable->buckets; b++)
list_init(&chashtable->table[b], destroy);
chashtable->h = h;
chashtable->match = match;
chashtable->destroy = destroy;
chashtable->size = 0;
return RC_SUCCESS;
}
void chashtable_destroy(chashtable_t *chashtable)
{
for (uint32_t b = 0; b < chashtable->buckets; b++)
list_destroy(&chashtable->table[b]);
free(chashtable->table);
memset(chashtable, 0, sizeof(chashtable_t));
}
int chashtable_insert(chashtable_t *chashtable, const void *data)
{
int rc;
void *temp = NULL;
/* If data is already in hashtable, do nothing. */
rc = chashtable_lookup(chashtable, data, &temp);
if (rc == RC_DATA_FOUND)
return RC_DATA_ALREADY_INSERTED;
/* Hash the key. */
const uint32_t bucket = chashtable->h(data) %
chashtable->buckets;
/* Insert data into the corresponding bucket. */
rc = list_ins_next(&chashtable->table[bucket], NULL, data);
if (rc == RC_SUCCESS)
chashtable->size++;
return rc;
}
int chashtable_remove(chashtable_t *chashtable, const void *lookup_data,
void **data)
{
int rc;
list_node_t *prev = NULL;
const uint32_t bucket = chashtable->h(lookup_data) %
chashtable->buckets;
/* Iterate over linked-list in bucket. */
for (list_node_t *node = list_head(&chashtable->table[bucket]);
node != NULL;
node = list_next(node)) {
rc = (chashtable->match(lookup_data, list_data(node)));
if (rc == RC_SUCCESS) {
/* Remove the data in linked-list in bucket. */
rc = list_rem_next(&chashtable->table[bucket],
prev, data);
if (rc == RC_SUCCESS) {
chashtable->size--;
return rc;
} else
return RC_ERROR;
}
prev = node;
}
return RC_DATA_NOT_FOUND;
}
int chashtable_lookup(const chashtable_t *chashtable, const void *lookup_data,
void **data)
{
int rc;
const uint32_t bucket = chashtable->h(lookup_data) %
chashtable->buckets;
for (list_node_t *node = list_head(&chashtable->table[bucket]);
node != NULL;
node = list_next(node)) {
rc = chashtable->match(lookup_data, list_data(node));
if (rc == RC_SUCCESS) {
*data = list_data(node);
return RC_DATA_FOUND;
}
}
return RC_DATA_NOT_FOUND;
}
void for_each_key(const chashtable_t *chashtable, void (*callback)(void *data))
{
for (uint32_t b = 0; b < chashtable->buckets; b++)
for (list_node_t *node = list_head(&chashtable->table[b]);
node != NULL;
node = list_next(node))
callback(list_data(node));
}
|
/*
Copyright 2009 David Nolden <david.nolden.kdevelop@art-master.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
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 KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H
#define KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H
#include <language/duchain/navigation/abstractnavigationcontext.h>
#include <language/duchain/problem.h>
#include <language/languageexport.h>
#include <qpointer.h>
namespace KDevelop {
class KDEVPLATFORMLANGUAGE_EXPORT ProblemNavigationContext : public AbstractNavigationContext
{
public:
ProblemNavigationContext(KDevelop::ProblemPointer problem);
~ProblemNavigationContext();
virtual QString name() const;
virtual QString html(bool shorten = false);
virtual QWidget* widget() const;
virtual bool isWidgetMaximized() const;
private:
QPointer<QWidget> m_widget;
ProblemPointer m_problem;
};
}
#endif // KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H
|
/*
* memset.c -- provides memset() if necessary.
*
* $Id: memset.c,v 1.1.1.1 2010/07/26 21:11:06 simple Exp $
*/
/*
* Copyright (C) 1997 Robey Pointer
* Copyright (C) 2000 - 2010 Eggheads Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "main.h"
#include "memset.h"
#ifndef HAVE_MEMSET
void *egg_memset(void *dest, int c, size_t n)
{
while (n--)
*((u_8bit_t *) dest)++ = c;
return dest;
}
#endif /* !HAVE_MEMSET */
|
//
// ConnectionController.h
// CERN
//
// Created by Timur Pocheptsov on 1/17/13.
// Copyright (c) 2013 CERN. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol ConnectionController <NSObject>
@required
- (void) cancelAnyConnections;
@end
namespace CernAPP {
void CancelConnections(UIViewController *controller);
} |
void handler(int PIN_ID){
if(isSystemLocked){
return;
}
//Getting the reader associated to the PIN that raised the event
CardReader* reader = readers[PIN_ID];
//Executing the function atomically
pthread_mutex_lock(&reader->lockObj);
//Getting current time
struct timespec newTime;
if(clock_gettime(CLOCK_REALTIME, &newTime) != 0)
debugf(("Error N° : %d\n", errno));
//Buffer empty, start of frame
if(reader->bitCount == 0){
reader->lastUpdated = newTime;
reader->tag[reader->bitCount] = values[PIN_ID];
reader->bitCount++;
}
//Buffer not empty
else{
//Last bit is outdated = corrupted buffer
if(isTimedOut(reader->lastUpdated, newTime)){
//printf("Buffer size %d \n", reader->bitCount);
reader->bitCount = 1;
reader->tag[0] = values[PIN_ID];
reader->lastUpdated = newTime;
}
//End of frame
else if(reader->bitCount == FRAME_SIZE-1) {
reader->tag[reader->bitCount] = values[PIN_ID];
reader->bitCount++;
if(parityCheck(&reader->tag)){
long tagValue = getIntFromTag(reader->tag);
int isAccepted;
debugf(("[%s] Parity check with %d bits succeeded: %s, value = %ld => ", reader->name, reader->bitCount, reader->tag, tagValue));
if(!reader->isOpening == 1){
if(checkAuthorization(&tagValue, reader) == 1){
isAccepted = 1;
pthread_t thread;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
int error = 1;
debugf(("Authorized !\n"));
error = pthread_create(&thread, &attr, &grantAccess, readers[PIN_ID]);
if(error!=0)
debugf(("error: %d", error));
}
else{
isAccepted = 0;
pthread_t thread;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
int error = 1;
debugf(("Refused !\n"));
error = pthread_create(&thread, &attr, &refuseAccess, readers[PIN_ID]);
if(error!=0)
debugf(("error: %d", error));
}
}
else{
isAccepted = 2;
debugf(("Reader already in use\n"));
}
createLogEntry(reader->name, tagValue, isAccepted);
}
else{
//printf("[%s] Parity check with %d bits failed : %s\n", reader->name, reader->bitCount, reader->tag);
}
reader->bitCount = 0;
}
//Add bit
else{
reader->tag[reader->bitCount] = values[PIN_ID];
reader->bitCount++;
reader->lastUpdated = newTime;
}
}
pthread_mutex_unlock(&reader->lockObj);
}
//Return wether the delay between last bit and previous bit is superior to BIT_TIMEOUT
int isTimedOut(struct timespec start, struct timespec end){
long int secDelta = end.tv_sec - start.tv_sec;
long int nsecDelta = end.tv_nsec - start.tv_nsec;
if(secDelta == 0){
if(nsecDelta < BIT_TIMEOUT ) return 0;
}
else{
if(((SECOND_IN_NS * secDelta - start.tv_nsec) + end.tv_nsec) < BIT_TIMEOUT ) return 0;
}
//printf("%ld %ld\n", secDelta, nsecDelta);
return 1;
}
void callback0(){handler(PIN_0);}
void callback1(){handler(PIN_1);}
void callback2(){handler(PIN_2);}
void callback3(){handler(PIN_3);}
void callback4(){handler(PIN_4);}
void callback7(){handler(PIN_7);}
void callback8(){handler(PIN_8);}
void callback9(){handler(PIN_9);}
void callback10(){handler(PIN_10);}
void callback11(){handler(PIN_11);}
void callback14(){handler(PIN_14);}
void callback15(){handler(PIN_15);}
void callback17(){handler(PIN_17);}
void callback18(){handler(PIN_18);}
void callback21(){handler(PIN_21);}
void callback22() {handler(PIN_22);}
void callback23() {handler(PIN_23);}
void callback24() {handler(PIN_24);}
void callback25() {handler(PIN_25);}
void callback27() {handler(PIN_27);}
void callback28() {handler(PIN_28);}
void callback29() {handler(PIN_29);}
void callback30() {handler(PIN_30);}
void callback31() {handler(PIN_31);}
|
//
// ActivityLogViewController.h
// WordPress
//
// Created by Aaron Douglas on 6/7/13.
// Copyright (c) 2013 WordPress. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ActivityLogViewController : UITableViewController
@end
|
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <AIUtilities/AIFileManagerAdditions.h>
#import <AIUtilities/AIParagraphStyleAdditions.h>
#import <Adium/AIWindowController.h>
@class AIEmoticonPack;
@interface AIEmoticonPreferences : AIWindowController <NSTableViewDelegate, NSTableViewDataSource>
{
IBOutlet NSTableView *table_emoticonPacks;
NSMutableArray *emoticonPackPreviewControllers;
IBOutlet NSTableView *table_emoticons;
IBOutlet NSTextField *textField_packTitle;
IBOutlet NSButton *button_OK;
IBOutlet NSButton *checkbox_emoticonMenu;
NSButtonCell *checkCell;
AIEmoticonPack *selectedEmoticonPack;
NSMutableDictionary *emoticonImageCache;
NSIndexSet *dragRows;
BOOL viewIsOpen;
}
- (void)toggledPackController:(id)packController;
- (void)emoticonXtrasDidChange;
@end
|
/* bsp.h
*
* This include file contains all Patmos simulator definitions.
*
* Project: T-CREST - Time-Predictable Multi-Core Architecture for Embedded Systems
*
* Copyright (C) GMVIS Skysoft S.A., 2013
* @author André Rocha
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
*/
#ifndef _BSP_H
#define _BSP_H
#ifdef __cplusplus
extern "C" {
#endif
/* Patmos CPU variant: PASIM */
#define PASIM 1
/* Constants */
/*
* Information placed in the linkcmds file.
*/
#define RAM_START 0x001C0000
#define RAM_SIZE 4M
#define RAM_END RAM_START + RAM_SIZE
#define PROM_START 0x00000000
#define PROM_SIZE 256M
#define PROM_END PROM_START + PROM_SIZE
#ifndef ASM
#include <bspopts.h>
#include <rtems.h>
#include <rtems/clockdrv.h>
#include <rtems/console.h>
extern int CLOCK_SPEED;
extern int end; /* last address in the program */
/* miscellaneous stuff assumed to exist */
rtems_isr_entry set_vector( /* returns old vector */
rtems_isr_entry handler, /* isr routine */
rtems_vector_number vector, /* vector number */
int type /* RTEMS or RAW intr */
);
void BSP_fatal_return( void );
void bsp_spurious_initialize( void );
#endif /* !ASM */
#ifdef __cplusplus
}
#endif
#include <pasim.h>
#endif
|
/* ftnfdel.h */
#ifndef _FTNFDELE_H
#define _FTNFDELE_H
void Delete(int, int, char *);
#endif
|
#ifndef __PXA3XX_BBT_H__
#define __PXA3XX_BBT_H__
#define PXA_RELOC_HEADER 0x524e
#define PXA_BEGIN_SLOT 2
/* New BBM scheme */
#define BOOT_PRAT_MAX 10
#define PXA_NEW_BBM_HEADER 0x4D424254
#define PXA_PART_IDET_1 0x4D52564C
#define PXA_PART_IDET_2 0x204D5054
#define BBM_FULL_MASK 0xffffffff
#define BBM_HALF_MASK 0x0000ffff
#define BBT_TYPE_FACT 0x46616374
#define BBT_TYPE_RUNT 0x52756E74
#define PART_PHYS 0x50687973
#define PART_LOGI 0x4C6F6769
#define RP_UPWD 0x55505744
#define RP_DNWD 0x444E5755
enum bbm_type {
BBM_NONE = 0,
BBM_LEGACY,
BBM_NEW,
};
enum bbm_order {
ORDER_REVERSE = 0,
ORDER_POSITIVE,
};
enum bbt_state {
BBT_NOINIT = 0,
BBT_INITED,
BBT_FORCE_NOINIT,
};
struct reloc_item {
unsigned short from;
unsigned short to;
};
struct reloc_table {
unsigned short header;
unsigned short total;
};
struct pxa3xx_bbt {
uint32_t ident;
uint32_t ver;
uint32_t type;
uint32_t reserved_1;
uint32_t reserved_2;
uint32_t entry_num;
uint32_t bbt_loc;
uint32_t reserved_3;
uint32_t reserved_4;
uint32_t reserved_5;
union {
struct reloc_item *reloc;
uint32_t *fact_bad;
};
};
struct pxa3xx_partinfo {
uint32_t type; // Logi or Phys
uint32_t usage; // Partition name
uint32_t identifier; // for distinguish same name
uint32_t attrs; // r/w and permisson control
uint64_t start_addr; // addr of LSB of start block
uint64_t end_addr; // addr of MSB of end block
uint64_t rp_start;
uint64_t rp_size;
uint32_t rp_algo;
uint32_t rbbt_type;
uint64_t rbbt_start;
uint64_t rbbt_start_back;
uint64_t reserved;
};
struct pxa3xx_part {
uint64_t identifier;
uint32_t version;
uint32_t part_num;
uint64_t reserved;
};
struct pxa3xx_legacy_bbm {
int current_slot;
int max_reloc_entry;
struct reloc_table *table;
struct reloc_item *reloc;
};
struct pxa3xx_new_bbm {
int main_block;
int back_block;
int update_indicator;
struct pxa3xx_part *part;
struct pxa3xx_bbt *fbbt;
struct pxa3xx_bbt *rbbt;
struct pxa3xx_partinfo *partinfo;
loff_t *rbbt_offset;
int *max_reloc_entry;
};
struct pxa3xx_bbm {
int bbm_type;
int is_init;
int no_sync;
void *data_buf;
char *rel_dist;
void (*uninit)(struct mtd_info *mtd);
loff_t (*search)(struct mtd_info *mtd, loff_t ofs);
struct mtd_partition * (*check_partition)
(struct mtd_info *mtd, struct mtd_partition *part, int *num);
};
int pxa3xx_scan_bbt(struct mtd_info *mtd);
int pxa3xx_block_bad(struct mtd_info *mtd, loff_t ofs, int allowbbt);
int pxa3xx_update_bbt(struct mtd_info *mtd, loff_t offs);
int pxa3xx_block_markbad(struct mtd_info *mtd, loff_t ofs);
int pxa3xx_bbm_recovery(struct mtd_info *mtd, int bbm_type);
#endif
|
#ifndef __ASM_ARCH_RESET_H
#define __ASM_ARCH_RESET_H __FILE__
extern void (*s3c24xx_reset_hook)(void);
#endif /* __ASM_ARCH_RESET_H */
|
/**************************************
* WRAPPERS FOR MALLOC/REALLOC/FREE *
*************************************/
#include <assert.h>
#include "pvslib.h"
/*
* Fatal error: out of memory
*/
void out_of_memory() {
fprintf(stderr, "Out of memory\n");
exit(PVS2C_EXIT_OUT_OF_MEMORY);
}
/*
* Local malloc: abort if out of memory.
*
* Special case: if size = 0, malloc(size) may
* return NULL on some systems, but that does not
* mean we're out of memory.
*/
void *safe_malloc(size_t size) {
void *tmp;
tmp = malloc(size);
if (tmp == NULL && size > 0) {
out_of_memory();
}
return tmp;
}
/*
* Safer realloc to support lazy allocation.
* If ptr == NULL, call malloc otherwise call realloc.
* Abort if out of memory.
*
* NOTE: C99 specifies that realloc should behave like
* malloc if ptr is NULL. This is what the Linux default
* malloc does, but it's not clear whether other malloc
* implementations (e.g., on MacOSX) follow the standard.
* It's safer to check whether ptr is NULL and
* call malloc or realloc accordingly.
*
* size must be positive: realloc(p, 0) is the same as free(ptr).
*/
void *safe_realloc(void *ptr, size_t size) {
void *tmp;
assert(size > 0);
if (ptr == NULL) {
tmp = malloc(size);
} else {
tmp = realloc(ptr, size);
}
if (tmp == NULL) out_of_memory();
return tmp;
}
//computes CPU time in seconds - from Yices
#include <time.h>
double get_cpu_time(void) {
return ((double) clock())/CLOCKS_PER_SEC;
}
//hash functions
uint32_t mpz_hash(mpz_t x){
uint64_t y;
y = (uint64_t) mpz_get_ui(x);
return uint64_hash(y);
}
uint32_t uint64_hash(uint64_t x){
uint64_t y = x;
y = ((y >> 30) ^ y) * UINT64_C(0xbf58476d1ce4e5b9);
y = ((y >> 27) ^ y) * UINT64_C(0x94d049bb133111eb);
y = (y >> 31);
return y ^ 4294967295;
}
uint32_t uint32_hash(uint32_t x){
uint32_t y = x;
y = ((y >> 16) ^ y) * 0x45d9f3b;
y = ((y >> 16) ^ y) * 0x45d9f3b;
y = (y >> 16) ^ y;
return y;
}
void mpz_add_si(mpz_t x, mpz_t y, int64_t i){
if (i < 0) {
mpz_add_ui(x, y, -i);
} else {
mpz_sub_ui(x, y, -i);
}
}
uint32_t div_uint32_uint32(uint32_t x, uint32_t y){
return x/y;
}
int32_t div_int32_uint32(int32_t x, uint32_t y){
if (x < 0){
int32_t q;
q = -x/y;
if (q*y < -x){
return (-q)-1;
} else {
return -q;
}
}
return x/y;
}
uint64_t div_uint64_uint64(int64_t x, uint64_t y){
return x/y;
}
int64_t div_int64_uint64(int64_t x, uint64_t y){
if (x < 0){
int64_t q;
q = -x/y;
if (q*y < -x){
return (-q)-1;
} else {
return -q;
}
}
return x/y;
}
uint128_t div_uint128_uint128(int128_t x, uint128_t y){
return x/y;
}
int128_t div_int128_uint128(int128_t x, uint128_t y){
if (x < 0){
int128_t q;
q = -x/y;
if (q*y < -x){
return (-q)-1;
} else {
return -q;
}
}
return x/y;
}
uint32_t rem_uint32_uint32(uint32_t x, uint32_t y){
return x%y;
}
uint32_t rem_int32_uint32(int32_t x, uint32_t y){
if (x < 0){
int32_t r;
r = (-x)%y;
if (r == 0){
return r;
} else {
return y - r;
}
}
return x%y;
}
uint64_t rem_uint64_uint64(int64_t x, uint64_t y){
return x%y;
}
int64_t rem_int64_uint64(int64_t x, uint64_t y){
if (x < 0){
int64_t r;
r = (-x)%y;
if (r == 0){
return r;
} else {
return y - r;
}
}
return x%y;
}
uint128_t rem_uint128_uint128(int128_t x, uint128_t y){
return x%y;
}
int128_t rem_int128_uint128(int128_t x, uint128_t y){
if (x < 0){
int128_t r;
r = (-x)%y;
if (r == 0){
return r;
} else {
return y - r;
}
}
return x%y;
}
|
#include "common.h"
int main()
{
Connection conn;
DbRetVal rv = conn.open("root", "manager");
if (rv != OK) return 1;
DatabaseManager *dbMgr = conn.getDatabaseManager();
if (dbMgr == NULL) { printf("Auth failed\n"); return 2;}
int ret =0;
if ( dropTable(dbMgr, "t1") != 0 ) { ret = 3; }
if ( dropTable(dbMgr, "t2") != 0 ) { ret = 3; }
conn.close();
return ret;
}
|
/*
* File : digfont.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-12-21 pife first version
*/
#include <rtgui/dc.h>
#include <rtgui/widgets/digtube.h>
#include <rtgui/rtgui_theme.h>
static void _rtgui_digtube_constructor(struct rtgui_digtube * digtube)
{
RTGUI_WIDGET_TEXTALIGN(digtube) = RTGUI_ALIGN_CENTER;
/* init widget and set event handler */
rtgui_object_set_event_handler(RTGUI_OBJECT(digtube), rtgui_digtube_event_handler);
}
static void _rtgui_digtube_destructor(struct rtgui_digtube *digtube)
{
#ifndef RTGUI_DIGTUBE_USE_CONST_FONT
/* release font memory */
rt_free(digtube->digitfont.data);
digtube->digitfont.data = RT_NULL;
#endif
}
DEFINE_CLASS_TYPE(digtube, "digtube",
RTGUI_WIDGET_TYPE,
_rtgui_digtube_constructor,
_rtgui_digtube_destructor,
sizeof(struct rtgui_digtube));
rt_bool_t rtgui_digtube_event_handler(struct rtgui_object *object, struct rtgui_event *event)
{
struct rtgui_digtube *digtube;
struct rtgui_dc *dc;
rtgui_rect_t rect;
rtgui_rect_t text_rect;
rtgui_color_t color;
char * disbuf;
char tempbuf[8];
int i;
RTGUI_WIDGET_EVENT_HANDLER_PREPARE
digtube = RTGUI_DIGTUBE(object);
switch (event->type)
{
case RTGUI_EVENT_PAINT:
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(object));
if (dc == RT_NULL)
break;
rtgui_widget_get_rect(RTGUI_WIDGET(object), &rect);
rtgui_dc_fill_rect(dc, &rect);
if (! (digtube->tube_style & RTGUI_DIGTUBE_STYLE_NOBACKFONT))
{
color = RTGUI_DC_BC(dc);
RTGUI_DC_BC(dc) = digtube->digit_bc;
}
if (digtube->tube_style & RTGUI_DIGTUBE_STYLE_DISCODES)
disbuf = (char *) (digtube->value);
else
{
const char * format =
digtube->tube_style & RTGUI_DIGTUBE_STYLE_DISHEXNUM ?
"%7x" : "%7d";
disbuf = &tempbuf[0];
rt_snprintf(disbuf, 8, format, digtube->value);
/* */
for (i=0; i<7; i++)
{
if (disbuf[i] == ' ')
disbuf[i] = 0;
else
{
disbuf[i] = (disbuf[i] >= '0' && disbuf[i] <= '9') ? disbuf[i] - '0':
disbuf[i] - 'a' + 10;
disbuf[i] = digtube_code_table[disbuf[i]];
}
}
disbuf = tempbuf + 7 - digtube->tube_count;
}
text_rect.x1 = 0;
text_rect.y1 = 0;
text_rect.x2 = (digtube->digit_width + digtube->digit_space) * digtube->tube_count
-digtube->digit_space;
text_rect.y2 = digtube->digit_hight;
rtgui_rect_moveto_align(&rect, &text_rect, RTGUI_DC_TEXTALIGN(dc));
for (i=0; i<digtube->tube_count; i++)
{
rtgui_dc_draw_digitfont_code(dc, &digtube->digitfont, &text_rect, disbuf[i]);
text_rect.x1 += digtube->digit_width + digtube->digit_space;
}
if (! (digtube->tube_style & RTGUI_DIGTUBE_STYLE_NOBACKFONT))
RTGUI_DC_BC(dc) = color;
rtgui_dc_end_drawing(dc);
break;
default:
return rtgui_widget_event_handler(object, event);
}
return RT_FALSE;
}
rtgui_digtube_t *rtgui_digtube_create(
struct rtgui_digitfont * digitfont,
int count,
void * value,
int style)
{
struct rtgui_digtube *digtube;
rtgui_rect_t rect;
RT_ASSERT(count <= 7 && count > 0)
digtube = (struct rtgui_digtube *) rtgui_widget_create(RTGUI_DIGTUBE_TYPE);
if (digtube == RT_NULL)
return RT_NULL;
/* set field */
if (digitfont == RT_NULL)
digitfont = &digitfont_40;
rt_memcpy(& digtube->digitfont, digitfont, sizeof(struct rtgui_digitfont));
#ifndef RTGUI_DIGTUBE_USE_CONST_FONT
if (digtube->digitfont.data == RT_NULL)
rtgui_digitfont_create(& digtube->digitfont);
#endif
/* set default rect */
rtgui_get_digfont_metrics(&digtube->digitfont, &rect);
digtube->digit_width = rect.x2;
digtube->digit_hight = rect.y2;
digtube->tube_count = count;
digtube->digit_space = RTGUI_DIGTUBE_DEFAULT_SPACE;
rect.x2 = (rect.x2 + digtube->digit_space) * count - digtube->digit_space;
rect.y2 = rect.y2;
RTGUI_WIDGET_BACKGROUND(digtube) = rtgui_theme_default_bc();
RTGUI_WIDGET_FOREGROUND(digtube) = RTGUI_DIGTUBE_DEFAULT_FC;
rtgui_widget_set_rect(RTGUI_WIDGET(digtube), &rect);
/* set display value */
digtube->digit_bc = RTGUI_DIGTUBE_DEFAULT_DIGIT_BC;
digtube->value = value;
digtube->tube_style = style;
return digtube;
}
void rtgui_digtube_destroy(rtgui_digtube_t *digtube)
{
rtgui_widget_destroy(RTGUI_WIDGET(digtube));
}
|
//
// SCNViewController.h
// ARPlayDemo
//
// Created by alexyang on 2017/7/11.
// Copyright © 2017年 alexyang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SCNViewController : UIViewController
@property(nonatomic, assign) BOOL isCardBoard;
@end
|
/***************************************************************************
* Copyright (C) 2004-2005 by Andrew Krause *
* *
* 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 OUTPUT_SEARCH_H
#define OUTPUT_SEARCH_H
/*!
\file openldev-output-search.h
\brief OutputSearch
*/
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
#define LIST_TYPE (output_list_get_type ())
#define LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIST_TYPE, OutputList))
#define LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIST_TYPE, OutputListClass))
#define IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIST_TYPE))
#define IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIST_TYPE))
/*! \brief Widgets for the list output GtkTreeView. */
struct OutputList
{
GtkTreeView parent;
/*! GtkScrolledWindow that contains the main GtkTreeView widget. */
GtkWidget *swin;
};
struct OutputListClass
{
GtkTreeViewClass parent_class;
};
GType output_list_get_type ();
/*! Create a new OutputList object. This is useful if you want a generic GtkTreeView to show output in.
\return A new OutputList object.
*/
GtkWidget* output_list_new ();
/*! Get the GtkScrolledWindow widget in the OutputList object.
\param list An OutputList object.
\return The OutputList's GtkScrolledWindow.
*/
GtkWidget* output_list_get_scrolled_window (OutputList *list);
/*! Clear the content of the GtkTreeView.
\param list An OutputList object.
*/
void output_list_clear (OutputList *list);
G_END_DECLS
#endif
|
/*****************************************************************************
* omxil.h: helper functions
*****************************************************************************
* Copyright (C) 2010 VLC authors and VideoLAN
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef RPI_OMX
#define OMX_SKIP64BIT
#endif
/*****************************************************************************
* Includes
*****************************************************************************/
#include "OMX_Core.h"
#include "OMX_Index.h"
#include "OMX_Component.h"
#include "OMX_Video.h"
#include "omxil_utils.h"
#include "omxil_core.h"
/*****************************************************************************
* decoder_sys_t : omxil decoder descriptor
*****************************************************************************/
typedef struct OmxFifo
{
vlc_mutex_t lock;
vlc_cond_t wait;
OMX_BUFFERHEADERTYPE *p_first;
OMX_BUFFERHEADERTYPE **pp_last;
int offset;
} OmxFifo;
typedef struct OmxPort
{
bool b_valid;
OMX_U32 i_port_index;
OMX_HANDLETYPE omx_handle;
OMX_PARAM_PORTDEFINITIONTYPE definition;
es_format_t *p_fmt;
unsigned int i_frame_size;
unsigned int i_frame_stride;
unsigned int i_frame_stride_chroma_div;
unsigned int i_buffers;
OMX_BUFFERHEADERTYPE **pp_buffers;
OmxFifo fifo;
OmxFormatParam format_param;
OMX_BOOL b_reconfigure;
OMX_BOOL b_update_def;
OMX_BOOL b_direct;
OMX_BOOL b_flushed;
} OmxPort;
struct decoder_sys_t
{
OMX_HANDLETYPE omx_handle;
bool b_enc;
char psz_component[OMX_MAX_STRINGNAME_SIZE];
char ppsz_components[MAX_COMPONENTS_LIST_SIZE][OMX_MAX_STRINGNAME_SIZE];
unsigned int components;
OmxEventQueue event_queue;
OmxPort *p_ports;
unsigned int ports;
OmxPort in;
OmxPort out;
bool b_error;
bool b_aspect_ratio_handled;
date_t end_date;
size_t i_nal_size_length; /* Length of the NAL size field for H264 */
int b_use_pts;
};
|
/* alert_box.c
* Routines to put up various "standard" alert boxes used in multiple
* places
*
* $Id: alert_box.c 49279 2013-05-13 23:17:12Z guy $
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <string.h>
#include <glib.h>
#include <epan/filesystem.h>
#include <epan/dfilter/dfilter.h>
#include "ui/alert_box.h"
#include "ui/simple_dialog.h"
/*
* Alert box for general errors.
*/
void
failure_alert_box(const char *msg_format, va_list ap)
{
vsimple_error_message_box(msg_format, ap);
}
/*
* Alert box for a failed attempt to open or create a file.
* "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if
* the file is being opened for writing and FALSE if it's being opened
* for reading.
*
* XXX - add explanatory secondary text for at least some of the errors;
* various HIGs suggest that you should, for example, suggest that the
* user remove files if the file system is full. Perhaps that's because
* they're providing guidelines for people less sophisticated than the
* typical Wireshark user is, but....
*/
void
open_failure_alert_box(const char *filename, int err, gboolean for_writing)
{
gchar *display_basename;
display_basename = g_filename_display_basename(filename);
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
file_open_error_message(err, for_writing),
display_basename);
g_free(display_basename);
}
/*
* Alert box for a failed attempt to read a file.
* "err" is assumed to be a UNIX-style errno.
*/
void
read_failure_alert_box(const char *filename, int err)
{
gchar *display_basename;
display_basename = g_filename_display_basename(filename);
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
"An error occurred while reading from the file \"%s\": %s.",
display_basename, g_strerror(err));
g_free(display_basename);
}
/*
* Alert box for a failed attempt to write to a file.
* "err" is assumed to be a UNIX-style errno if positive and a
* Wiretap error if negative.
*
* XXX - add explanatory secondary text for at least some of the errors;
* various HIGs suggest that you should, for example, suggest that the
* user remove files if the file system is full. Perhaps that's because
* they're providing guidelines for people less sophisticated than the
* typical Wireshark user is, but....
*/
void
write_failure_alert_box(const char *filename, int err)
{
gchar *display_basename;
display_basename = g_filename_display_basename(filename);
if (err < 0) {
switch (err) {
case WTAP_ERR_SHORT_WRITE:
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
"A full write couldn't be done to the file \"%s\".",
display_basename);
break;
default:
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
"An error occurred while writing to the file \"%s\": %s.",
display_basename, wtap_strerror(err));
break;
}
} else {
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
file_write_error_message(err), display_basename);
}
g_free(display_basename);
}
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|
//
// renderable_interface.h
// gbCore
//
// Created by sergey.sergeev on 10/12/15.
// Copyright © 2015 sergey.sergeev. All rights reserved.
//
#ifndef renderable_interface_h
#define renderable_interface_h
#include "ces_entity.h"
namespace gb
{
class renderable_interface : public ces_entity
{
private:
std::weak_ptr<scene_graph> m_scene_graph;
protected:
void set_scene_graph(const scene_graph_shared_ptr& scene_graph);
scene_graph_shared_ptr get_scene_graph() const;
public:
renderable_interface();
virtual ~renderable_interface();
virtual void on_added_to_scene(const scene_graph_shared_ptr& scene_graph);
virtual void on_removed_from_scene();
virtual void add_material(const std::string& technique_name, i32 technique_pass, const material_shared_ptr& material);
virtual void remove_material(const std::string& technique_name, i32 technique_pass);
virtual material_shared_ptr get_material(const std::string& technique_name, i32 technique_pass) const;
void set_visible(bool value);
bool get_visible() const;
};
};
#endif
|
/* RECCACHE.C
* Record cache management.
* Copyright (c) 2005 Ladybridge Systems, All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Ladybridge Systems can be contacted via the www.openqm.com web site.
*
* START-HISTORY:
* 01 Jul 07 2.5-7 Extensive change for PDA merge.
* 06 May 05 2.1-13 Removed raw mode argument from keyin().
* 16 Sep 04 2.0-1 OpenQM launch. Earlier history details suppressed.
* END-HISTORY
*
* START-DESCRIPTION:
*
* END-DESCRIPTION
*
* START-CODE
*/
#include "qm.h"
#include "config.h"
typedef struct REC_CACHE_ENTRY REC_CACHE_ENTRY;
struct REC_CACHE_ENTRY {
REC_CACHE_ENTRY *next;
REC_CACHE_ENTRY *prev;
short int file_no; /* File table index */
unsigned long int upd_ct; /* File's upd_ct value when cached */
STRING_CHUNK *data; /* Record data, NULL if null string */
short int id_len; /* Length of record id */
char id[MAX_ID_LEN]; /* Id, not null terminated */
};
Private REC_CACHE_ENTRY *rec_cache_head = NULL;
Private REC_CACHE_ENTRY *rec_cache_tail = NULL;
Private short int rec_cache_size = 0; /* Current size */
/* ======================================================================
init_record_cache() - Initialise record cache */
void init_record_cache() {
REC_CACHE_ENTRY *p;
STRING_CHUNK *str;
/* Expand cache */
while (rec_cache_size < pcfg.reccache) {
p = (REC_CACHE_ENTRY *)k_alloc(71, sizeof(REC_CACHE_ENTRY));
p->next = NULL;
p->prev = rec_cache_tail;
p->file_no = -1;
p->id_len = 0;
p->data = NULL;
if (rec_cache_head == NULL)
rec_cache_head = p;
else
rec_cache_tail->next = p;
rec_cache_tail = p;
rec_cache_size++;
}
/* Contract cache */
while (rec_cache_size > pcfg.reccache) {
p = rec_cache_tail;
rec_cache_tail = p->prev;
if (rec_cache_tail != NULL)
rec_cache_tail->next = NULL;
str = p->data;
if ((str != NULL) && (--(str->ref_ct) == 0))
s_free(str);
k_free(p);
if (--rec_cache_size == 0)
rec_cache_head = NULL;
}
}
/* ======================================================================
cache_record() - Add record to cache */
void cache_record(short int fno, /* File table index */
short int id_len, char *id, STRING_CHUNK *data) {
REC_CACHE_ENTRY *p;
STRING_CHUNK *str;
if (rec_cache_size) {
/* Release the oldest entry. It doesn't matter if there is another
version of this record in the cache as we could never find it. */
p = rec_cache_tail;
str = p->data;
if ((str != NULL) && (--(str->ref_ct) == 0))
s_free(str);
if (p != rec_cache_head) /* Not already at head */
{
/* Dechain */
rec_cache_tail = p->prev;
rec_cache_tail->next = NULL;
/* Rechain at head */
rec_cache_head->prev = p;
p->next = rec_cache_head;
p->prev = NULL;
rec_cache_head = p;
}
/* Enter details of new record */
p->file_no = fno;
p->upd_ct = FPtr(fno)->upd_ct;
p->data = data;
if (data != NULL)
data->ref_ct++;
p->id_len = id_len;
if (id_len)
memcpy(p->id, id, id_len);
}
}
/* ======================================================================
scan_record_cache() - Search for a record in the cache
Returns pointer to string via data argument, incrementing ref count */
bool scan_record_cache(short int fno, short int id_len, char *id,
STRING_CHUNK **data) {
REC_CACHE_ENTRY *p;
FILE_ENTRY *fptr;
unsigned long int upd_ct;
fptr = FPtr(fno);
upd_ct = fptr->upd_ct;
for (p = rec_cache_head; p != NULL; p = p->next) {
if ((p->upd_ct == upd_ct) && (p->file_no == fno) && (p->id_len == id_len) &&
!(memcmp(p->id, id, id_len))) {
if ((*data = p->data) != NULL)
p->data->ref_ct++;
if (p != rec_cache_head) {
/* Move to head of cache */
p->prev->next = p->next;
if (p == rec_cache_tail)
rec_cache_tail = p->prev;
else
p->next->prev = p->prev;
rec_cache_head->prev = p;
p->next = rec_cache_head;
p->prev = NULL;
rec_cache_head = p;
}
return TRUE;
}
}
return FALSE;
}
/* END-CODE */
|
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "Common/CommonTypes.h"
#include "Core/IOS/Device.h"
#include "Core/IOS/USB/Host.h"
class PointerWrap;
namespace IOS
{
namespace HLE
{
namespace USB
{
struct DeviceInfo
{
u16 vid;
u16 pid;
bool operator<(const DeviceInfo& other) const { return vid < other.vid; }
};
} // namespace USB
namespace Device
{
// /dev/usb/oh0
class OH0 final : public USBHost
{
public:
OH0(u32 device_id, const std::string& device_name);
~OH0() override;
ReturnCode Open(const OpenRequest& request) override;
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
IPCCommandResult IOCtlV(const IOCtlVRequest& request) override;
std::pair<ReturnCode, u64> DeviceOpen(u16 vid, u16 pid);
void DeviceClose(u64 device_id);
IPCCommandResult DeviceIOCtl(u64 device_id, const IOCtlRequest& request);
IPCCommandResult DeviceIOCtlV(u64 device_id, const IOCtlVRequest& request);
void DoState(PointerWrap& p) override;
private:
IPCCommandResult CancelInsertionHook(const IOCtlRequest& request);
IPCCommandResult GetDeviceList(const IOCtlVRequest& request) const;
IPCCommandResult GetRhDesca(const IOCtlRequest& request) const;
IPCCommandResult GetRhPortStatus(const IOCtlVRequest& request) const;
IPCCommandResult SetRhPortStatus(const IOCtlVRequest& request);
IPCCommandResult RegisterRemovalHook(u64 device_id, const IOCtlRequest& request);
IPCCommandResult RegisterInsertionHook(const IOCtlVRequest& request);
IPCCommandResult RegisterInsertionHookWithID(const IOCtlVRequest& request);
IPCCommandResult RegisterClassChangeHook(const IOCtlVRequest& request);
s32 SubmitTransfer(USB::Device& device, const IOCtlVRequest& request);
bool HasDeviceWithVidPid(u16 vid, u16 pid) const;
void OnDeviceChange(ChangeEvent event, std::shared_ptr<USB::Device> device) override;
template <typename T>
void TriggerHook(std::map<T, u32>& hooks, T value, ReturnCode return_value);
struct DeviceEntry
{
u32 unknown;
u16 vid;
u16 pid;
};
static_assert(sizeof(DeviceEntry) == 8, "sizeof(DeviceEntry) must be 8");
// Device info (VID, PID) → command address for pending hook requests
std::map<USB::DeviceInfo, u32> m_insertion_hooks;
std::map<u64, u32> m_removal_hooks;
std::set<u64> m_opened_devices;
std::mutex m_hooks_mutex;
};
} // namespace Device
} // namespace HLE
} // namespace IOS
|
#ifndef SYS_INCLUDE_H
#define SYS_INCLUDE_H
/* ========================================================================== **
* sys_include.h
*
* Copyright (C) 1998 by Christopher R. Hertel
*
* Email: crh@ubiqx.mn.org
* -------------------------------------------------------------------------- **
* This header provides system declarations and data types used internally
* by the ubiqx modules.
* -------------------------------------------------------------------------- **
*
* 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; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* -------------------------------------------------------------------------- **
*
* You may want to replace this file with your own system specific header,
* or you may find that this default header has everything you need. In
* most cases, I expect the latter to be the case. The ubi_* modules were
* written to be as clean as possible. On purpose. There are limits,
* though. Variations in compilers, and competing standards have made it
* difficult to write code that just compiles. In particular, the location
* of a definition of NULL seems to be less than consistant.
*
* This header makes a good attempt to find NULL. If you find that you
* need something more on your system make sure that you keep a copy of
* your version so that it won't be overwritten by updates of the ubiqx
* code.
*
* -------------------------------------------------------------------------- **
*
* $Log: sys_include.h,v $
* Revision 1.1 2004/09/11 18:30:36 mb
* Initial revision
*
* Revision 0.0 1998/06/02 02:20:49 crh
* Initial Revision.
*
* ========================================================================== **
*/
/* -------------------------------------------------------------------------- **
* Looking for NULL.
*
* The core ubiqx modules (all those beginning with 'ubi_') rely on very
* little from the outside world. One exception is that we need a
* defintion for NULL. This has turned out to be something of a problem,
* as NULL is NOT always defined in the same place on different systems.
*
* Ahh... standards...
*
* K&R 2nd Ed. (pg 102) says NULL should be in <stdio.h>. I've heard
* that it is in <locale.h> on some systems. I've also seen it in
* <stddef.h> and <stdlib.h>. In most cases it's defined in multiple
* places. We'll try several of them. If none of these work on your
* system, please send E'mail and let me know where you get your NULL!
*
* The purpose of the mess below, then, is simply to supply a definition
* of NULL to the ubi_*.c files. Keep in mind that C compilers (all
* those of which I'm aware) will allow you to define a constant on the
* command line, eg.: -DNULL=((void *)0).
*
* Also, 99.9% of the time, NULL is zero. I have been informed of at
* least one exception.
*
* crh; may 1998
*/
#ifndef NULL
#include <stddef.h>
#endif
#ifndef NULL
#include <stdlib.h>
#endif
#ifndef NULL
#include <stdio.h>
#endif
#ifndef NULL
#include <locale.h>
#endif
#ifndef NULL
#define NULL ((void *)0)
#endif
/* ================================ The End ================================= */
#endif /* SYS_INCLUDE_H */
|
/*
* functor.h:
*
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
* $Id: functor.h,v 1.1 2006-08-24 23:25:07 phintuka Exp $
*
*/
#ifndef __XINELIB_FUNCTOR_H
#define __XINELIB_FUNCTOR_H
#include <vdr/tools.h>
class cFunctor : public cListObject
{
public:
cFunctor() : cListObject() {}
virtual ~cFunctor() {}
virtual void Execute(void) = 0;
};
#if 1 /* gcc 3.3.x (?) does not accept class TRESULT=void */
template<class TCLASS>
cFunctor *CreateFunctor(TCLASS *c,
void (TCLASS::*fp)(void));
template<class TCLASS, class TARG1>
cFunctor *CreateFunctor(TCLASS *c,
void (TCLASS::*fp)(TARG1),
TARG1 arg1);
#endif
template<class TCLASS, class TRESULT>
cFunctor *CreateFunctor(TCLASS *c,
TRESULT (TCLASS::*fp)(void));
template<class TCLASS, class TRESULT, class TARG1>
cFunctor *CreateFunctor(TCLASS *c,
TRESULT (TCLASS::*fp)(TARG1),
TARG1 arg1);
#include "functorimpl.h"
#endif
|
/**
* Copyright (c) 2010-2011 Trusted Logic S.A.
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Trusted Logic S.A. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered
* into with Trusted Logic S.A.
*
* TRUSTED LOGIC S.A. MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TRUSTED LOGIC S.A. SHALL
* NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
#ifndef __RSA_SECURE_PROTOCOL_H__
#define __RSA_SECURE_PROTOCOL_H__
/** RSA Secure Driver UUID
* {E079E630-6708-11E1-B86C-0800200C9A66}
*/
#define SERVICE_RSA_UUID { 0xE079E630, 0x6708, 0x11E1, {0xB8, 0x6C, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66 } }
/* ----- Service APIs ------ */
/**
* OpenClientSession API:
* No input parameter is required
*
* This turns on hardware resources and initialize internal structures.
*
* This function always return S_SUCCESS
*/
/**
* CloseClientSession API:
* No input parameter is required
*
* Clean internal resources:
* - if a key has been set, the key is erased,
*/
/**
* InvokeCommand API:
*
* Command RSA_SET_AES_KEY:
*
* @param buff (type S_PARAM_TYPE_MEMREF_INPUT), the key that is programmed in the OTF engine.
*
* @return S_ERROR_BAD_PARAMETERS, S_ERROR_OUT_OF_MEMORY, S_SUCCESS
*
* This command installs the RSA encrypted key in the OTF engine.
*
*/
/* Commands ID */
#define RSA_SET_AES_KEY 1
#endif /* __RSA_SECURE_PROTOCOL_H__ */
|
/*
** tr2latex - troff to LaTeX converter
** $Id: setups.h,v 2.2 1992/04/27 15:13:26 Christian_Engel Dist krischan $
** COPYRIGHT (C) 1987 Kamal Al-Yahya, 1991,1992 Christian Engel
**
** Module: setups.h
**
** setup file
*/
#ifdef __TURBOC__
# ifndef __COMPACT__
# error "The COMPACT model is needed"
# endif
#endif
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <time.h>
#if defined(__TURBOC__) | defined(MSC)
# include <io.h> /* for type declarations */
#endif
#ifdef UCB
# include <strings.h>
#else
# include <string.h>
#endif
#ifdef VMS
# define GOOD 1
#else
# define GOOD 0
#endif
#ifdef __TURBOC__
/*--- ONE MEGABYTE for EACH BUFFER? Really? - not for a brain-dead cpu
like the 8086 or 80286. Would my account on the VAX let me have
this much?
Maybe, one day when we all have an 80386+, or a SPARC, or a real
cpu.... ---*/
#define MAXLEN (0xfff0) /* maximum length of document */
/* A segment is 64k bytes! */
#else
/* ... but no problem on virtual operating systems */
#define MAXLEN (1024*1024) /* maximum length of document */
#endif
#define MAXWORD 250 /* maximum word length */
#define MAXLINE 500 /* maximum line length */
#define MAXDEF 200 /* maximum number of defines */
#define MAXARGS 128 /* maximal number of arguments */
#define EOS '\0' /* end of string */
#if defined(__TURBOC__) | defined (VAXC)
# define index strchr
#endif
#ifdef MAIN /* can only declare globals once */
# define GLOBAL
#else
# define GLOBAL extern
#endif
GLOBAL int math_mode, /* math mode status */
de_arg, /* .de argument */
IP_stat, /* IP status */
QP_stat, /* QP status */
TP_stat; /* TP status */
#ifdef DEBUG
GLOBAL int debug_o;
GLOBAL int debug_v;
#endif
GLOBAL struct defs {
char *def_macro;
char *replace;
int illegal;
} def[MAXDEF];
GLOBAL struct mydefs {
char *def_macro;
char *replace;
int illegal;
int arg_no;
int par; /* if it impiles (or contains) a par break */
} mydef[MAXDEF];
GLOBAL struct measure {
char old_units[MAXWORD]; float old_value;
char units[MAXWORD]; float value;
char def_units[MAXWORD]; /* default units */
int def_value; /* default value: 0 means take last one */
} linespacing, indent, tmpind, space, vspace;
typedef unsigned char bool;
extern int errno;
|
/*=============================================================================
Copyright (C) 2000 Kenneth Kocienda and David Hakim.
This file is part of the Codex C Library.
The Codex C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Codex C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Codex C Library; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
$RCSfile: stringbuffer.h,v $
$Revision: 1.8 $
$Author: dhakim $
$Date: 2003/07/06 17:58:43 $
==============================================================================*/
#ifndef __STRINGBUFFER_H
#define __STRINGBUFFER_H
#ifdef HAVE_RCONFIG_H
#include <rconfig.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdarg.h>
#include "integer.h"
#include "mxarr.h"
/*-----------------------------------------------------------------------------
constants
-----------------------------------------------------------------------------*/
enum {
/* the default size for a StringBuffer */
BUF_DEFAULT_CAP = 1024,
/* the maximum limit for formatted output to a StringBuffer */
BUF_PRINTF_MAXLEN = 8192,
};
/*-----------------------------------------------------------------------------
typedefs
-----------------------------------------------------------------------------*/
/* the StringBuffer struct */
typedef struct {
char *data; /* the pointer to the string buffer */
int size; /* # of bytes in buffer */
int cap; /* current allocated size of buffer */
} StringBuffer;
/*-----------------------------------------------------------------------------
memory management
-----------------------------------------------------------------------------*/
/* dynamically allocates a StringBuffer */
StringBuffer *buf_create(int size);
/* dynamically allocates a StringBuffer, using the default size */
StringBuffer *buf_createDefault();
/* frees a StringBuffer */
void buf_free(StringBuffer *d);
/* grows a buffer to a new size */
void buf_grow(StringBuffer *d, int cap);
/* makes a copy of a StringBuffer */
StringBuffer *buf_dup(StringBuffer *d);
/*-----------------------------------------------------------------------------
StringBufferfer data manipulation
-----------------------------------------------------------------------------*/
/* clears a StringBuffer */
void buf_clear(StringBuffer *d);
/* puts an arbitrary data block into a StringBuffer */
void buf_put(StringBuffer *d, const void *data, int size);
/* appends a string into a StringBuffer */
void buf_puts(StringBuffer *d, const char *str);
/* appends an int into a StringBuffer */
void buf_puti(StringBuffer *d, int n);
/* appends a 64-bit integer into a StringBuffer */
void buf_putl(StringBuffer *d, int64_t n);
/* appends a float into a StringBuffer */
void buf_putf(StringBuffer *d, float n);
/* appends a double into a StringBuffer */
void buf_putd(StringBuffer *d, double n);
/* appends a pointer address into a StringBuffer */
void buf_putp(StringBuffer *d, void *p);
/* appends a char into a StringBuffer */
void buf_putc(StringBuffer *d, char c);
/* appends a "true" into a StringBuffer if c>0 "false" otherwise */
void buf_putb(StringBuffer *d, unsigned char c);
/* appends a byte into a StringBuffer */
void buf_puty(StringBuffer *d, signed char c);
/* appends a character array to a StringBuffer */
void buf_putca(StringBuffer *d, UnArray *x);
/* appends a byte array to a StringBuffer */
void buf_putya(StringBuffer *d, UnArray *x);
/* formatted output to a StringBuffer */
int buf_printf(StringBuffer *d, const char *format, ...);
/* formatted output to a StringBuffer */
int buf_vprintf(StringBuffer *d, const char *format, va_list ap);
/* concats two StringBuffers together */
void buf_cat(StringBuffer *dest, StringBuffer *src);
/* gets the size of the buffer */
int buf_size(StringBuffer *d);
/* gets the character at the specified index */
char buf_charAt(StringBuffer *d, int index);
/* gets the char character in the buffer */
char buf_firstChar(StringBuffer *d);
/* gets the last character in the buffer */
char buf_lastChar(StringBuffer *d);
/* replaces every instance of oldc with newc */
void buf_replaceChar(StringBuffer *d, char oldc, char newc);
/* trims the text in the buffer */
void buf_trim(StringBuffer *d);
/* trims tabs and spaces off the text in the buffer */
void buf_trimLine(StringBuffer *d);
/*----------------------------------------------------------------------------
StringBuffer comparisons
-----------------------------------------------------------------------------*/
int buf_comp(StringBuffer *d, StringBuffer *d1);
/*----------------------------------------------------------------------------
StringBufferfer output
-----------------------------------------------------------------------------*/
/* returns a StringBuffer as a string, without allocating new memory */
char *buf_data(StringBuffer *d);
/* returns a StringBuffer as a string, allocating new memory for the returned
* string
*/
char *buf_toString(StringBuffer *d);
/* writes a StringBuffer to stdout...helpful for debugging */
int buf_dump(StringBuffer *d);
#endif
/*=============================================================================
// end of file: $RCSfile: stringbuffer.h,v $
==============================================================================*/
|
/*
* kexec/arch/s390/kexec-s390.c
*
* (C) Copyright IBM Corp. 2005
*
* Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
*
*/
#define _GNU_SOURCE
#include <stddef.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <getopt.h>
#include <sys/utsname.h>
#include "../../kexec.h"
#include "../../kexec-syscall.h"
#include "kexec-s390.h"
#include <arch/options.h>
#define MAX_MEMORY_RANGES 64
static struct memory_range memory_range[MAX_MEMORY_RANGES];
/*
* get_memory_ranges:
* Return a list of memory ranges by parsing the file returned by
* proc_iomem()
*
* INPUT:
* - Pointer to an array of memory_range structures.
* - Pointer to an integer with holds the number of memory ranges.
*
* RETURN:
* - 0 on normal execution.
* - (-1) if something went wrong.
*/
int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long flags)
{
char sys_ram[] = "System RAM\n";
char *iomem = proc_iomem();
FILE *fp;
char line[80];
int current_range = 0;
fp = fopen(iomem,"r");
if(fp == 0) {
fprintf(stderr,"Unable to open %s: %s\n",iomem,strerror(errno));
return -1;
}
/* Setup the compare string properly. */
while(fgets(line,sizeof(line),fp) != 0) {
unsigned long long start, end;
int cons;
char *str;
if (current_range == MAX_MEMORY_RANGES)
break;
sscanf(line,"%Lx-%Lx : %n", &start, &end, &cons);
str = line+cons;
if(memcmp(str,sys_ram,strlen(sys_ram)) == 0) {
memory_range[current_range].start = start;
memory_range[current_range].end = end;
memory_range[current_range].type = RANGE_RAM;
current_range++;
}
else {
continue;
}
}
fclose(fp);
*range = memory_range;
*ranges = current_range;
return 0;
}
/* Supported file types and callbacks */
struct file_type file_type[] = {
{ "image", image_s390_probe, image_s390_load, image_s390_usage},
};
int file_types = sizeof(file_type) / sizeof(file_type[0]);
void arch_usage(void)
{
}
int arch_process_options(int argc, char **argv)
{
return 0;
}
int arch_compat_trampoline(struct kexec_info *info)
{
info->kexec_flags |= KEXEC_ARCH_S390;
return 0;
}
void arch_update_purgatory(struct kexec_info *info)
{
}
int is_crashkernel_mem_reserved(void)
{
return 0; /* kdump is not supported on this platform (yet) */
}
|
#ifndef SC_SEG_DROPSHADOW_H
#define SC_SEG_DROPSHADOW_H
#include <QWidget>
#include "sclayoutsegment.h"
namespace Ui {
class sc_seg_dropshadow;
}
class sc_seg_dropshadow : public ScLayoutSegment
{
Q_OBJECT
public:
explicit sc_seg_dropshadow(QWidget *parent = 0);
~sc_seg_dropshadow();
private:
Ui::sc_seg_dropshadow *ui;
};
#endif // SC_SEG_DROPSHADOW_H
|
/*
* linux/drivers/input/serio/ambakmi.c
*
* Copyright (C) 2000-2003 Deep Blue Solutions Ltd.
* Copyright (C) 2002 Russell King.
*
* 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/module.h>
#include <linux/init.h>
#include <linux/serio.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/amba/bus.h>
#include <linux/amba/kmi.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <asm/io.h>
#include <asm/irq.h>
#define KMI_BASE (kmi->base)
struct amba_kmi_port {
struct serio *io;
struct clk *clk;
void __iomem *base;
unsigned int irq;
unsigned int divisor;
unsigned int open;
};
static irqreturn_t amba_kmi_int(int irq, void *dev_id)
{
struct amba_kmi_port *kmi = dev_id;
unsigned int status = readb(KMIIR);
int handled = IRQ_NONE;
while (status & KMIIR_RXINTR) {
serio_interrupt(kmi->io, readb(KMIDATA), 0);
status = readb(KMIIR);
handled = IRQ_HANDLED;
}
return handled;
}
static int amba_kmi_write(struct serio *io, unsigned char val)
{
struct amba_kmi_port *kmi = io->port_data;
unsigned int timeleft = 10000; /* timeout in 100ms */
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
udelay(10);
if (timeleft)
writeb(val, KMIDATA);
return timeleft ? 0 : SERIO_TIMEOUT;
}
static int amba_kmi_open(struct serio *io)
{
struct amba_kmi_port *kmi = io->port_data;
unsigned int divisor;
int ret;
int gpccon;
// ret = clk_enable(kmi->clk);
// if (ret)
ret = readb(KMICR);//add by zhaojun
if (ret & KMICR_EN)//add by zhaojun
goto out;
// divisor = clk_get_rate(kmi->clk) / 8000000 - 1;
divisor = 0xf;//add by zhaojun
writeb(divisor, KMICLKDIV);
writeb(KMICR_EN, KMICR);
// set gpc to pic function add by zhaojun
imapx_gpio_setcfg(IMAPX_GPC_RANGE(4, 7), IG_CTRL0, IG_NORMAL);
ret = request_irq(kmi->irq, amba_kmi_int, IRQF_DISABLED, "kmi-pl050", kmi);
if (ret) {
printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq);
writeb(0, KMICR);
goto clk_disable;
}
writeb(KMICR_EN | KMICR_RXINTREN, KMICR);
return 0;
clk_disable:
clk_disable(kmi->clk);
out:
return ret;
}
static void amba_kmi_close(struct serio *io)
{
struct amba_kmi_port *kmi = io->port_data;
writeb(0, KMICR);
free_irq(kmi->irq, kmi);
clk_disable(kmi->clk);
}
static int __devinit amba_kmi_probe(struct amba_device *dev, struct amba_id *id)
{
struct amba_kmi_port *kmi;
struct serio *io;
int ret;
ret = amba_request_regions(dev, NULL);
if (ret)
return ret;
kmi = kzalloc(sizeof(struct amba_kmi_port), GFP_KERNEL);
io = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!kmi || !io) {
ret = -ENOMEM;
goto out;
}
io->id.type = SERIO_8042;
io->write = amba_kmi_write;
io->open = amba_kmi_open;
io->close = amba_kmi_close;
strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name));
strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
io->port_data = kmi;
io->dev.parent = &dev->dev;
kmi->io = io;
kmi->base = ioremap(dev->res.start, resource_size(&dev->res));
if (!kmi->base) {
ret = -ENOMEM;
goto out;
}
// if (IS_ERR(kmi->clk)) {
// ret = PTR_ERR(kmi->clk);
// goto unmap;
// }
kmi->irq = dev->irq[0];
amba_set_drvdata(dev, kmi);
serio_register_port(kmi->io);
return 0;
//unmap:
// iounmap(kmi->base);
out:
kfree(kmi);
kfree(io);
amba_release_regions(dev);
return ret;
}
static int __devexit amba_kmi_remove(struct amba_device *dev)
{
struct amba_kmi_port *kmi = amba_get_drvdata(dev);
amba_set_drvdata(dev, NULL);
serio_unregister_port(kmi->io);
clk_put(kmi->clk);
iounmap(kmi->base);
kfree(kmi);
amba_release_regions(dev);
return 0;
}
static int amba_kmi_resume(struct amba_device *dev)
{
struct amba_kmi_port *kmi = amba_get_drvdata(dev);
/* kick the serio layer to rescan this port */
serio_reconnect(kmi->io);
return 0;
}
static struct amba_id amba_kmi_idtable[] = {
{
.id = 0x00041050,
.mask = 0x000fffff,
},
{ 0, 0 }
};
static struct amba_driver ambakmi_driver = {
.drv = {
.name = "kmi-pl050",
.owner = THIS_MODULE,
},
.id_table = amba_kmi_idtable,
.probe = amba_kmi_probe,
.remove = __devexit_p(amba_kmi_remove),
.resume = amba_kmi_resume,
};
static int __init amba_kmi_init(void)
{
return amba_driver_register(&ambakmi_driver);
}
static void __exit amba_kmi_exit(void)
{
amba_driver_unregister(&ambakmi_driver);
}
module_init(amba_kmi_init);
module_exit(amba_kmi_exit);
MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
MODULE_DESCRIPTION("AMBA KMI controller driver");
MODULE_LICENSE("GPL");
|
/***************************************************************************
* 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. *
* *
* copyright (C) 2006-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
#ifndef UMLVIEWIMAGEEXPORTERMODEL_H
#define UMLVIEWIMAGEEXPORTERMODEL_H
#include "umlscene.h"
#include "umlviewlist.h"
#include <QStringList>
#include <QRect>
// forward declarations
class KUrl;
/**
* Exports an UMLView in various image formats.
* It can also export all the views in the current document.
*
* The methods in this class don't communicate with the user, so asking the format
* to save the images in, checking if the target file exists and so on must be done before
* calling those methods, if needed.
* The only exception is asking passwords for example when KIO slaves are used, as this
* operation is made automatically by the KIO classes.
*/
class UMLViewImageExporterModel
{
public:
static QStringList supportedImageTypes();
static QStringList supportedMimeTypes();
static QString imageTypeToMimeType(const QString& imageType);
static QString mimeTypeToImageType(const QString& mimeType);
UMLViewImageExporterModel();
virtual ~UMLViewImageExporterModel();
#if QT_VERSION >= 0x050000
QString exportView(UMLScene* scene, const QString &imageType, const QUrl &url) const;
#else
QString exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const;
#endif
QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const;
private:
QString getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders = false) const;
#if QT_VERSION >= 0x050000
bool prepareDirectory(const QUrl &url) const;
#else
bool prepareDirectory(const KUrl &url) const;
#endif
bool exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const;
bool exportViewToDot(UMLScene* scene, const QString &fileName) const;
bool exportViewToEps(UMLScene* scene, const QString &fileName) const;
bool exportViewToSvg(UMLScene* scene, const QString &fileName) const;
bool exportViewToPixmap(UMLScene* scene, const QString &imageType, const QString &fileName) const;
static QStringList s_supportedImageTypesList;
static QStringList s_supportedMimeTypesList;
};
#endif
|
/***************************************************************************
qgsguiutils.h - Constants used throughout the QGIS GUI.
------------
Date : 11-Jan-2006
Copyright : (C) 2006 by Tom Elwertowski
Email : telwertowski at users dot sourceforge dot net
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSGUIUTILS_H
#define QGSGUIUTILS_H
#include <Qt>
#include <QPair>
#include <QWidget>
#include <QStringList>
#include "qgis_gui.h"
#define SIP_NO_FILE
class QFont;
/**
* \ingroup gui
* \namespace QgsGuiUtils
* The QgsGuiUtils namespace contains constants and helper functions used throughout the QGIS GUI.
* \note not available in Python bindings
*/
namespace QgsGuiUtils
{
/**
* /var ModalDialogFlags
* /brief Flags used to create a modal dialog (adapted from QMessageBox).
*
* Using these flags for all modal dialogs throughout QGIS ensures that
* for platforms such as the Mac where modal and modeless dialogs have
* different looks, QGIS modal dialogs will look the same as Qt modal
* dialogs and all modal dialogs will look distinct from modeless dialogs.
* Although not the standard Mac modal look, it does lack the minimize
* control which makes sense only for modeless dislogs.
*
* The Qt3 method of creating a true Mac modal dialog is deprecated in Qt4
* and should not be used due to conflicts with QMessageBox style dialogs.
*
* Qt::WindowMaximizeButtonHint is included but will be ignored if
* the dialog is a fixed size and does not have a size grip.
*/
static const Qt::WindowFlags ModalDialogFlags = 0;
/**
* Minimum magnification level allowed in map canvases.
* \see CANVAS_MAGNIFICATION_MAX
* \since QGIS 3.0
*/
constexpr double CANVAS_MAGNIFICATION_MIN = 0.1;
/**
* Maximum magnification level allowed in map canvases.
* \see CANVAS_MAGNIFICATION_MAX
* \since QGIS 3.0
*/
// Must be a factor of 2, so zooming in to max from 100% then zooming back out will result in 100% mag
constexpr double CANVAS_MAGNIFICATION_MAX = 16.0;
/**
Open files, preferring to have the default file selector be the
last one used, if any; also, prefer to start in the last directory
associated with filterName.
\param filterName the name of the filter; used for persistent store key
\param filters the file filters used for QFileDialog
\param selectedFiles string list of selected files; will be empty if none selected
\param enc encoding?
\param title the title for the dialog
\param cancelAll add button to cancel further requests
\note
Stores persistent settings under /UI/. The sub-keys will be
filterName and filterName + "Dir".
Opens dialog on last directory associated with the filter name, or
the current working directory if this is the first time invoked
with the current filter name.
This method returns true if cancel all was clicked, otherwise false
*/
bool GUI_EXPORT openFilesRememberingFilter( QString const &filterName,
QString const &filters, QStringList &selectedFiles, QString &enc, QString &title,
bool cancelAll = false );
/**
* A helper function to get an image name from the user. It will nicely
* provide filters with all available writable image formats.
* \param parent widget that should act as the parent for the file dialog
* \param message the message to display to the user
* \param defaultFilename default file name (empty by default)
* \returns QPair<QString, QString> where first is the file name and second is
* the file type
*/
QPair<QString, QString> GUI_EXPORT getSaveAsImageName( QWidget *parent, const QString &message, const QString &defaultFilename = QString() );
/**
Convenience function for readily creating file filters.
Given a long name for a file filter and a regular expression, return
a file filter string suitable for use in a QFileDialog::OpenFiles()
call. The regular express, glob, will have both all lower and upper
case versions added.
*/
QString GUI_EXPORT createFileFilter_( QString const &longName, QString const &glob );
/**
* Create file filters suitable for use with QFileDialog
*
* \param format extension e.g. "png"
* \returns QString e.g. "PNG format (*.png, *.PNG)"
*/
QString GUI_EXPORT createFileFilter_( QString const &format );
/**
* Show font selection dialog.
*
* It is strongly recommended that you do not use this method, and instead use the standard
* QgsFontButton widget to allow users consistent font selection behavior.
*
* \param ok true on ok, false on cancel
* \param initial initial font
* \param title optional dialog title
* \returns QFont the selected fon
*/
QFont GUI_EXPORT getFont( bool &ok, const QFont &initial, const QString &title = QString() );
}
#endif // QGSGUIUTILS_H
|
#include "std.h"
#include "mcu.h"
#include "sys_time.h"
#include "led.h"
#include "interrupt_hw.h"
#include "mcu_periph/usb_serial.h"
#include "mcu_periph/uart.h"
#include "mcu_arch.h"
#include "messages.h"
#include "downlink.h"
#include "armVIC.h"
static inline void main_init( void );
static inline void main_periodic( void );
static inline void main_event( void );
static inline void main_init_tacho(void);
static uint32_t lp_pulse;
static uint32_t nb_pulse = 0;
static float omega_rad;
int main( void ) {
main_init();
while(1) {
if (sys_time_periodic())
main_periodic();
main_event();
}
return 0;
}
static inline void main_init( void ) {
mcu_init();
sys_time_init();
main_init_tacho();
mcu_int_enable();
}
#define NB_STEP 256
static inline void main_periodic( void ) {
RunOnceEvery(50, {
const float tach_to_rpm = 15000000.*2*M_PI/(float)NB_STEP;
omega_rad = tach_to_rpm / lp_pulse;
DOWNLINK_SEND_IMU_TURNTABLE(DefaultChannel, &omega_rad);}
// float foo = nb_pulse;
// DOWNLINK_SEND_IMU_TURNTABLE(DefaultChannel, &foo);}
);
RunOnceEvery(100, {DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM);});
}
static inline void main_event( void ) {
}
/* INPUT CAPTURE CAP0.0 on P0.22*/
#define TT_TACHO_PINSEL PINSEL1
#define TT_TACHO_PINSEL_VAL 0x02
#define TT_TACHO_PINSEL_BIT 12
static inline void main_init_tacho(void) {
/* select pin for capture */
TT_TACHO_PINSEL |= TT_TACHO_PINSEL_VAL << TT_TACHO_PINSEL_BIT;
/* enable capture 0.2 on falling edge + trigger interrupt */
T0CCR |= TCCR_CR0_F | TCCR_CR0_I;
}
//
// trimed version of arm7/sys_time_hw.c
//
uint32_t cpu_time_ticks;
uint32_t last_periodic_event;
uint32_t sys_time_chrono_start; /* T0TC ticks */
uint32_t sys_time_chrono; /* T0TC ticks */
void TIMER0_ISR ( void ) {
ISR_ENTRY();
// LED_TOGGLE(1);
if (T0IR & TIR_CR0I) {
static uint32_t pulse_last_t;
uint32_t t_now = T0CR0;
uint32_t diff = t_now - pulse_last_t;
lp_pulse = (lp_pulse + diff)/2;
pulse_last_t = t_now;
nb_pulse++;
// got_one_pulse = TRUE;
T0IR = TIR_CR0I;
}
VICVectAddr = 0x00000000;
ISR_EXIT();
}
|
/*
* addr_hash.h:
*
*/
#ifndef __HASH_H_ /* include guard */
#define __HASH_H_
/* implementation independent declarations */
typedef enum {
HASH_STATUS_OK,
HASH_STATUS_MEM_EXHAUSTED,
HASH_STATUS_KEY_NOT_FOUND,
HASH_STATUS_FAILED
} hash_status_enum;
typedef struct node_tag {
struct node_tag *next; /* next node */
void* key; /* key */
void* rec; /* user data */
} hash_node_type;
typedef struct {
int (*compare) (void*, void*);
int (*hash) (void*);
void* (*copy_key) (void*);
void (*delete_key) (void*);
hash_node_type** table;
int size;
} hash_type;
hash_status_enum hash_initialise(hash_type*);
hash_status_enum hash_destroy(hash_type*);
hash_status_enum hash_insert(hash_type*, void* key, void *rec);
hash_status_enum hash_delete(hash_type* hash_table, void* key);
hash_status_enum hash_find(hash_type* hash_table, void* key, void** rec);
hash_status_enum hash_next_item(hash_type* hash_table, hash_node_type** ppnode);
void hash_delete_all(hash_type* hash_table);
#endif /* __HASH_H_ */
|
/*
* Summary: interface for the XSLT functions not from XPath
* Description: a set of extra functions coming from XSLT but not in XPath
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard and Bjorn Reese <breese@users.sourceforge.net>
*/
#ifndef __XML_XSLT_FUNCTIONS_H__
#define __XML_XSLT_FUNCTIONS_H__
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
#define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \
xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \
(xmlXPathFuncLookupFunc) xsltXPathFunctionLookup, \
(void *)(ctxt->xpathCtxt));
XSLTPUBFUN xmlXPathFunction XSLTCALL
xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
XSLTPUBFUN void XSLTCALL
xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltKeyFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <folly/futures/Future.h>
#include <memory>
#include <optional>
#include <vector>
#include "eden/fs/fuse/Invalidation.h"
#include "eden/fs/inodes/InodePtr.h"
#include "eden/fs/model/TreeEntry.h"
namespace folly {
class exception_wrapper;
}
namespace facebook {
namespace eden {
class Blob;
class CheckoutContext;
class ObjectStore;
class Tree;
/**
* A helper class representing an action that must be taken as part of a
* checkout operation.
*
* The TreeInode is responsible for computing the list of CheckoutActions that
* must be run in order to perform a checkout. These actions are computed
* while holding the TreeInode's contents_ lock, and then executed after
* releasing the lock.
*
* A few actions can be done immediately while still holding the TreeInode's
* contents lock. In particular, this includes creating new entries for files
* or directories that did not previously exist. TreeInode is responsible for
* performing these actions while still holding the contents_ lock. No
* CheckoutAction objects are ever created for these cases, since these actions
* can be taken immediately.
*/
class CheckoutAction {
public:
/**
* Create a CheckoutAction with an already loaded Inode object.
*/
CheckoutAction(
CheckoutContext* ctx,
const TreeEntry* oldScmEntry,
const TreeEntry* newScmEntry,
InodePtr&& inode);
/**
* Create a CheckoutAction where the Inode object in question is not loaded
* yet.
*
* (This is a template function purely to avoid ambiguity with the
* constructor type above. Future<InodePtr> is implicitly constructible from
* an InodePtr, but we want to prefer the constructor above if we have an
* InodePtr.)
*/
template <typename InodePtrType>
CheckoutAction(
CheckoutContext* ctx,
const TreeEntry* oldScmEntry,
const TreeEntry* newScmEntry,
folly::Future<InodePtrType> inodeFuture)
: CheckoutAction(
INTERNAL,
ctx,
oldScmEntry,
newScmEntry,
std::move(inodeFuture)) {}
/*
* CheckoutAction does not allow copying or moving.
*
* We hold a pointer to ourself while waiting on the data to load, so we
* cannot allow the object to potentially move to another address.
*/
CheckoutAction(CheckoutAction&& other) = delete;
CheckoutAction& operator=(CheckoutAction&& other) = delete;
~CheckoutAction();
PathComponentPiece getEntryName() const;
/**
* Run the CheckoutAction.
*
* If this completes successfully, the result returned via the Future
* indicates if the change updated the parent directory's entries. Returns
* whether the caller is responsible for invalidating the directory's inode
* cache in the kernel.
*/
FOLLY_NODISCARD folly::Future<InvalidationRequired> run(
CheckoutContext* ctx,
ObjectStore* store);
private:
class LoadingRefcount;
enum InternalConstructor {
INTERNAL,
};
CheckoutAction(
InternalConstructor,
CheckoutContext* ctx,
const TreeEntry* oldScmEntry,
const TreeEntry* newScmEntry,
folly::Future<InodePtr> inodeFuture);
void setOldTree(std::shared_ptr<const Tree> tree);
void setOldBlob(Hash20 blobSha1);
void setNewTree(std::shared_ptr<const Tree> tree);
void setNewBlob();
void setInode(InodePtr inode);
void error(folly::StringPiece msg, const folly::exception_wrapper& ew);
void allLoadsComplete() noexcept;
bool ensureDataReady() noexcept;
folly::Future<bool> hasConflict();
/**
* Return whether the directory's contents have changed and the
* inode's readdir cache must be flushed.
*/
FOLLY_NODISCARD folly::Future<InvalidationRequired> doAction();
/**
* The context for the in-progress checkout operation.
*/
CheckoutContext* const ctx_{nullptr};
/**
* The TreeEntry in the old Tree that we are moving away from.
*
* This will be none if the entry did not exist in the old Tree.
*/
std::optional<TreeEntry> oldScmEntry_;
/**
* The TreeEntry in the new Tree that we are checking out.
*
* This will be none if the entry is deleted in the new Tree.
*/
std::optional<TreeEntry> newScmEntry_;
/**
* A Future that will be invoked when the inode is loaded.
*
* This may be unset if the inode was already available when the
* CheckoutAction was created (in which case inode_ will be non-null).
*/
folly::Future<InodePtr> inodeFuture_ = folly::Future<InodePtr>::makeEmpty();
/**
* A reference count tracking number of outstanding futures still
* running as part of the process to load all of our data.
*
* When all futures complete (successfully or not) this will drop to zero,
* at which point allDataReady() will be invoked to complete the action.
*/
std::atomic<uint32_t> numLoadsPending_{0};
/*
* Data that we have to load to perform the checkout action.
*
* Only one each oldTree_ and oldBlob_ will be loaded,
* and the same goes for newTree_ and newBlob_.
*
* Note that for trees we download the full tree. For the old blob we
* only download the sha1 as this is all we will need. We don't actually ever
* need the data from new blob. So we just record if the destination is
* a new blob, and not bother loading the blob data itself.
*/
InodePtr inode_;
std::shared_ptr<const Tree> oldTree_;
std::optional<Hash20> oldBlobSha1_;
std::shared_ptr<const Tree> newTree_;
bool newBlobMarker_ = false;
/**
* The errors vector keeps track of any errors that occurred while trying to
* load the data needed to perform the checkout action.
*/
std::vector<folly::exception_wrapper> errors_;
/**
* The promise that we will fulfil when the CheckoutAction is complete.
*/
folly::Promise<InvalidationRequired> promise_;
};
} // namespace eden
} // namespace facebook
|
/* vi: ts=8 sts=4 sw=4
*
* This file is part of the KDE project, module kdesu.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
*/
#ifndef __SuDlg_h_Included__
#define __SuDlg_h_Included__
#include <kpassdlg.h>
class KDEsuDialog
: public KPasswordDialog
{
Q_OBJECT
public:
KDEsuDialog(QCString user, QCString auth_user, bool enableKeep, const QString& icon , bool withIgnoreButton=false);
~KDEsuDialog();
enum ResultCodes { AsUser = 10 };
protected:
bool checkPassword(const char *password);
void slotUser1();
private:
QCString m_User;
};
#endif // __SuDlg_h_Included__
|
/*
* (C) 2008-2009 Patrik Fimml.
*
* This file is part of dvbdescramble.
*
* dvbdescramble is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CA_RESOURCE_MANAGER_H
#define CA_RESOURCE_MANAGER_H
#include <glib-object.h>
#define CA_TYPE_RESOURCE_MANAGER (ca_resource_manager_get_type())
GType
ca_resource_manager_get_type();
typedef struct _CAResourceManagerClass CAResourceManagerClass;
typedef struct _CAResourceManager CAResourceManager;
typedef struct _CAResourceInfo CAResourceInfo;
#include "ca-t-c.h"
struct _CAResourceManagerClass
{
GObjectClass _parent;
};
struct _CAResourceManager
{
GObject _parent;
GList *resources;
GArray *sessions;
gboolean first;
};
struct _CAResourceInfo
{
guint res_class : 14;
guint res_type : 10;
guint res_version : 6;
const char *name;
/* Returns: 0 or an error as described in EN 50221, page 20 */
guint8 (*open)(CAResourceManager *mgr,
CATC *catc,
guint16 session);
/* called after opening the session */
void (*init)(CAResourceManager *mgr,
CATC *catc,
guint16 session);
gboolean (*received_apdu)(CAResourceManager *mgr,
CATC *catc,
guint16 session,
guint32 tag,
guint8 *data,
guint len);
void (*close)(CAResourceManager *mgr,
CATC *catc,
guint16 session);
};
CAResourceManager *
ca_resource_manager_new();
void
ca_resource_manager_manage_t_c(CAResourceManager *mgr,
CATC *catc);
gboolean
ca_resource_manager_has_cainfo(CAResourceManager *mgr,
CATC *catc);
void
ca_resource_manager_descramble_pmt(CAResourceManager *mgr,
CATC *catc,
guint8 *pmt);
#endif
|
#ifndef __MODULEHIDE__H_
#define __MODULEHIDE__H_
typedef enum _MEMORY_INFORMATION_CLASS
{
MemoryBasicInformation,
MemoryWorkingSetList,
MemorySectionName,
MemoryBasicVlmInformation
} MEMORY_INFORMATION_CLASS;
typedef struct _MEMORY_BASIC_INFORMATION
{
PVOID BaseAddress;
PVOID AllocationBase;
ULONG AllocationProtect;
SIZE_T RegionSize;
ULONG State;
ULONG Protect;
ULONG Type;
} MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
typedef NTSTATUS(NTAPI *NtReadVirtualMemory_t)(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
OUT PVOID Buffer,
IN SIZE_T NumberOfBytesToRead,
OUT PSIZE_T NumberOfBytesRead);
typedef NTSTATUS(NTAPI *NtQueryVirtualMemory_t)(IN HANDLE ProcessHandle,
IN PVOID Address,
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
IN SIZE_T Length,
OUT PSIZE_T ResultLength);
BOOLEAN bCloakModule( DWORD dwBaseAddress, DWORD dwSize, char* szProcessName );
BOOLEAN bSetModuleHideHooks( VOID );
#endif
|
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.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, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef KWIN_SCENE_QPAINTER_X11_BACKEND_H
#define KWIN_SCENE_QPAINTER_X11_BACKEND_H
#include "scene_qpainter.h"
#include <QObject>
namespace KWin
{
class X11WindowedBackend;
class X11WindowedQPainterBackend : public QObject, public QPainterBackend
{
Q_OBJECT
public:
X11WindowedQPainterBackend(X11WindowedBackend *backend);
virtual ~X11WindowedQPainterBackend();
QImage *buffer() override;
bool needsFullRepaint() const override;
bool usesOverlayWindow() const override;
void prepareRenderingFrame() override;
void present(int mask, const QRegion &damage) override;
void screenGeometryChanged(const QSize &size);
private:
bool m_needsFullRepaint = true;
xcb_gcontext_t m_gc = XCB_NONE;
QImage m_backBuffer;
X11WindowedBackend *m_backend;
};
}
#endif
|
/* traffic_table_dialog.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef TRAFFIC_TABLE_DIALOG_H
#define TRAFFIC_TABLE_DIALOG_H
#include "config.h"
#include "file.h"
#include "epan/conversation_table.h"
#include "ui/follow.h"
#include "filter_action.h"
#include <QPushButton>
#include <QCheckBox>
#include <QDialog>
#include <QDialogButtonBox>
#include <QMenu>
#include <QTabWidget>
#include <QTreeWidget>
namespace Ui {
class TrafficTableDialog;
}
class TrafficTableTreeWidgetItem : public QTreeWidgetItem
{
public:
TrafficTableTreeWidgetItem(QTreeWidget *tree) : QTreeWidgetItem(tree) {}
TrafficTableTreeWidgetItem(QTreeWidget *parent, const QStringList &strings)
: QTreeWidgetItem (parent, strings) {}
virtual QVariant colData(int col, bool resolve_names) const = 0;
};
class TrafficTableTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
explicit TrafficTableTreeWidget(QWidget *parent, register_ct_t* table);
~TrafficTableTreeWidget();
// String, int, or double data for each column in a row.
// Passing -1 returns titles.
QList<QVariant> rowData(int row) const;
public slots:
void setNameResolutionEnabled(bool enable);
// Title string plus optional count
const QString &trafficTreeTitle() { return title_; }
conv_hash_t* trafficTreeHash() {return &hash_;}
protected:
register_ct_t* table_;
QString title_;
conv_hash_t hash_;
bool resolve_names_;
QMenu ctx_menu_;
void contextMenuEvent(QContextMenuEvent *event);
private:
private slots:
virtual void updateItems() {}
signals:
void titleChanged(QWidget *tree, const QString &text);
void filterAction(QString& filter, FilterAction::Action action, FilterAction::ActionType type);
};
class TrafficTableDialog : public QDialog
{
Q_OBJECT
public:
/** Create a new conversation window.
*
* @param parent Parent widget.
* @param cf Capture file. No statistics will be calculated if this is NULL.
* @param proto_id If valid, add this protocol and bring it to the front.
* @param filter Display filter to apply.
*/
explicit TrafficTableDialog(QWidget *parent = 0, capture_file *cf = NULL, const char *filter = NULL, const QString &table_name = tr("Unknown"));
~TrafficTableDialog();
public slots:
virtual void setCaptureFile(capture_file *cf) { Q_UNUSED(cf) }
signals:
void filterAction(QString& filter, FilterAction::Action action, FilterAction::ActionType type);
void openFollowStreamDialog(follow_type_t type);
void openTcpStreamGraph(int graph_type);
protected:
Ui::TrafficTableDialog *ui;
capture_file *cap_file_;
QString filter_;
QMenu traffic_type_menu_;
QPushButton *copy_bt_;
QMap<int, TrafficTableTreeWidget *> proto_id_to_tree_;
const QList<int> defaultProtos() const;
void fillTypeMenu(QList<int> &enabled_protos);
// Adds a conversation tree. Returns true if the tree was freshly created, false if it was cached.
virtual bool addTrafficTable(register_ct_t* table) { Q_UNUSED(table) return false; }
// UI getters
QDialogButtonBox *buttonBox() const;
QTabWidget *trafficTableTabWidget() const;
QCheckBox *displayFilterCheckBox() const;
QCheckBox *nameResolutionCheckBox() const;
QPushButton *enabledTypesPushButton() const;
protected slots:
virtual void itemSelectionChanged() {}
void updateWidgets();
private:
QList<QVariant> curTreeRowData(int row) const;
private slots:
void on_nameResolutionCheckBox_toggled(bool checked);
void on_displayFilterCheckBox_toggled(bool checked);
void setTabText(QWidget *tree, const QString &text);
void toggleConversation();
void copyAsCsv();
void copyAsYaml();
virtual void on_buttonBox_helpRequested() = 0;
};
#endif // TRAFFIC_TABLE_DIALOG_H
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|
#ifndef _ASM_A_OUT_CORE_H
#define _ASM_A_OUT_CORE_H
#ifdef __KERNEL__
#include <linux/user.h>
#include <linux/elfcore.h>
static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
{
struct switch_stack *sw;
/* changed the size calculations - should hopefully work better. lbt */
dump->magic = CMAGIC;
dump->start_code = 0;
dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
dump->u_dsize = ((unsigned long) (current->mm->brk +
(PAGE_SIZE-1))) >> PAGE_SHIFT;
dump->u_dsize -= dump->u_tsize;
dump->u_ssize = 0;
if (dump->start_stack < TASK_SIZE)
dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
dump->u_ar0 = offsetof(struct user, regs);
sw = ((struct switch_stack *)regs) - 1;
dump->regs.d1 = regs->d1;
dump->regs.d2 = regs->d2;
dump->regs.d3 = regs->d3;
dump->regs.d4 = regs->d4;
dump->regs.d5 = regs->d5;
dump->regs.d6 = sw->d6;
dump->regs.d7 = sw->d7;
dump->regs.a0 = regs->a0;
dump->regs.a1 = regs->a1;
dump->regs.a2 = regs->a2;
dump->regs.a3 = sw->a3;
dump->regs.a4 = sw->a4;
dump->regs.a5 = sw->a5;
dump->regs.a6 = sw->a6;
dump->regs.d0 = regs->d0;
dump->regs.orig_d0 = regs->orig_d0;
dump->regs.stkadj = regs->stkadj;
dump->regs.sr = regs->sr;
dump->regs.pc = regs->pc;
dump->regs.fmtvec = (regs->format << 12) | regs->vector;
/* dump floating point stuff */
dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
}
#endif /* __KERNEL__ */
#endif /* _ASM_A_OUT_CORE_H */
|
/*
* Author: MontaVista Software, Inc. <source@mvista.com>
*
* 2008 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/mvl_patch.h>
static __init int regpatch(void)
{
return mvl_register_patch(782);
}
module_init(regpatch);
|
/*MT*
MediaTomb - http://www.mediatomb.cc/
libmp4v2_handler.h - this file is part of MediaTomb.
Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
Copyright (C) 2006-2010 Gena Batyan <bgeradz@mediatomb.cc>,
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
Leonhard Wimmer <leo@mediatomb.cc>
MediaTomb 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.
MediaTomb 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
version 2 along with MediaTomb; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
$Id: libmp4v2_handler.h 2081 2010-03-23 20:18:00Z lww $
*/
/// \file libmp4v2_handler.h
/// \brief Definition of the LibMP4V2 class.
#ifndef __METADATA_LIBMP4V2_H__
#define __METADATA_LIBMP4V2_H__
#include "metadata_handler.h"
/// \brief This class is responsible for reading id3 tags metadata
class LibMP4V2Handler : public MetadataHandler
{
public:
LibMP4V2Handler();
virtual void fillMetadata(zmm::Ref<CdsItem> item);
virtual zmm::Ref<IOHandler> serveContent(zmm::Ref<CdsItem> item, int resNum, off_t *data_size);
};
#endif // __METADATA_LIBMP4V2_H__
|
#define _GNU_SOURCE /* syscall() is not POSIX */
#include <stdio.h> /* for perror() */
#include <unistd.h> /* for syscall() */
#include <sys/syscall.h> /* for __NR_* definitions */
#include <linux/aio_abi.h> /* for AIO types and constants */
#include <fcntl.h> /* O_RDWR */
#include <string.h> /* memset() */
#include <inttypes.h> /* uint64_t */
inline int io_setup(unsigned nr, aio_context_t *ctxp)
{
return syscall(__NR_io_setup, nr, ctxp);
}
inline int io_destroy(aio_context_t ctx)
{
return syscall(__NR_io_destroy, ctx);
}
inline int io_submit(aio_context_t ctx, long nr, struct iocb **iocbpp)
{
return syscall(__NR_io_submit, ctx, nr, iocbpp);
}
inline int io_getevents(aio_context_t ctx, long min_nr, long max_nr,
struct io_event *events, struct timespec *timeout)
{
return syscall(__NR_io_getevents, ctx, min_nr, max_nr, events, timeout);
}
int main()
{
aio_context_t ctx;
struct iocb cb;
struct iocb *cbs[1];
char data[4096];
struct io_event events[1];
int ret;
int fd;
fd = open("/tmp/testfile", O_RDWR | O_CREAT);
if (fd < 0) {
perror("open error");
return -1;
}
ctx = 0;
ret = io_setup(128, &ctx);
if (ret < 0) {
perror("io_setup error");
return -1;
}
/* setup I/O control block */
memset(&cb, 0, sizeof(cb));
cb.aio_fildes = fd;
cb.aio_lio_opcode = IOCB_CMD_PWRITE;
/* command-specific options */
cb.aio_buf = (uint64_t)data;
cb.aio_offset = 0;
cb.aio_nbytes = 4096;
cbs[0] = &cb;
ret = io_submit(ctx, 1, cbs);
if (ret != 1) {
if (ret < 0)
perror("io_submit error");
else
fprintf(stderr, "could not sumbit IOs");
return -1;
}
/* get the reply */
ret = io_getevents(ctx, 1, 1, events, NULL);
printf("io_getevents return %d, events.res %d \n", ret, events[0].res);
ret = io_destroy(ctx);
if (ret < 0) {
perror("io_destroy error");
return -1;
}
return 0;
}
|
/*
* arch/arm/mach-omap2/board-blaze-panel.c
*
* Copyright (C) 2011 Texas Instruments
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/leds-omap4430sdp-display.h>
#include <linux/platform_device.h>
#include <linux/i2c/twl.h>
#include <plat/i2c.h>
#include "board-blaze.h"
#include "mux.h"
#define DP_4430_GPIO_59 59
#define LED_SEC_DISP_GPIO 27
#define DSI2_GPIO_59 59
#define LED_PWM2ON 0x03
#define LED_PWM2OFF 0x04
#define LED_TOGGLE3 0x92
static void blaze_init_display_led(void)
{
twl_i2c_write_u8(TWL_MODULE_PWM, 0xFF, LED_PWM2ON);
twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, LED_PWM2OFF);
twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x30, LED_TOGGLE3);
}
static void blaze_set_primary_brightness(u8 brightness)
{
if (brightness > 1) {
if (brightness == 255)
brightness = 0x7f;
else
brightness = (~(brightness/2)) & 0x7f;
twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x30, LED_TOGGLE3);
twl_i2c_write_u8(TWL_MODULE_PWM, brightness, LED_PWM2ON);
} else if (brightness <= 1) {
twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x08, LED_TOGGLE3);
twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x38, LED_TOGGLE3);
}
}
static void blaze_set_secondary_brightness(u8 brightness)
{
if (brightness > 0)
brightness = 1;
gpio_set_value(LED_SEC_DISP_GPIO, brightness);
}
static struct omap4430_sdp_disp_led_platform_data blaze_disp_led_data = {
.flags = LEDS_CTRL_AS_ONE_DISPLAY,
.display_led_init = blaze_init_display_led,
.primary_display_set = blaze_set_primary_brightness,
.secondary_display_set = blaze_set_secondary_brightness,
};
static void omap_disp_led_init(void)
{
/* Seconday backlight control */
gpio_request(DSI2_GPIO_59, "dsi2_bl_gpio");
gpio_direction_output(DSI2_GPIO_59, 0);
if (blaze_disp_led_data.flags & LEDS_CTRL_AS_ONE_DISPLAY) {
pr_info("%s: Configuring as one display LED\n", __func__);
gpio_set_value(DSI2_GPIO_59, 1);
}
gpio_request(LED_SEC_DISP_GPIO, "dsi1_bl_gpio");
gpio_direction_output(LED_SEC_DISP_GPIO, 1);
mdelay(120);
gpio_set_value(LED_SEC_DISP_GPIO, 0);
}
static struct platform_device blaze_disp_led = {
.name = "display_led",
.id = -1,
.dev = {
.platform_data = &blaze_disp_led_data,
},
};
int __init blaze_panel_init(void)
{
omap_disp_led_init();
platform_device_register(&blaze_disp_led);
return 0;
}
|
#ifndef JHEADERAREA_H
#define JHEADERAREA_H
#include "jwt_global.h"
#include <QSortFilterProxyModel>
#include <QAbstractItemView>
// - class JHeaderArea -
class JHeaderAreaPrivate;
class JTableSortFilterModel;
class JWT_EXPORT JHeaderArea : public QFrame
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(int titleHeight READ titleHeight WRITE setTitleHeight NOTIFY titleHeightChanged)
Q_PROPERTY(int filterHeight READ filterHeight WRITE setFilterHeight NOTIFY filterHeightChanged)
public:
explicit JHeaderArea(QWidget *parent = nullptr);
~JHeaderArea();
bool autoUpdateTitle() const;
bool titleVisible() const;
QString title() const;
int titleHeight() const;
QFont titleFont() const;
Qt::Alignment titleAlignment() const;
bool filterVisible() const;
int filterHeight() const;
//! QLabel - stypeSheet
void setTitleStyle(const QString &styleSheet);
//! QWidget - styleSheet
void setFilterStyle(const QString &styleSheet);
//! filter
bool filterItemVisible(int column) const;
QStringList filterItem(int column) const;
bool filterItemEditable(int column) const;
void setFilterItemEditable(bool editable, int column = -1);
bool setFilterItem(int column, const QString &text); // QLineEdit
bool setFilterItem(int column, const QStringList &texts = QStringList()); // QComboBox
void setFilterItem(const QList<int> &columns); // QLineEdit
void setFilterItem(const QList<QPair<int, QString> > &columns); // QLineEdit
void setFilterItem(const QList<QPair<int, QStringList> > &columns); // QComboBox
void setFilterItemAsComboBox(const QList<int> columns); // QComboBox
void setAllFilterItemWithLineEdit(); // QLineEdit
void setAllFilterItemWithComboBox(); // QComboBox
void removeFilterItem(int column);
void clearFilterItem();
JTableSortFilterModel *filterModel();
void setFilterModel(JTableSortFilterModel *model);
bool attach(QAbstractItemView *view);
void detach();
Q_SIGNALS:
void titleVisibleChanged(bool);
void titleChanged(const QString &);
void titleHeightChanged(int);
void filterHeightChanged(int);
void filterVisibleChanged(bool);
void attached();
void detached();
public Q_SLOTS:
void setAutoUpdateTitle(bool enable = true);
void setTitleVisible(bool visible = true);
void setTitle(const QString &text);
void setTitleHeight(int height);
void setTitleFont(const QFont &font);
void setTitleAlignment(Qt::Alignment alignment);
void setFilterVisible(bool visible = true);
void setFilterHeight(int height);
void setSwitchEnabled(bool enable = true);
private:
Q_DISABLE_COPY(JHeaderArea)
J_DECLARE_PRIVATE(JHeaderArea)
};
#endif // JHEADERAREA_H
|
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
__visible struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
.name = KBUILD_MODNAME,
.init = init_module,
#ifdef CONFIG_MODULE_UNLOAD
.exit = cleanup_module,
#endif
.arch = MODULE_ARCH_INIT,
};
MODULE_INFO(intree, "Y");
static const struct modversion_info ____versions[]
__used
__attribute__((section("__versions"))) = {
{ 0xb95b937f, __VMLINUX_SYMBOL_STR(module_layout) },
{ 0xd01d57ff, __VMLINUX_SYMBOL_STR(kmalloc_caches) },
{ 0xf9a482f9, __VMLINUX_SYMBOL_STR(msleep) },
{ 0x51eafc8e, __VMLINUX_SYMBOL_STR(param_ops_int) },
{ 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) },
{ 0x5e2ee4ce, __VMLINUX_SYMBOL_STR(dvb_usb_device_exit) },
{ 0xde224bfd, __VMLINUX_SYMBOL_STR(dvb_usb_device_init) },
{ 0x96cc1a34, __VMLINUX_SYMBOL_STR(_mutex_unlock) },
{ 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) },
{ 0x5f754e5a, __VMLINUX_SYMBOL_STR(memset) },
{ 0xe5c22ac0, __VMLINUX_SYMBOL_STR(param_ops_short) },
{ 0x5197cd8d, __VMLINUX_SYMBOL_STR(usb_deregister) },
{ 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) },
{ 0x81c0ddfb, __VMLINUX_SYMBOL_STR(usb_control_msg) },
{ 0x1b056ec3, __VMLINUX_SYMBOL_STR(kmem_cache_alloc_trace) },
{ 0x37a0cba, __VMLINUX_SYMBOL_STR(kfree) },
{ 0x9d669763, __VMLINUX_SYMBOL_STR(memcpy) },
{ 0x1f54e93d, __VMLINUX_SYMBOL_STR(param_array_ops) },
{ 0x43d1951f, __VMLINUX_SYMBOL_STR(usb_register_driver) },
{ 0xbf562cb0, __VMLINUX_SYMBOL_STR(_mutex_lock_interruptible) },
};
static const char __module_depends[]
__used
__attribute__((section(".modinfo"))) =
"depends=dvb-usb";
MODULE_ALIAS("usb:v13D3p3205d*dc*dsc*dp*ic*isc*ip*in*");
MODULE_ALIAS("usb:v13D3p3206d*dc*dsc*dp*ic*isc*ip*in*");
MODULE_ALIAS("usb:v13D3p3223d*dc*dsc*dp*ic*isc*ip*in*");
MODULE_ALIAS("usb:v13D3p3224d*dc*dsc*dp*ic*isc*ip*in*");
MODULE_INFO(srcversion, "4E2E245DB5DAF08B73EEA4E");
|
/** -*- c++ -*-
* Copyright (C) 2011 Hypertable, Inc.
*
* This file is part of Hypertable.
*
* Hypertable 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 any later version.
*
* Hypertable is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef HYPERTABLE_REMOVALMANAGER_H
#define HYPERTABLE_REMOVALMANAGER_H
#include "Common/HashMap.h"
#include "Hypertable/Lib/MetaLogWriter.h"
#include "Operation.h"
#include <list>
#include <boost/thread/condition.hpp>
namespace Hypertable {
class RemovalManagerContext {
public:
RemovalManagerContext() : shutdown(false) { }
class RemovalRec {
public:
RemovalRec() : approvals_remaining(0) { }
RemovalRec(Operation *_op, size_t needed_approvals)
: op(_op), approvals_remaining(needed_approvals) { }
OperationPtr op;
size_t approvals_remaining;
};
typedef hash_map<int64_t, RemovalRec> RemovalMapT;
Mutex mutex;
boost::condition cond;
MetaLog::WriterPtr mml_writer;
RemovalMapT map;
std::list<OperationPtr> removal_queue;
bool shutdown;
};
/**
* RemovalManager is a class that is used manage explicit removal operations.
* Most operations do not require explicit removal and will get removed
* automatically upon completion. However some operations, such as the
* MOVE_RANGE operation, must be explicitly removed only after some condition
* is met (e.g. relinquish acknowledge).
*/
class RemovalManager {
public:
RemovalManager(MetaLog::WriterPtr &mml_writer);
void operator()();
void shutdown();
bool add_operation(OperationPtr &operation) { return add_operation(operation.get()); }
bool add_operation(Operation *operation);
void approve_removal(int64_t hash_code);
void approve_removal(OperationPtr &operation) { approve_removal(operation->hash_code()); }
private:
RemovalManagerContext *m_ctx;
Thread *m_thread;
};
} // namespace Hypertable
#endif // HYPERTABLE_REMOVALMANAGER_H
|
/*
* \brief Provide informations about a client of an eavesdropping CPU service
* \author Martin Stein
* \date 2012-06-11
*/
/*
* Copyright (C) 2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__CPU_CLIENT_H_
#define _INCLUDE__CPU_CLIENT_H_
/* Genode includes */
#include <cpu_session/cpu_session.h>
/* local includes */
#include <util/indexed.h>
namespace Init
{
using namespace Genode;
/**
* Provide informations about a client of an eavesdropping CPU service
*/
class Cpu_client : public Capability_indexed<Cpu_client>
{
Cpu_session * const _session; /* related CPU session */
public:
/**
* Constructor
*
* \param thread_cap capability of related thread
* \param session related CPU session
*/
Cpu_client(Thread_capability thread_cap,
Cpu_session * const session)
:
Capability_indexed(thread_cap), _session(session)
{ }
/***************
** Accessors **
***************/
Cpu_session * session() const { return _session; }
};
}
#endif /* _INCLUDE__CPU_CLIENT_H_ */
|
/*
* Copyright (C) 2002-2006 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DOSBOX_PARPORT_H
#define DOSBOX_PARPORT_H
// set to 1 for debug messages and debugging log:
#define PARALLEL_DEBUG 1
#ifndef DOSBOX_DOSBOX_H
#include "dosbox.h"
#endif
#ifndef DOSBOX_INOUT_H
#include "inout.h"
#endif
#include "setup.h"
#include "dos_inc.h"
#include "programs.h"
class device_LPT : public DOS_Device {
public:
// Creates a LPT device that communicates with the num-th parallel port, i.e. is LPTnum
device_LPT(Bit8u num, class CParallel* pp);
~device_LPT();
bool Read(Bit8u * data,Bit16u * size);
bool Write(Bit8u * data,Bit16u * size);
bool Seek(Bit32u * pos,Bit32u type);
bool Close();
Bit16u GetInformation(void);
private:
CParallel* pportclass;
Bit8u num; // This device is LPTnum
};
class CParallel {
public:
#if PARALLEL_DEBUG
FILE * debugfp;
bool dbg_data;
bool dbg_putchar;
bool dbg_cregs;
bool dbg_plainputchar;
bool dbg_plaindr;
void log_par(bool active, char const* format,...);
#endif
// Constructor
CParallel(CommandLine* cmd, Bitu portnr, Bit8u initirq);
virtual ~CParallel();
IO_ReadHandleObject ReadHandler[3];
IO_WriteHandleObject WriteHandler[3];
void Timer(void);
virtual void Timer2(void)=0;
Bitu base;
Bitu irq;
// read data line register
virtual Bitu Read_PR()=0;
virtual Bitu Read_COM()=0;
virtual Bitu Read_SR()=0;
virtual void Write_PR(Bitu)=0;
virtual void Write_CON(Bitu)=0;
virtual void Write_IOSEL(Bitu)=0;
void Write_reserved(Bit8u data, Bit8u address);
virtual bool Putchar(Bit8u)=0;
bool Putchar_default(Bit8u);
Bit8u getPrinterStatus();
void initialize();
private:
DOS_Device* mydosdevice;
};
extern CParallel* parallelPortObjects[];
void PARALLEL_Init (Section * sec);
const Bit16u parallel_baseaddr[3] = {0x378,0x278,0x3bc};
#endif
|
/***************************************************************************
qgscodeeditorsql.h - A SQL editor based on QScintilla
--------------------------------------
Date : 06-Oct-2013
Copyright : (C) 2013 by Salvatore Larosa
Email : lrssvtml (at) gmail (dot) 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. *
* *
***************************************************************************/
#ifndef QGSCODEEDITORSQL_H
#define QGSCODEEDITORSQL_H
#include "qgscodeeditor.h"
#include "qgis_gui.h"
/** \ingroup gui
* A SQL editor based on QScintilla2. Adds syntax highlighting and
* code autocompletion.
* \note added in 2.6
* \note may not be available in Python bindings, depending on platform support
*/
class GUI_EXPORT QgsCodeEditorSQL : public QgsCodeEditor
{
Q_OBJECT
public:
QgsCodeEditorSQL( QWidget *parent = nullptr );
private:
//QgsCodeEditor *mSciWidget;
//QWidget *mWidget;
void setSciLexerSQL();
};
#endif
|
/*
* File: main.c
* Author: Harpal
*
* Created on 25 settembre 2014, 10.24
*/
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "functions.h"
#include "lcd.h"
#include "motorEncoder.h"
#include <pic18f47j53.h>
#include <xc.h>
/*
*
*/
void interrupt ISR(void);
void showTempLight(void);
void showAccelerometerVal(void);
void showDistance(void);
int main(int argc, char** argv) {
int i;
TRISD = 0x00;
TRISA = 0xff;
TRISC = 0xff;
EECON2 = 0x55;
EECON2 = 0xAA;
PPSCONbits.IOLOCK = 0;
RPINR1 = 18;
EECON2 = 0x55;
EECON2 = 0xAA;
PPSCONbits.IOLOCK = 1;
//INTCONbits.RBIE = 1; //PortB interrupt on change;
INTCON2bits.INTEDG1 = 1; //Interrupt on rising edge
INTCON3bits.INT1IE = 1; //enable external interrupt 1
INTCONbits.GIE = 1; //enabling all the interrupts
ANCON0 = 0b11111111; //set All pin as digital
ANCON1 |= 0b00001111;
lcdInit();
//MOTOR_init();
//MOTOR_testMotors();
//MOTOR_moveTest();
while (1) {
//MOTOR_forward(130);
//encoder_move_degree(720, 100, 1);
/*MOTOR_forward(50);
for(int i = 0; i < 1000; i++) __delay_ms(10);
MOTOR_forward(100);
for(int i = 0; i < 1000; i++) __delay_ms(10);
MOTOR_forward(200);
for(int i = 0; i < 1000; i++) __delay_ms(10);
MOTOR_forward(255);
//MOTOR_backwardT(255,10);
*/
//for(int i = 0; i < 300; i++) __delay_ms(10);
//MOTOR_stop();
//MOTOR_testMotors();
/*
//Controlling the motor speed through PWM signal
for (int i = 0; i < 255; i++) {
CCPR4L = i;
__delay_ms(20);
}
for (int i = 255; i > 0; i--) {
CCPR4L = i;
__delay_ms(20);
}*/
/*
showDistance();
__delay_ms(50);
__delay_ms(50);
for(i = 1; i < 180; i+=15)
{
setServo(i);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
}
for(i = 180; i > 1; i-=15)
{
setServo(i);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
__delay_ms(50);
}
/*
showTempLight();
for(i = 0; i < 10; i++) __delay_ms(10);
showAccelerometerVal();
for(i = 0; i < 100; i++) __delay_ms(10);
*/
}
return (EXIT_SUCCESS);
}
void interrupt ISR(void) {
if (INTCONbits.RBIF == 1) {
//__delay_us(100);
if (PORTBbits.RB4 == 0) {
//showTempLight();
}
if (PORTBbits.RB5 == 0) {
//showAccelerometerVal();
}
if (PORTBbits.RB6 == 0) {
}
INTCONbits.RBIF = 0; //resetting the interrupt flag
}
if (INTCON3bits.INT1IF == 1) {
lcdClear();
lcdWriteStrC(readSwitch());
__delay_ms(50);
INTCON3bits.INT1IF = 0;
}
}
void showDistance(void) {
char buffer [10];
lcdClear();
lcdSetPos(0, 0);
lcdWriteStrC("Distance: [cm/uS]");
lcdSetPos(0, 1);
sprintf(buffer, "%3.3f", readDistance());
lcdWriteStrC(buffer);
}
void showTempLight(void) {
char buffer [10];
lcdClear();
lcdSetPos(0, 0);
sprintf(buffer, "temp: %1.3f", readTempF());
lcdWriteStrC(buffer);
lcdSetPos(0, 1);
sprintf(buffer, "light: %d", readLight());
lcdWriteStrC(buffer);
}
void showAccelerometerVal(void) {
char buffer [10];
lcdClear();
lcdWriteStrC("Aclmtr values:");
lcdSetPos(0, 1);
sprintf(buffer, "%1.2f", single_axis_measure(X_AXIS, iteration_point));
lcdWriteStrC(buffer);
lcdWriteChar(' ');
sprintf(buffer, "%1.2f", single_axis_measure(Y_AXIS, iteration_point));
lcdWriteStrC(buffer);
lcdWriteChar(' ');
sprintf(buffer, "%1.2f", single_axis_measure(Z_AXIS, iteration_point));
lcdWriteStrC(buffer);
}
|
#ifndef _TAF_MMA_SND_MMC_H_
#define _TAF_MMA_SND_MMC_H_
/*****************************************************************************
1 ÆäËûÍ·Îļþ°üº¬
*****************************************************************************/
#include "MmaMmcInterface.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#pragma pack(4)
/*****************************************************************************
2 ºê¶¨Òå
*****************************************************************************/
/*****************************************************************************
3 ö¾Ù¶¨Òå
*****************************************************************************/
/*****************************************************************************
4 È«¾Ö±äÁ¿ÉùÃ÷
*****************************************************************************/
/*****************************************************************************
5 ÏûϢͷ¶¨Òå
*****************************************************************************/
/*****************************************************************************
6 ÏûÏ¢¶¨Òå
*****************************************************************************/
/*****************************************************************************
7 STRUCT¶¨Òå
*****************************************************************************/
/*****************************************************************************
8 UNION¶¨Òå
*****************************************************************************/
/*****************************************************************************
9 OTHERS¶¨Òå
*****************************************************************************/
/*****************************************************************************
10 º¯ÊýÉùÃ÷
*****************************************************************************/
VOS_UINT32 TAF_MMA_SndMmcStartReq(
MMA_MMC_CARD_STATUS_ENUM_UINT8 ucCardStatus,
MMA_MMC_PLMN_RAT_PRIO_STRU *pstPlmnRatPrio
);
VOS_UINT32 TAF_MMA_SndMmcSignalReportReq(
VOS_UINT8 ucActionType,
VOS_UINT8 ucRrcMsgType,
VOS_UINT8 ucSignThreshold,
VOS_UINT8 ucMinRptTimerInterval
);
VOS_UINT32 TAF_MMA_SndMmcModeChangeReq(
MMA_MMC_MS_MODE_ENUM_UINT32 enMsMode
);
VOS_UINT32 TAF_MMA_SndMmcAttachReq(
VOS_UINT32 ulOpID,
MMA_MMC_ATTACH_TYPE_ENUM_UINT32 enAttachType,
TAF_MMA_EPS_ATTACH_REASON_ENUM_UINT8 enAttachReason
);
VOS_UINT32 TAF_MMA_SndMmcDetachReq(
VOS_UINT32 ulOpID,
MMA_MMC_DETACH_TYPE_ENUM_UINT32 enDetachType,
TAF_MMA_DETACH_CAUSE_ENUM_UINT8 enDetachCause
);
VOS_UINT32 TAF_MMA_SndMmcPlmnListReq(VOS_VOID);
VOS_UINT32 TAF_MMA_SndMmcPlmnListAbortReq(VOS_VOID);
VOS_UINT32 TAF_MMA_SndMmcPlmnUserReselReq(MMA_MMC_PLMN_SEL_MODE_ENUM_UINT32 enPlmnSelMode);
VOS_UINT32 TAF_MMA_SndMmcPlmnSpecialReq(
MMA_MMC_PLMN_ID_STRU *pstPlmnId,
MMA_MMC_NET_RAT_TYPE_ENUM_UINT8 enAccessMode
);
VOS_UINT32 TAF_MMA_SndMmcPowerOffReq(
MMA_MMC_POWER_OFF_CAUSE_ENUM_UINT32 enCause
);
VOS_UINT32 TAF_MMA_SndMmcSysCfgReq(
TAF_MMA_SYS_CFG_PARA_STRU *pSysCfgReq,
VOS_UINT16 usSetFlg
);
VOS_UINT32 TAF_MMA_SndMmcNetScanMsgReq(
TAF_MMA_NET_SCAN_REQ_STRU *pstNetScanReq
);
VOS_UINT32 TAF_MMA_SndMmcAbortNetScanMsgReq(VOS_VOID);
VOS_UINT32 TAF_MMA_SndMmcPlmnSearchReq(VOS_VOID);
VOS_UINT32 TAF_MMA_SndMmcSpecPlmnSearchAbortReq(VOS_VOID);
VOS_UINT32 TAF_MMA_SndMmcOmMaintainInfoInd(
VOS_UINT8 ucOmConnectFlg,
VOS_UINT8 ucOmPcRecurEnableFlg
);
VOS_UINT32 TAF_MMA_SndMmcUpdateUplmnNtf( VOS_VOID );
#if (FEATURE_MULTI_MODEM == FEATURE_ON)
VOS_UINT32 TAF_MMA_SndMmcOtherModemInfoNotify(
struct MsgCB *pstMsg
);
VOS_UINT32 TAF_MMA_SndMmcOtherModemDplmnNplmnInfoNotify(
struct MsgCB *pstMsg
);
VOS_UINT32 TAF_MMA_SndMmcNcellInfoInd(
struct MsgCB *pstMsg
);
VOS_UINT32 TAF_MMA_SndMmcPsTransferInd(
struct MsgCB *pstMsg
);
#endif
VOS_VOID TAF_MMA_SndMmcEOPlmnSetReq(
TAF_MMA_SET_EOPLMN_LIST_STRU *pstEOPlmnSetPara
);
VOS_VOID TAF_MMA_SndMmcImsVoiceCapInd(
VOS_UINT8 ucImsVoiceAvail
);
VOS_UINT32 TAF_MMA_SndMmcAcqReq(
TAF_MMA_ACQ_PARA_STRU *pstMmaAcqPara
);
VOS_UINT32 TAF_MMA_SndMmcRegReq(
TAF_MMA_REG_PARA_STRU *pstMmaRegPara
);
VOS_UINT32 TAF_MMA_SndMmcPowerSaveReq(
TAF_MMA_POWER_SAVE_PARA_STRU *pstMmaPowerSavePara
);
VOS_VOID TAF_MMA_SndMmcImsSrvInfoNotify(
VOS_UINT8 ucImsCallFlg
);
#if (VOS_OS_VER == VOS_WIN32)
#pragma pack()
#else
#pragma pack(0)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* end of TafSdcLib.h */
|
/*
* arch/arm/mach-omap2/board-44xx-tablet-sensors.c
*
* Copyright (C) 2011 Texas Instruments
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/i2c/bma180.h>
#include <linux/i2c/tsl2771.h>
#include <linux/i2c/mpu3050.h>
#include <plat/i2c.h>
#include "board-44xx-tablet.h"
#include "mux.h"
#define OMAP4_BMA180ACCL_GPIO 178
#define OMAP4_TSL2771_INT_GPIO 184
#define OMAP4_TSL2771_PWR_GPIO 188
#define OMAP4_MPU3050GYRO_GPIO 2
/* BMA180 Accelerometer Begin */
static struct bma180accel_platform_data bma180accel_platform_data = {
.ctrl_reg0 = 0x11,
.g_range = BMA_GRANGE_2G,
.bandwidth = BMA_BW_10HZ,
.mode = BMA_MODE_LOW_NOISE,
.bit_mode = BMA_BITMODE_14BITS,
.smp_skip = 1,
.def_poll_rate = 200,
.fuzz_x = 25,
.fuzz_y = 25,
.fuzz_z = 25,
};
static void blaze_tablet_bma180accl_init(void)
{
if (gpio_request(OMAP4_BMA180ACCL_GPIO, "Accelerometer") < 0) {
pr_err("Accelerometer GPIO request failed\n");
return;
}
gpio_direction_input(OMAP4_BMA180ACCL_GPIO);
}
/* BMA180 Accelerometer End */
/* TSL2771 ALS/Prox Begin */
static void omap_tsl2771_power(int state)
{
gpio_set_value(OMAP4_TSL2771_PWR_GPIO, state);
}
static void blaze_tablet_tsl2771_init(void)
{
/* TO DO: Not sure what the use case of the proximity is on a tablet
* but the interrupt may need to be wakeable if and only if proximity
* is enabled but for now leave it alone */
gpio_request(OMAP4_TSL2771_PWR_GPIO, "tsl2771_power");
gpio_direction_output(OMAP4_TSL2771_PWR_GPIO, 0);
gpio_request(OMAP4_TSL2771_INT_GPIO, "tsl2771_interrupt");
gpio_direction_input(OMAP4_TSL2771_INT_GPIO);
}
/* TO DO: Need to create a interrupt threshold table here */
struct tsl2771_platform_data tsl2771_data = {
.irq_flags = (IRQF_TRIGGER_LOW | IRQF_ONESHOT),
.flags = (TSL2771_USE_ALS | TSL2771_USE_PROX),
.def_enable = 0x0,
.als_adc_time = 0xdb,
.prox_adc_time = 0xff,
.wait_time = 0x00,
.als_low_thresh_low_byte = 0x0,
.als_low_thresh_high_byte = 0x0,
.als_high_thresh_low_byte = 0x0,
.als_high_thresh_high_byte = 0x0,
.prox_low_thresh_low_byte = 0x0,
.prox_low_thresh_high_byte = 0x0,
.prox_high_thresh_low_byte = 0x0,
.prox_high_thresh_high_byte = 0x0,
.interrupt_persistence = 0xf6,
.config = 0x00,
.prox_pulse_count = 0x03,
.gain_control = 0xE0,
.glass_attn = 0x01,
.device_factor = 0x34,
.tsl2771_pwr_control = omap_tsl2771_power,
};
/* TSL2771 ALS/Prox End */
/* MPU3050 Gyro Begin */
static void blaze_tablet_mpu3050_init(void)
{
if (gpio_request(OMAP4_MPU3050GYRO_GPIO, "mpu3050") < 0) {
pr_err("%s: MPU3050 GPIO request failed\n", __func__);
return;
}
gpio_direction_input(OMAP4_MPU3050GYRO_GPIO);
}
static struct mpu3050gyro_platform_data mpu3050_platform_data = {
.irq_flags = (IRQF_TRIGGER_HIGH | IRQF_ONESHOT),
.default_poll_rate = 200,
.slave_i2c_addr = 0x40,
.sample_rate_div = 0x00,
.dlpf_fs_sync = 0x10,
.interrupt_cfg = (MPU3050_INT_CFG_OPEN | MPU3050_INT_CFG_LATCH_INT_EN |
MPU3050_INT_CFG_MPU_RDY_EN | MPU3050_INT_CFG_RAW_RDY_EN),
};
/* MPU3050 Gyro End */
static struct i2c_board_info __initdata blaze_tablet_i2c_bus4_sensor_info[] = {
{
I2C_BOARD_INFO("bmp085", 0x77),
},
{
I2C_BOARD_INFO("hmc5843", 0x1e),
},
{
I2C_BOARD_INFO("bma180_accel", 0x40),
.platform_data = &bma180accel_platform_data,
},
{
I2C_BOARD_INFO("mpu3050_gyro", 0x68),
.platform_data = &mpu3050_platform_data,
},
{
I2C_BOARD_INFO(TSL2771_NAME, 0x39),
.platform_data = &tsl2771_data,
.irq = OMAP_GPIO_IRQ(OMAP4_TSL2771_INT_GPIO),
},
};
int __init tablet_sensor_init(void)
{
blaze_tablet_tsl2771_init();
blaze_tablet_mpu3050_init();
blaze_tablet_bma180accl_init();
i2c_register_board_info(4, blaze_tablet_i2c_bus4_sensor_info,
ARRAY_SIZE(blaze_tablet_i2c_bus4_sensor_info));
return 0;
}
|
/*
* audio.h: The basic audio interface
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: audio.h 4.0 2008/07/06 11:39:21 kls Exp $
*/
#ifndef __AUDIO_H
#define __AUDIO_H
#include "thread.h"
#include "tools.h"
class cAudio : public cListObject {
protected:
cAudio(void);
public:
virtual ~cAudio();
virtual void Play(const uchar *Data, int Length, uchar Id) = 0;
///< Plays the given block of audio Data. Must return as soon as possible.
///< If the entire block of data can't be processed immediately, it must
///< be copied and processed in a separate thread. The Data is always a
///< complete PES audio packet. Id indicates the type of audio data this
///< packet holds.
virtual void PlayTs(const uchar *Data, int Length) = 0;
///< Plays the given block of audio Data. Must return as soon as possible.
///< If the entire block of data can't be processed immediately, it must
///< be copied and processed in a separate thread. The Data is always a
///< complete TS audio packet.
virtual void Mute(bool On) = 0;
///< Immediately sets the audio device to be silent (On==true) or to
///< normal replay (On==false).
virtual void Clear(void) = 0;
///< Clears all data that might still be awaiting processing.
};
class cAudios : public cList<cAudio> {
public:
void PlayAudio(const uchar *Data, int Length, uchar Id);
void PlayTsAudio(const uchar *Data, int Length);
void MuteAudio(bool On);
void ClearAudio(void);
};
extern cAudios Audios;
class cExternalAudio : public cAudio {
private:
char *command;
cPipe pipe;
bool mute;
public:
cExternalAudio(const char *Command);
virtual ~cExternalAudio();
virtual void Play(const uchar *Data, int Length, uchar Id);
virtual void PlayTs(const uchar *Data, int Length);
virtual void Mute(bool On);
virtual void Clear(void);
};
#endif //__AUDIO_H
|
static int reduce(int n, const int d[]) {
int s, i;
for (i = s = 0; i < n; ++i) s += d[i];
return s;
}
static void pack_pp(const DMap m, const Particle *pp, /**/ dBags bags) {
int n;
const int S = sizeof(Particle) / sizeof(float2);
float2p26 wrap;
bag2Sarray(bags, &wrap);
n = reduce(NFRAGS, m.hcounts);
KL((dflu_dev::pack<float2, S>), (k_cnf(S*n)), ((const float2*)pp, m, /**/ wrap));
}
static void pack_ii(const DMap m, const int *ii, /**/ dBags bags) {
int n;
const int S = 1;
intp26 wrap;
bag2Sarray(bags, &wrap);
n = reduce(NFRAGS, m.hcounts);
KL((dflu_dev::pack<int, S>), (k_cnf(S*n)), (ii, m, /**/ wrap));
}
void dflu_pack(const FluQuants *q, /**/ DFluPack *p) {
UC(pack_pp(p->map, q->pp, /**/ p->dpp));
if (p->opt.ids) UC(pack_ii(p->map, q->ii, /**/ p->dii));
if (p->opt.colors) UC(pack_ii(p->map, q->cc, /**/ p->dcc));
}
struct ExceedData { int cap, cnt, fid; };
enum {OK, FAIL};
static int check_counts(int nfrags, const int *counts, const hBags *hpp, /**/ ExceedData *e) {
int fid, cnt, cap;
for (fid = 0; fid < nfrags; ++fid) {
cnt = counts[fid];
cap = comm_get_number_capacity(fid, hpp);
if (cnt > cap) {
e->cap = cap; e->cnt = cnt; e->fid = fid;
return FAIL;
}
}
return OK;
}
static void fail_exceed(ExceedData *e) {
enum {X, Y, Z};
int cap, cnt, fid, d[3];
cap = e->cap; cnt = e->cnt; fid = e->fid;
frag_hst::i2d3(fid, d);
ERR("exceed capacity, fragment %d = [%d %d %d]: %d/%d",
fid, d[X], d[Y], d[Z], cnt, cap);
}
static void dflu_download0(DFluPack *p) {
size_t sz;
int *cnt;
sz = NFRAGS * sizeof(int);
cnt = p->map.hcounts;
dSync(); /* wait for pack kernels */
memcpy(p->hpp.counts, cnt, sz);
if (p->opt.ids) memcpy(p->hii.counts, cnt, sz);
if (p->opt.colors) memcpy(p->hcc.counts, cnt, sz);
p->nhalo = reduce(NFRAGS, cnt);
}
void dflu_download(DFluPack *p, /**/ DFluStatus *s) {
ExceedData e;
int r;
int *cnt;
cnt = p->map.hcounts;
r = check_counts(NFRAGS, cnt, &p->hpp, /**/ &e);
if (r == OK) {
UC(dflu_download0(p));
}
else {
if (dflu_status_nullp(s)) UC(fail_exceed(&e));
else UC(dflu_status_exceed(e.fid, e.cnt, e.cap, /**/ s));
}
}
|
/* tarfs - A GNU tar filesystem for the Hurd.
Copyright (C) 2002, Ludovic Courtès <ludo@chbouib.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 */
#include <hurd.h>
#include <hurd/netfs.h>
#include <hurd/paths.h>
#include <argp.h>
#include <errno.h>
#include <error.h>
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <fcntl.h>
#include <maptime.h>
#include "backend.h"
/* Choose the right backend here. */
extern struct fs_backend tarfs_backend;
struct fs_backend backend;
/* The underlying node. */
mach_port_t ul_node;
/* Has to be defined for libnetfs... */
int netfs_maxsymlinks = 2;
/* Main. */
int
main (int argc, char **argv)
{
struct argp fs_argp;
mach_port_t bootstrap_port;
struct iouser *user;
error_t err;
/* Defaults to tarfs. */
backend = tarfs_backend;
backend.get_argp (&fs_argp);
argp_parse (&fs_argp, argc, argv, 0, 0, 0);
task_get_bootstrap_port (mach_task_self (), &bootstrap_port);
/* Init netfs, the root_node and the backend, */
netfs_init ();
err = iohelp_create_simple_iouser (&user, getuid (), getgid ());
if (err)
error (1, err, "Cannot create iouser");
err = backend.init (&netfs_root_node, user);
if (err)
error (EXIT_FAILURE, err, "cannot create root node");
ul_node = netfs_startup (bootstrap_port, 0);
for (;;)
netfs_server_loop ();
/* Never reached. */
exit (0);
}
|
/*
* Copyright (C) 2009-2010 Nick Schermer <nick@xfce.org>
*
* This library 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 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 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
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <dbus/dbus-glib.h>
#include <common/panel-private.h>
#include <common/panel-xfconf.h>
#include <libheartlenvpanel/xfce-panel-macros.h>
static void
panel_properties_store_value (XfconfChannel *channel,
const gchar *xfconf_property,
GType xfconf_property_type,
GObject *object,
const gchar *object_property)
{
GValue value = { 0, };
GdkColor *color;
guint16 alpha = 0xffff;
#ifndef NDEBUG
GParamSpec *pspec;
#endif
panel_return_if_fail (G_IS_OBJECT (object));
panel_return_if_fail (XFCONF_IS_CHANNEL (channel));
#ifndef NDEBUG
/* check if the types match */
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), object_property);
panel_assert (pspec != NULL);
panel_assert (G_PARAM_SPEC_VALUE_TYPE (pspec) == xfconf_property_type);
#endif
/* write the property to the xfconf channel */
g_value_init (&value, xfconf_property_type);
g_object_get_property (G_OBJECT (object), object_property, &value);
if (G_LIKELY (xfconf_property_type != GDK_TYPE_COLOR))
{
xfconf_channel_set_property (channel, xfconf_property, &value);
}
else
{
/* work around xfconf's lack of storing colors (bug #7117) and
* do the same as xfconf_g_property_bind_gdkcolor() does */
color = g_value_get_boxed (&value);
xfconf_channel_set_array (channel, xfconf_property,
XFCONF_TYPE_UINT16, &color->red,
XFCONF_TYPE_UINT16, &color->green,
XFCONF_TYPE_UINT16, &color->blue,
XFCONF_TYPE_UINT16, &alpha,
G_TYPE_INVALID);
}
g_value_unset (&value);
}
XfconfChannel *
panel_properties_get_channel (GObject *object_for_weak_ref)
{
GError *error = NULL;
XfconfChannel *channel;
panel_return_val_if_fail (G_IS_OBJECT (object_for_weak_ref), NULL);
if (!xfconf_init (&error))
{
g_critical ("Failed to initialize Xfconf: %s", error->message);
g_error_free (error);
return NULL;
}
channel = xfconf_channel_get (XFCE_PANEL_CHANNEL_NAME);
g_object_weak_ref (object_for_weak_ref, (GWeakNotify) xfconf_shutdown, NULL);
return channel;
}
void
panel_properties_bind (XfconfChannel *channel,
GObject *object,
const gchar *property_base,
const PanelProperty *properties,
gboolean save_properties)
{
const PanelProperty *prop;
gchar *property;
panel_return_if_fail (channel == NULL || XFCONF_IS_CHANNEL (channel));
panel_return_if_fail (G_IS_OBJECT (object));
panel_return_if_fail (property_base != NULL && *property_base == '/');
panel_return_if_fail (properties != NULL);
if (G_LIKELY (channel == NULL))
channel = panel_properties_get_channel (object);
panel_return_if_fail (XFCONF_IS_CHANNEL (channel));
/* walk the properties array */
for (prop = properties; prop->property != NULL; prop++)
{
property = g_strconcat (property_base, "/", prop->property, NULL);
if (save_properties)
panel_properties_store_value (channel, property, prop->type, object, prop->property);
if (G_LIKELY (prop->type != GDK_TYPE_COLOR))
xfconf_g_property_bind (channel, property, prop->type, object, prop->property);
else
xfconf_g_property_bind_gdkcolor (channel, property, object, prop->property);
g_free (property);
}
}
void
panel_properties_unbind (GObject *object)
{
xfconf_g_property_unbind_all (object);
}
GType
panel_properties_value_array_get_type (void)
{
static volatile gsize type__volatile = 0;
GType type;
if (g_once_init_enter (&type__volatile))
{
type = dbus_g_type_get_collection ("GPtrArray", G_TYPE_VALUE);
g_once_init_leave (&type__volatile, type);
}
return type__volatile;
}
|
/* This procedure examines a file system and figures out whether it is
* version 1 or version 2. It returns the result as an int. If the
* file system is neither, it returns -1. A typical call is:
*
* n = fsversion("/dev/hd1", "df");
*
* The first argument is the special file for the file system.
* The second is the program name, which is used in error messages.
*/
#include <sys/types.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <nucleos/const.h>
#include <nucleos/magic.h>
#include <servers/fs/minixfs/const.h>
#include <servers/fs/minixfs/type.h>
#include <servers/fs/minixfs/super.h>
#include <servers/fs/ext2/const.h>
#include <servers/fs/ext2/type.h>
#include <servers/fs/ext2/super.h>
static char super[SUPER_BLOCK_BYTES];
#define MAGIC_OFFSET_MINIXFS 0x18
#define MAGIC_OFFSET_EXT 0x38
static int check_super(off_t offset, unsigned short magic)
{
return (memcmp(super + offset, &magic, sizeof(magic)) == 0) ? 1 : 0;
}
int fsversion(dev, prog)
char *dev, *prog;
{
int fd;
if ((fd = open(dev, O_RDONLY)) < 0) {
std_err(prog);
std_err(" cannot open ");
perror(dev);
return(-1);
}
lseek(fd, (off_t) SUPER_BLOCK_BYTES, SEEK_SET); /* skip boot block */
if (read(fd, (char *) &super, sizeof(super)) != sizeof(super)) {
std_err(prog);
std_err(" cannot read super block on ");
perror(dev);
close(fd);
return(-1);
}
close(fd);
/* first check MFS, a valid MFS may look like EXT but not vice versa */
if (check_super(MAGIC_OFFSET_MINIXFS, MINIX_SUPER_MAGIC))
return FSVERSION_MFS1;
if (check_super(MAGIC_OFFSET_MINIXFS, MINIX2_SUPER_MAGIC))
return FSVERSION_MFS2;
if (check_super(MAGIC_OFFSET_MINIXFS, MINIX3_SUPER_MAGIC))
return FSVERSION_MFS3;
if (check_super(MAGIC_OFFSET_EXT, EXT2_SUPER_MAGIC))
return FSVERSION_EXT2;
return(-1);
}
|
#pragma once
#define DARK_PLUGINS_SHOW_SHOWCODE_DEFAULT 0
#define DARK_PLUGINS_SHOW_SHOWCODE_NO_TIME 0x1
#define DARK_PLUGINS_SHOW_SHOWCODE_NO_CMD 0x2
#define DARK_PLUGINS_SHOW_SHOWCODE_NO_STYLE 0x4
#define DARK_PLUGINS_SHOW_SHOWCODE_NO_CODE 0x8
struct js_result
{
int code;
std::string msg;
std::size_t showcode;
js_result()
{
code = 0;
showcode = 0;
}
};
typedef boost::shared_ptr<js_result> js_result_t;
#define DARK_PLUGINS_AUTOCOMPLETE_SHOWCODE_DEFAULT 0
#define DARK_PLUGINS_AUTOCOMPLETE_SHOWCODE_NO_STYLE 0x1 //²»ï@ʾĬÕJïL¸ñ (¿Õ¸ñ бów ...)
#define DARK_PLUGINS_AUTOCOMPLETE_SHOWCODE_CMD 0x2 //ï@ʾÃüÁîtext ºÍ ×ÔÓÍê³Écmd ²»Í¬
struct autocomplete_node
{
//ÈçºÎï@ʾ
std::size_t code;
//ï@ʾµÄ ÃüÁîÌáʾ
std::string text;
//×ÔÓÍê³É¦ ÃüÁî
//Èç¹û]ÔOÖà DARK_PLUGINS_AUTOCOMPLETE_SHOWCODE_CMD ÙÐÔ t cmd ʹÓà textµÄÈÈÝ
std::string cmd;
autocomplete_node()
{
code = DARK_PLUGINS_AUTOCOMPLETE_SHOWCODE_DEFAULT;
}
};
typedef boost::shared_ptr<autocomplete_node> js_autocomplete_node_t; |
/*
* Document-class: FastXml::AttrList
*
* call-seq:
* doc = FastXml( docfile ) # from FastXml::Doc
* n = doc.root # pull the root node
* attrlist = n.attr # pull the FastXml::AttrList for the node
* puts attrlist[:some_attr]
* puts attrlist["some_attr"]
*/
// Please see the LICENSE file for copyright, licensing and distribution information
#include "fastxml.h"
#include "fastxml_node.h"
#include "fastxml_doc.h"
#include "fastxml_nodelist.h"
#include "fastxml_attrlist.h"
/* {{{ fastml_attr_list
*/
void Init_fastxml_attrlist()
{
#ifdef RDOC_SHOULD_BE_SMARTER__THIS_IS_NEVER_RUN
rb_mFastXml = rb_define_module( "FastXml" );
#endif
rb_cFastXmlAttrList = rb_define_class_under( rb_mFastXml, "AttrList", rb_cObject );
rb_include_module( rb_cFastXmlAttrList, rb_mEnumerable );
rb_define_method( rb_cFastXmlAttrList, "initialize", fastxml_attrlist_initialize, 0 );
rb_define_method( rb_cFastXmlAttrList, "[]", fastxml_attrlist_indexer, 1 );
rb_define_method( rb_cFastXmlAttrList, "[]=", fastxml_attrlist_indexer_set, 2 );
rb_define_method( rb_cFastXmlAttrList, "include?", fastxml_attrlist_include, 1 );
}
VALUE fastxml_attrlist_initialize(VALUE self)
{
return self;
}
/* Returns the value of the attribute with the provided attr_name
* as a string.
* nil if the attribute does not exist.
*
* call-seq:
* puts node.attr[:an_attr_name]
*/
VALUE fastxml_attrlist_indexer(VALUE self, VALUE attr_name)
{
VALUE ret, dv, attr_raw_str;
fxml_data_t *data;
xmlChar *raw_ret, *name_str;
if (attr_name == Qnil)
return Qnil;
dv = rb_iv_get( self, "@lxml_doc" );
Data_Get_Struct( dv, fxml_data_t, data );
attr_raw_str = rb_funcall( attr_name, s_to_s, 0 );
name_str = (xmlChar*)StringValuePtr( attr_raw_str );
raw_ret = xmlGetProp( data->node, name_str );
if (raw_ret == NULL)
return Qnil;
ret = rb_str_new2( (const char*)raw_ret );
xmlFree( raw_ret );
return ret;
}
/* Assignes a value to the attribute with the provided attr_name.
* if the value provided is nil, the attribute is removed from the element.
*
* call-seq:
* node.attr[:an_attr_name] = "testing" # adds the attribute if it doesn't exist
* node.attr[:an_attr_name] = nil # removes the attribute if it exists
*/
VALUE fastxml_attrlist_indexer_set(VALUE self, VALUE attr_name, VALUE attr_value)
{
VALUE dv, attr_raw_str;
fxml_data_t *data;
xmlChar *val, *name_str;
if (attr_name == Qnil)
return Qnil;
dv = rb_iv_get( self, "@lxml_doc" );
Data_Get_Struct( dv, fxml_data_t, data );
attr_raw_str = rb_funcall( attr_name, s_to_s, 0 );
name_str = (xmlChar*)StringValuePtr( attr_raw_str );
if (attr_value == Qnil) {
xmlUnsetProp( data->node, name_str ); // don't care if the node doesn't exist, as the end result is the same.
} else {
val = (xmlChar*)StringValuePtr( attr_value );
xmlSetProp( data->node, name_str, val );
}
return attr_value;
}
/* Returns True if the FastXml::AttrList contains an attribute
* with the specified attr_name. Returns nil otherwise.
*
* call-seq:
* puts "FAIL" unless node.attr.include?(:a_required_node)
*/
VALUE fastxml_attrlist_include(VALUE self, VALUE attr_name)
{
VALUE dv, attr_raw_str;
fxml_data_t *data;
xmlChar *raw_ret, *name_str;
if (attr_name == Qnil)
return Qnil;
dv = rb_iv_get( self, "@lxml_doc" );
Data_Get_Struct( dv, fxml_data_t, data );
attr_raw_str = rb_funcall( attr_name, s_to_s, 0 );
name_str = (xmlChar*)StringValuePtr( attr_raw_str );
raw_ret = xmlGetProp( data->node, name_str );
if (raw_ret == NULL)
return Qnil;
return Qtrue;
}
/* }}} fastxml_attr_list
*/ |
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef MDSS_H
#define MDSS_H
#include <linux/msm_ion.h>
#include <linux/earlysuspend.h>
#include <linux/msm_mdp.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/workqueue.h>
#include <mach/iommu_domains.h>
#define MDSS_REG_WRITE(addr, val) writel_relaxed(val, mdss_res->mdp_base + addr)
#define MDSS_REG_READ(addr) readl_relaxed(mdss_res->mdp_base + addr)
enum mdss_mdp_clk_type {
MDSS_CLK_AHB,
MDSS_CLK_AXI,
MDSS_CLK_MDP_SRC,
MDSS_CLK_MDP_CORE,
MDSS_CLK_MDP_LUT,
MDSS_CLK_MDP_VSYNC,
MDSS_MAX_CLK
};
enum mdss_iommu_domain_type {
MDSS_IOMMU_DOMAIN_SECURE,
MDSS_IOMMU_DOMAIN_UNSECURE,
MDSS_IOMMU_MAX_DOMAIN
};
struct mdss_iommu_map_type {
char *client_name;
char *ctx_name;
struct device *ctx;
struct msm_iova_partition partitions[1];
int npartitions;
int domain_idx;
};
struct mdss_hw_settings {
char __iomem *reg;
u32 val;
};
struct mdss_data_type {
u32 rev;
u32 mdp_rev;
struct clk *mdp_clk[MDSS_MAX_CLK];
struct regulator *fs;
struct workqueue_struct *clk_ctrl_wq;
struct delayed_work clk_ctrl_worker;
struct platform_device *pdev;
char __iomem *mdp_base;
size_t mdp_reg_size;
char __iomem *vbif_base;
u32 irq;
u32 irq_mask;
u32 irq_ena;
u32 irq_buzy;
u32 mdp_irq_mask;
u32 mdp_hist_irq_mask;
u32 suspend;
u32 timeout;
u8 clk_ena;
u8 fs_ena;
u8 vsync_ena;
u32 res_init;
u32 bus_hdl;
u32 smp_mb_cnt;
u32 smp_mb_size;
struct mdss_hw_settings *hw_settings;
struct mdss_mdp_pipe *vig_pipes;
struct mdss_mdp_pipe *rgb_pipes;
struct mdss_mdp_pipe *dma_pipes;
u32 nvig_pipes;
u32 nrgb_pipes;
u32 ndma_pipes;
struct mdss_mdp_mixer *mixer_intf;
struct mdss_mdp_mixer *mixer_wb;
u32 nmixers_intf;
u32 nmixers_wb;
struct mdss_mdp_ctl *ctl_off;
u32 nctl;
struct mdss_mdp_dp_intf *dp_off;
u32 ndp;
void *video_intf;
u32 nintf;
struct ion_client *iclient;
int iommu_attached;
struct mdss_iommu_map_type *iommu_map;
struct early_suspend early_suspend;
void *debug_data;
};
extern struct mdss_data_type *mdss_res;
enum mdss_hw_index {
MDSS_HW_MDP,
MDSS_HW_DSI0,
MDSS_HW_DSI1,
MDSS_HW_HDMI,
MDSS_HW_EDP,
MDSS_MAX_HW_BLK
};
struct mdss_hw {
u32 hw_ndx;
void *ptr;
irqreturn_t (*irq_handler)(int irq, void *ptr);
};
void mdss_enable_irq(struct mdss_hw *hw);
void mdss_disable_irq(struct mdss_hw *hw);
void mdss_disable_irq_nosync(struct mdss_hw *hw);
static inline struct ion_client *mdss_get_ionclient(void)
{
if (!mdss_res)
return NULL;
return mdss_res->iclient;
}
static inline int is_mdss_iommu_attached(void)
{
if (!mdss_res)
return false;
return mdss_res->iommu_attached;
}
static inline int mdss_get_iommu_domain(u32 type)
{
if (type >= MDSS_IOMMU_MAX_DOMAIN)
return -EINVAL;
if (!mdss_res)
return -ENODEV;
return mdss_res->iommu_map[type].domain_idx;
}
#endif /* MDSS_H */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.