text stringlengths 4 6.14k |
|---|
//leandro-ie@hotmail.com;lucascherutti@gmail.com;octavio.carpes10@gmail.com
#include<iostream>
#include<fstream>
#include<list>
#include "cartao.h"
using namespace std;
class Banco {
friend ostream& operator<<(ostream& s, Banco& lst);
public:
void ler();
bool vercartao(Cartao&);
private:
list <int> lista;
};
|
// PROGRAMMERS: Deniss Jacenko and Michael O'Reggio
// CLASS: COP4655 Tue/Thur 5pm - 6:15pm
// INSTRUCTOR: Steve Luis
// ASSIGNMENT: Shopping Experience Concept (Group 3)
// DUE: Thursday 12/11/14
//
// Created by Deniss Jacenko and Michael O'Reggio
// Creative Commons Attribution International 4.0 Licence
//
// ProfileViewController.h
// HypeGirlsApp
#import <UIKit/UIKit.h>
#import <MobileCoreServices/UTCoreTypes.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import "Theme.h"
#import "Person.h"
#import "People.h"
#import "UIView+FormScroll.h"
@interface ProfileViewController : UIViewController <UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
// Input properties for the Profile view
@property (weak, nonatomic) IBOutlet UITextField *profileName;
@property (weak, nonatomic) IBOutlet UITextField *profileAge;
@property (weak, nonatomic) IBOutlet UITextField *profileEmail;
@property (weak, nonatomic) IBOutlet UIImageView *profilePic;
- (IBAction)saveProfile:(id)sender;
- (IBAction)takePhoto:(id)sender;
- (IBAction)deletePhoto:(id)sender;
- (void) logInWithPerson: (Person *) p;
@end |
/*
* Copyright (c) 2009-2014 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation, Steven Munroe - initial API and implementation
*/
/*
* SAS SYSV IPC Shared Memory
*/
#ifndef __SAS_SHM_H
#define __SAS_SHM_H
#ifdef __cplusplus
#define __C__ "C"
#else
#define __C__
#endif
#ifdef __WORDSIZE_64
#define __SAS_DEFAULT_SHMKEY 0x5341534D
#else
#define __SAS_DEFAULT_SHMKEY 0x5341324D
#endif
typedef int sasshm_t;
extern __C__ int sasshm_id;
extern __C__ int SASAllocateShm( void* addr, long size );
extern __C__ int SASAllocateShmID(key_t key_id, void* addr, long size );
extern __C__ int SASAllocateShmID_clear(key_t key_id, void* addr, long size );
extern __C__ int SASAllocateShmName(char *key_name, void* addr, long size );
extern __C__ int SASAllocateShmNameProj( char* key_name, char proj,
void* addr, long size );
extern __C__ void SASDetachShm( void* addr );
extern __C__ void SASRemoveShm( void );
extern __C__ void SASRemoveShmID(int shm_id );
#endif
|
#define F_CPU 8000000
#include <avr/io.h>
#include <util/delay.h>
#include "UART.h"
void UART1_Init(unsigned int BaudRate){
unsigned short int UBRR0 = (short) (F_CPU/(BaudRate*16UL)-1);
UBRR1L = UBRR0 ;
UBRR1H = (UBRR0>>8);
UCSR1C = ((0<<UMSEL1)|(0<<UPM11)|(0<<UPM11)|(0<<USBS1)|(1<<UCSZ11)|(1<<UCSZ10));
UCSR1B = ((1<<RXEN1)|(1<<TXEN1)|(0<<UCSZ12));
}
void UART1_Transmit_Char(unsigned char data)
{
while(!(UCSR1A & (1<<UDRE1))); //UDRE0 = 0 "not empty"
UDR1 = data ;
}
void UART1_Transmit_String(unsigned char *srt){
unsigned int i = 0;
while(srt[i] != '\0'){
UART1_Transmit_Char(srt[i]);
i++;
}
}
unsigned char UART1_Receive_Char(void){
while(!(UCSR1A & (1<<RXC1)));
return UDR1 ;
}
void UART1_Receive_String(unsigned char *srt){
unsigned int i =0;
srt[i] = UART1_Receive_Char();
while (srt[i] !='#')
{
i++ ;
srt[i] = UART1_Receive_Char();
} i++ ;
srt[i] ='\0' ;
}
char UART_Receive_ascii_byte(void)
{
unsigned char data;
while((get_bit(UCSR1A,RXC1))==0);
data=UDR1;
if((data<=(9+'0')&&(data>=(0+'0')))){data=data-'0';}
return data;
}
char UART1_ReceiveByte(void)
{
if((get_bit(UCSR1A,RXC1))==1);
return UDR1;
}
|
#define PADS_TY(suf) entry_t ## suf
#define DEF_INPUT_FILE "../../data/transform"
#include "transform.h"
#include "template/accum_report.h"
|
/*************************************************************************
*** FORTE Library Element
***
*** This file was generated using the 4DIAC FORTE Export Filter V1.0.x!
***
*** Name: F_DWORD_TO_UDINT
*** Description: convert DWORD to UDINT
*** Version:
*** 0.0: 2011-12-25/4DIAC-IDE - 4DIAC-Consortium - null
*************************************************************************/
#ifndef _F_DWORD_TO_UDINT_H_
#define _F_DWORD_TO_UDINT_H_
#include <funcbloc.h>
#include <forte_dword.h>
#include <forte_udint.h>
class FORTE_F_DWORD_TO_UDINT: public CFunctionBlock{
DECLARE_FIRMWARE_FB(FORTE_F_DWORD_TO_UDINT)
private:
static const CStringDictionary::TStringId scm_anDataInputNames[];
static const CStringDictionary::TStringId scm_anDataInputTypeIds[];
CIEC_DWORD &IN() {
return *static_cast<CIEC_DWORD*>(getDI(0));
};
static const CStringDictionary::TStringId scm_anDataOutputNames[];
static const CStringDictionary::TStringId scm_anDataOutputTypeIds[];
CIEC_UDINT &OUT() {
return *static_cast<CIEC_UDINT*>(getDO(0));
};
static const TEventID scm_nEventREQID = 0;
static const TForteInt16 scm_anEIWithIndexes[];
static const TDataIOID scm_anEIWith[];
static const CStringDictionary::TStringId scm_anEventInputNames[];
static const TEventID scm_nEventCNFID = 0;
static const TForteInt16 scm_anEOWithIndexes[];
static const TDataIOID scm_anEOWith[];
static const CStringDictionary::TStringId scm_anEventOutputNames[];
static const SFBInterfaceSpec scm_stFBInterfaceSpec;
FORTE_FB_DATA_ARRAY(1, 1, 1, 0);
void executeEvent(int pa_nEIID);
public:
FUNCTION_BLOCK_CTOR(FORTE_F_DWORD_TO_UDINT){
};
virtual ~FORTE_F_DWORD_TO_UDINT(){};
};
#endif //close the ifdef sequence from the beginning of the file
|
/* Copyright (c) 2017 Oracle and/or its affiliates. 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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef TABLE_PERSISTED_VARIABLES_H
#define TABLE_PERSISTED_VARIABLES_H
/**
@file storage/perfschema/table_persisted_variables.h
Table PERSISTED_VARIABLES (declarations).
*/
#include "pfs_column_types.h"
#include "pfs_engine_table.h"
#include "pfs_instr_class.h"
#include "pfs_instr.h"
#include "table_helper.h"
#include "pfs_variable.h"
/**
@addtogroup performance_schema_tables
@{
*/
class PFS_index_persisted_variables : public PFS_engine_index
{
public:
PFS_index_persisted_variables()
: PFS_engine_index(&m_key), m_key("VARIABLE_NAME")
{
}
~PFS_index_persisted_variables()
{
}
virtual bool match(const System_variable *pfs);
private:
PFS_key_variable_name m_key;
};
/**
Store and retrieve table state information during queries that reinstantiate
the table object.
*/
class table_persisted_variables_context : public PFS_table_context
{
public:
table_persisted_variables_context(ulonglong hash_version, bool restore)
: PFS_table_context(hash_version, restore, THR_PFS_SV)
{
}
};
/**
A row of table
PERFORMANCE_SCHEMA.PERSISTED_VARIABLES.
*/
struct row_persisted_variables
{
/** Column VARIABLE_NAME. */
PFS_variable_name_row m_variable_name;
/** Column VARIABLE_VALUE. */
PFS_variable_value_row m_variable_value;
};
/** Table PERFORMANCE_SCHEMA.PERSISTED_VARIABLES. */
class table_persisted_variables : public PFS_engine_table
{
typedef PFS_simple_index pos_t;
public:
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table *create();
static ha_rows get_row_count();
virtual void reset_position(void);
virtual int rnd_init(bool scan);
virtual int rnd_next();
virtual int rnd_pos(const void *pos);
virtual int index_init(uint idx, bool sorted);
virtual int index_next();
protected:
virtual int read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
bool read_all);
table_persisted_variables();
public:
~table_persisted_variables()
{
}
protected:
int make_row(const System_variable *system_var);
private:
/** Table share lock. */
static THR_LOCK m_table_lock;
/** Fields definition. */
static TABLE_FIELD_DEF m_field_def;
/** Current THD variables. */
PFS_system_persisted_variables_cache m_sysvar_cache;
/** Current row. */
row_persisted_variables m_row;
/** Current position. */
pos_t m_pos;
/** Next position. */
pos_t m_next_pos;
/** Table context with system variable hash version. */
table_persisted_variables_context *m_context;
PFS_index_persisted_variables *m_opened_index;
};
/** @} */
#endif
|
/*
* Copyright (C) 2010-2022 Fabio Cavallo (aka FHorse)
*
* 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 "mappers.h"
#include "info.h"
#include "mem_map.h"
void map_init_Hes(void) {
EXTCL_CPU_WR_MEM(Hes);
info.mapper.extend_wr = TRUE;
if (info.reset >= HARD) {
if (info.prg.rom[0].max.banks_32k != 0xFFFF) {
map_prg_rom_8k(4, 0, 0);
}
}
}
void extcl_cpu_wr_mem_Hes(WORD address, BYTE value) {
if ((address < 0x4100) || (address > 0x5FFF)) {
return;
}
if ((address & 0x0100) == 0x0100) {
const BYTE save = value;
DBWORD bank;
if (value & 0x80) {
mirroring_V();
} else {
mirroring_H();
}
if (info.prg.rom[0].max.banks_32k != 0xFFFF) {
value = (value >> 3) & 0x07;
control_bank(info.prg.rom[0].max.banks_32k)
map_prg_rom_8k(4, 0, value);
map_prg_rom_8k_update();
}
value = ((save >> 3) & 0x08) | (save & 0x07);
control_bank(info.chr.rom[0].max.banks_8k)
bank = value << 13;
chr.bank_1k[0] = chr_chip_byte_pnt(0, bank);
chr.bank_1k[1] = chr_chip_byte_pnt(0, bank | 0x0400);
chr.bank_1k[2] = chr_chip_byte_pnt(0, bank | 0x0800);
chr.bank_1k[3] = chr_chip_byte_pnt(0, bank | 0x0C00);
chr.bank_1k[4] = chr_chip_byte_pnt(0, bank | 0x1000);
chr.bank_1k[5] = chr_chip_byte_pnt(0, bank | 0x1400);
chr.bank_1k[6] = chr_chip_byte_pnt(0, bank | 0x1800);
chr.bank_1k[7] = chr_chip_byte_pnt(0, bank | 0x1C00);
}
}
|
/* This file is part of t411 Client Installer.
t411 Client Installer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
t411 Client Installer 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 t411 Client Installer. If not, see <http://www.gnu.org/licenses/>. */
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "installer.h"
namespace Ui {
class MainWindow;
}
class Installer;
class MainWindow : public QDialog
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void enableNext();
void disableQuit();
void enableFinish();
public slots:
void refreshLayout(QGridLayout *newlayout);
void pressedNext();
void pressedQuit();
private:
void closeEvent(QCloseEvent *event);
void clear();
private:
Ui::MainWindow *ui;
Installer *installer;
};
#endif // MAINWINDOW_H
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#include <avl.h>
#include <math.h>
#include "flx_shadowmem.h"
/*
* When doing pattern matching, PyQemu relies on
* the advantages of dynamic analysis to reduce
* the search space and thus also the false positive
* rate. Therefore we need a shadow memory which stores
* only memory regions that were acessed before.
* This module implements the shadow memory and supports
* iteration over subsequent pages.
*/
static int
shadowmem_page_cmp(const shadow_page* p1, const shadow_page* p2){
if(p1->addr < p2->addr)
return -1;
else if(p1->addr > p2->addr)
return 1;
return 0;
}
static void
shadowmem_page_free(shadow_page* page){
if(page->mem)
free(page->mem);
free(page);
}
static shadow_page*
flx_shadowmem_find_page(shadowmem* mem, uint32_t addr){
shadow_page* page = malloc(sizeof(*page));
page->addr = addr&(~0xfff);
avl_node_t* node = avl_search(mem, page);
if(!node){
page->mem = malloc(FLX_PAGE_SIZE);
page->eip = malloc(FLX_PAGE_SIZE*sizeof(uint32_t));
memset(page->mem, 0, FLX_PAGE_SIZE);
node = avl_insert(mem, page);
}
else
free(page);
return node->item;
}
shadowmem*
flx_shadowmem_new(void){
return avl_alloc_tree((avl_compare_t)shadowmem_page_cmp, (avl_freeitem_t)shadowmem_page_free);
}
void
flx_shadowmem_delete(shadowmem* mem){
avl_free_tree(mem);
}
void
flx_shadowmem_store(shadowmem* mem, uint32_t address, uint8_t value, uint32_t eip){
shadow_page* page = flx_shadowmem_find_page(mem, address);
assert(page);
address &= 0xfff;
page->mem[address] = value;
page->eip[address] = eip;
}
uint8_t
flx_shadowmem_load(shadowmem* mem, uint32_t address, uint8_t *value){
shadow_page* page = flx_shadowmem_find_page(mem, address);
assert(page);
address &= 0xfff;
*value = page->mem[address];
return 1;
}
shadowmem_iterator*
flx_shadowmem_iterator_new(shadowmem* mem){
shadowmem_iterator* iter = malloc(sizeof(*iter));
iter->current = avl_at(mem, 0);
iter->addr = 0;
return iter;
}
void
flx_shadowmem_iterator_delete(shadowmem_iterator* iter){
free(iter);
}
void
flx_shadowmem_block_dealloc(mem_block* block){
free(block->mem);
free(block->eips);
free(block);
}
static mem_block*
flx_shadowmem_block_alloc(uint32_t num_pages){
mem_block* block = malloc(sizeof(*block));
block->eips = malloc(num_pages*FLX_PAGE_SIZE*sizeof(*(block->eips)));
block->mem = malloc(num_pages*FLX_PAGE_SIZE);
block->len = num_pages*FLX_PAGE_SIZE;
return block;
}
static mem_block*
flx_shadowmem_block_realloc(mem_block* block, uint32_t num_pages){
block->eips = realloc(block->eips, num_pages*FLX_PAGE_SIZE*sizeof(uint32_t));
block->mem = realloc(block->mem, num_pages*FLX_PAGE_SIZE);
block->len = num_pages*FLX_PAGE_SIZE;
return block;
}
mem_block*
flx_shadowmem_iterate(shadowmem_iterator* iter){
if(!iter->current)
return NULL;
uint32_t num_pages = 1;
uint32_t last_page_addr;
shadow_page* page = iter->current->item;
last_page_addr = page->addr;
mem_block* block = flx_shadowmem_block_alloc(num_pages);
memcpy(block->mem, page->mem, FLX_PAGE_SIZE);
memcpy(block->eips, page->eip, FLX_PAGE_SIZE*sizeof(uint32_t));
iter->current = iter->current->next;
while(iter->current){
page = iter->current->item;
if(page->addr == (last_page_addr+FLX_PAGE_SIZE)){
block = flx_shadowmem_block_realloc(block, ++num_pages);
memcpy(&block->mem[(num_pages-1)*FLX_PAGE_SIZE], page->mem, FLX_PAGE_SIZE);
memcpy(&block->eips[(num_pages-1)*FLX_PAGE_SIZE], page->eip, FLX_PAGE_SIZE*sizeof(uint32_t));
}
else{
break;
}
iter->current = iter->current->next;
}
return block;
}
|
// Name: i2c.h
//
// Copyright(c) 2013 Loctronix Corporation
// http://www.loctronix.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#ifndef I2C_H
#define I2C_H
// Error Codes.
enum I2C_ERROR_TYPES
{
I2C_ERROR_NOACK = 1,
I2C_ERROR_WRITEDATAACK
};
// I2C Device Address
#define SLAVE_ADDR_BMP180 0xEE
#define SLAVE_ADDR_MOTION 0xD0
#define SLAVE_ADDR_BATTERY 0x8C
// Function Prototypes
void I2C_Init( void );
int i2c_read(uint8_t slave_addr, uint8_t reg_addr, int length, uint8_t *data);
int i2c_write(uint8_t slave_addr, uint8_t reg_addr, int length, uint8_t *data);
#endif /* I2C_H */
|
/****************************************************************************
**
** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the Qt3Support module of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef Q3WIZARD_H
#define Q3WIZARD_H
#include <QtGui/qdialog.h>
QT_BEGIN_HEADER
QT_MODULE(Qt3SupportLight)
class QHBoxLayout;
class Q3WizardPrivate;
class Q_COMPAT_EXPORT Q3Wizard : public QDialog
{
Q_OBJECT
Q_PROPERTY( QFont titleFont READ titleFont WRITE setTitleFont )
public:
Q3Wizard( QWidget* parent=0, const char* name=0, bool modal=false, Qt::WindowFlags f=0 );
~Q3Wizard();
void setVisible(bool);
void setFont( const QFont & font );
virtual void addPage( QWidget *, const QString & );
virtual void insertPage( QWidget*, const QString&, int );
virtual void removePage( QWidget * );
QString title( QWidget * ) const;
void setTitle( QWidget *, const QString & );
QFont titleFont() const;
void setTitleFont( const QFont & );
virtual void showPage( QWidget * );
QWidget * currentPage() const;
QWidget* page( int ) const;
int pageCount() const;
int indexOf( QWidget* ) const;
virtual bool appropriate( QWidget * ) const;
virtual void setAppropriate( QWidget *, bool );
QPushButton * backButton() const;
QPushButton * nextButton() const;
QPushButton * finishButton() const;
QPushButton * cancelButton() const;
QPushButton * helpButton() const;
bool eventFilter( QObject *, QEvent * );
public Q_SLOTS:
virtual void setBackEnabled( QWidget *, bool );
virtual void setNextEnabled( QWidget *, bool );
virtual void setFinishEnabled( QWidget *, bool );
virtual void setHelpEnabled( QWidget *, bool );
// obsolete
virtual void setFinish( QWidget *, bool ) {}
protected Q_SLOTS:
virtual void back();
virtual void next();
virtual void help();
Q_SIGNALS:
void helpClicked();
void selected( const QString& );
protected:
virtual void layOutButtonRow( QHBoxLayout * );
virtual void layOutTitleRow( QHBoxLayout *, const QString & );
private:
void setBackEnabled( bool );
void setNextEnabled( bool );
void setHelpEnabled( bool );
void setNextPage( QWidget * );
void updateButtons();
void layOut();
Q3WizardPrivate *d;
Q_DISABLE_COPY(Q3Wizard)
};
QT_END_HEADER
#endif // Q3WIZARD_H
|
/*
* GrandOrgue - free pipe organ simulator
*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2015 GrandOrgue contributors (see AUTHORS)
*
* 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 GOGUIMANUAL_H
#define GOGUIMANUAL_H
#include "GOGUIControl.h"
#include "GOrgueBitmap.h"
#include <vector>
class GOrgueManual;
class GOGUIManual : public GOGUIControl
{
private:
typedef struct {
unsigned MidiNumber;
bool IsSharp;
wxRect Rect;
wxRect MouseRect;
GOrgueBitmap OnBitmap;
GOrgueBitmap OffBitmap;
} KeyInfo;
GOrgueManual* m_manual;
unsigned m_ManualNumber;
std::vector<KeyInfo> m_Keys;
public:
GOGUIManual(GOGUIPanel* panel, GOrgueManual* manual, unsigned manual_number);
bool IsSharp(unsigned key);
unsigned GetKeyCount();
void Init(GOrgueConfigReader& cfg, wxString group);
void Load(GOrgueConfigReader& cfg, wxString group);
void Layout();
void PrepareDraw(double scale, GOrgueBitmap* background);
void Draw(GOrgueDC& dc);
bool HandleMousePress(int x, int y, bool right, GOGUIMouseState& state);
};
#endif
|
/*
* This file is distributed as part of the MariaDB Corporation MaxScale. It is free
* software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation,
* version 2.
*
* 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.
*
* Copyright MariaDB Corporation Ab 2013-2014
*/
/**
* @file maxkeys.c - Create the random encryption keys for maxscale
*
* @verbatim
* Revision History
*
* Date Who Description
* 24/07/13 Mark Riddoch Initial implementation
*
* @endverbatim
*/
#include <stdio.h>
#include <secrets.h>
#include <skygw_utils.h>
#include <log_manager.h>
#include <gwdirs.h>
int main(int argc, char **argv)
{
char *keyfile;
int rval = 0;
if (argc < 2)
{
keyfile = "/var/lib/maxscale/";
fprintf(stderr, "Generating .secrets file in /var/lib/maxscale/ ...\n");
}
else
{
keyfile = argv[1];
}
mxs_log_init(NULL, NULL, MXS_LOG_TARGET_DEFAULT);
if (secrets_writeKeys(keyfile))
{
fprintf(stderr, "Failed to encode the password\n");
rval = 1;
}
mxs_log_flush_sync();
mxs_log_finish();
return rval;
}
|
//
// FacesViewController.h
// Photos+
//
// Created by on 8/12/14.
// Copyright (c) 2014 Delightful. All rights reserved.
//
#import "PhotosViewController.h"
@interface FacesViewController : PhotosViewController
@end
|
/*
Copyright (c) 2015, 2017, Oracle and/or its affiliates. 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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MUTEX_INCLUDED
#define MUTEX_INCLUDED
#include "my_thread.h"
#include "thr_mutex.h"
namespace my_boost{
class mutex
{
public:
mutex();
~mutex();
void lock();
bool try_lock();
void unlock();
class scoped_lock
{
public:
scoped_lock(my_boost::mutex& mutex_to_lock);
~scoped_lock();
private:
my_boost::mutex& m_mutex;
};
private:
native_mutex_t m_mutex;
};
}
#endif
|
#include "main.h"
#include "timeout.h"
#include "lcd12864.h"
#include "hc_sr04.h"
#include "pwm.h"
#include "uart.h"
#include "adc.h"
#include "tm1650.h"
// ------ Public function prototypes ----------------------
// ------ Private function prototypes ---------------------
// ------ Public variable definitions ---------------------
// ------ Public variable declarations --------------------
void main()
{
}
|
/***************************************************************************
qgsdxpaintengine.h
------------------
begin : November 2013
copyright : (C) 2013 by Marco Hugentobler
email : marco at sourcepole dot ch
***************************************************************************/
/***************************************************************************
* *
* 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 QGSDXFPAINTENGINE_H
#define QGSDXFPAINTENGINE_H
#define SIP_NO_FILE
#include "qgis_core.h"
#include <QPaintEngine>
#include "qgsabstractgeometry.h"
#include "qgspoint.h"
class QgsDxfExport;
class QgsDxfPaintDevice;
/** \ingroup core
* \class QgsDxfPaintEngine
* \note not available in Python bindings
*/
class CORE_EXPORT QgsDxfPaintEngine: public QPaintEngine
{
public:
QgsDxfPaintEngine( const QgsDxfPaintDevice *dxfDevice, QgsDxfExport *dxf );
bool begin( QPaintDevice *pdev ) override;
bool end() override;
QPaintEngine::Type type() const override;
void updateState( const QPaintEngineState &state ) override;
void drawPixmap( const QRectF &r, const QPixmap &pm, const QRectF &sr ) override;
void drawPolygon( const QPointF *points, int pointCount, PolygonDrawMode mode ) override;
void drawPath( const QPainterPath &path ) override;
void drawLines( const QLineF *lines, int lineCount ) override;
void setLayer( const QString &layer ) { mLayer = layer; }
QString layer() const { return mLayer; }
void setShift( QPointF shift ) { mShift = shift; }
private:
const QgsDxfPaintDevice *mPaintDevice = nullptr;
QgsDxfExport *mDxf = nullptr;
//painter state information
QTransform mTransform;
QPen mPen;
QBrush mBrush;
QString mLayer;
QPointF mShift;
QgsRingSequence mPolygon;
QPolygonF mCurrentPolygon;
QList<QPointF> mCurrentCurve;
QgsPoint toDxfCoordinates( QPointF pt ) const;
double currentWidth() const;
void moveTo( double dx, double dy );
void lineTo( double dx, double dy );
void curveTo( double dx, double dy );
void endPolygon();
void endCurve();
void setRing( QgsPointSequence &polyline, const QPointF *points, int pointCount );
//utils for bezier curve calculation
static QPointF bezierPoint( const QList<QPointF> &controlPolygon, double t );
static double bernsteinPoly( int n, int i, double t );
static int lower( int n, int i );
static double power( double a, int b );
static int faculty( int n );
};
#endif // QGSDXFPAINTENGINE_H
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_
#define CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/gtest_prod_util.h"
#include "chrome/installer/util/work_item.h"
class MoveTreeWorkItem : public WorkItem {
public:
virtual ~MoveTreeWorkItem();
virtual bool Do();
virtual void Rollback();
private:
friend class WorkItem;
FRIEND_TEST_ALL_PREFIXES(MoveTreeWorkItemTest,
MoveDirectoryDestExistsCheckForDuplicatesFull);
FRIEND_TEST_ALL_PREFIXES(MoveTreeWorkItemTest,
MoveDirectoryDestExistsCheckForDuplicatesPartial);
MoveTreeWorkItem(const base::FilePath& source_path,
const base::FilePath& dest_path,
const base::FilePath& temp_dir,
MoveTreeOption duplicate_option);
base::FilePath source_path_;
base::FilePath dest_path_;
base::FilePath temp_dir_;
base::ScopedTempDir backup_path_;
bool moved_to_dest_path_;
bool moved_to_backup_;
bool source_moved_to_backup_;
MoveTreeOption duplicate_option_;
};
#endif
|
// Found this posted by "Peret" at
// http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=28214&highlight=crc32
// CCITT CRC-32 (Autodin II) polynomial:
// X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
unsigned long CalcCRCBase (unsigned long crc, const char *buffer, int length)
{
int i,j ;
for (i=0; i<length; i++)
{
crc = crc ^ *buffer++ ;
for (j=0; j<8; j++)
{
if (crc & 1)
crc = (crc>>1) ^ 0xEDB88320 ;
else
crc = crc >>1 ;
}
}
return crc ;
}
unsigned long CalcCRC(const char *buffer, int length) {
unsigned long k = CalcCRCBase(0xFFFFFFFF, buffer, length);
k ^= 0xffffffff;
k &= 0xffffffff;
return k;
}
|
#ifndef _ASM_X86_IDLE_H
#define _ASM_X86_IDLE_H
<<<<<<< HEAD
#define IDLE_START 1
#define IDLE_END 2
struct notifier_block;
void idle_notifier_register(struct notifier_block *n);
void idle_notifier_unregister(struct notifier_block *n);
=======
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#ifdef CONFIG_X86_64
void enter_idle(void);
void exit_idle(void);
#else /* !CONFIG_X86_64 */
static inline void enter_idle(void) { }
static inline void exit_idle(void) { }
#endif /* CONFIG_X86_64 */
<<<<<<< HEAD
void amd_e400_remove_cpu(int cpu);
=======
void c1e_remove_cpu(int cpu);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#endif /* _ASM_X86_IDLE_H */
|
/*
* netlink/cache.h Caching Module
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_CACHE_H_
#define NETLINK_CACHE_H_
#include <netlink/netlink.h>
#include <netlink/msg.h>
#include <netlink/utils.h>
#include <netlink/object.h>
#include <netlink/cache-api.h>
#ifdef __cplusplus
extern "C" {
#endif
struct nl_cache;
typedef void (*change_func_t)(struct nl_cache *, struct nl_object *, int, void *);
extern int nl_cache_nitems(struct nl_cache *);
extern int nl_cache_nitems_filter(struct nl_cache *,
struct nl_object *);
extern struct nl_cache_ops * nl_cache_get_ops(struct nl_cache *);
extern struct nl_object * nl_cache_get_first(struct nl_cache *);
extern struct nl_object * nl_cache_get_last(struct nl_cache *);
extern struct nl_object * nl_cache_get_next(struct nl_object *);
extern struct nl_object * nl_cache_get_prev(struct nl_object *);
extern struct nl_cache * nl_cache_alloc(struct nl_cache_ops *);
extern int nl_cache_alloc_and_fill(struct nl_cache_ops *,
struct nl_sock *,
struct nl_cache **);
extern int nl_cache_alloc_name(const char *,
struct nl_cache **);
extern struct nl_cache * nl_cache_subset(struct nl_cache *,
struct nl_object *);
extern void nl_cache_clear(struct nl_cache *);
extern void nl_cache_free(struct nl_cache *);
extern int nl_cache_add(struct nl_cache *,
struct nl_object *);
extern int nl_cache_parse_and_add(struct nl_cache *,
struct nl_msg *);
extern void nl_cache_remove(struct nl_object *);
extern int nl_cache_refill(struct nl_sock *,
struct nl_cache *);
extern int nl_cache_pickup(struct nl_sock *,
struct nl_cache *);
extern int nl_cache_resync(struct nl_sock *,
struct nl_cache *,
change_func_t,
void *);
extern int nl_cache_include(struct nl_cache *,
struct nl_object *,
change_func_t,
void *);
extern int nl_cache_is_empty(struct nl_cache *);
extern void nl_cache_mark_all(struct nl_cache *);
extern void nl_cache_dump(struct nl_cache *,
struct nl_dump_params *);
extern void nl_cache_dump_filter(struct nl_cache *,
struct nl_dump_params *,
struct nl_object *);
extern void nl_cache_foreach(struct nl_cache *,
void (*cb)(struct nl_object *,
void *),
void *arg);
extern void nl_cache_foreach_filter(struct nl_cache *,
struct nl_object *,
void (*cb)(struct
nl_object *,
void *),
void *arg);
extern struct nl_cache_ops * nl_cache_ops_lookup(const char *);
extern struct nl_cache_ops * nl_cache_ops_associate(int, int);
extern struct nl_msgtype * nl_msgtype_lookup(struct nl_cache_ops *, int);
extern void nl_cache_ops_foreach(void (*cb)(struct nl_cache_ops *, void *), void *);
extern int nl_cache_mngt_register(struct nl_cache_ops *);
extern int nl_cache_mngt_unregister(struct nl_cache_ops *);
extern void nl_cache_mngt_provide(struct nl_cache *);
extern void nl_cache_mngt_unprovide(struct nl_cache *);
extern struct nl_cache * nl_cache_mngt_require(const char *);
struct nl_cache_mngr;
#define NL_AUTO_PROVIDE 1
extern int nl_cache_mngr_alloc(struct nl_sock *,
int, int,
struct nl_cache_mngr **);
extern int nl_cache_mngr_add(struct nl_cache_mngr *,
const char *,
change_func_t,
void *,
struct nl_cache **);
extern int nl_cache_mngr_get_fd(struct nl_cache_mngr *);
extern int nl_cache_mngr_poll(struct nl_cache_mngr *,
int);
extern int nl_cache_mngr_data_ready(struct nl_cache_mngr *);
extern void nl_cache_mngr_free(struct nl_cache_mngr *);
#ifdef __cplusplus
}
#endif
#endif
|
//
// ThemeScrollView.h
// Camera
//
// Created by zhang xiangying on 13-3-26.
// Copyright (c) 2013年 ChenHongbin. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ThemeImageView.h"
#import "VideoThemesData.h"
@class ThemeScrollView;
@protocol ThemeScrollViewDelegate<NSObject>
@optional
/**
* @brief 选择相应的主题
*
* @param index 主题位置
*/
- (void)selectedItem:(NSInteger)index;
/**
* @brief 当点中某个节点素材的时候,自动调用此函数
*/
- (void)themeScrollView:(ThemeScrollView *)themeScrollView didSelectMaterial:(VideoThemes *)material;
@end
@interface ThemeScrollView : UIView <ThemeImageViewDelegate>
@property(nonatomic, strong) id<ThemeScrollViewDelegate> delegate; /*< 事件代理 >*/
@property(nonatomic, strong) UIImage *backgroundImage; /*< 背景图 >*/
@property(nonatomic, strong) NSMutableArray *themeImages; /*< 所有的主题 >*/
@property(nonatomic, strong) UIButton *btnlastThemeCell; /*< 最后一个视图按钮,--以后扩张为“更多”按钮 >*/
- (CGPoint)getContentOffsetAtIndex:(int)index;
- (void)setContentStartAtIndex:(int)index;
- (void)setContentEndAtIndex:(int)index;
/**
* @brief 设置当前的项为高亮
*/
- (void)setCurrentSelectedItem:(NSInteger)index;
/**
* @brief 运动scrollview到显示指定索引的位置
*
* @param index 指定位置
*/
- (void)scrollToItemAtIndex:(NSInteger)index;
@end
|
#ifndef _CkHtmlToText_H
#define _CkHtmlToText_H
#include "Chilkat_C.h"
HCkHtmlToText CkHtmlToText_Create(void);
void CkHtmlToText_Dispose(HCkHtmlToText handle);
void CkHtmlToText_getLastErrorHtml(HCkHtmlToText handle, HCkString retval);
void CkHtmlToText_getLastErrorText(HCkHtmlToText handle, HCkString retval);
void CkHtmlToText_getLastErrorXml(HCkHtmlToText handle, HCkString retval);
BOOL CkHtmlToText_getUtf8(HCkHtmlToText handle);
void CkHtmlToText_putUtf8(HCkHtmlToText handle, BOOL newVal);
BOOL CkHtmlToText_IsUnlocked(HCkHtmlToText handle);
BOOL CkHtmlToText_ReadFileToString(HCkHtmlToText handle, const char *filename, const char *srcCharset, HCkString str);
BOOL CkHtmlToText_SaveLastError(HCkHtmlToText handle, const char *filename);
BOOL CkHtmlToText_ToText(HCkHtmlToText handle, const char *html, HCkString outStr);
BOOL CkHtmlToText_UnlockComponent(HCkHtmlToText handle, const char *code);
BOOL CkHtmlToText_WriteStringToFile(HCkHtmlToText handle, const char *str, const char *filename, const char *charset);
const char *CkHtmlToText_lastErrorHtml(HCkHtmlToText handle);
const char *CkHtmlToText_lastErrorText(HCkHtmlToText handle);
const char *CkHtmlToText_lastErrorXml(HCkHtmlToText handle);
const char *CkHtmlToText_readFileToString(HCkHtmlToText handle, const char *filename, const char *srcCharset);
const char *CkHtmlToText_toText(HCkHtmlToText handle, const char *html);
#endif
|
/****************************************Copyright (c)**************************************************
** Çå ·ç º£ °¶
**
** yzfcer@163.com
**
**--------------ÎļþÐÅÏ¢--------------------------------------------------------------------------------
**ÎÄ ¼þ Ãû: wind_os_prelaunch.c
**´´ ½¨ ÈË: Jason Zhou
**×îºóÐÞ¸ÄÈÕÆÚ: 2019.01.06
**Ãè Êö: wind osµÄÔ¤Æô¶¯Îļþ
**¹¦ ÄÜ: Æô¶¯Ç°Ó²¼þ³õʼ»¯£¬³õʼ»¯ÍⲿRAM£¬³õʼ»¯Êý¾Ý¶Î£¬Ìø×ªµ½wind_o_lunch
**
**--------------ÀúÊ·°æ±¾ÐÅÏ¢----------------------------------------------------------------------------
** ´´½¨ÈË: Jason Zhou
** °æ ±¾: v1.0
** ÈÕ¡¡ÆÚ: 2019.01.06
** Ãè¡¡Êö: Ôʼ°æ±¾
**
**--------------µ±Ç°°æ±¾ÐÞ¶©----------------------------------------------------------------------------
** ÐÞ¸ÄÈË: Jason Zhou
** ÈÕ¡¡ÆÚ: 2019.01.06
** Ãè¡¡Êö:
**
**------------------------------------------------------------------------------------------------------
*******************************************************************************************************/
#include "wind_type.h"
#include <windows.h>
CRITICAL_SECTION CriticalSection;
#ifdef __cplusplus
extern "C" {
#endif
static void hw_preinit(void)
{
InitializeCriticalSection(&CriticalSection);
}
#if defined(__CC_ARM)
void data_bss_init(void)
{
return;
}
#else
static void data_bss_init(void)
{
}
#endif
static void exram_init(void)
{
}
extern void wind_os_launch(void);
void wind_os_prelaunch(void)
{
hw_preinit();
exram_init();
data_bss_init();
wind_os_launch();
}
#ifdef __cplusplus
}
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <error.h>
#include <errno.h>
#include "NE10.h"
/* customize these macros and variables for a particular implementation */
#define FFT_IN_ROUNDS (128)
#define FFT_CALC_POINTS (256)
#define FFT_CALC_ROUNDS (32)
#define FFT_POINTS (FFT_CALC_POINTS * FFT_CALC_ROUNDS)
#define IN_SAMPLE_TYPE ne10_fft_cpx_int32_t
#define OUT_SAMPLE_TYPE ne10_fft_cpx_int32_t
#define CFG_TYPE ne10_fft_cfg_int32_t
#define CFG_ALLOC_FUNC ne10_fft_alloc_c2c_int32
#define FFT_FUNC ne10_fft_c2c_1d_int32_neon
const char *g_test = "stream_neon32_256x32x128";
const char *g_description = "256x32x128 point FFT, NEON implementation, 32-bit precision";
/* these functions and variables are implemented in overhead.c as a library */
extern void initialize_everything(int argc, char **argv);
extern uint64_t get_gt_value(void);
extern void release_everything(void);
extern void print_results(void);
extern char *g_input_filename;
extern char *g_output_filename;
extern uint64_t g_start_time;
extern uint64_t g_end_time;
int main(int argc, char **argv)
{
int input_fd;
int output_fd;
int raw256stream_dev_fd;
int result;
IN_SAMPLE_TYPE *in_buf;
OUT_SAMPLE_TYPE *out_buf;
CFG_TYPE cfg;
int i;
int j;
initialize_everything(argc, argv);
/* allocate storage for input, output and config buffers */
in_buf = (IN_SAMPLE_TYPE*) NE10_MALLOC (FFT_POINTS * sizeof(IN_SAMPLE_TYPE));
if(in_buf == NULL)
error(1, errno, "in_buf allocation");
out_buf = (OUT_SAMPLE_TYPE*) NE10_MALLOC (FFT_POINTS * sizeof(OUT_SAMPLE_TYPE));
if(out_buf == NULL)
error(1, errno, "out_buf allocation");
cfg = CFG_ALLOC_FUNC(FFT_CALC_POINTS);
if(cfg == NULL)
error(1, errno, "cfg allocation");
/* open the input and output files and raw256stream device */
input_fd = open(g_input_filename, O_RDONLY);
if(input_fd < 0)
error(1, errno, "opening input file '%s'", g_input_filename);
output_fd = open(g_output_filename, O_WRONLY | O_CREAT);
if(output_fd < 0)
error(1, errno, "opening output file '%s'", g_output_filename);
raw256stream_dev_fd = open("/dev/raw256stream", O_RDWR);
if(raw256stream_dev_fd < 0)
error(1, errno, "opening raw256stream_dev_fd");
/* read the input data */
result = read(input_fd, in_buf, FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE));
if(result < 0)
error(1, errno, "read input file");
if(result != (FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE)))
error(1, 0, "input data size, expected %d but got %d", FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE), result);
/* write the waveform buffer */
result = write(raw256stream_dev_fd, in_buf, FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE));
if(result < 0)
error(1, errno, "write waveform buffer");
if(result != (FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE)))
error(1, 0, "output data size, expected %d but got %d", FFT_CALC_POINTS * sizeof(IN_SAMPLE_TYPE), result);
/* capture the start value of the GT */
g_start_time = get_gt_value();
for(j = 0 ; j < FFT_IN_ROUNDS ; j++) {
/* read the input stream */
result = read(raw256stream_dev_fd, in_buf, FFT_POINTS * sizeof(IN_SAMPLE_TYPE));
if(result < 0)
error(1, errno, "read input stream");
if(result != (FFT_POINTS * sizeof(IN_SAMPLE_TYPE)))
error(1, 0, "input data size, expected %d but got %d", FFT_POINTS * sizeof(IN_SAMPLE_TYPE), result);
/* compute FFT */
for (i = 0; i < FFT_CALC_ROUNDS ; i++) {
FFT_FUNC(out_buf + (i * FFT_CALC_POINTS), in_buf + (i * FFT_CALC_POINTS), cfg, 0, 1);
}
/* write the output data */
result = write(output_fd, out_buf, FFT_POINTS * sizeof(OUT_SAMPLE_TYPE));
if(result < 0)
error(1, errno, "write output file");
if(result != (FFT_POINTS * sizeof(OUT_SAMPLE_TYPE)))
error(1, 0, "output data size, expected %d but got %d", FFT_POINTS * sizeof(OUT_SAMPLE_TYPE), result);
}
/* capture the end value of the GT */
g_end_time = get_gt_value();
/* close the input and output files and stream device */
close(raw256stream_dev_fd);
close(output_fd);
close(input_fd);
/* free storage for input, output and config buffers */
NE10_FREE (cfg);
NE10_FREE (out_buf);
NE10_FREE (in_buf);
print_results();
release_everything();
return 0;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <trace.h>
#include <util.h>
void shw_udelay(uint32_t microseconds)
{
uint64_t t_start, t_cur;
struct timeval tv;
gettimeofday(&tv, NULL);
t_start = (uint64_t) tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
do {
gettimeofday(&tv, NULL);
t_cur = (uint64_t) tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
} while(t_cur <= t_start + (uint64_t) microseconds);
}
void *shw_malloc(size_t nbytes)
{
void *p = malloc(nbytes);
if(!p)
{
TRACE(TRACE_FATAL, "malloc(%d) failed!", nbytes);
exit(-1);
}
return p;
}
void shw_free(void *ptr)
{
free(ptr);
}
uint64_t shw_get_tics()
{
struct timeval tv;
struct timezone tz={0,0};
gettimeofday(&tv, &tz);
return (uint64_t)tv.tv_usec + (uint64_t)tv.tv_sec * 1000000ULL;
}
/**
* \brief Helper function to quickly display byte into binary code.
* WARNING: this returns static storage
*/
const char *shw_2binary(uint8_t x)
{
static char b[9];
int z;
char *p=b;
for (z=0x80; z > 0; z >>= 1)
{
*p++=(((x & z) == z) ? '1' : '0');
}
*p='\0';
return b;
}
|
/**
* Copyright (c) 2009 LxDE Developers, see the file AUTHORS for details.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MENU_POLICY_H
#define MENU_POLICY_H
#ifndef DISABLE_MENU
#include <menu-cache.h>
extern MenuCache * panel_menu_cache_new(guint32* visibility_flags); /* Allocate a menu cache */
extern gboolean panel_menu_item_evaluate_visibility(MenuCacheItem * item, guint32 visibility_flags); /* Evaluate the visibility of a menu item */
#endif
#endif
|
#ifndef INCLUDE_CDDB_H
#define INCLUDE_CDDB_H
#include <cdio/cdio.h>
#include <cddb/cddb.h>
enum giles_cddb_err {
giles_cddb_err_none,
giles_cddb_err_no_conn,
giles_cddb_err_no_match
};
enum giles_cddb_err get_cddb_info_for_device(const CdIo_t *p_cdio, cddb_disc_t *disc);
#endif
|
/******************************************************************************
fgdump - by fizzgig and the foofus.net group
Copyright (C) 2008 by fizzgig
http://www.foofus.net
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
******************************************************************************/
#pragma once
class NetUse
{
public:
NetUse(LONG nCacheID = -1);
~NetUse(void);
bool Connect(const char* lpszMachine, const char* lpszUserName, const char* lpszPassword);
bool Disconnect(const char* lpszMachine);
private:
LONG m_nCacheID;
};
|
/******************************************************************************\
* client/src/PersonaView.h *
* Copyright (C) 2008 John Eric Martin <john.eric.martin@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 as *
* published by the Free Software Foundation. *
* *
* 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 __PersonaView_h__
#define __PersonaView_h__
#include "AjaxView.h"
#include "ui_PersonaView.h"
#include <QtCore/QVariant>
#include <QtCore/QMap>
class PersonaView : public AjaxView
{
Q_OBJECT
public:
PersonaView(QWidget *parent = 0);
protected:
virtual bool checkValues();
virtual QString table() const;
virtual QString addWarningTitle() const;
virtual QString addWarningMessage() const;
Ui::PersonaView ui;
};
#endif // __PersonaView_h__
|
/*
* This is included by init/main.c to check for architecture-dependent bugs.
*
* Needs:
* void check_bugs(void);
*
* Copyright (C) 1998, 1999, 2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef _ASM_IA64_BUGS_H
#define _ASM_IA64_BUGS_H
#include <asm/processor.h>
extern void check_bugs (void);
#endif /* _ASM_IA64_BUGS_H */
|
#ifndef FILEZILLA_ENGINE_SFTP_EVENT_HEADER
#define FILEZILLA_ENGINE_SFTP_EVENT_HEADER
#define FZSFTP_PROTOCOL_VERSION 8
enum class sftpEvent {
Unknown = -1,
Reply = 0,
Done,
Error,
Verbose,
Info,
Status,
Recv,
Send,
Listentry,
AskHostkey,
AskHostkeyChanged,
AskHostkeyBetteralg,
AskPassword,
Transfer,
RequestPreamble,
RequestInstruction,
UsedQuotaRecv,
UsedQuotaSend,
KexAlgorithm,
KexHash,
KexCurve,
CipherClientToServer,
CipherServerToClient,
MacClientToServer,
MacServerToClient,
Hostkey,
count
};
struct sftp_message
{
sftpEvent type;
mutable std::wstring text[2];
};
struct sftp_event_type;
typedef fz::simple_event<sftp_event_type, sftp_message> CSftpEvent;
struct sftp_list_message
{
mutable std::wstring text;
mutable std::wstring name;
uint64_t mtime;
};
struct sftp_list_event_type;
typedef fz::simple_event<sftp_list_event_type, sftp_list_message> CSftpListEvent;
struct terminate_event_type;
typedef fz::simple_event<terminate_event_type, std::wstring> CTerminateEvent;
#endif
|
/*
*
* Copyright (c) International Business Machines Corp., 2001
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* ipcmsg.h - common definitions for the IPC message tests.
*/
#ifndef __IPCMSG_H
#define __IPCMSG_H 1
#include <errno.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include "test.h"
#include "usctest.h"
void cleanup(void);
void setup(void);
#define MSG_RD 0400 /* read permission for the queue */
#define MSG_WR 0200 /* write permission for the queue */
#define MSG_RW MSG_RD | MSG_WR
#define MSGSIZE 1024 /* a resonable size for a message */
#define MSGTYPE 1 /* a type ID for a message */
#define NR_MSGQUEUES 16 /* MSGMNI as defined in linux/msg.h */
#define min(a, b) (((a) < (b)) ? (a) : (b))
typedef struct mbuf { /* a generic message structure */
long mtype;
char mtext[MSGSIZE + 1]; /* add 1 here so the message can be 1024 */
} MSGBUF; /* characters long with a '\0' termination */
#ifdef LIBIPC
key_t msgkey; /* the ftok() generated message key */
#else
extern key_t msgkey; /* the ftok() generated message key */
#endif
void check_root();
void init_buf(MSGBUF *, int, int);
void rm_queue(int);
key_t getipckey();
int getuserid(char *);
int get_max_msgqueues(void);
int get_used_msgqueues(void);
#endif /* ipcmsg.h */
|
/**
* Copyright (C) 2007 Stefan Buettcher. All rights reserved.
* This is free software with ABSOLUTELY NO WARRANTY.
*
* 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
**/
/**
* author: Stefan Buettcher
* created: 2006-07-09
* changed: 2009-02-01
**/
#ifndef __QUERY__NPQUERY_H
#define __QUERY__NPQUERY_H
#include "query.h"
#include "gclquery.h"
#include "rankedquery.h"
#include "../index/index.h"
class NPQuery : public RankedQuery {
public:
/** These are the standard Robertson/Walker parameters for BM25. **/
static const double DEFAULT_K1 = 1.2;
static const double DEFAULT_B = 0.75;
static const double DEFAULT_DECAY = 1.5;
/** Our BM25 implementation will not score containers that are smaller than this. **/
static const int MIN_OKAPI_CONTAINER_SIZE = 4;
protected:
/** BM25 parameters. **/
double k1, b;
/** Exponent for proximity stuff. **/
double decay;
public:
/** Stupid default constructor. **/
NPQuery() { }
NPQuery(Index *index, const char *command, const char **modifiers, const char *body,
VisibleExtents *visibleExtents, int memoryLimit);
NPQuery(Index *index, const char *command, const char **modifiers, const char *body,
uid_t userID, int memoryLimit);
virtual ~NPQuery();
protected:
/** This method does the actual work for the constructors. **/
virtual void initialize(Index *index, const char *command, const char **modifiers,
const char *body, VisibleExtents *visibleExtents, int memoryLimit);
/** Standard modifier processing routine, based on RankedQuery::processModifiers. **/
virtual void processModifiers(const char **modifiers);
/** The actual query processing. **/
virtual void processCoreQuery();
}; // end of class NPQuery
#endif
|
/* ----------------------------------------------------------------------- *
*
* Copyright 2000 H. Peter Anvin - 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, Inc., 675 Mass Ave, Cambridge MA 02139,
* USA; either version 2 of the License, or (at your option) any later
* version; incorporated herein by reference.
*
* ----------------------------------------------------------------------- */
/*
* msr.c
*
* x86 MSR access device
*
* This device is accessed by lseek() to the appropriate register number
* and then read/write in chunks of 8 bytes. A larger size means multiple
* reads or writes of the same register.
*
* This driver uses /dev/cpu/%d/msr where %d is the minor number, and on
* an SMP box will direct the access to CPU %d.
*/
#include <linux/module.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
#include <linux/init.h>
#include <linux/poll.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/major.h>
#include <linux/fs.h>
#include <asm/processor.h>
#include <asm/msr.h>
#include <asm/uaccess.h>
#include <asm/system.h>
/* Note: "err" is handled in a funny way below. Otherwise one version
of gcc or another breaks. */
static inline int wrmsr_eio(u32 reg, u32 eax, u32 edx)
{
int err;
asm volatile ("1: wrmsr\n"
"2:\n"
".section .fixup,\"ax\"\n"
"3: movl %4,%0\n"
" jmp 2b\n"
".previous\n"
".section __ex_table,\"a\"\n"
" .align 4\n" " .long 1b,3b\n" ".previous":"=&bDS" (err)
:"a"(eax), "d"(edx), "c"(reg), "i"(-EIO), "0"(0));
return err;
}
static inline int rdmsr_eio(u32 reg, u32 *eax, u32 *edx)
{
int err;
asm volatile ("1: rdmsr\n"
"2:\n"
".section .fixup,\"ax\"\n"
"3: movl %4,%0\n"
" jmp 2b\n"
".previous\n"
".section __ex_table,\"a\"\n"
" .align 4\n"
" .long 1b,3b\n"
".previous":"=&bDS" (err), "=a"(*eax), "=d"(*edx)
:"c"(reg), "i"(-EIO), "0"(0));
return err;
}
#ifdef CONFIG_SMP
struct msr_command {
int cpu;
int err;
u32 reg;
u32 data[2];
};
static void msr_smp_wrmsr(void *cmd_block)
{
struct msr_command *cmd = (struct msr_command *)cmd_block;
if (cmd->cpu == smp_processor_id())
cmd->err = wrmsr_eio(cmd->reg, cmd->data[0], cmd->data[1]);
}
static void msr_smp_rdmsr(void *cmd_block)
{
struct msr_command *cmd = (struct msr_command *)cmd_block;
if (cmd->cpu == smp_processor_id())
cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]);
}
static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
{
struct msr_command cmd;
int ret;
preempt_disable();
if (cpu == smp_processor_id()) {
ret = wrmsr_eio(reg, eax, edx);
} else {
cmd.cpu = cpu;
cmd.reg = reg;
cmd.data[0] = eax;
cmd.data[1] = edx;
smp_call_function(msr_smp_wrmsr, &cmd, 1, 1);
ret = cmd.err;
}
preempt_enable();
return ret;
}
static inline int do_rdmsr(int cpu, u32 reg, u32 * eax, u32 * edx)
{
struct msr_command cmd;
int ret;
preempt_disable();
if (cpu == smp_processor_id()) {
ret = rdmsr_eio(reg, eax, edx);
} else {
cmd.cpu = cpu;
cmd.reg = reg;
smp_call_function(msr_smp_rdmsr, &cmd, 1, 1);
*eax = cmd.data[0];
*edx = cmd.data[1];
ret = cmd.err;
}
preempt_enable();
return ret;
}
#else /* ! CONFIG_SMP */
static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
{
return wrmsr_eio(reg, eax, edx);
}
static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx)
{
return rdmsr_eio(reg, eax, edx);
}
#endif /* ! CONFIG_SMP */
static loff_t msr_seek(struct file *file, loff_t offset, int orig)
{
loff_t ret = -EINVAL;
lock_kernel();
switch (orig) {
case 0:
file->f_pos = offset;
ret = file->f_pos;
break;
case 1:
file->f_pos += offset;
ret = file->f_pos;
}
unlock_kernel();
return ret;
}
static ssize_t msr_read(struct file *file, char __user * buf,
size_t count, loff_t * ppos)
{
u32 __user *tmp = (u32 __user *) buf;
u32 data[2];
size_t rv;
u32 reg = *ppos;
int cpu = iminor(file->f_dentry->d_inode);
int err;
if (count % 8)
return -EINVAL; /* Invalid chunk size */
for (rv = 0; count; count -= 8) {
err = do_rdmsr(cpu, reg, &data[0], &data[1]);
if (err)
return err;
if (copy_to_user(tmp, &data, 8))
return -EFAULT;
tmp += 2;
}
return ((char __user *)tmp) - buf;
}
static ssize_t msr_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
const u32 __user *tmp = (const u32 __user *)buf;
u32 data[2];
size_t rv;
u32 reg = *ppos;
int cpu = iminor(file->f_dentry->d_inode);
int err;
if (count % 8)
return -EINVAL; /* Invalid chunk size */
for (rv = 0; count; count -= 8) {
if (copy_from_user(&data, tmp, 8))
return -EFAULT;
err = do_wrmsr(cpu, reg, data[0], data[1]);
if (err)
return err;
tmp += 2;
}
return ((char __user *)tmp) - buf;
}
static int msr_open(struct inode *inode, struct file *file)
{
unsigned int cpu = iminor(file->f_dentry->d_inode);
struct cpuinfo_x86 *c = &(cpu_data)[cpu];
if (cpu >= NR_CPUS || !cpu_online(cpu))
return -ENXIO; /* No such CPU */
if (!cpu_has(c, X86_FEATURE_MSR))
return -EIO; /* MSR not supported */
return 0;
}
/*
* File operations we support
*/
static struct file_operations msr_fops = {
.owner = THIS_MODULE,
.llseek = msr_seek,
.read = msr_read,
.write = msr_write,
.open = msr_open,
};
int __init msr_init(void)
{
if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
printk(KERN_ERR "msr: unable to get major %d for msr\n",
MSR_MAJOR);
return -EBUSY;
}
return 0;
}
void __exit msr_exit(void)
{
unregister_chrdev(MSR_MAJOR, "cpu/msr");
}
module_init(msr_init);
module_exit(msr_exit)
MODULE_AUTHOR("H. Peter Anvin <hpa@zytor.com>");
MODULE_DESCRIPTION("x86 generic MSR driver");
MODULE_LICENSE("GPL");
|
/*
* Copyright (C) 2008 - 2011 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2011 - 2012 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARKCORE_TYPECONTAINERVISITOR_H
#define ARKCORE_TYPECONTAINERVISITOR_H
/*
* @class TypeContainerVisitor is implemented as a visitor pattern. It is
* a visitor to the TypeContainerList or TypeContainerMapList. The visitor has
* to overload its types as a visit method is called.
*/
#include "Define.h"
#include "Dynamic/TypeContainer.h"
// forward declaration
template<class T, class Y> class TypeContainerVisitor;
// visitor helper
template<class VISITOR, class TYPE_CONTAINER> void VisitorHelper(VISITOR &v, TYPE_CONTAINER &c)
{
v.Visit(c);
}
// terminate condition for container list
template<class VISITOR> void VisitorHelper(VISITOR &v, ContainerList<TypeNull> &c)
{
}
template<class VISITOR, class T> void VisitorHelper(VISITOR &v, ContainerList<T> &c)
{
v.Visit(c._element);
}
// recursion for container list
template<class VISITOR, class H, class T> void VisitorHelper(VISITOR &v, ContainerList<TypeList<H, T> > &c)
{
VisitorHelper(v, c._elements);
VisitorHelper(v, c._TailElements);
}
// terminate condition container map list
template<class VISITOR> void VisitorHelper(VISITOR &/*v*/, ContainerMapList<TypeNull> &/*c*/)
{
}
template<class VISITOR, class T> void VisitorHelper(VISITOR &v, ContainerMapList<T> &c)
{
v.Visit(c._element);
}
// recursion container map list
template<class VISITOR, class H, class T> void VisitorHelper(VISITOR &v, ContainerMapList<TypeList<H, T> > &c)
{
VisitorHelper(v, c._elements);
VisitorHelper(v, c._TailElements);
}
// array list
template<class VISITOR, class T> void VisitorHelper(VISITOR &v, ContainerArrayList<T> &c)
{
v.Visit(c._element);
}
template<class VISITOR> void VisitorHelper(VISITOR &/*v*/, ContainerArrayList<TypeNull> &/*c*/)
{
}
// recursion
template<class VISITOR, class H, class T> void VisitorHelper(VISITOR &v, ContainerArrayList<TypeList<H, T> > &c)
{
VisitorHelper(v, c._elements);
VisitorHelper(v, c._TailElements);
}
// for TypeMapContainer
template<class VISITOR, class OBJECT_TYPES> void VisitorHelper(VISITOR &v, TypeMapContainer<OBJECT_TYPES> &c)
{
VisitorHelper(v, c.GetElements());
}
template<class VISITOR, class TYPE_CONTAINER>
class TypeContainerVisitor
{
public:
TypeContainerVisitor(VISITOR &v) : i_visitor(v) {}
void Visit(TYPE_CONTAINER &c)
{
VisitorHelper(i_visitor, c);
}
void Visit(const TYPE_CONTAINER &c) const
{
VisitorHelper(i_visitor, c);
}
private:
VISITOR &i_visitor;
};
#endif
|
/* (c) GPL 2007 Karel 'Clock' Kulhavy, Twibright Labs */
#include <stdio.h> /* fprintf */
#include "optar.h"
#include "opts.h"
/* Coordinates don't count with the border - 0,0 is upper left corner of the
* first cross! */
int is_cross(unsigned x, unsigned y)
{
x%=CPITCH;
y%=CPITCH;
return (x<2*CHALF&&y<2*CHALF);
}
/* Returns the coords relative to the upperloeftmost cross upper left corner
* pixel! If you have borders, you have to add them! */
void seq2xy(int *x, int *y, unsigned seq)
{
unsigned rep; /* Repetition - number of narrow strip - wide strip pair,
starting with 0 */
if (seq>=TOTALBITS){
/* Out of range */
*x=-1;
*y=-1;
return;
}
/* We are sure we are in range. Document structure:
* - narrow strip (between top row of crosses), height is
* 2*CHALF
* - wide strip, height is CPITCH-2*CHALF
* - the above repeats (YCROSSES-1)-times
* - narrow strip
*/
rep=seq/REPPIXELS;
seq=seq%REPPIXELS;
*y=REPHEIGHT*rep;
/* Now seq is sequence in the repetition pair */
if (seq>=NARROWPIXELS){
/* Second, wide strip of the pair */
*y+=NARROWHEIGHT;
seq-=NARROWPIXELS;
/* Now seq is sequence in the wide strip */
*y+=seq/WIDEWIDTH;
*x=seq%WIDEWIDTH;
}else{
/* First, narrow strip of the pair */
unsigned gap; /* Horizontal gap number */
*x=2*CHALF;
*y+=seq/NARROWWIDTH;
seq%=NARROWWIDTH;
/* seq is now sequence in the horiz. line */
gap=seq/GAPWIDTH;
*x+=gap*CPITCH;
seq%=GAPWIDTH;
/* seq is now sequence in the gap */
*x+=seq;
}
}
/* Golay codes */
unsigned long golay(unsigned long in)
{
return golay_codes[in&4095];
}
|
/*
* thd_sys_fs.h: sysfs class interface
*
* Copyright (C) 2012 Intel Corporation. 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 or later as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*
* Author Name <Srinivas.Pandruvada@linux.intel.com>
*
*/
#ifndef THD_SYS_FS_H_
#define THD_SYS_FS_H_
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
class csys_fs {
private:
std::string base_path;
public:
csys_fs() :
base_path("") {
}
;
csys_fs(const char *path) :
base_path(path) {
}
/* write data to base path (dir) + provided path */
int write(const std::string &path, const std::string &buf);
int write(const std::string &path, unsigned int data);
int write(const std::string &path, unsigned int position,
unsigned long long data);
/* read data from base path (dir) + provided path */
int read(const std::string &path, char *buf, int len);
int read(const std::string &path, std::string &buf);
int read(const std::string &path, int *ptr_val);
int read(const std::string &path, unsigned long *ptr_val);
int read(const std::string &path, unsigned int position, char *buf,
int len);
const char *get_base_path() {
return base_path.c_str();
}
int read_symbolic_link_value(const std::string &path, char *buf, int len);
bool exists(const std::string &path);
bool exists();
size_t size(const std::string &path);
int create();
mode_t get_mode(const std::string &path);
void update_path(std::string path) {
base_path = path;
}
};
#endif /* THD_SYS_FS_H_ */
|
//
// --------------------------------------------------------------------------
// Gurux Ltd
//
//
//
// Filename: $HeadURL$
//
// Version: $Revision$,
// $Date$
// $Author$
//
// Copyright (c) Gurux Ltd
//
//---------------------------------------------------------------------------
//
// DESCRIPTION
//
// This file is a part of Gurux Device Framework.
//
// Gurux Device Framework is Open Source software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 of the License.
// Gurux Device Framework 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.
//
// More information of Gurux products: http://www.gurux.org
//
// This code is licensed under the GNU General Public License v2.
// Full text may be retrieved at http://www.gnu.org/licenses/gpl-2.0.txt
//---------------------------------------------------------------------------
#ifndef GXAPDU_H
#define GXAPDU_H
#include <vector>
#include "enums.h"
#include "errorcodes.h"
#include "GXHelpers.h"
#include "GXDLMSSettings.h"
#include "GXDLMSTranslatorStructure.h"
/////////////////////////////////////////////////////////////////////////////
// The services to access the attributes and methods of COSEM objects are
// determined on DLMS/COSEM Application layer. The services are carried by
// Application Protocol Data Units (APDUs).
// <p />
// In DLMS/COSEM the meter is primarily a server, and the controlling system is
// a client. Also unsolicited (received without a request) messages are
// available.
/////////////////////////////////////////////////////////////////////////////
class CGXAPDU
{
friend class CGXDLMSTranslator;
private:
/////////////////////////////////////////////////////////////////////////////
// Constructor.
/////////////////////////////////////////////////////////////////////////////
CGXAPDU()
{
}
static int ParsePDU2(
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& buff,
DLMS_ASSOCIATION_RESULT& result,
DLMS_SOURCE_DIAGNOSTIC& diagnostic
#ifndef DLMS_IGNORE_XML_TRANSLATOR
, CGXDLMSTranslatorStructure* xml
#endif //DLMS_IGNORE_XML_TRANSLATOR
);
static int Parse(bool initiateRequest,
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& data,
#ifndef DLMS_IGNORE_XML_TRANSLATOR
CGXDLMSTranslatorStructure* xml,
#endif //DLMS_IGNORE_XML_TRANSLATOR
unsigned char tag);
public:
/**
* Parse User Information from PDU.
*/
static int ParseUserInformation(
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& data
#ifndef DLMS_IGNORE_XML_TRANSLATOR
, CGXDLMSTranslatorStructure* xml
#endif //DLMS_IGNORE_XML_TRANSLATOR
);
/**
* Generates Aarq.
*/
static int GenerateAarq(
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer* encryptedData,
CGXByteBuffer& data);
/**
* Generate user information.
*
* @param settings
* DLMS settings.
* @param cipher
* @param data
* Generated user information.
*/
static int GenerateUserInformation(
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer* encryptedData,
CGXByteBuffer& data);
/**
* Parse APDU.
*/
static int ParsePDU(CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& buff,
DLMS_ASSOCIATION_RESULT &result,
DLMS_SOURCE_DIAGNOSTIC& diagnostic
#ifndef DLMS_IGNORE_XML_TRANSLATOR
, CGXDLMSTranslatorStructure* xml
#endif //DLMS_IGNORE_XML_TRANSLATOR
);
/**
* Server generates AARE message.
*/
static int GenerateAARE(
CGXDLMSSettings& settings,
CGXByteBuffer& data,
DLMS_ASSOCIATION_RESULT result,
DLMS_SOURCE_DIAGNOSTIC diagnostic,
CGXCipher* cipher,
CGXByteBuffer *errorData,
CGXByteBuffer *encryptedData);
static int GetUserInformation(
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& data);
static int ParseInitiate(
bool initiateRequest,
CGXDLMSSettings& settings,
CGXCipher* cipher,
CGXByteBuffer& data
#ifndef DLMS_IGNORE_XML_TRANSLATOR
, CGXDLMSTranslatorStructure* xml
#endif //DLMS_IGNORE_XML_TRANSLATOR
);
};
#endif //GXAPDU_H
|
/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
* Copyright (C) 2004-2005 Constantin Kaplinsky. All Rights Reserved.
* Copyright (C) 2015 Davide Bettio for Ispirata Srl
*
* This 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 software 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 software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
//
// Image.h
//
#ifndef __IMAGE_H__
#define __IMAGE_H__
class View;
class XImage;
typedef unsigned long Window;
//
// Image class is an Xlib-based implementation of screen image storage.
//
class Image {
public:
Image(View *v);
Image(View *v, int width, int height);
virtual ~Image();
bool isTrueColor() const { return trueColor; }
virtual const char *className() const {
return "Image";
}
virtual const char *classDesc() const {
return "basic Xlib image";
}
virtual void get(Window wnd, int x = 0, int y = 0);
virtual void get(Window wnd, int x, int y, int w, int h,
int dst_x = 0, int dst_y = 0);
// Copying pixels from one image to another.
virtual void updateRect(XImage *src, int dst_x = 0, int dst_y = 0);
virtual void updateRect(Image *src, int dst_x = 0, int dst_y = 0);
virtual void updateRect(XImage *src, int dst_x, int dst_y, int w, int h);
virtual void updateRect(Image *src, int dst_x, int dst_y, int w, int h);
virtual void updateRect(XImage *src, int dst_x, int dst_y,
int src_x, int src_y, int w, int h);
virtual void updateRect(Image *src, int dst_x, int dst_y,
int src_x, int src_y, int w, int h);
// Pointer to corresponding XImage, made public for efficiency.
// NOTE: if this field is NULL, then no methods other than Init()
// may be called.
#if 0
XImage *xim;
#endif
//Not XImage
int depth;
int bytes_per_line;
int bits_per_pixel;
unsigned int red_mask;
unsigned int green_mask;
unsigned int blue_mask;
int width;
int height;
static char *mem;
static char *data;
// Get a pointer to the data corresponding to the given coordinates.
inline char *locatePixel(int x, int y) const {
return ((char *) data +
(y * bytes_per_line +
x * bits_per_pixel / 8));
}
protected:
void Init(int width, int height);
// Like updateRect(), but does not check arguments.
void copyPixels(XImage *src,
int dst_x, int dst_y,
int src_x, int src_y,
int w, int h);
View *view;
bool trueColor;
};
//
// ImageFactory class is used to produce instances of Image-derived
// objects that are most appropriate for current X server and user
// settings.
//
class ImageFactory {
public:
ImageFactory(bool allowShm, bool allowOverlay);
virtual ~ImageFactory();
bool isShmAllowed() { return mayUseShm; }
bool isOverlayAllowed() { return mayUseOverlay; }
virtual Image *newImage(View *v, int width, int height);
protected:
bool mayUseShm;
bool mayUseOverlay;
};
#endif // __IMAGE_H__
|
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* 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 __ASM_ARCH_MSM_IRQS_H
#define __ASM_ARCH_MSM_IRQS_H
/*
* 0-15: STI/SGI (software triggered/generated interrupts)
* 16-31: PPI (private peripheral interrupts)
* 32+: SPI (shared peripheral interrupts)
*/
#define GIC_PPI_START 16
#define GIC_SPI_START 32
#define MSM_IRQ_BIT(irq) (1 << ((irq) & 31))
#if defined(CONFIG_PCI_MSI) && defined(CONFIG_MSM_PCIE)
#define MSM_PCIE_MSI_INT(n) (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS + \
NR_PM8821_IRQS + NR_TABLA_IRQS + NR_GPIO_EXPANDER_IRQS + (n))
#endif
#endif
|
/* Language-level data type conversion for GNU C.
Copyright (C) 1987, 1988, 1991, 1998, 2002 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* This file contains the functions for converting C expressions
to different data types. The only entry point is `convert'.
Every language front end must have a `convert' function
but what kind of conversions it does will depend on the language. */
/* copied from the f77 frontend I think */
/* copied from c-convert.c without significant modification*/
/* Change of width--truncation and extension of integers or reals--
is represented with NOP_EXPR. Proper functioning of many things
assumes that no other conversions can be NOP_EXPRs.
*/
/* I've added support for WITH_RECORD_EXPR. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "convert.h"
#include "c-common.h"
#include "toplev.h"
#include "g95-support.h"
/*
Conversion between integer and pointer is represented with CONVERT_EXPR.
Converting integer to real uses FLOAT_EXPR
and real to integer uses FIX_TRUNC_EXPR.
Here is a list of all the functions that assume that widening and
narrowing is always done with a NOP_EXPR:
In convert.c, convert_to_integer.
In c-typeck.c, build_binary_op (boolean ops), and
c_common_truthvalue_conversion.
In expr.c: expand_expr, for operands of a MULT_EXPR.
In fold-const.c: fold.
In tree.c: get_narrower and get_unwidened. */
/* Subroutines of `convert'. */
/* Create an expression whose value is that of EXPR,
converted to type TYPE. The TREE_TYPE of the value
is always TYPE. This function implements all reasonable
conversions; callers should filter out those that are
not permitted by the language being compiled. */
/* We are assuming that given a SIMPLE val, the result will be a SIMPLE rhs.
If this is not the case, we will abort with an internal error. */
tree convert (tree type, tree expr) {
tree e = expr;
enum tree_code code = TREE_CODE(type);
if (TREE_CODE (expr) == WITH_RECORD_EXPR)
return build(WITH_RECORD_EXPR, type,
convert(type, TREE_OPERAND(expr, 0)),
TREE_OPERAND(expr, 1));
if (type == TREE_TYPE(expr)
|| TREE_CODE(expr) == ERROR_MARK
|| code == ERROR_MARK || TREE_CODE(TREE_TYPE(expr)) == ERROR_MARK)
return expr;
if (TYPE_MAIN_VARIANT(type) == TYPE_MAIN_VARIANT(TREE_TYPE(expr)))
return fold(build1(NOP_EXPR, type, expr));
if (TREE_CODE(TREE_TYPE(expr)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE(TREE_TYPE (expr)) == VOID_TYPE) {
error ("void value not ignored as it ought to be");
return error_mark_node;
}
if (code == VOID_TYPE)
return build1(CONVERT_EXPR, type, e);
#if 0
/* This is incorrect. A truncation can't be stripped this way.
Extensions will be stripped by the use of get_unwidened. */
if (TREE_CODE(expr) == NOP_EXPR)
return convert(type, TREE_OPERAND(expr, 0));
#endif
if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
return fold(convert_to_integer(type, e));
if (code == BOOLEAN_TYPE) {
tree t = g95_truthvalue_conversion(expr);
/* If it returns a NOP_EXPR, we must fold it here to avoid
infinite recursion between fold () and convert (). */
if (TREE_CODE(t) == NOP_EXPR)
return fold(build1(NOP_EXPR, type, TREE_OPERAND(t, 0)));
else
return fold(build1(NOP_EXPR, type, t));
}
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
return fold(convert_to_pointer (type, e));
if (code == REAL_TYPE)
return fold(convert_to_real (type, e));
if (code == COMPLEX_TYPE)
return fold(convert_to_complex (type, e));
if (code == VECTOR_TYPE)
return fold(convert_to_vector (type, e));
error ("conversion to non-scalar type requested");
return error_mark_node;
}
|
#ifndef GAME_H_INCLUDED
#define GAME_H_INCLUDED
#include <SFML/Graphics.hpp>
#include <string>
#include "VectorBoard.h"
class Game
{
public:
static void run();
const static int ROW_NUM = 4;
const static int COL_NUM = 4;
const static int CELL_SIZE = 100;
const static int SCREEN_WIDTH = COL_NUM * CELL_SIZE;
const static int SCREEN_HEIGHT = ROW_NUM * CELL_SIZE;
const static std::string S;
private:
static void processEvents(char& direction);
static void update(char& direction, float realRandom1, float realRandom2);
static void render(const sf::Font& font);
static sf::RenderWindow _window;
static VectorBoard _board;
};
#endif // GAME_H_INCLUDED
|
/*
* Copyright (c) 1999-2002, Darren Hiebert
*
* This source code is released for free distribution under the terms of the
* GNU General Public License version 2 or (at your option) any later version.
*
* This module contains functions managing resizable pointer arrays.
*/
/*
* INCLUDE FILES
*/
#include "general.h" /* must always come first */
#include <string.h>
#include <stdlib.h>
#include "debug.h"
#include "ptrarray.h"
#include "routines.h"
/*
* DATA DECLARATIONS
*/
struct sPtrArray {
unsigned int max;
unsigned int count;
void **array;
ptrArrayDeleteFunc deleteFunc;
};
/*
* FUNCTION DEFINITIONS
*/
extern ptrArray *ptrArrayNew (ptrArrayDeleteFunc deleteFunc)
{
ptrArray* const result = xMalloc (1, ptrArray);
result->max = 8;
result->count = 0;
result->array = xMalloc (result->max, void*);
result->deleteFunc = deleteFunc;
return result;
}
extern unsigned int ptrArrayAdd (ptrArray *const current, void *ptr)
{
Assert (current != NULL);
if (current->count == current->max)
{
current->max *= 2;
current->array = xRealloc (current->array, current->max, void*);
}
current->array [current->count] = ptr;
return current->count++;
}
extern void *ptrArrayRemoveLast (ptrArray *const current)
{
Assert (current != NULL);
Assert (current->count > 0);
void *r = ptrArrayLast (current);
--current->count;
return r;
}
/* Combine array `from' into `current', deleting `from' */
extern void ptrArrayCombine (ptrArray *const current, ptrArray *const from)
{
unsigned int i;
Assert (current != NULL);
Assert (from != NULL);
for (i = 0 ; i < from->count ; ++i)
ptrArrayAdd (current, from->array [i]);
from->count = 0;
ptrArrayDelete (from);
}
extern unsigned int ptrArrayCount (const ptrArray *const current)
{
Assert (current != NULL);
return current->count;
}
extern void* ptrArrayItem (const ptrArray *const current, const unsigned int indx)
{
Assert (current != NULL);
return current->array [indx];
}
extern void* ptrArrayLast (const ptrArray *const current)
{
Assert (current != NULL);
Assert (current->count > 0);
return current->array [current->count - 1];
}
extern void ptrArrayClear (ptrArray *const current)
{
Assert (current != NULL);
if (current->deleteFunc)
{
unsigned int i;
for (i = 0 ; i < current->count ; ++i)
current->deleteFunc (current->array [i]);
}
current->count = 0;
}
extern void ptrArrayDelete (ptrArray *const current)
{
if (current != NULL)
{
ptrArrayClear (current);
eFree (current->array);
eFree (current);
}
}
extern bool ptrArrayHasTest (const ptrArray *const current,
bool (*test)(const void *ptr, void *userData),
void *userData)
{
bool result = false;
unsigned int i;
Assert (current != NULL);
for (i = 0 ; ! result && i < current->count ; ++i)
result = (*test)(current->array [i], userData);
return result;
}
static bool ptrEq (const void *ptr, void *userData)
{
return (ptr == userData);
}
extern bool ptrArrayHas (const ptrArray *const current, void *ptr)
{
return ptrArrayHasTest (current, ptrEq, ptr);
}
extern void ptrArrayReverse (const ptrArray *const current)
{
unsigned int i, j;
void *tmp;
Assert (current != NULL);
for (i = 0, j = current->count - 1 ; i < (current->count / 2); ++i, --j)
{
tmp = current->array[i];
current->array[i] = current->array[j];
current->array[j] = tmp;
}
}
extern void ptrArrayDeleteItem (ptrArray* const current, unsigned int indx)
{
void *ptr = current->array[indx];
if (current->deleteFunc)
current->deleteFunc (ptr);
memmove (current->array + indx, current->array + indx + 1,
(current->count - indx) * sizeof (*current->array));
--current->count;
}
static int (*ptrArraySortCompareVar)(const void *, const void *);
static int ptrArraySortCompare(const void *a0, const void *b0)
{
void *const *a = (void *const *)a0;
void *const *b = (void *const *)b0;
return ptrArraySortCompareVar (*a, *b);
}
extern void ptrArraySort (ptrArray *const current, int (*compare)(const void *, const void *))
{
ptrArraySortCompareVar = compare;
qsort (current->array, current->count, sizeof (void *), ptrArraySortCompare);
}
|
/**
* @file thtfangle.h
* Units transformation class.
*/
/* Copyright (C) 2000 Stacho Mudrak
*
* $Date: $
* $RCSfile: $
* $Revision: $
*
* --------------------------------------------------------------------
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* --------------------------------------------------------------------
*/
#ifndef thtfangle_h
#define thtfangle_h
#include "thtf.h"
#include "thparse.h"
enum {TT_TFU_DEG, TT_TFU_DMS, TT_TFU_GRAD, TT_TFU_MIN, TT_TFU_PERC, TT_TFU_UNKNOWN_ANGLE};
static const thstok thtt_tfunits_angle[] = {
{"deg", TT_TFU_DEG},
{"degree", TT_TFU_DEG},
{"degrees", TT_TFU_DEG},
{"grad", TT_TFU_GRAD},
{"grads", TT_TFU_GRAD},
{"mil",TT_TFU_GRAD},
{"mils", TT_TFU_GRAD},
{"min", TT_TFU_MIN},
{"minute", TT_TFU_MIN},
{"minutes", TT_TFU_MIN},
{"percent", TT_TFU_PERC},
{"percentage", TT_TFU_PERC},
{NULL, TT_TFU_UNKNOWN_ANGLE},
};
/**
* Angle transformation class.
*/
class thtfangle : public thtf {
public:
bool allow_percentage;
/**
* Parse units factor.
*/
thtfangle();
virtual void parse_units(char * ustr);
virtual double transform(double value);
};
#endif
|
/*
* Copyright (C) 2011 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BrowserWindow_h
#define BrowserWindow_h
#include <webkit2/webkit2.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define BROWSER_TYPE_WINDOW (browser_window_get_type())
#define BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_WINDOW, BrowserWindow))
#define BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_WINDOW, BrowserWindowClass))
#define BROWSER_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_WINDOW))
#define BROWSER_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_WINDOW))
#define BROWSER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_WINDOW, BrowserWindowClass))
#define BROWSER_DEFAULT_URL "http://www.webkitgtk.org/"
typedef struct _BrowserWindow BrowserWindow;
typedef struct _BrowserWindowClass BrowserWindowClass;
GType browser_window_get_type(void);
GtkWidget* browser_window_new(WebKitWebView*, GtkWindow*);
WebKitWebView* browser_window_get_view(BrowserWindow*);
void browser_window_load_uri(BrowserWindow *, const char *uri);
void browser_window_load_session(BrowserWindow *, const char *sessionFile);
void browser_window_set_background_color(BrowserWindow*, GdkRGBA*);
G_END_DECLS
#endif
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-search-directory-file.h: Subclass of NautilusFile to implement the
the case of the search directory
Copyright (C) 2003 Red Hat, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef NAUTILUS_SEARCH_DIRECTORY_FILE_H
#define NAUTILUS_SEARCH_DIRECTORY_FILE_H
#include <libnautilus-private/nautilus-file.h>
#define NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE \
(nautilus_search_directory_file_get_type ())
#define NAUTILUS_SEARCH_DIRECTORY_FILE(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, NautilusSearchDirectoryFile))
#define NAUTILUS_SEARCH_DIRECTORY_FILE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, NautilusSearchDirectoryFileClass))
#define NAUTILUS_IS_SEARCH_DIRECTORY_FILE(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE))
#define NAUTILUS_IS_SEARCH_DIRECTORY_FILE_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE))
typedef struct NautilusSearchDirectoryFileDetails NautilusSearchDirectoryFileDetails;
typedef struct {
NautilusFile parent_slot;
NautilusSearchDirectoryFileDetails *details;
} NautilusSearchDirectoryFile;
typedef struct {
NautilusFileClass parent_slot;
} NautilusSearchDirectoryFileClass;
GType nautilus_search_directory_file_get_type (void);
void nautilus_search_directory_file_update_display_name (NautilusSearchDirectoryFile *search_file);
#endif /* NAUTILUS_SEARCH_DIRECTORY_FILE_H */
|
/*
* Copyright (C) 1996-2015 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
#ifndef SQUID_RELEASE_TIME
#define SQUID_RELEASE_TIME 1427540278
#endif
/*
* String for version id of this distribution
* is now the automake "VERSION" string.
*/
#ifndef APP_SHORTNAME
#define APP_SHORTNAME "squid"
#endif
#ifndef APP_FULLNAME
#define APP_FULLNAME PACKAGE "/" VERSION
#endif
|
/*
* Copyright (C) 2010 Neil Stockbridge
* LICENSE: GPL
*/
#ifndef __STOPWATCH_H
#define __STOPWATCH_H
#include <sys/time.h>
typedef struct
{
struct timeval when_started;
struct timeval when_stopped;
}
Stopwatch;
extern
void start_stopwatch( Stopwatch *sw)
;
extern
void stop_stopwatch( Stopwatch *sw)
;
// Returns the number of nanoseconds between when the stopwatch was started and
// when it was stopped.
extern
long time_on_stopwatch( Stopwatch *sw)
;
#endif
|
/*
wiring_digital.c - digital input and output functions
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2005-2006 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
Modified 28 September 2010 by Mark Sproul
$Id: wiring.c 248 2007-02-03 15:36:30Z mellis $
*/
#include "wiring_private.h"
#include "pins_arduino.h"
#include "pins_arduino.c"
void pinMode(uint8_t pin, uint8_t mode)
{
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digital_pin_to_port_PGM[pin];
volatile uint8_t *reg;
if (port == NOT_A_PIN) return;
// JWS: can I let the optimizer do this?
reg = portModeRegister(port);
if (mode == INPUT) {
uint8_t oldSREG = SREG;
cli();
*reg &= ~bit;
SREG = oldSREG;
} else {
uint8_t oldSREG = SREG;
cli();
*reg |= bit;
SREG = oldSREG;
}
}
// Forcing this inline keeps the callers from having to push their own stuff
// on the stack. It is a good performance win and only takes 1 more byte per
// user than calling. (It will take more bytes on the 168.)
//
// But shouldn't this be moved into pinMode? Seems silly to check and do on
// each digitalread or write.
//
// Mark Sproul:
// - Removed inline. Save 170 bytes on atmega1280
// - changed to a switch statment; added 32 bytes but much easier to read and maintain.
// - Added more #ifdefs, now compiles for atmega645
//
//static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline));
//static inline void turnOffPWM(uint8_t timer)
static void turnOffPWM(uint8_t timer)
{
switch (timer)
{
#if defined(TCCR1A) && defined(COM1A1)
case TIMER1A: cbi(TCCR1A, COM1A1); break;
#endif
#if defined(TCCR1A) && defined(COM1B1)
case TIMER1B: cbi(TCCR1A, COM1B1); break;
#endif
#if defined(TCCR2) && defined(COM21)
case TIMER2: cbi(TCCR2, COM21); break;
#endif
#if defined(TCCR0A) && defined(COM0A1)
case TIMER0A: cbi(TCCR0A, COM0A1); break;
#endif
#if defined(TIMER0B) && defined(COM0B1)
case TIMER0B: cbi(TCCR0A, COM0B1); break;
#endif
#if defined(TCCR2A) && defined(COM2A1)
case TIMER2A: cbi(TCCR2A, COM2A1); break;
#endif
#if defined(TCCR2A) && defined(COM2B1)
case TIMER2B: cbi(TCCR2A, COM2B1); break;
#endif
#if defined(TCCR3A) && defined(COM3A1)
case TIMER3A: cbi(TCCR3A, COM3A1); break;
#endif
#if defined(TCCR3A) && defined(COM3B1)
case TIMER3B: cbi(TCCR3A, COM3B1); break;
#endif
#if defined(TCCR3A) && defined(COM3C1)
case TIMER3C: cbi(TCCR3A, COM3C1); break;
#endif
#if defined(TCCR4A) && defined(COM4A1)
case TIMER4A: cbi(TCCR4A, COM4A1); break;
#endif
#if defined(TCCR4A) && defined(COM4B1)
case TIMER4B: cbi(TCCR4A, COM4B1); break;
#endif
#if defined(TCCR4A) && defined(COM4C1)
case TIMER4C: cbi(TCCR4A, COM4C1); break;
#endif
#if defined(TCCR5A)
case TIMER5A: cbi(TCCR5A, COM5A1); break;
case TIMER5B: cbi(TCCR5A, COM5B1); break;
case TIMER5C: cbi(TCCR5A, COM5C1); break;
#endif
}
}
void digitalWrite(uint8_t pin, uint8_t val)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digital_pin_to_port_PGM[pin];
volatile uint8_t *out;
if (port == NOT_A_PIN) return;
// If the pin that support PWM output, we need to turn it off
// before doing a digital write.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);
out = portOutputRegister(port);
if (val == LOW) {
uint8_t oldSREG = SREG;
cli();
*out &= ~bit;
SREG = oldSREG;
} else {
uint8_t oldSREG = SREG;
cli();
*out |= bit;
SREG = oldSREG;
}
}
int digitalRead(uint8_t pin)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digital_pin_to_port_PGM[pin];
if (port == NOT_A_PIN) return LOW;
// If the pin that support PWM output, we need to turn it off
// before getting a digital reading.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);
if (*portInputRegister(port) & bit) return HIGH;
return LOW;
}
|
#include <stic.h>
#include <stddef.h> /* NULL */
#include <string.h> /* strcmp() strcpy() strlen() */
#include "../../src/ui/ui.h"
#include "../../src/utils/str.h"
#include "../../src/bmarks.h"
#include "../../src/cmd_core.h"
static int count_bmarks(void);
static void bmarks_cb(const char p[], const char t[], time_t timestamp,
void *arg);
static char *path;
static char *tags;
static int cb_called;
SETUP()
{
init_commands();
lwin.selected_files = 0;
strcpy(lwin.curr_dir, "/a/path");
path = NULL;
tags = NULL;
}
TEARDOWN()
{
assert_success(exec_commands("delbmarks!", &lwin, CIT_COMMAND));
free(path);
free(tags);
}
TEST(tag_with_comma_is_rejected)
{
assert_failure(exec_commands("bmark a,b", &lwin, CIT_COMMAND));
}
TEST(tag_with_space_is_rejected)
{
assert_failure(exec_commands("bmark a\\ b", &lwin, CIT_COMMAND));
}
TEST(emark_allows_specifying_bookmark_path)
{
assert_success(exec_commands("bmark! /fake/path tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
}
TEST(delbmarks_with_emark_removes_all_tags)
{
assert_success(exec_commands("bmark! /path1 tag1", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path2 tag2", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path3 tag3", &lwin, CIT_COMMAND));
assert_success(exec_commands("delbmarks!", &lwin, CIT_COMMAND));
assert_int_equal(0, count_bmarks());
}
TEST(delbmarks_with_emark_removes_selected_bookmarks)
{
assert_success(exec_commands("bmark! /path1 tag1", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path2 tag2", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path3 tag3", &lwin, CIT_COMMAND));
assert_success(exec_commands("delbmarks! /path1 /path3", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
}
TEST(delbmarks_without_args_removes_current_mark)
{
assert_success(exec_commands("bmark tag1", &lwin, CIT_COMMAND));
assert_success(exec_commands("delbmarks", &lwin, CIT_COMMAND));
assert_int_equal(0, count_bmarks());
}
TEST(delbmarks_with_args_removes_matching_bookmarks)
{
assert_success(exec_commands("bmark! /path1 t1 t2", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path2 t2 t3", &lwin, CIT_COMMAND));
assert_success(exec_commands("bmark! /path3 t1 t3", &lwin, CIT_COMMAND));
assert_success(exec_commands("delbmarks t3", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
}
TEST(arguments_are_unescaped)
{
assert_success(exec_commands("bmark! /\\*stars\\* tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("/*stars*", path);
}
TEST(arguments_are_unquoted_single)
{
assert_success(exec_commands("bmark! '/squotes' tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("/squotes", path);
}
TEST(arguments_are_unquoted_double)
{
assert_success(exec_commands("bmark! \"/dquotes\" tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("/dquotes", path);
}
TEST(first_argument_is_expanded)
{
assert_success(exec_commands("bmark! %d tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("/a/path", path);
}
TEST(not_first_argument_is_not_expanded)
{
assert_success(exec_commands("bmark! /dir %d", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("%d", tags);
}
TEST(not_all_macros_are_expanded)
{
assert_success(exec_commands("bmark! /%b%n%i%a%m%M%s%S%u%U%px tag", &lwin,
CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_string_equal("/", path);
}
TEST(tilde_is_expanded)
{
assert_success(exec_commands("bmark! ~ tag", &lwin, CIT_COMMAND));
assert_int_equal(1, count_bmarks());
assert_false(path[0] == '~');
assert_false(path[strlen(path) - 1] == '~');
}
static int
count_bmarks(void)
{
cb_called = 0;
bmarks_list(&bmarks_cb, NULL);
return cb_called;
}
static void
bmarks_cb(const char p[], const char t[], time_t timestamp, void *arg)
{
replace_string(&path, p);
replace_string(&tags, t);
++cb_called;
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
/* vim: set cinoptions+=t0 filetype=c : */
|
/*
* IP Virtual Server
* data structure and functionality definitions
*/
#ifndef KEEPALIVED_IP_VS_H
#define KEEPALIVED_IP_VS_H
#ifdef HAVE_LINUX_IP_VS_H
#include <linux/ip_vs.h>
#else
#include <net/ip_vs.h>
#endif
/* Prior to Linux 4.2 have to include linux/in.h and linux/in6.h
* or linux/netlink.h to include linux/netfilter.h */
#include <linux/netfilter.h> /* For nf_inet_addr */
#ifdef _WITH_LVS_64BIT_STATS_
struct ip_vs_stats64 {
__u64 conns; /* connections scheduled */
__u64 inpkts; /* incoming packets */
__u64 outpkts; /* outgoing packets */
__u64 inbytes; /* incoming bytes */
__u64 outbytes; /* outgoing bytes */
__u64 cps; /* current connection rate */
__u64 inpps; /* current in packet rate */
__u64 outpps; /* current out packet rate */
__u64 inbps; /* current in byte rate */
__u64 outbps; /* current out byte rate */
};
typedef struct ip_vs_stats64 ip_vs_stats_t;
#else
typedef struct ip_vs_stats_user ip_vs_stats_t;
#endif
struct ip_vs_service_app {
struct ip_vs_service_user user;
u_int16_t af;
union nf_inet_addr nf_addr;
#ifdef _HAVE_PE_NAME_
char pe_name[IP_VS_PENAME_MAXLEN];
#endif
};
struct ip_vs_dest_app {
struct ip_vs_dest_user user;
u_int16_t af;
union nf_inet_addr nf_addr;
};
struct ip_vs_service_entry_app {
struct ip_vs_service_entry user;
ip_vs_stats_t stats;
u_int16_t af;
union nf_inet_addr nf_addr;
#ifdef _HAVE_PE_NAME_
char pe_name[IP_VS_PENAME_MAXLEN];
#endif
};
struct ip_vs_dest_entry_app {
struct ip_vs_dest_entry user;
ip_vs_stats_t stats;
u_int16_t af;
union nf_inet_addr nf_addr;
};
struct ip_vs_get_dests_app {
struct { // Can we avoid this duplication of definition?
/* which service: user fills in these */
__u16 protocol;
__be32 addr; /* virtual address */
__be16 port;
__u32 fwmark; /* firwall mark of service */
/* number of real servers */
unsigned int num_dests;
/* the real servers */
struct ip_vs_dest_entry_app entrytable[0];
} user;
u_int16_t af;
union nf_inet_addr nf_addr;
};
/* The argument to IP_VS_SO_GET_SERVICES */
struct ip_vs_get_services_app {
struct {
/* number of virtual services */
unsigned int num_services;
/* service table */
struct ip_vs_service_entry_app entrytable[0];
} user;
};
/* The argument to IP_VS_SO_GET_DAEMON */
struct ip_vs_daemon_kern {
/* sync daemon state (master/backup) */
int state;
/* multicast interface name */
char mcast_ifn[IP_VS_IFNAME_MAXLEN];
/* SyncID we belong to */
int syncid;
};
struct ip_vs_daemon_app {
/* sync daemon state (master/backup) */
int state;
/* multicast interface name */
char mcast_ifn[IP_VS_IFNAME_MAXLEN];
/* SyncID we belong to */
int syncid;
#ifdef _HAVE_IPVS_SYNCD_ATTRIBUTES_
/* UDP Payload Size */
uint16_t sync_maxlen;
/* Multicast Port (base) */
u_int16_t mcast_port;
/* Multicast TTL */
u_int8_t mcast_ttl;
/* Multicast Address Family */
u_int16_t mcast_af;
/* Multicast Address */
union nf_inet_addr mcast_group;
#endif
};
#endif /* KEEPALIVED_IP_VS_H */
|
#include "mux/io.h"
int open(struct file* file) {
return file->fops->open(file);
}
int ioctl(struct file* file, int cmd, long args) {
return file->fops->ioctl(file, cmd, args);
}
ssize_t read(struct file* file, char* const buffer, size_t size) {
struct file_operations* fops = file->fops;
if (fops->read == NULL) return -1;
else return fops->read(file, buffer, size);
}
ssize_t write(struct file* file, const char* const buffer, size_t size) {
struct file_operations* fops = file->fops;
if (fops->write == NULL) return -1;
else return fops->write(file, buffer, size);
}
int close(struct file* file) {
return file->fops->close(file);
} |
#ifndef _CAPSICUM_RIGHTS_H
#define _CAPSICUM_RIGHTS_H
#ifdef CONFIG_SECURITY_CAPSICUM
void cap_rights_regularize(struct capsicum_rights *rights);
bool cap_rights_has(const struct capsicum_rights *rights, u64 right);
#endif
#endif /* _CAPSICUM_RIGHTS_H */
|
/*
silcstack_i.h
Author: Pekka Riikonen <priikone@silcnet.org>
Copyright (C) 2003 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef SILCSTACK_I_H
#define SILCSTACK_I_H
#ifndef SILCSTACK_H
#error "Do not include this header directly"
#endif
/* The default stack size when stack is created */
#define SILC_STACK_DEFAULT_SIZE 1024
/* Number of pre-allocated stack frames */
#define SILC_STACK_DEFAULT_NUM 8
/* Default alignment */
#define SILC_STACK_DEFAULT_ALIGN sizeof(unsigned long)
/* Maximum allocation that can be made with SilcStack. This is
SILC_STACK_DEFAULT_SIZE * (2 ^ (SILC_STACK_BLOCK_NUM - 1)). */
#define SILC_STACK_MAX_ALLOC 0x02000000
#define SILC_STACK_BLOCK_NUM 16
/* Stack frame data area */
typedef struct SilcStackDataStruct {
SilcUInt32 bytes_left; /* Free bytes in stack */
/* Stack data area starts here */
} *SilcStackData;
/* Stack frame */
struct SilcStackFrameStruct {
struct SilcStackFrameStruct *prev; /* Pointer to previous frame */
SilcUInt32 bytes_used; /* Bytes used when pushed */
unsigned int sp : 27; /* Stack pointer */
unsigned int si : 5; /* Stack index */
};
/* The SilcStack context */
struct SilcStackStruct {
SilcStackData stack[SILC_STACK_BLOCK_NUM]; /* Allocated stack blocks */
SilcStackFrame *frames; /* Allocated stack frames */
SilcStackFrame *frame; /* Current stack frame */
SilcUInt32 stack_size; /* Default stack size */
#ifdef SILC_DIST_INPLACE
/* Statistics */
SilcUInt32 snum_malloc;
SilcUInt32 sbytes_malloc;
SilcUInt32 snum_errors;
#endif /* SILC_DIST_INPLACE */
};
/* Align the requested amount bytes. The `align' defines the requested
alignment. */
#define SILC_STACK_ALIGN(bytes, align) (((bytes) + (align - 1)) & ~(align - 1))
/* Computes the size of stack block si. */
#define SILC_STACK_BLOCK_SIZE(stack, si) \
(((si) == 0) ? stack->stack_size : \
SILC_STACK_DEFAULT_SIZE * (1L << ((si) - 1)) << 1);
/* Returns a pointer to the data in the frame */
#define SILC_STACK_DATA(stack, si, bsize) \
(((unsigned char *)(stack)->stack[si]) + \
SILC_STACK_ALIGN(sizeof(**(stack)->stack), SILC_STACK_DEFAULT_ALIGN) + \
((bsize) - (stack)->stack[si]->bytes_left))
#ifdef SILC_DIST_INPLACE
/* Statistics updating */
#define SILC_STACK_STAT(stack, stat, val) ((stack)->s ## stat += (val))
#define SILC_ST_DEBUG(fmt) SILC_LOG_DEBUG(fmt)
#else /* !SILC_DIST_INPLACE */
#define SILC_STACK_STAT(stack, stat, val)
#define SILC_ST_DEBUG(fmt)
#endif /* SILC_DIST_INPLACE */
/* Allocate memory. If the `aligned' is FALSE this allocates unaligned
memory, otherwise memory is aligned. Returns pointer to the memory
or NULL on error. */
void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned);
/* Attempts to reallocate memory by changing the size of the `ptr' into
`size'. This routine works only if the previous allocation to `stack'
was `ptr'. If there is another memory allocation between allocating
`ptr' and this call this routine will return NULL. NULL is also returned
if the `size' does not fit into the current block. If NULL is returned
the old memory remains intact. */
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
void *ptr, SilcUInt32 size, SilcBool aligned);
#ifdef SILC_DIST_INPLACE
/* Prints statistics of the usage of SilcStack to stdout. */
void silc_stack_stats(SilcStack stack);
#endif /* SILC_DIST_INPLACE */
#endif /* SILCSTACK_I_H */
|
/*
* \archivo: adc.h
* \version: 1.0
*
* \descripcion: Este fichero contiene libreria para manejo del ADC
*
* \autor: Gary Servin
* \web: www.garyservin.wordpress.com
* \fecha: 07/10/12
*/
#ifndef ADC_H
#define ADC_H
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 16000000
#endif
#include <xc.h> // Incluimos la libreria para definicion de Registros y configuraciones
#include "GenericTypeDefs.h"
#define IniciarSensores() OpenADC()
#define LeerSensor(a) ReadADC(a)
#define read_a2d(a) ReadADC(a)
void OpenADC ( void );
UINT16_VAL ReadADC ( char channel );
#endif
|
/*
* Copyright (C) 2004-2014 Metaphonic Labs
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General
* Public License along with this program; if not, write to the
* Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GTH_ALSAMIDI_H
#define GTH_ALSAMIDI_H
#define ALSA_DEFAULT_MIDI_DEVICE "default"
typedef sigc::signal1<int, snd_seq_t *> sigMidiEvent_t;
class gthALSAMidi
{
public:
gthALSAMidi (const char *name)
throw(thIOException);
~gthALSAMidi (void);
sigMidiEvent_t signal_midi_event (void);
bool pollMidiEvent (Glib::IOCondition);
inline bool seq_opened(void) const { return seq_opened_; }
protected:
string name_, device_;
bool open_seq (void);
bool seq_opened_;
snd_seq_t *seq_handle_;
int seq_nfds_;
struct pollfd *pfds_;
sigMidiEvent_t m_sigMidiEvent_;
};
#endif /* GTH_ALSAMIDI_H */
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors: Ghada Badawy <gbadawy@gmail.com>
* Sébastien Deronne <sebastien.deronne@gmail.com>
*/
#ifndef AMPDU_TAG_H
#define AMPDU_TAG_H
#include "ns3/nstime.h"
#include "ns3/tag.h"
namespace ns3 {
/**
* \ingroup wifi
*
* The aim of the AmpduTag is to provide means for a MAC to specify that a packet includes A-MPDU
* since this is done in HT-SIG and there is no HT-SIG representation in ns-3
*/
class AmpduTag : public Tag
{
public:
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
/**
* Create a AmpduTag with the default =0 no Ampdu
*/
AmpduTag ();
/**
* Set m_ampdu to 1.
*/
void SetAmpdu (bool supported);
/**
* \param nbofmpdus the remaining number of MPDUs
*
* Set the remaining number of MPDUs in the A-MPDU.
*/
void SetRemainingNbOfMpdus (uint8_t nbofmpdus);
/**
* \param duration the remaining duration of the A-MPDU
*
* Set the remaining duration of the A-MPDU.
*/
void SetRemainingAmpduDuration (Time duration);
virtual void Serialize (TagBuffer i) const;
virtual void Deserialize (TagBuffer i);
virtual uint32_t GetSerializedSize () const;
virtual void Print (std::ostream &os) const;
/**
* \return true if it is an A-MPDU,
* false otherwise.
*
* Returns m_ampdu
*/
bool GetAmpdu (void) const;
/**
* \return the remaining number of MPDUs in an A-MPDU
*
* Returns the remaining number of MPDUs in an A-MPDU
*/
uint8_t GetRemainingNbOfMpdus (void) const;
/**
* \return the remaining duration of an A-MPDU
*
* Returns the remaining duration of an A-MPDU
*/
Time GetRemainingAmpduDuration (void) const;
private:
uint8_t m_ampdu; //!< Flag whether it is an A-MPDU
uint8_t m_nbOfMpdus; //!< Remaining number of MPDUs in the A-MPDU
Time m_duration; //!< Remaining duration of the A-MPDU in nanoseconds
};
} //namespace ns3
#endif /* AMPDU_TAG_H */
|
/*
* This file is part of the KDE Baloo Project
* Copyright (C) 2013 Vishesh Handa <me@vhanda.in>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef BALOO_FILE_P_H
#define BALOO_FILE_P_H
#include <QString>
#include <QStringList>
#include <kfilemetadata/properties.h>
namespace Baloo {
class FilePrivate {
public:
QByteArray id;
QString url;
KFileMetaData::PropertyMap propertyMap;
int rating;
QStringList tags;
QString userComment;
};
}
#endif
|
#if !defined (IMAGELIST_H)
#define IMAGELIST_H
//----------------------------------------------------
// ImageList.h
// (c) Reliable Software 2000 -- 2003
//
//----------------------------------------------------
#include <Win/Handles.h>
#include <Graph/Brush.h>
#include <Graph/Icon.h>
#include <Bit.h>
namespace ImageList
{
class Flags : public BitFieldMask<DWORD>
{
public:
Flags (unsigned long value = 0)
: BitFieldMask<DWORD> (value)
{}
void SetDefaultColor () { Set (ILC_COLOR); }
void SetColor4 () { Set (ILC_COLOR4); }
void SetColor8 () { Set (ILC_COLOR8); }
void SetColor16 () { Set (ILC_COLOR16); }
void SetColor24 () { Set (ILC_COLOR24); }
void SetColor32 () { Set (ILC_COLOR32); }
void SetDeviceColor () { Set (ILC_COLORDDB); }
void SetMask () { Set (ILC_MASK); }
};
// Use to make background transparent
class FlagsMasked: public Flags
{
public:
FlagsMasked ()
: Flags (ILC_MASK)
{}
};
class Flags256ColorsMasked: public Flags
{
public:
Flags256ColorsMasked ()
: Flags (ILC_COLOR8 | ILC_MASK)
{}
};
class Handle: public Win::Handle<HIMAGELIST>
{
public:
Handle (HIMAGELIST h = NullValue ()) : Win::Handle<HIMAGELIST> (h) {}
// returns icon index
int AddIcon (Icon::Handle icon)
{
return ::ImageList_AddIcon (H (), icon.ToNative ());
}
int ReplaceIcon (int idx, Icon::Handle icon)
{
return ::ImageList_ReplaceIcon (H (), idx, icon.ToNative ());
}
// Make image at index imageIdx an overlay to be addressed by
// overlayIdx (which must be > 0 -- 0 means no overlay)
void SetOverlayImage (int imageIdx, int overlayIdx)
{
Assert (overlayIdx != 0);
::ImageList_SetOverlayImage (H (), imageIdx, overlayIdx);
}
void GetImageSize (int & width, int & height);
// if increasing the count, add new images using Replace
void SetCount (int newCount)
{
::ImageList_SetImageCount (H (), newCount);
}
int GetCount ()
{
return ::ImageList_GetImageCount (H ());
}
AutoHandle Duplicate ();
};
class AutoHandle: public Win::AutoHandle<ImageList::Handle>
{
public:
AutoHandle (int imageWidth, int imageHeight,
int count,
ImageList::Flags flags = ImageList::Flags256ColorsMasked (),
int grow = 0);
// By default, make grey #c0c0c0 transparent
AutoHandle (Win::Instance inst, int bitmapId, int imageWidth,
Win::Color mask = Win::Color (0xc0, 0xc0, 0xc0), int growCount = 0);
AutoHandle (HIMAGELIST h = 0)
: Win::AutoHandle<ImageList::Handle> (h)
{}
};
}
#endif
|
#ifndef H__adh__test_macros__
#define H__adh__test_macros__
#include <stdio.h>
#include <stdlib.h>
#include <dfsch/lib/cmdopts.h>
static int test__fail_fast = 0;
#define TEST_INIT(argc, argv) \
int test__pass = 0; \
int test__fail = 0; \
test__init_impl((argc), (argv))
#define TEST(name, cond) \
if ((cond)){ \
test__pass++; \
printf(" Test passed: \033[0;32m%s\033[0;39m\n", name); \
} else { \
test__fail++; \
printf("\033[0;31m!!\033[0;39m Test failed: "\
"\033[0;31m%s\033[0;39m (%s)\n", name, #cond); \
if (test__fail_fast) { \
exit(1); \
} \
} \
#define TEST_EXIT(fail_status) \
printf("***** RESULTS: ******\n"); \
printf(" Tests passed: %d\n", test__pass); \
printf(" Tests failed: %d\n", test__fail); \
printf("===========================\n"); \
printf(" Tests total: %d\n", test__pass + test__fail); \
if (test__fail != 0){ \
exit(fail_status); \
} else { \
exit(0); \
}
static void test__init_impl(int argc, char** argv){
dfsch_cmdopts_t* parser = dfsch_cmdopts_make_parser(0);
dfsch_cmdopts_add_flag_set(parser, 0, "one-test-fail", 1, &test__fail_fast);
dfsch_cmdopts_parse_argv(parser, argv+1, argc-1);
}
#endif
|
/* UOL Fone
* Copyright (c) 2006 Universo Online S/A
*
* Direitos Autorais Reservados
* All rights reserved
*
* Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo
* sob os termos da Licença Pública Geral GNU conforme publicada pela Free
* Software Foundation; tanto a versão 2 da Licença, como (a seu critério)
* qualquer versão posterior.
* Este programa é distribuído na expectativa de que seja útil, porém,
* SEM NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE
* OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
* do GNU para mais detalhes.
* Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
* com este programa; se não, escreva para a Free Software Foundation, Inc.,
* no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
*
* 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.
*
* Universo Online S/A - A/C: UOL Fone 5o. Andar
* Avenida Brigadeiro Faria Lima, 1.384 - Jardim Paulistano
* São Paulo SP - CEP 01452-002 - BRASIL */
#pragma once
class CHeaderData
{
public:
CHeaderData(const CString& strName, const CString& strValue);
~CHeaderData();
CString GetName() const;
CString GetValue() const;
private:
CString m_strName;
CString m_strValue;
};
MAKEAUTOPTR(CHeaderData);
|
/****************************************************************************
*
* Open Watcom Project
*
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code and/or Modifications of Original
* Code as defined in and that are subject to the Sybase Open Watcom
* Public License version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
* provided with the Original Code and Modifications, and is also
* available at www.sybase.com/developer/opensource.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
* NON-INFRINGEMENT. Please see the License for the specific language
* governing rights and limitations under the License.
*
* ========================================================================
*
* Description: __set_errno() implementation.
*
****************************************************************************/
#if defined(__WATCOMC__) || defined(__SNAP__)
#include "variety.h"
#include <stdlib.h>
#include <errno.h>
#include "rtdata.h"
#include "seterrno.h"
_WCRTLINK void __set_errno( unsigned int err )
{
_RWD_errno = err;
}
_WCRTLINK void __set_EDOM()
{
__set_errno( EDOM );
}
_WCRTLINK void __set_ERANGE()
{
__set_errno( ERANGE );
}
_WCRTLINK int __set_EINVAL()
{
__set_errno( EINVAL );
return( -1 );
}
#if !defined(__UNIX__) && !defined(__NETWARE__) && !defined(__SNAP__)
_WCRTLINK void __set_doserrno( unsigned int err )
{
_RWD_doserrno = err;
}
#endif
#else
#include <errno.h>
void __set_errno( unsigned int err )
{
errno = err;
}
#endif
|
/* * ScreenCloud - An easy to use screenshot sharing application
* Copyright (C) 2016 Olav Sortland Thoresen <olav.s.th@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*/
#ifndef LICENSESDIALOG_H
#define LICENSESDIALOG_H
#include <QDialog>
namespace Ui {
class LicensesDialog;
}
class LicensesDialog : public QDialog
{
Q_OBJECT
public:
explicit LicensesDialog(QWidget *parent = 0);
~LicensesDialog();
private:
Ui::LicensesDialog *ui;
};
#endif // LICENSESDIALOG_H
|
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* "Ping" sockets
*
* 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.
*
* Based on ipv4/ping.c code.
*
* Authors: Lorenzo Colitti (IPv6 support)
* Vasiliy Kulikov / Openwall (IPv4 implementation, for Linux 2.6),
* Pavel Kankovsky (IPv4 implementation, for Linux 2.4.32)
*
*/
#include <net/addrconf.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/protocol.h>
#include <net/udp.h>
#include <net/ping.h>
struct proto pingv6_prot = {
.name = "PINGv6",
.owner = THIS_MODULE,
.init = ping_init_sock,
.close = ping_close,
.connect = ip6_datagram_connect,
.disconnect = udp_disconnect,
.setsockopt = ipv6_setsockopt,
.getsockopt = ipv6_getsockopt,
.sendmsg = ping_v6_sendmsg,
.recvmsg = ping_recvmsg,
.bind = ping_bind,
.backlog_rcv = ping_queue_rcv_skb,
.hash = ping_hash,
.unhash = ping_unhash,
.get_port = ping_get_port,
.obj_size = sizeof(struct raw6_sock),
};
EXPORT_SYMBOL(pingv6_prot);
static struct inet_protosw pingv6_protosw = {
.type = SOCK_DGRAM,
.protocol = IPPROTO_ICMPV6,
.prot = &pingv6_prot,
.ops = &inet6_dgram_ops,
.no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE,
};
int __init pingv6_init(void)
{
return inet6_register_protosw(&pingv6_protosw);
}
void pingv6_exit(void)
{
inet6_unregister_protosw(&pingv6_protosw);
}
int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct icmp6hdr user_icmph;
int addr_type;
struct in6_addr *daddr;
int iif = 0;
struct flowi6 fl6;
int err;
int hlimit;
struct dst_entry *dst;
struct rt6_info *rt;
struct pingfakehdr pfh;
pr_debug("ping_v6_sendmsg(sk=%p,sk->num=%u)\n", inet, inet->inet_num);
err = ping_common_sendmsg(AF_INET6, msg, len, &user_icmph,
sizeof(user_icmph));
if (err)
return err;
if (msg->msg_name) {
struct sockaddr_in6 *u = (struct sockaddr_in6 *) msg->msg_name;
if (msg->msg_namelen < sizeof(*u))
return -EINVAL;
if (u->sin6_family != AF_INET6) {
return -EAFNOSUPPORT;
}
if (sk->sk_bound_dev_if &&
sk->sk_bound_dev_if != u->sin6_scope_id) {
return -EINVAL;
}
daddr = &(u->sin6_addr);
iif = u->sin6_scope_id;
} else {
if (sk->sk_state != TCP_ESTABLISHED)
return -EDESTADDRREQ;
daddr = &np->daddr;
}
if (!iif)
iif = sk->sk_bound_dev_if;
addr_type = ipv6_addr_type(daddr);
if (__ipv6_addr_needs_scope_id(addr_type) && !iif)
return -EINVAL;
if (addr_type & IPV6_ADDR_MAPPED)
return -EINVAL;
/* TODO: use ip6_datagram_send_ctl to get options from cmsg */
memset(&fl6, 0, sizeof(fl6));
fl6.flowi6_proto = IPPROTO_ICMPV6;
fl6.saddr = np->saddr;
fl6.daddr = *daddr;
fl6.flowi6_mark = sk->sk_mark;
fl6.flowi6_uid = sk->sk_uid;
fl6.fl6_icmp_type = user_icmph.icmp6_type;
fl6.fl6_icmp_code = user_icmph.icmp6_code;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
fl6.flowi6_oif = np->mcast_oif;
else if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->ucast_oif;
dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, 1);
if (IS_ERR(dst))
return PTR_ERR(dst);
rt = (struct rt6_info *) dst;
np = inet6_sk(sk);
if (!np)
return -EBADF;
if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
fl6.flowi6_oif = np->mcast_oif;
else if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->ucast_oif;
pfh.icmph.type = user_icmph.icmp6_type;
pfh.icmph.code = user_icmph.icmp6_code;
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence;
pfh.iov = msg->msg_iov;
pfh.wcheck = 0;
pfh.family = AF_INET6;
if (ipv6_addr_is_multicast(&fl6.daddr))
hlimit = np->mcast_hops;
else
hlimit = np->hop_limit;
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);
lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,
0, hlimit,
np->tclass, NULL, &fl6, rt,
MSG_DONTWAIT, np->dontfrag);
if (err) {
ICMP6_INC_STATS_BH(sock_net(sk), rt->rt6i_idev,
ICMP6_MIB_OUTERRORS);
ip6_flush_pending_frames(sk);
} else {
err = icmpv6_push_pending_frames(sk, &fl6,
(struct icmp6hdr *) &pfh.icmph,
len);
}
release_sock(sk);
if (err)
return err;
return len;
}
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2010 Advanced Micro Devices, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <device/smbus.h>
#include <arch/io.h>
#include <cpu/x86/lapic.h>
#include <arch/ioapic.h>
#include <stdlib.h>
#include "hudson.h"
#include "smbus.c"
#define NMI_OFF 0
#define MAINBOARD_POWER_OFF 0
#define MAINBOARD_POWER_ON 1
#ifndef CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL
#define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON
#endif
#define BIT0 (1 << 0)
#define BIT1 (1 << 1)
#define BIT2 (1 << 2)
#define BIT3 (1 << 3)
#define BIT4 (1 << 4)
#define BIT5 (1 << 5)
#define BIT6 (1 << 6)
#define BIT7 (1 << 7)
#define BIT8 (1 << 8)
#define BIT9 (1 << 9)
#define BIT10 (1 << 10)
#define BIT11 (1 << 11)
#define BIT12 (1 << 12)
#define BIT13 (1 << 13)
#define BIT14 (1 << 14)
#define BIT15 (1 << 15)
#define BIT16 (1 << 16)
#define BIT17 (1 << 17)
#define BIT18 (1 << 18)
#define BIT19 (1 << 19)
#define BIT20 (1 << 20)
#define BIT21 (1 << 21)
#define BIT22 (1 << 22)
#define BIT23 (1 << 23)
#define BIT24 (1 << 24)
#define BIT25 (1 << 25)
#define BIT26 (1 << 26)
#define BIT27 (1 << 27)
#define BIT28 (1 << 28)
#define BIT29 (1 << 29)
#define BIT30 (1 << 30)
#define BIT31 (1 << 31)
/*
* HUDSON enables all USB controllers by default in SMBUS Control.
* HUDSON enables SATA by default in SMBUS Control.
*/
static void sm_init(struct device *dev)
{
setup_ioapic(VIO_APIC_VADDR, CONFIG_MAX_CPUS);
}
static int lsmbus_recv_byte(struct device *dev)
{
u32 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x90);
return do_smbus_recv_byte(res->base, device);
}
static int lsmbus_send_byte(struct device *dev, u8 val)
{
u32 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x90);
return do_smbus_send_byte(res->base, device, val);
}
static int lsmbus_read_byte(struct device *dev, u8 address)
{
u32 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x90);
return do_smbus_read_byte(res->base, device, address);
}
static int lsmbus_write_byte(struct device *dev, u8 address, u8 val)
{
u32 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x90);
return do_smbus_write_byte(res->base, device, address, val);
}
static struct smbus_bus_operations lops_smbus_bus = {
.recv_byte = lsmbus_recv_byte,
.send_byte = lsmbus_send_byte,
.read_byte = lsmbus_read_byte,
.write_byte = lsmbus_write_byte,
};
static void hudson_sm_read_resources(struct device *dev)
{
}
static void hudson_sm_set_resources(struct device *dev)
{
}
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static struct device_operations smbus_ops = {
.read_resources = hudson_sm_read_resources,
.set_resources = hudson_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
.scan_bus = scan_smbus,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
};
static const struct pci_driver smbus_driver __pci_driver = {
.ops = &smbus_ops,
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_SB900_SM,
};
|
/* This file is part of SIR, an open-source cross-platform Image tool
* 2007-2010 Rafael Sachetto <rsachetto@gmail.com>
* 2011-2014 Marek Jędryka <jedryka89@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Program URL: http://marek629.github.io/sir/
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#ifndef SIR_CMAKE
#define SIR_METADATA_SUPPORT
#endif // SIR_CMAKE
#include <QSettings>
#include <QPoint>
#include <QSize>
typedef QMap<QString,QVariant> HistoryMap;
typedef QList<QVariant> HistoryList;
/** \brief Settings manipulation class implemented as singleton.
*
* All settings groups in settings file are represented by public structs with
* \e Group suffix.
*
* Access to settings object is available by instance() method only because
* this class is implemented using singleton design pattern.
*/
class Settings : public QSettings {
Q_OBJECT
public:
// singletons pattern instance
static Settings *instance();
// I/O operations
void readSettings();
void writeSettings();
// fields
struct MainWindowGroup {
bool maximized;
QPoint possition;
QSize size;
QByteArray horizontalSplitter;
QByteArray verticalSplitter;
} mainWindow;
struct SettingsGroup {
bool alreadySent;
QString targetFolder;
QString targetFormat;
QString targetPrefix;
QString targetSuffix;
QString languageNiceName;
QString languageFileName;
QString dateDisplayFormat;
QString timeDisplayFormat;
QString lastDir;
int quality;
int cores;
int maxHistoryCount;
} settings;
struct SizeGroup {
int widthPx;
float widthPercent;
int heightPx;
float heightPercent;
float fileSizeValue;
int fileSizeUnit;
int sizeUnit;
bool keepAspectRatio;
} size;
struct TreeWidgetGroup {
int columns;
} treeWidget;
#ifdef SIR_METADATA_SUPPORT
struct MetadataGroup {
bool enabled;
bool saveMetadata;
bool realRotate;
bool updateThumbnail;
bool rotateThumbnail;
} metadata;
struct ExifGroup {
HistoryMap cameraManufacturerMap;
HistoryList cameraManufacturerList;
HistoryMap cameraModelMap;
HistoryList cameraModelList;
bool artistOverwrite;
HistoryMap artistMap;
HistoryList artistList;
bool copyrightOverwrite;
HistoryMap copyrightMap;
HistoryList copyrightList;
bool userCommentOverwrite;
HistoryMap userCommentMap;
HistoryList userCommentList;
} exif;
struct IPTCGroup {
HistoryMap editStatusMap;
HistoryList editStatusList;
} iptc;
struct DetailsGroup {
int exifImage;
int exifPhoto;
int exifCamera;
int exifAuthor;
int iptc;
} details;
#endif // SIR_METADATA_SUPPORT
struct SelectionGroup {
bool subdirs;
bool clearSelection;
bool selectImported;
QString fileSizeSymbol;
QString imageWidthSymbol;
QString imageHeightSymbol;
} selection;
struct SelectionDialogGroup {
HistoryMap fileNameMap;
HistoryList fileNameList;
HistoryMap fileSizeMap;
HistoryList fileSizeList;
HistoryMap imageSizeMap;
HistoryList imageSizeList;
HistoryMap anyAuthorMap;
HistoryList anyAuthorList;
HistoryMap anyCopyrightMap;
HistoryList anyCopyrightList;
HistoryMap exifSoftMap;
HistoryList exifSoftList;
HistoryMap exifCameraManufacturerMap;
HistoryList exifCameraManufacturerList;
HistoryMap exifCameraModelMap;
HistoryList exifCameraModelList;
HistoryMap iptcObjectNameMap;
HistoryList iptcObjectNameList;
HistoryMap iptcKeywordsMap;
HistoryList iptcKeywordsList;
HistoryMap iptcDescriptionMap;
HistoryList iptcDescriptionList;
HistoryMap iptcCountryNameMap;
HistoryList iptcCountryNameList;
HistoryMap iptcCityMap;
HistoryList iptcCityList;
HistoryMap iptcEditStatusMap;
HistoryList iptcEditStatusList;
} selectionDialog;
struct RawGroup {
bool enabled;
QString dcrawPath;
QString dcrawOptions;
} raw;
private:
// constructors
explicit Settings(QObject *parent = 0);
explicit Settings(const QString &organization,
const QString &application = QString(), QObject *parent = 0);
// destructor
~Settings();
// methods
void migrateFrom_2_1();
void migrateFrom_2_2();
void migrateFrom_2_3();
void migrateFrom_2_4();
};
#endif // SETTINGS_H
|
/** @brief Library for Arduino returns x,y,z data on current magnetic field
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Designed for use with Freescale (C) MAG3110 Magnetometer
Tested with MAG3110 Breakout from Sparkfun and Arduino Uno
Based on Sparkfun's example for the MAG3110 breakout board:
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/BreakoutBoards/Mag3110_v10.pde
@author Jeroen Cappaert & Lara Booth for NanoSatisfi
@author Jorge Ortiz
@date May 2013
*/
#ifndef SAT_MAG_H
#define SAT_MAG_H
#include <Arduino.h>
class SAT_Mag
{
public:
/**Constructor that has a single ID parameter. */
SAT_Mag();
/**Constructor that has a single ID parameter.
@param node_id - The id of the user's arduino on the ArduSat. This allows
the supervisor to know which arduino node to send the data back to.
The id is assigned by NanoSatisfi.
*/
// void init(uint8_t node_id); // jfomhover on 07/08/2013 : function not used ? furthermore, the "node_id" should be given by a "central power" (I2CComm)
/**Initializes the magnetometer. */
void configMag();
/**Reads the x vector. */
int readx();
/**Reads the y vector. */
int ready();
/**Reads the z vector. */
int readz();
/**Reads the x offset value. */
float x_value();
/**Reads the y offset value. */
float y_value();
/**Reads the z offset value. */
float z_value();
/**Returns the heading.
@param x the x vector. Typically, you would pass the value you recieved from readx();
@param y the y vector. Typically, you would pass the value you recieved from ready();
@param z the z vector. Typically, you would pass the value you recieved from readz();
*/
int getHeading(float x, float y, float z);
private:
//uint8_t _local_address; // jfomhover on 07/08/2013 : handled by I2CComm
// byte _buff[2]; // jfomhover on 07/08/2013 : unused in the class ??
// class-only methods:
// int read16Data(char msg_reg, char lsb_reg); // jfomhover on 07/08/2013 : handled by I2CComm
//global variables
float mag_x_scale;
float mag_y_scale;
float mag_z_scale;
};
#endif /* SAT_MAG_H */
|
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <math.h>
#include "PWM.h"
#define VKp 16
#define HKp 16
#define Kp 6
#define NoiseThresHold 28
#define sfactor(x) (x*4)
#define TMRRESET 194
#define HBEAT 0
#define MSGRCV 1
#define DBGR 2
#define DBGL 3
typedef struct
{
int RawIntCnt;
int EncCnt; // Shaft Encoder count for this wheel
int EncCnt_Old; // Shaft encoder count last time (1/250 sec ago)
int Vin; // Voltage in -> actually requested speed
} MOTOR_DATA;
volatile MOTOR_DATA LM, RM;
volatile unsigned char PIDInterruptFlag;
void PID_Init (void)
{
/* Timer0 is for the PID Controller */
TCCR0 = 0x07; // Use 1024 prescaler on Timer 0 pdf p.105 (this actually sets to 128. For 1024, should be 0x07 with atmega128
TIMSK = 0x01; // Enable timer (overflow interrupt enabled. Same on ATMEGA128)
PIDInterruptFlag = 0;
LM.EncCnt = 0; RM.EncCnt = 0;
LM.EncCnt_Old = 0; RM.EncCnt_Old = 0;
LM.Vin = 0; RM.Vin = 0;
}
SIGNAL(SIG_OVERFLOW0) //PID Controller sampling
{
cli();
TCNT0=TMRRESET;
LM.EncCnt = LM.RawIntCnt;
RM.EncCnt = RM.RawIntCnt;
LM.RawIntCnt = 0;
RM.RawIntCnt = 0;
PIDInterruptFlag = 1;
sei();
}
SIGNAL(SIG_INTERRUPT1) // Left wheel shaft encoder interrupt
{
if (PIND & '\x40'){ // Check wheel direction status bit
LM.RawIntCnt--;
}else{
LM.RawIntCnt++;
}
}
SIGNAL(SIG_INTERRUPT2) // Right wheel shaft encoder interrupt
{
if (PIND & '\x80'){ // Check wheel direction status bit
RM.RawIntCnt++;
}else{
RM.RawIntCnt--;
}
}
void SetPIDInput ( int LftMotorSpeed,int RgtMotorSpeed )
{
LM.Vin = LftMotorSpeed;
RM.Vin = RgtMotorSpeed;
}
void PIDHeartBeat(void)
{
if( (LM.Vin==0) && (RM.Vin==0) ){
// Hold the position
int EL = (0 - sfactor(LM.EncCnt));
int ER = (0 - sfactor(RM.EncCnt));
if((EL < NoiseThresHold)&&(EL > -NoiseThresHold)){ EL = EL/4;} // deadband
if((ER < NoiseThresHold)&&(ER > -NoiseThresHold)){ ER = ER/4;}
SetSpeed( HKp * EL,HKp * ER);
}else{
// Robot is moving
int EL = (LM.Vin - sfactor(LM.EncCnt));
int ER = (RM.Vin - sfactor(RM.EncCnt));
if( LM.EncCnt - LM.EncCnt_Old >= 2){
EL = EL/8;
}
if( RM.EncCnt - RM.EncCnt_Old >= 2){
ER = ER/8;
}
SetSpeed( (VKp+3) * EL, (VKp+3) * ER);
}
LM.EncCnt_Old = LM.EncCnt;
RM.EncCnt_Old = RM.EncCnt;
}
|
#ifndef WEBELEMENT_H
#define WEBELEMENT_H
#include <QObject>
class WebDriverHub;
class By;
class WebElement
{
public:
WebElement(QString id, WebDriverHub* hub);
virtual ~WebElement() {}
void click();
void submit();
void sendKeys(QString text);
QString text();
QString tagName();
void clear();
bool isSelected();
bool isEnabled();
bool isDisplayed();
QString attribute(QString name);
bool equals(QString otherElementId);
QPoint location();
QSize size();
QString cssValue(QString cssProperty);
WebElement* findElement(By *by);
QList<WebElement*> findElements(By *by);
QString id() { return m_id; }
private:
QString m_id;
WebDriverHub* m_hub;
};
#endif // WEBELEMENT_H
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/iTunesStoreUI.framework/iTunesStoreUI
*/
#import <iTunesStoreUI/SUScriptNativeObject.h>
#import <iTunesStoreUI/XXUnknownSuperclass.h>
@interface SUScriptDialogAlertView : XXUnknownSuperclass <SUScriptNativeObject> {
}
- (BOOL)clearsWeakScriptReferences; // 0x515ad
- (void)dealloc; // 0x51561
@end
|
/* PPPoE support library "libpppoe"
*
* Copyright 2000 Michal Ostrowski <mostrows@styx.uwaterloo.ca>,
* Jamal Hadi Salim <hadi@cyberus.ca>
*
* 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 "pppoe.h"
#include <unistd.h>
static unsigned int pcid=1111;
static int srv_rcv_padi(struct session* ses,
struct pppoe_packet *p_in,
struct pppoe_packet **p_out){
struct pppoe_con *newpc = NULL;
struct pppoe_tag *tag;
poe_dbglog(ses,"Srv Recv'd packet: %P\n",p_in);
ses->curr_pkt.hdr = (struct pppoe_hdr*) ses->curr_pkt.buf;
ses->curr_pkt.hdr->ver = 1;
ses->curr_pkt.hdr->type = 1;
tag = get_tag(p_in->hdr,PTT_SRV_NAME);
if(!tag )
return 0;
if( ntohs(tag->tag_len)==0 ){
ses->curr_pkt.tags[TAG_SRV_NAME] = ses->filt->stag ;
}else if( tag->tag_len != ses->filt->stag->tag_len
|| !memcmp( tag+1, ses->filt->stag, ntohs(tag->tag_len)) ){
return 0;
}else{
ses->curr_pkt.tags[TAG_SRV_NAME] = tag;
}
ses->curr_pkt.tags[ TAG_AC_NAME] = ses->filt->ntag ;
ses->curr_pkt.tags[ TAG_HOST_UNIQ ] = get_tag(p_in->hdr,PTT_HOST_UNIQ);
memcpy(&ses->remote, &p_in->addr, sizeof(struct sockaddr_ll));
memcpy( &ses->curr_pkt.addr, &ses->remote , sizeof(struct sockaddr_ll));
ses->curr_pkt.hdr->code = PADO_CODE;
ses->curr_pkt.tags[ TAG_RELAY_SID ] = get_tag(p_in->hdr,PTT_RELAY_SID);
send_disc(ses, &ses->curr_pkt);
poe_dbglog(ses,"Srv Sent packet: %P\n",&ses->curr_pkt);
return 0;
}
static int srv_rcv_padr(struct session* ses,
struct pppoe_packet *p_in,
struct pppoe_packet **p_out){
struct pppoe_tag *tag;
poe_dbglog(ses,"Recv'd packet: %P\n",p_in);
/* Run checks to ensure this packets asks for
what we're willing to offer */
tag = get_tag(p_in->hdr,PTT_SRV_NAME);
if(!tag || tag->tag_len == 0 ){
p_in->tags[TAG_SRV_NAME] = ses->filt->stag;
}else if( tag->tag_len != ses->filt->stag->tag_len
|| !memcmp(tag + 1 , ses->filt->stag, ntohs(tag->tag_len)) ){
return 0;
}else{
p_in->tags[TAG_SRV_NAME] = tag;
}
tag = get_tag(p_in->hdr,PTT_AC_NAME);
if( !tag || tag->tag_len==0 ){
p_in->tags[TAG_AC_NAME] = ses->filt->ntag;
}else if( tag->tag_len != ses->filt->ntag->tag_len
|| !memcmp(tag + 1, ses->filt->ntag, ntohs(tag->tag_len)) ){
return 0;
}else{
p_in->tags[TAG_AC_NAME] = tag;
}
pcid = ++pcid & 0x0000ffff ;
if(pcid == 0 ){
pcid = 1111;
}
p_in->hdr->sid = ntohs(pcid);
p_in->hdr->code = PADS_CODE;
send_disc(ses, p_in);
poe_dbglog(ses,"Sent packet: %P\n",p_in);
ses->sp.sa_family = AF_PPPOX;
ses->sp.sa_protocol=PX_PROTO_OE;
ses->sp.sa_addr.pppoe.sid = p_in->hdr->sid;
memcpy(ses->sp.sa_addr.pppoe.dev, ses->name, IFNAMSIZ);
memcpy(ses->sp.sa_addr.pppoe.remote, p_in->addr.sll_addr, ETH_ALEN);
memcpy(&ses->remote, &p_in->addr, sizeof(struct sockaddr_ll));
return 1;
}
static int srv_rcv_padt(struct session* ses,
struct pppoe_packet *p_in,
struct pppoe_packet **p_out){
return 0;
}
int srv_init_ses(struct session *ses, char* from)
{
int retval;
retval = client_init_ses(ses, from);
ses->init_disc = NULL;
ses->rcv_pado = NULL;
ses->rcv_pads = NULL;
ses->rcv_padi = srv_rcv_padi;
ses->rcv_padr = srv_rcv_padr;
ses->rcv_padt = srv_rcv_padt;
/* retries forever */
ses->retries = -1;
return retval;
}
|
/* ============================================================
*
* This file is a part of digiKam project
* http://www.digikam.org
*
* Date : 2005-02-06
* Description : an image editor actions undo/redo manager
*
* Copyright (C) 2005-2006 by Renchi Raju <renchi dot raju at gmail dot com>
* Copyright (C) 2005-2006 by Joern Ahrens <joern dot ahrens at kdemail dot net>
* Copyright (C) 2006-2015 by Gilles Caulier <caulier dot gilles 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, 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.
*
* ============================================================ */
#ifndef UNDOMANAGER_H
#define UNDOMANAGER_H
// Qt includes
#include <QStringList>
// Local includes
#include "digikam_export.h"
namespace Digikam
{
class DImageHistory;
class DImg;
class EditorCore;
class UndoAction;
class UndoMetadataContainer;
class DIGIKAM_EXPORT UndoManager
{
public:
explicit UndoManager(EditorCore* const core);
~UndoManager();
void addAction(UndoAction* const action);
void undo();
void redo();
void rollbackToOrigin();
bool putImageDataAndHistory(DImg* const img, int stepsBack) const;
void clear(bool clearCache = true);
bool anyMoreUndo() const;
bool anyMoreRedo() const;
int availableUndoSteps() const;
int availableRedoSteps() const;
QStringList getUndoHistory() const;
QStringList getRedoHistory() const;
bool isAtOrigin() const;
void setOrigin() const;
bool hasChanges() const;
/// The history if all available redo steps are redone
DImageHistory getImageHistoryOfFullRedo() const;
void clearPreviousOriginData();
private:
void clearUndoActions();
void clearRedoActions();
void undoStep(bool saveRedo, bool execute, bool flyingRollback);
void redoStep(bool execute, bool flyingRollback);
void makeSnapshot(int index);
void restoreSnapshot(int index, const UndoMetadataContainer& c);
void getSnapshot(int index, DImg* const img) const;
private:
class Private;
Private* const d;
};
} // namespace Digikam
#endif /* UNDOMANAGER_H */
|
static char rcsid[] = "$Id: jump.c,v 1.4 2005/10/04 22:05:13 svitak Exp $";
/*
** $Log: jump.c,v $
** Revision 1.4 2005/10/04 22:05:13 svitak
** Merged branch tagged rel-2-3beta-fixes back to main trunk. All comments from
** the branch modifications should be included.
**
** Revision 1.3.2.1 2005/08/13 05:23:27 svitak
** Fixed extern decl of sig_msg to match definition.
**
** Revision 1.3 2005/07/07 19:15:14 svitak
** Changed return type of TraceScript from int to void. These calls are within
** #ifdefs and will probably need to be removed if and when those statements are
** reached.
**
** Revision 1.2 2005/06/17 20:19:35 svitak
** Added Cygwin to the list of systems that need struct sigcontext
** defined.
**
** Revision 1.1.1.1 2005/06/14 04:38:34 svitak
** Import from snapshot of CalTech CVS tree of June 8, 2005
**
** Revision 1.13 2001/04/25 17:17:04 mhucka
** Misc. small changes to improve portability and address compiler warnings.
**
** Revision 1.11 2000/09/21 19:47:16 mhucka
** Added declaration for TraceScript().
**
** Revision 1.10 2000/07/12 06:16:25 mhucka
** Added #include of strings.h and removed some unusued variables
** in sig_msg_restore_context().
**
** Revision 1.9 1999/12/31 08:31:40 mhucka
** Added return type declarations.
**
** Revision 1.8 1998/07/21 22:16:59 dhb
** Fixed reference to __GLIBC__ (was looking at __GLIBC).
**
** Revision 1.7 1997/08/08 19:26:29 dhb
** Added check for __GLIBC__ (the new glibc c library) and define
** a sigcontext structure for this case.
**
** Revision 1.6 1996/06/06 20:53:55 dhb
** merged in 1.4.1.1 changes.
**
** Revision 1.5 1996/05/23 23:17:48 dhb
** t3d/e port
**
** Revision 1.4.1.1 1996/06/06 20:06:33 dhb
** Paragon port.
**
** Revision 1.4 1995/02/22 19:11:10 dhb
** Linux support.
**
** Revision 1.3 1993/10/05 20:14:47 dhb
** Fixed mistake in application of Solaris patches.
**
** Revision 1.2 1993/09/17 20:13:08 dhb
** Solaris compatability.
**
** Revision 1.1 1992/12/11 19:05:30 dhb
** Initial revision
**
*/
#include <math.h>
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <strings.h>
#include "system_deps.h"
#if (defined(i860) && !defined(paragon)) || (defined(Linux) && !defined(__GLIBC__)) || defined(CRAY) || defined(Cygwin)
struct sigcontext
{
int xyzzy;
};
#endif
extern jmp_buf main_context;
#ifndef Solaris
struct sigcontext sig_context;
SIGTYPE
save_context(sig,code,scp)
int sig,code;
struct sigcontext *scp;
{
/*
** save the context for later return
*/
BCOPY(scp,&sig_context,sizeof(struct sigcontext));
}
#endif
#ifdef Solaris
SIGTYPE
restore_context(sig,code)
int sig,code;
{
/*
** restore the earlier context
lprintf("\ninterrupted\n");
*/
printf("\n");
longjmp(main_context,1);
}
#else
SIGTYPE
restore_context(sig,code,scp)
int sig,code;
struct sigcontext *scp;
{
/*
** restore the earlier context
lprintf("\ninterrupted\n");
*/
printf("\n");
longjmp(main_context,1);
}
#endif
#ifdef DEPENDENT
SIGTYPE
sig_msg_restore_context(sig,code,scp)
int sig,code;
struct sigcontext *scp;
{
char *file;
char *FindSrcLine();
int line;
extern SIGTYPE sig_msg();
file = FindSrcLine(scp->sc_pc,&line);
if(file != NULL){
printf("\nerror in %s at line %d\n",file,line);
} else {
printf("\nerror at pc = %d\n",scp->sc_pc);
}
sig_msg(sig,code,scp);
restore_context(sig,code,scp);
}
#elif defined(Solaris)
SIGTYPE
sig_msg_restore_context(sig,code)
int sig,code;
{
char *file;
int line;
extern SIGTYPE sig_msg();
extern void TraceScript();
TraceScript();
sig_msg(sig,code);
restore_context(sig,code);
}
#else
SIGTYPE
sig_msg_restore_context(sig,code,scp)
int sig,code;
struct sigcontext *scp;
{
extern SIGTYPE sig_msg();
extern void TraceScript();
TraceScript();
sig_msg(sig,code,scp);
restore_context(sig,code,scp);
}
#endif
|
/*********************************************************
*
* This source code is part of the Carnegie Mellon Robot
* Navigation Toolkit (CARMEN)
*
* CARMEN Copyright (c) 2002 Michael Montemerlo, Nicholas
* Roy, Sebastian Thrun, Dirk Haehnel, Cyrill Stachniss,
* and Jared Glover
*
* CARMEN 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.
*
* CARMEN 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 CARMEN; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
********************************************************/
#ifndef XR4000_IPC_H
#define XR4000_IPC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "base_interface.h"
void carmen_xr4000_register_ipc_messages(void);
#ifdef __cplusplus
}
#endif
#endif
|
// Copyright 2008 The RE2 Authors. All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Unicode character groups.
// The codes get split into ranges of 16-bit codes
// and ranges of 32-bit codes. It would be simpler
// to use only 32-bit ranges, but these tables are large
// enough to warrant extra care.
//
// Using just 32-bit ranges gives 27 kB of data.
// Adding 16-bit ranges gives 18 kB of data.
// Adding an extra table of 16-bit singletons would reduce
// to 16.5 kB of data but make the data harder to use;
// we don't bother.
#ifndef RE2_UNICODE_GROUPS_H__
#define RE2_UNICODE_GROUPS_H__
#include "util/util.h"
namespace re2 {
struct URange16
{
uint16 lo;
uint16 hi;
};
struct URange32
{
uint32 lo;
uint32 hi;
};
struct UGroup
{
const char *name;
URange16 *r16;
int nr16;
URange32 *r32;
int nr32;
};
// Named by property or script name (e.g., "Nd", "N", "Han").
// Negated groups are not included.
extern UGroup unicode_groups[];
extern int num_unicode_groups;
// Named by POSIX name (e.g., "[:alpha:]", "[:^lower:]").
// Negated groups are included.
extern UGroup posix_groups[];
extern int num_posix_groups;
// Named by Perl name (e.g., "\\d", "\\D").
// Negated groups are included.
extern UGroup perl_groups[];
extern int num_perl_groups;
} // namespace re2
#endif // RE2_UNICODE_GROUPS_H__
|
/*
* The ManaPlus Client
* Copyright (C) 2013-2014 The ManaPlus Developers
*
* 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 UTILS_PHYSFSTOOLS_H
#define UTILS_PHYSFSTOOLS_H
#include <physfs.h>
#include <string>
namespace PhysFs
{
void init(const char *const name);
void updateDirSeparator();
const char *getDirSeparator();
const char *getBaseDir();
const char *getUserDir();
bool exists(const char *const fname);
char **enumerateFiles(const char *const dir);
bool isDirectory(const char *const fname);
void freeList(void *const listVar);
PHYSFS_file *openRead(const char *const filename);
PHYSFS_file *openWrite(const char *const filename);
PHYSFS_file *openAppend(const char *const filename);
bool setWriteDir(const char *const newDir);
bool addToSearchPath(const char *const newDir, const int appendToPath);
bool removeFromSearchPath(const char *const oldDir);
const char *getRealDir(const char *const filename);
bool mkdir(const char *const dirName);
void *loadFile(const std::string &fileName, int &fileSize);
} // namespace PhysFs
extern const char *dirSeparator;
#endif // UTILS_PHYSFSTOOLS_H
|
/*
* csum-file.c
*
* Copyright (C) 2005 Linus Torvalds
*
* Simple file write infrastructure for writing SHA1-summed
* files. Useful when you write a file that you want to be
* able to verify hasn't been messed with afterwards.
*/
#include "cache.h"
#include "progress.h"
#include "csum-file.h"
static void flush(struct sha1file *f, const void *buf, unsigned int count)
{
if (0 <= f->check_fd && count) {
unsigned char check_buffer[8192];
ssize_t ret = read_in_full(f->check_fd, check_buffer, count);
if (ret < 0)
die_errno("%s: sha1 file read error", f->name);
if (ret < count)
die("%s: sha1 file truncated", f->name);
if (memcmp(buf, check_buffer, count))
die("sha1 file '%s' validation error", f->name);
}
for (;;) {
int ret = xwrite(f->fd, buf, count);
if (ret > 0) {
f->total += ret;
display_throughput(f->tp, f->total);
buf = (char *) buf + ret;
count -= ret;
if (count)
continue;
return;
}
if (!ret)
die("sha1 file '%s' write error. Out of diskspace", f->name);
die_errno("sha1 file '%s' write error", f->name);
}
}
void sha1flush(struct sha1file *f)
{
unsigned offset = f->offset;
if (offset) {
git_SHA1_Update(&f->ctx, f->buffer, offset);
flush(f, f->buffer, offset);
f->offset = 0;
}
}
int sha1close(struct sha1file *f, unsigned char *result, unsigned int flags)
{
int fd;
sha1flush(f);
git_SHA1_Final(f->buffer, &f->ctx);
if (result)
hashcpy(result, f->buffer);
if (flags & (CSUM_CLOSE | CSUM_FSYNC)) {
/* write checksum and close fd */
flush(f, f->buffer, 20);
if (flags & CSUM_FSYNC)
fsync_or_die(f->fd, f->name);
if (close(f->fd))
die_errno("%s: sha1 file error on close", f->name);
fd = 0;
} else
fd = f->fd;
if (0 <= f->check_fd) {
char discard;
int cnt = read_in_full(f->check_fd, &discard, 1);
if (cnt < 0)
die_errno("%s: error when reading the tail of sha1 file",
f->name);
if (cnt)
die("%s: sha1 file has trailing garbage", f->name);
if (close(f->check_fd))
die_errno("%s: sha1 file error on close", f->name);
}
free(f);
return fd;
}
void sha1write(struct sha1file *f, const void *buf, unsigned int count)
{
while (count) {
unsigned offset = f->offset;
unsigned left = sizeof(f->buffer) - offset;
unsigned nr = count > left ? left : count;
const void *data;
if (f->do_crc)
f->crc32 = crc32(f->crc32, buf, nr);
if (nr == sizeof(f->buffer)) {
/* process full buffer directly without copy */
data = buf;
} else {
memcpy(f->buffer + offset, buf, nr);
data = f->buffer;
}
count -= nr;
offset += nr;
buf = (char *) buf + nr;
left -= nr;
if (!left) {
git_SHA1_Update(&f->ctx, data, offset);
flush(f, data, offset);
offset = 0;
}
f->offset = offset;
}
}
struct sha1file *sha1fd(int fd, const char *name)
{
return sha1fd_throughput(fd, name, NULL);
}
struct sha1file *sha1fd_check(const char *name)
{
int sink, check;
struct sha1file *f;
sink = open("/dev/null", O_WRONLY);
if (sink < 0)
die_errno("unable to open /dev/null");
check = open(name, O_RDONLY);
if (check < 0)
die_errno("unable to open '%s'", name);
f = sha1fd(sink, name);
f->check_fd = check;
return f;
}
struct sha1file *sha1fd_throughput(int fd, const char *name, struct progress *tp)
{
struct sha1file *f = xmalloc(sizeof(*f));
f->fd = fd;
f->check_fd = -1;
f->offset = 0;
f->total = 0;
f->tp = tp;
f->name = name;
f->do_crc = 0;
git_SHA1_Init(&f->ctx);
return f;
}
void sha1file_checkpoint(struct sha1file *f, struct sha1file_checkpoint *checkpoint)
{
sha1flush(f);
checkpoint->offset = f->total;
checkpoint->ctx = f->ctx;
}
int sha1file_truncate(struct sha1file *f, struct sha1file_checkpoint *checkpoint)
{
off_t offset = checkpoint->offset;
if (ftruncate(f->fd, offset) ||
lseek(f->fd, offset, SEEK_SET) != offset)
return -1;
f->total = offset;
f->ctx = checkpoint->ctx;
f->offset = 0; /* sha1flush() was called in checkpoint */
return 0;
}
void crc32_begin(struct sha1file *f)
{
f->crc32 = crc32(0, NULL, 0);
f->do_crc = 1;
}
uint32_t crc32_end(struct sha1file *f)
{
f->do_crc = 0;
return f->crc32;
}
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/Conference.framework/Conference
*/
#import <Conference/Conference-Structs.h>
#import <Conference/CNFRegAccountWebViewController.h>
@class NSString;
@protocol CNFRegAccountAuthorizationDelegate;
@interface CNFRegAccountAuthorizationController : CNFRegAccountWebViewController {
@private
NSString *_authID; // 200 = 0xc8
NSString *_authToken; // 204 = 0xcc
id<CNFRegAccountAuthorizationDelegate> _delegate; // 208 = 0xd0
}
@property(copy, nonatomic) NSString *authID; // G=0x330a9; S=0x33119; @synthesize=_authID
@property(copy, nonatomic) NSString *authToken; // G=0x33099; S=0x3313d; @synthesize=_authToken
@property(assign, nonatomic) id<CNFRegAccountAuthorizationDelegate> delegate; // G=0x33079; S=0x33089; @synthesize=_delegate
- (id)initWithRegController:(id)regController authID:(id)anId token:(id)token; // 0x330b9
- (void)dealloc; // 0x3322d
- (id)bagKey; // 0x331e9
- (id)logName; // 0x3306d
- (void)cancelTapped; // 0x331b9
- (void)completeHandoffWithStatus:(int)status appleID:(id)anId authID:(id)anId3 authToken:(id)token; // 0x33181
- (id)authIdHeaderValue; // 0x33171
- (id)authTokenHeaderValue; // 0x33161
// declared property getter: - (id)delegate; // 0x33079
// declared property setter: - (void)setDelegate:(id)delegate; // 0x33089
// declared property getter: - (id)authToken; // 0x33099
// declared property setter: - (void)setAuthToken:(id)token; // 0x3313d
// declared property getter: - (id)authID; // 0x330a9
// declared property setter: - (void)setAuthID:(id)anId; // 0x33119
@end
|
/*
* RSD demuxer
* Copyright (c) 2013 James Almer
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef IDE_COMPILE
#include "libavutil/internal.h"
#endif
#include "libavcodec/bytestream.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio.h"
#include "internal.h"
static const AVCodecTag rsd_tags[] = {
{ AV_CODEC_ID_ADPCM_THP, MKTAG('G','A','D','P') },
{ AV_CODEC_ID_ADPCM_IMA_RAD, MKTAG('R','A','D','P') },
{ AV_CODEC_ID_PCM_S16BE, MKTAG('P','C','M','B') },
{ AV_CODEC_ID_PCM_S16LE, MKTAG('P','C','M',' ') },
{ AV_CODEC_ID_NONE, 0 },
};
static const uint32_t rsd_unsupported_tags[] = {
MKTAG('O','G','G',' '),
MKTAG('V','A','G',' '),
MKTAG('W','A','D','P'),
MKTAG('X','A','D','P'),
MKTAG('X','M','A',' '),
};
static int rsd_probe(AVProbeData *p)
{
if (memcmp(p->buf, "RSD", 3) || p->buf[3] - '0' < 2 || p->buf[3] - '0' > 6)
return 0;
if (AV_RL32(p->buf + 8) > 256 || !AV_RL32(p->buf + 8))
return AVPROBE_SCORE_MAX / 8;
if (AV_RL32(p->buf + 16) > 8*48000 || !AV_RL32(p->buf + 16))
return AVPROBE_SCORE_MAX / 8;
return AVPROBE_SCORE_MAX;
}
static int rsd_read_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int i, version, start = 0x800;
AVCodecContext *codec;
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
avio_skip(pb, 3); // "RSD"
version = avio_r8(pb) - '0';
codec = st->codec;
codec->codec_type = AVMEDIA_TYPE_AUDIO;
codec->codec_tag = avio_rl32(pb);
codec->codec_id = ff_codec_get_id(rsd_tags, codec->codec_tag);
if (!codec->codec_id) {
char tag_buf[5];
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), codec->codec_tag);
for (i=0; i < FF_ARRAY_ELEMS(rsd_unsupported_tags); i++) {
if (codec->codec_tag == rsd_unsupported_tags[i]) {
avpriv_request_sample(s, "Codec tag: %s", tag_buf);
return AVERROR_PATCHWELCOME;
}
}
av_log(s, AV_LOG_ERROR, "Unknown codec tag: %s\n", tag_buf);
return AVERROR_INVALIDDATA;
}
codec->channels = avio_rl32(pb);
if (!codec->channels)
return AVERROR_INVALIDDATA;
avio_skip(pb, 4); // Bit depth
codec->sample_rate = avio_rl32(pb);
if (!codec->sample_rate)
return AVERROR_INVALIDDATA;
avio_skip(pb, 4); // Unknown
switch (codec->codec_id) {
case AV_CODEC_ID_ADPCM_IMA_RAD:
codec->block_align = 20 * codec->channels;
if (pb->seekable)
st->duration = av_get_audio_frame_duration(codec, avio_size(pb) - start);
break;
case AV_CODEC_ID_ADPCM_THP:
/* RSD3GADP is mono, so only alloc enough memory
to store the coeff table for a single channel. */
start = avio_rl32(pb);
if (ff_get_extradata(codec, s->pb, 32) < 0)
return AVERROR(ENOMEM);
for (i = 0; i < 16; i++)
AV_WB16(codec->extradata + i * 2, AV_RL16(codec->extradata + i * 2));
if (pb->seekable)
st->duration = (avio_size(pb) - start) / 8 * 14;
break;
case AV_CODEC_ID_PCM_S16LE:
case AV_CODEC_ID_PCM_S16BE:
if (version != 4)
start = avio_rl32(pb);
if (pb->seekable)
st->duration = (avio_size(pb) - start) / 2 / codec->channels;
break;
}
avio_skip(pb, start - avio_tell(pb));
avpriv_set_pts_info(st, 64, 1, codec->sample_rate);
return 0;
}
static int rsd_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *codec = s->streams[0]->codec;
int ret, size = 1024;
if (avio_feof(s->pb))
return AVERROR_EOF;
if (codec->codec_id == AV_CODEC_ID_ADPCM_IMA_RAD)
ret = av_get_packet(s->pb, pkt, codec->block_align);
else
ret = av_get_packet(s->pb, pkt, size);
if (ret != size) {
if (ret < 0) {
av_free_packet(pkt);
return ret;
}
av_shrink_packet(pkt, ret);
}
pkt->stream_index = 0;
return ret;
}
#ifdef IDE_COMPILE
static const AVCodecTag* const tmpx[] = {rsd_tags, 0};
#endif
AVInputFormat ff_rsd_demuxer = {
#ifdef IDE_COMPILE
"rsd",
"GameCube RSD",
0, "rsd",
tmpx,
0, 0, 0, 0, 0, rsd_probe,
rsd_read_header,
rsd_read_packet,
#else
.name = "rsd",
.long_name = NULL_IF_CONFIG_SMALL("GameCube RSD"),
.read_probe = rsd_probe,
.read_header = rsd_read_header,
.read_packet = rsd_read_packet,
.extensions = "rsd",
.codec_tag = (const AVCodecTag* const []){rsd_tags, 0},
#endif
};
|
/*
* HND Run Time Environment debug info area
*
* Copyright (C) 1999-2013, 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 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: hndrte_debug.h 342211 2012-07-02 02:23:04Z $
*/
#ifndef _HNDRTE_DEBUG_H
#define _HNDRTE_DEBUG_H
/* Magic number at a magic location to find HNDRTE_DEBUG pointers */
#define HNDRTE_DEBUG_PTR_PTR_ADDR 0xf8
#define HNDRTE_DEBUG_PTR_PTR_MAGIC 0x50504244 /* DBPP */
#ifndef _LANGUAGE_ASSEMBLY
/* Includes only when building dongle code */
#define NUM_EVENT_LOG_SETS 4
/* We use explicit sizes here since this gets included from different
* systems. The sizes must be the size of the creating system
* (currently 32 bit ARM) since this is gleaned from dump.
*/
/* Define pointers for use on other systems */
#define _HD_EVLOG_P uint32
#define _HD_CONS_P uint32
#define _HD_TRAP_P uint32
typedef struct hndrte_debug {
uint32 magic;
#define HNDRTE_DEBUG_MAGIC 0x47424544 /* 'DEBG' */
uint32 version; /* Debug struct version */
#define HNDRTE_DEBUG_VERSION 1
uint32 fwid; /* 4 bytes of fw info */
char epivers[32];
_HD_TRAP_P trap_ptr; /* trap_t data struct */
_HD_CONS_P console; /* Console */
uint32 ram_base;
uint32 ram_size;
uint32 rom_base;
uint32 rom_size;
_HD_EVLOG_P event_log_top;
} hndrte_debug_t;
/*
* timeval_t and prstatus_t are copies of the Linux structures.
* Included here because we need the definitions for the target processor
* (32 bits) and not the definition on the host this is running on
* (which could be 64 bits).
*/
typedef struct { /* Time value with microsecond resolution */
uint32 tv_sec; /* Seconds */
uint32 tv_usec; /* Microseconds */
} timeval_t;
/* Linux/ARM 32 prstatus for notes section */
typedef struct prstatus {
int32 si_signo; /* Signal number */
int32 si_code; /* Extra code */
int32 si_errno; /* Errno */
uint16 pr_cursig; /* Current signal. */
uint16 unused;
uint32 pr_sigpend; /* Set of pending signals. */
uint32 pr_sighold; /* Set of held signals. */
uint32 pr_pid;
uint32 pr_ppid;
uint32 pr_pgrp;
uint32 pr_sid;
timeval_t pr_utime; /* User time. */
timeval_t pr_stime; /* System time. */
timeval_t pr_cutime; /* Cumulative user time. */
timeval_t pr_cstime; /* Cumulative system time. */
uint32 uregs[18];
int32 pr_fpvalid; /* True if math copro being used. */
} prstatus_t;
#ifdef DUMP_INFO
extern hndrte_debug_t hndrte_debug_info __attribute__ ((weak));
#endif
#endif /* LANGUAGE_ASSEMBLY */
#endif /* _HNDRTE_DEBUG_H */
|
#pragma once
// AboutDialog dialog
class AboutDialog : public CDialog
{
DECLARE_DYNAMIC(AboutDialog)
public:
AboutDialog(CWnd* pParent = NULL); // standard constructor
virtual ~AboutDialog();
// Dialog Data
enum { IDD = IDD_ABOUT };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CString fVersion;
afx_msg void OnStnClickedStatic2();
afx_msg void OnStnClickedStatic4();
afx_msg void OnStnClickedStatic7();
};
|
# ifndef SW_LIBSETUP_INCLUDE
# define SW_LIBSETUP_INCLUDE
Library *SWSupportBase = NULL;
Library *MUIMasterBase = NULL;
int _STI_4000_Libs(void)
{
MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN);
SWSupportBase = OpenLibrary("PROGDIR:MUI/" SWSUPPORTNAME, SWSUPPORTVER);
if (!SWSupportBase)
SWSupportBase = OpenLibrary(SWSUPPORTNAME, SWSUPPORTVER);
if (!MUIMasterBase) PutStr("ERROR: Unable to open " MUIMASTER_NAME "\n");
if (!SWSupportBase) {
PutStr("ERROR: Unable to open " SWSUPPORTNAME "\n");
if (MUIMasterBase)
MUI_Request(NULL, NULL, 0, "ERROR", "Ok",
"Unable to open %s version %ld. This\n"
"may be because another installed application\n"
"is using an older version of the library.",
SWSUPPORTNAME, SWSUPPORTVER);
}
return (SWSupportBase == NULL || MUIMasterBase == NULL) ? -1 : 0;
}
void _STD_4000_Libs(void)
{
SW_CLOSELIB(SWSupportBase);
SW_CLOSELIB(MUIMasterBase);
}
int _STI_4100_Setup(void)
{
if (SWSupportBase) {
SWInit();
SWDB_OPEN(NULL, NULL, NULL);
}
return 0;
}
void _STD_4100_Setup(void)
{
if (SWSupportBase) {
SWDB_CLOSE();
SWExit();
}
}
# endif
|
//
// CocoaPodsTest.h
// CocoaPodsTest
//
// Created by Tobiasz Parys on 23/02/14.
// Copyright (c) 2014 Treadstone Entertainment. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CocoaPodsTest : NSObject
@end
|
//
// face.h
// Bistellar
//
// Created by Alexander Thumm on 07.10.11.
// Copyright 2011 -. All rights reserved.
//
#ifndef Bistellar_face_h
#define Bistellar_face_h
#include <iostream>
#include <deque>
#include "types.h"
class Face
{
vertex_t * _vertices;
int _dimension;
public:
Face();
Face(const vertex_t * vertices, int dimension);
Face(const Face & cpy);
Face & operator=(const Face & cpy);
~Face();
bool operator==(const Face & cmp) const;
bool operator!=(const Face & cmp) const;
int dimension() const;
// returns a reference to the i-th vertex.
const vertex_t & vertex(unsigned int i) const;
// returns the boundary face obtained by omitting the i-th vertex.
Face * createBoundaryFace(unsigned int i) const;
// tests if the face is a subface of face
bool isSubfaceOf(const Face & face) const;
// create linkFace
static Face linkFace(const Face & face, const face_list_t & linkFacets);
// create union
static Face unite(const Face & face1, const Face & face2);
// serialization methods
friend std::ostream & operator<< (std::ostream & os, const Face & face);
friend std::istream & operator>> (std::istream & is, Face & face);
};
// adds all boundaryfaces of face to listOfBoundaryfaces
void addBoundaryfacesOfFace(const Face & face, face_list_t & listOfBoundaryfaces);
// adds all subfaces of face to listOfSubfaces
void addSubfacesOfFace(const Face & face, face_list_t & listOfSubfaces);
#endif
|
/*
* Userspace Backlight Driver
* Modified from Driver for the Cirrus EP93xx lcd backlight
* by 2010 H Hartley Sweeten <hsweeten@visionengravers.com>
*
* Copyright (c) 2015 Icenowy Zheng <icenowy@outlook.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/kmod.h>
static int userspace_bl_brightness;
static struct backlight_device *userspace_bl_device;
static int userspace_bl_set(struct backlight_device *bl, int brightness)
{
char brightness_chars[4];
static char *envp[] = {"PATH=/sbin:/bin:/usr/sbin:/usr/bin", NULL};
char *argv[] = {"/sbin/backlight_helper", brightness_chars, NULL};
if(brightness < 0 || brightness > 255)
return -EINVAL;
snprintf(brightness_chars, 4, "%d", brightness);
if(call_usermodehelper(argv[0], argv, envp, 1))
return -ENOSYS;
userspace_bl_brightness = brightness;
return 0;
}
static int userspace_bl_update_status(struct backlight_device *bl)
{
int brightness = bl->props.brightness;
if (bl->props.power != FB_BLANK_UNBLANK ||
bl->props.fb_blank != FB_BLANK_UNBLANK)
brightness = 0;
return userspace_bl_set(bl, brightness);
}
static int userspace_bl_get_brightness(struct backlight_device *bl)
{
return userspace_bl_brightness;
}
static const struct backlight_ops userspace_bl_ops = {
.update_status = userspace_bl_update_status,
.get_brightness = userspace_bl_get_brightness,
};
static int __init userspace_bl_create(void)
{
struct backlight_properties props;
printk("Initializing Userspace Backlight Driver.\n");
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.max_brightness = 255;
userspace_bl_device = backlight_device_register("userspace-bl", NULL, NULL,
&userspace_bl_ops, &props);
if (IS_ERR(userspace_bl_device))
return PTR_ERR(userspace_bl_device);
userspace_bl_device->props.brightness = 255;
userspace_bl_update_status(userspace_bl_device);
return 0;
}
static int userspace_bl_remove(void)
{
backlight_device_unregister(userspace_bl_device);
return 0;
}
static int __init userspace_bl_init(void)
{
printk("userspace_bl_init\n");
return userspace_bl_create();
}
module_init(userspace_bl_init);
static void __exit userspace_bl_exit(void)
{
userspace_bl_remove();
}
module_exit(userspace_bl_exit);
MODULE_DESCRIPTION("Userspace Backlight Driver");
MODULE_AUTHOR("Icenowy Zheng <icenowy@outlook.com>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:userspace-bl");
|
/* $Id: upnpglobalvars.c,v 1.39 2014/12/10 09:49:22 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2014 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
#include <sys/types.h>
#include <netinet/in.h>
#include "config.h"
#include "upnpglobalvars.h"
#include "upnpdescstrings.h"
/* network interface for internet */
const char * ext_if_name = 0;
/* file to store leases */
#ifdef ENABLE_LEASEFILE
const char* lease_file = 0;
#endif
/* forced ip address to use for this interface
* when NULL, getifaddr() is used */
const char * use_ext_ip_addr = 0;
unsigned long downstream_bitrate = 0;
unsigned long upstream_bitrate = 0;
/* startup time */
time_t startup_time = 0;
#ifdef ENABLE_PCP
/* for PCP */
unsigned long int min_lifetime = 120;
unsigned long int max_lifetime = 86400;
#endif
int runtime_flags = 0;
const char * pidfilename = "/var/run/miniupnpd.pid";
char uuidvalue_igd[] = "uuid:00000000-0000-0000-0000-000000000000";
char uuidvalue_wan[] = "uuid:00000000-0000-0000-0000-000000000000";
char uuidvalue_wcd[] = "uuid:00000000-0000-0000-0000-000000000000";
char serialnumber[SERIALNUMBER_MAX_LEN] = "00000000";
char modelnumber[MODELNUMBER_MAX_LEN] = "1";
char friendly_name[FRIENDLYNAME_MAX_LEN] = "ASUS Router";
/* presentation url :
* http://nnn.nnn.nnn.nnn:ppppp/ => max 30 bytes including terminating 0 */
char presentationurl[PRESENTATIONURL_MAX_LEN];
#ifdef ENABLE_MANUFACTURER_INFO_CONFIGURATION
///* friendly name for root devices in XML description */
//char friendly_name[FRIENDLY_NAME_MAX_LEN] = OS_NAME " router";
/* manufacturer name for root devices in XML description */
char manufacturer_name[MANUFACTURER_NAME_MAX_LEN] = ROOTDEV_MANUFACTURER;
/* manufacturer url for root devices in XML description */
char manufacturer_url[MANUFACTURER_URL_MAX_LEN] = ROOTDEV_MANUFACTURERURL;
/* model name for root devices in XML description */
char model_name[MODEL_NAME_MAX_LEN] = ROOTDEV_MODELNAME;
/* model description for root devices in XML description */
char model_description[MODEL_DESCRIPTION_MAX_LEN] = ROOTDEV_MODELDESCRIPTION;
/* model url for root devices in XML description */
char model_url[MODEL_URL_MAX_LEN] = ROOTDEV_MODELURL;
#endif
/* UPnP permission rules : */
struct upnpperm * upnppermlist = 0;
unsigned int num_upnpperm = 0;
#ifdef PCP_SADSCP
struct dscp_values* dscp_values_list = 0;
unsigned int num_dscp_values = 0;
#endif /*PCP_SADSCP*/
/* For automatic removal of expired rules (with LeaseDuration) */
unsigned int nextruletoclean_timestamp = 0;
#ifdef USE_PF
const char * anchor_name = "miniupnpd";
const char * queue = 0;
const char * tag = 0;
#endif
#ifdef USE_NETFILTER
/* chain name to use, both in the nat table
* and the filter table */
const char * miniupnpd_nat_chain = "MINIUPNPD";
const char * miniupnpd_peer_chain = "MINIUPNPD-PCP-PEER";
const char * miniupnpd_forward_chain = "MINIUPNPD";
#ifdef ENABLE_UPNPPINHOLE
const char * miniupnpd_v6_filter_chain = "MINIUPNPD";
#endif
#endif
#ifdef ENABLE_NFQUEUE
int nfqueue = -1;
int n_nfqix = 0;
unsigned nfqix[MAX_LAN_ADDR];
#endif
struct lan_addr_list lan_addrs;
#ifdef ENABLE_IPV6
/* ipv6 address used for HTTP */
char ipv6_addr_for_http_with_brackets[64];
/* address used to bind local services */
struct in6_addr ipv6_bind_addr;
#endif
/* Path of the Unix socket used to communicate with MiniSSDPd */
const char * minissdpdsocketpath = "/var/run/minissdpd.sock";
/* BOOTID.UPNP.ORG and CONFIGID.UPNP.ORG */
/* See UPnP Device Architecture v1.1 section 1.2 Advertisement :
* The field value of the BOOTID.UPNP.ORG header field MUST be increased
* each time a device (re)joins the network and sends an initial announce
* (a "reboot" in UPnP terms), or adds a UPnP-enabled interface.
* Unless the device explicitly announces a change in the BOOTID.UPNP.ORG
* field value using an SSDP message, as long as the device remains
* continuously available in the network, the same BOOTID.UPNP.ORG field
* value MUST be used in all repeat announcements, search responses,
* update messages and eventually bye-bye messages. */
unsigned int upnp_bootid = 1; /* BOOTID.UPNP.ORG */
/* The field value of the CONFIGID.UPNP.ORG header field identifies the
* current set of device and service descriptions; control points can
* parse this header field to detect whether they need to send new
* description query messages. */
/* UPnP 1.1 devices MAY freely assign configid numbers from 0 to
* 16777215 (2^24-1). Higher numbers are reserved for future use, and
* can be assigned by the Technical Committee. The configuration of a
* root device consists of the following information: the DDD of the
* root device and all its embedded devices, and the SCPDs of all the
* contained services. If any part of the configuration changes, the
* CONFIGID.UPNP.ORG field value MUST be changed.
* DDD = Device Description Document
* SCPD = Service Control Protocol Description */
unsigned int upnp_configid = 1337; /* CONFIGID.UPNP.ORG */
|
/*
* This file is part of the sockstress project.
*
* Copyright (C) 2008-2013 Outpost24 AB
* (Written by Jack C. Louis for Outpost24 AB)
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _MISC_H
# define _MISC_H
char *sockaddrstr(const struct sockaddr *);
#endif
|
/* RCOS by RCSoft(riadh.chtara@gmail.com)
* Based on Skelix by Xiaoming Mo (xiaoming.mo@skelix.org)
* Licence: GPLv2 */
#ifndef LIBCC_H
#define LIBCC_H
#define NULL ((void *)0)
void bcopy(const void *src, void *dest, unsigned int n);
void bzero(void *dest, unsigned int n);
void *memcpy(void *dest, const void *src, unsigned int n);
void *memset(void *dest, int c, unsigned int n);
int memcmp(const void *s1, const void *s2, unsigned int n);
int strcmp(const char *s1, const char *s2);
char *strcpy(char *dest, const char *src);
unsigned int strlen(const char *s);
#define assert(s) do { if (! (s)) { \
kprintf(KPL_PANIC, "ASSERT: %s, %d", __FILE__, __LINE__); \
halt(); \
}} while (0)
#endif
|
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
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,
};
static const struct modversion_info ____versions[]
__used
__attribute__((section("__versions"))) = {
{ 0xae141548, "module_layout" },
{ 0x6980fe91, "param_get_int" },
{ 0xff964b25, "param_set_int" },
{ 0x29537c9e, "alloc_chrdev_region" },
{ 0x38787e33, "cdev_add" },
{ 0xf432cc41, "cdev_init" },
{ 0x105e2727, "__tracepoint_kmalloc" },
{ 0xf4c9dacc, "kmem_cache_alloc" },
{ 0xfc2358d1, "kmalloc_caches" },
{ 0xd8e484f0, "register_chrdev_region" },
{ 0x2da418b5, "copy_to_user" },
{ 0xf2a644fb, "copy_from_user" },
{ 0xb72397d5, "printk" },
{ 0x7485e15e, "unregister_chrdev_region" },
{ 0x37a0cba, "kfree" },
{ 0x2152d374, "cdev_del" },
};
static const char __module_depends[]
__used
__attribute__((section(".modinfo"))) =
"depends=";
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/iAdCore.framework/iAdCore
*/
#import <iAdCore/iAdCore-Structs.h>
#import <iAdCore/XXUnknownSuperclass.h>
// iOSOpenDev: wrapped with define check (since occurs in other dumped files)
#ifndef __XXUnknownSuperclass__
#define __XXUnknownSuperclass__ 1
@interface XXUnknownSuperclass : NSObject
@end
#endif
@interface XXUnknownSuperclass (_iAd_Extras)
+ (id)_iAd_imageNamed:(id)named; // 0xffa1
@end
@interface XXUnknownSuperclass (_iAd_Extras)
+ (id)_iAd_colorWithRGBA:(unsigned)rgba; // 0xffd1
@end
@interface XXUnknownSuperclass (ADWebScriptObjectExtras)
+ (id)_iAd_pointWithCGPoint:(CGPoint)cgpoint; // 0x4944d
+ (id)_iAd_rectWithCGRect:(CGRect)cgrect; // 0x4935d
- (id)_iAd_dictionaryFromTopLevelKeysAndValuesInContext:(OpaqueJSContext *)context; // 0x494fd
- (CGRect)_iAd_CGRectValue; // 0x492f9
- (CGSize)_iAd_CGSizeValue; // 0x49225
- (CGPoint)_iAd_CGPointValue; // 0x49121
- (id)_iAd_valueForKeyOrNil:(id)keyOrNil; // 0x49075
- (void)_iAd_enumerateObjectsUsingBlock:(id)block; // 0x48f11
- (BOOL)_iAd_hasProperties:(id)properties inContext:(OpaqueJSContext *)context missingProperties:(id *)properties3; // 0x48dfd
- (id)_iAd_stringValueForKey:(id)key; // 0x48d11
- (void)_iAd_webThreadCallWebScriptMethod:(id)method withArguments:(id)arguments; // 0x48c35
@end
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_java_net_protocol_core_Connection__
#define __gnu_java_net_protocol_core_Connection__
#pragma interface
#include <java/net/URLConnection.h>
extern "Java"
{
namespace java
{
namespace net
{
class URL;
}
}
namespace gnu
{
namespace java
{
namespace net
{
namespace protocol
{
namespace core
{
class Connection;
}
}
}
}
namespace gcj
{
class Core;
}
}
}
class gnu::java::net::protocol::core::Connection : public ::java::net::URLConnection
{
public:
Connection (::java::net::URL *);
virtual void connect ();
virtual ::java::io::InputStream *getInputStream ();
virtual ::java::lang::String *getHeaderField (::java::lang::String *);
virtual ::java::util::Map *getHeaderFields ();
virtual ::java::lang::String *getHeaderField (jint);
virtual ::java::lang::String *getHeaderFieldKey (jint);
private:
::java::lang::String *getKey (::java::lang::String *);
::java::lang::String *getField (::java::lang::String *);
void getHeaders ();
::java::util::Hashtable * __attribute__((aligned(__alignof__( ::java::net::URLConnection )))) hdrHash;
::java::util::Vector *hdrVec;
jboolean gotHeaders;
::gnu::gcj::Core *core;
public:
static ::java::lang::Class class$;
};
#endif /* __gnu_java_net_protocol_core_Connection__ */
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_java_text_LineBreakIterator__
#define __gnu_java_text_LineBreakIterator__
#pragma interface
#include <gnu/java/text/BaseBreakIterator.h>
extern "Java"
{
namespace gnu
{
namespace java
{
namespace text
{
class LineBreakIterator;
}
}
}
}
class gnu::java::text::LineBreakIterator : public ::gnu::java::text::BaseBreakIterator
{
public:
virtual ::java::lang::Object *clone ();
LineBreakIterator ();
private:
LineBreakIterator (::gnu::java::text::LineBreakIterator *);
jboolean isNb (jchar);
jboolean isClose (jint);
jboolean isIdeo (jchar);
public:
virtual jint next ();
virtual jint previous ();
static ::java::lang::Class class$;
};
#endif /* __gnu_java_text_LineBreakIterator__ */
|
/*******************************************************************
*
*
* Copyright (C) 2015, 2016, 2017 Xilinx, 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
*
*
* Description: Driver configuration
*
*******************************************************************/
#include "xparameters.h"
#include "xhdcp22_cipher.h"
/*
* The configuration table for devices
*/
XHdcp22_Cipher_Config XHdcp22_Cipher_ConfigTable[] =
{
#if XPAR_XHDCP22_CIPHER_NUM_INSTANCES
{
XPAR_HDMI_RX_SS_HDCP22_RX_SS_V_HDCP22_CIPHER_RX_0_DEVICE_ID,
XPAR_HDMI_RX_SS_HDCP22_RX_SS_V_HDCP22_CIPHER_RX_0_CPU_BASEADDR
},
{
XPAR_HDMI_TX_SS_HDCP22_TX_SS_V_HDCP22_CIPHER_TX_0_DEVICE_ID,
XPAR_HDMI_TX_SS_HDCP22_TX_SS_V_HDCP22_CIPHER_TX_0_CPU_BASEADDR
}
#endif
};
|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include "VideoBackends/DX11/D3DPtr.h"
#include "VideoCommon/VideoCommon.h"
namespace DX11
{
class XFBEncoder
{
public:
XFBEncoder();
void Init();
void Shutdown();
void Encode(u8* dst, u32 width, u32 height, const EFBRectangle& srcRect, float gamma);
private:
D3D::Texture2dPtr m_out;
D3D::RtvPtr m_outRTV;
D3D::Texture2dPtr m_outStage;
D3D::BufferPtr m_encodeParams;
D3D::BufferPtr m_quad;
D3D::VertexShaderPtr m_vShader;
D3D::InputLayoutPtr m_quadLayout;
D3D::PixelShaderPtr m_pShader;
D3D::BlendStatePtr m_xfbEncodeBlendState;
D3D::DepthStencilStatePtr m_xfbEncodeDepthState;
D3D::RasterizerStatePtr m_xfbEncodeRastState;
D3D::SamplerStatePtr m_efbSampler;
};
} |
//
// ViewController.h
// TextKit_demo
//
// Created by CornerZhang on 14-9-25.
// Copyright (c) 2014年 NeXtreme.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *textLabel;
@end
|
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
.name = KBUILD_MODNAME,
.arch = MODULE_ARCH_INIT,
};
MODULE_INFO(intree, "Y");
static const struct modversion_info ____versions[]
__used
__attribute__((section("__versions"))) = {
{ 0xce969278, "module_layout" },
{ 0x2546a652, "kmalloc_caches" },
{ 0xf9a482f9, "msleep" },
{ 0x2e5810c6, "__aeabi_unwind_cpp_pr1" },
{ 0x9fca1d63, "i2c_transfer" },
{ 0x27e1a049, "printk" },
{ 0xf0fdf6cb, "__stack_chk_fail" },
{ 0xecdf8ea1, "kmem_cache_alloc_trace" },
{ 0x37a0cba, "kfree" },
{ 0x9d669763, "memcpy" },
{ 0xefd6cf06, "__aeabi_unwind_cpp_pr0" },
{ 0x8f678b07, "__stack_chk_guard" },
};
static const char __module_depends[]
__used
__attribute__((section(".modinfo"))) =
"depends=";
|
/*
* Copyright (C) 1996-2016 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
* DEBUG: section 76 Internal Squid Object handling
* AUTHOR: Duane, Alex, Henrik
*/
#ifndef SQUID_INTERNAL_H_
#define SQUID_INTERNAL_H_
#include "comm/forward.h"
class HttpRequest;
class SBuf;
class StoreEntry;
void internalStart(const Comm::ConnectionPointer &clientConn, HttpRequest *, StoreEntry *);
bool internalCheck(const SBuf &urlPath);
bool internalStaticCheck(const SBuf &urlPath);
char *internalLocalUri(const char *dir, const SBuf &name);
char *internalRemoteUri(const char *, unsigned short, const char *, const SBuf &);
const char *internalHostname(void);
int internalHostnameIs(const char *);
#endif /* SQUID_INTERNAL_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(970);
}
module_init(regpatch);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.