text stringlengths 4 6.14k |
|---|
#ifndef _ASM_I386_MODULE_H
#define _ASM_I386_MODULE_H
/* x86 is simple */
struct mod_arch_specific
{
};
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr
#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif defined CONFIG_M586
#define MODULE_PROC_FAMILY "586 "
#elif defined CONFIG_M586TSC
#define MODULE_PROC_FAMILY "586TSC "
#elif defined CONFIG_M586MMX
#define MODULE_PROC_FAMILY "586MMX "
#elif defined CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif defined CONFIG_MPENTIUMII
#define MODULE_PROC_FAMILY "PENTIUMII "
#elif defined CONFIG_MPENTIUMIII
#define MODULE_PROC_FAMILY "PENTIUMIII "
#elif defined CONFIG_MPENTIUM4
#define MODULE_PROC_FAMILY "PENTIUM4 "
#elif defined CONFIG_MK6
#define MODULE_PROC_FAMILY "K6 "
#elif defined CONFIG_MK7
#define MODULE_PROC_FAMILY "K7 "
#elif defined CONFIG_MK8
#define MODULE_PROC_FAMILY "K8 "
#elif defined CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif defined CONFIG_MCRUSOE
#define MODULE_PROC_FAMILY "CRUSOE "
#elif defined CONFIG_MWINCHIPC6
#define MODULE_PROC_FAMILY "WINCHIPC6 "
#elif defined CONFIG_MWINCHIP2
#define MODULE_PROC_FAMILY "WINCHIP2 "
#elif defined CONFIG_MWINCHIP3D
#define MODULE_PROC_FAMILY "WINCHIP3D "
#elif defined CONFIG_MCYRIXIII
#define MODULE_PROC_FAMILY "CYRIXIII "
#elif CONFIG_MVIAC3_2
#define MODULE_PROC_FAMILY "VIAC3-2 "
#else
#error unknown processor family
#endif
#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
#endif /* _ASM_I386_MODULE_H */
|
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD 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.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file newgrf_industries.h Functions for NewGRF industries. */
#ifndef NEWGRF_INDUSTRIES_H
#define NEWGRF_INDUSTRIES_H
#include "command_type.h"
#include "newgrf_spritegroup.h"
/** When should the industry(tile) be triggered for random bits? */
enum IndustryTrigger {
/** Triggered each tile loop */
INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1,
/** Triggered (whole industry) each 256 ticks */
INDUSTRY_TRIGGER_256_TICKS = 2,
/** Triggered on cargo delivery */
INDUSTRY_TRIGGER_CARGO_DELIVERY = 4,
};
/** From where is callback CBID_INDUSTRY_AVAILABLE been called */
enum IndustryAvailabilityCallType {
IACT_MAPGENERATION, ///< during random map generation
IACT_RANDOMCREATION, ///< during creation of random ingame industry
IACT_USERCREATION, ///< from the Fund/build window
};
/* in newgrf_industry.cpp */
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i, uint32 cur_grfid);
void IndustryProductionCallback(Industry *ind, int reason);
CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed, uint16 initial_random_bits, Owner founder);
bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type);
IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id);
/* in newgrf_industrytiles.cpp*/
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index);
#endif /* NEWGRF_INDUSTRIES_H */
|
/*****************************************************************************
* s16tofixed32.c : converter from signed 16 bits integer to fixed 32
*****************************************************************************
* Copyright (C) 2002, 2006 the VideoLAN team
* $Id: s16tofixed32.c 14997 2006-03-31 15:15:07Z fkuehne $
*
* Authors: Marc Ariberti <marcari@videolan.ord>
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <vlc/vlc.h>
#include "audio_output.h"
#include "aout_internal.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Create ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_category( CAT_AUDIO );
set_subcategory( SUBCAT_AUDIO_MISC );
set_description( _("Audio filter for s16->fixed32 conversion") );
set_capability( "audio filter", 15 );
set_callbacks( Create, NULL );
vlc_module_end();
/*****************************************************************************
* Create: allocate filter
*****************************************************************************
* This function allocates and initializes a s16->fixed32 audio filter.
*****************************************************************************/
static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->output.i_format != VLC_FOURCC('f','i','3','2')
|| p_filter->input.i_format != AOUT_FMT_S16_NE )
{
return -1;
}
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
return 0;
}
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
int i = p_in_buf->i_nb_samples * aout_FormatNbChannels( &p_filter->input );
/* We start from the end because b_in_place is true */
int16_t * p_in = (int16_t *)p_in_buf->p_buffer + i - 1;
vlc_fixed_t * p_out = (vlc_fixed_t *)p_out_buf->p_buffer + i - 1;
while( i-- )
{
*p_out = (vlc_fixed_t)( (int32_t)(*p_in) * (FIXED32_ONE >> 16) );
p_in--; p_out--;
}
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes
* sizeof(vlc_fixed_t) / sizeof(int16_t);
}
|
int main(void){
char (*s)[6];
s = &"hello";
(*s)[0] = 'x';
return 0;
}
|
/* Mytget - A download accelerator for GNU/Linux
* Homepage: https://github.com/lytsing/Mytget
* Copyright (C) 2005- xiaosuo
*
* 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.
*/
// support ipv4 and ipv6
/* getaddrinfo is a thread-safe function in linux system
* so these classes are thread-safe too*/
#ifndef TCP_H_
#define TCP_H_
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <netinet/ip.h>
#include "advio.h"
/***
* store the tcp socket address information
* support ipv4 and ipv6 */
class TcpSockAddr {
public:
/* default ipv4 */
TcpSockAddr(int family = AF_INET);
void set_family(int family);
// ~TcpSockAddr();
// TcpSockAddr(const TcpSockAddr& sock);
// void operator = (const TcpSockAddr& sock);
// set the tcp port
void set_port(int port);
int get_port();
// set addr
int set_addr(const char *addr);
// get the address ipv4 or ipv6
int get_addr(char *addr, int size);
public:
int ai_family;
char ai_addr[24]; // ipv6's length is 24 bytes
socklen_t ai_addrlen;
};
class TcpConnection : public BufferStream {
public:
TcpConnection():BufferStream(-1) {}
// ~TcpConnection();
// TcpConnection(const TcpConnection &con);
// void operator = (const TcpConnection &con);
int set_tos(void);
bool is_connected(); // try to judge the connection
int get_remote_addr(TcpSockAddr& sockaddr)const; // return this remote
int get_local_addr(TcpSockAddr& sockaddr)const; // return local
};
class Address {
public:
Address() { addr = NULL; }
~Address() { freeaddrinfo(addr); }
// resolve dns_name with getaddrinfo
int resolve(const char *dns_name, int port, int family = AF_UNSPEC);
public:
struct addrinfo *addr;
};
class TcpConnector {
public:
static TcpConnection* connect(const Address& addr, int& ret, long timeout = -1);
static TcpConnection* connect(const TcpSockAddr& addr, int& ret, long timeout = -1);
};
class TcpAcceptor {
public:
TcpAcceptor() { listen_fd = -1; }
~TcpAcceptor() { close(listen_fd); }
// forbid the follow two functions
// TcpAcceptor(const TcpAcceptor& acc);
// void operator = (const TcpAcceptor& acc);
// if bind port == 0, when binded it will return a random port */
int get_bind_port();
int listen(const TcpSockAddr& local, int backlog = 1);
TcpConnection* accept(int &ret, long timeout = -1);
// wait expect's connection
TcpConnection* accept(const TcpSockAddr& expect, int &ret, long timeout = -1);
private:
int listen_fd;
};
#endif // TCP_H_
|
/***************************************************************************
* OpenRadio - RadioMixer *
* Copyright (C) 2005-2007 by Jan Boysen *
* trekkie@media-mission.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef VERSION_H
#define VERSION_H
#define VERSION_MAJOR "1"
#define VERSION_MINOR "99"
#define VERSION_SUFFIX "_TRUNK"
#endif
|
/*
* ======== imports ========
*/
#ifndef pollen_event_Dispatcher__M
#define pollen_event_Dispatcher__M
#include "../../pollen.event/Dispatcher/Dispatcher.h"
#endif
#ifndef pollen_event_Event__M
#define pollen_event_Event__M
#include "../../pollen.event/Event/Event.h"
#endif
#ifndef virtual_mcu_ConsolePrint__M
#define virtual_mcu_ConsolePrint__M
#include "../../virtual.mcu/ConsolePrint/ConsolePrint.h"
#endif
#ifndef virtual_mcu_GlobalInterrupts__M
#define virtual_mcu_GlobalInterrupts__M
#include "../../virtual.mcu/GlobalInterrupts/GlobalInterrupts.h"
#endif
#ifndef test54_PrintImpl__M
#define test54_PrintImpl__M
#include "../../test54/PrintImpl/PrintImpl.h"
#endif
/*
* ======== forward declarations for intrinsics ========
*/
void test86_Test_11_pollen__reset__E();
void test86_Test_11_pollen__ready__E();
/*
* ======== extern definition ========
*/
extern struct test86_Test_11_ test86_Test_11;
/*
* ======== struct module definition (unit Test_11) ========
*/
struct pollen_event_Event;
struct test54_PrintImpl_;
struct test86_Test_11_ {
const uint8 NumEvents;
struct test54_PrintImpl_ *pollenPrintProxy;
};
typedef struct test86_Test_11_ test86_Test_11_;
/*
* ======== host variables (unit Test_11) ========
*/
typedef pollen_event_Event test86_Test_11_events__TYPE;
extern test86_Test_11_events__TYPE test86_Test_11_events__A[];
/*
* ======== function members (unit Test_11) ========
*/
extern void test86_Test_11_tick4__I();
extern void test86_Test_11_pollen__run__E();
extern void test86_Test_11_tick3__I();
extern void test86_Test_11_tick2__I();
extern void test86_Test_11_tick1__I();
extern void test86_Test_11_pollen__shutdown__E( uint8 id );
extern void test86_Test_11_tick5__I();
extern void test86_Test_11_targetInit__I();
/*
* ======== const definitions ========
*/
#define test86_Test_11_NumEvents (5)
/*
* ======== data members (unit Test_11) ========
*/
#define test86_Test_11_NumEvents__V test86_Test_11.NumEvents
#define test86_Test_11_pollenPrintProxy__V test86_Test_11.pollenPrintProxy
|
#ifndef _ASM_X86_UNISTD_64_X32_H
#define _ASM_X86_UNISTD_64_X32_H 1
#define __NR_x32_rt_sigaction 512
#define __NR_x32_rt_sigreturn 513
#define __NR_x32_ioctl 514
#define __NR_x32_readv 515
#define __NR_x32_writev 516
#define __NR_x32_recvfrom 517
#define __NR_x32_sendmsg 518
#define __NR_x32_recvmsg 519
#define __NR_x32_execve 520
#define __NR_x32_ptrace 521
#define __NR_x32_rt_sigpending 522
#define __NR_x32_rt_sigtimedwait 523
#define __NR_x32_rt_sigqueueinfo 524
#define __NR_x32_sigaltstack 525
#define __NR_x32_timer_create 526
#define __NR_x32_mq_notify 527
#define __NR_x32_kexec_load 528
#define __NR_x32_waitid 529
#define __NR_x32_set_robust_list 530
#define __NR_x32_get_robust_list 531
#define __NR_x32_vmsplice 532
#define __NR_x32_move_pages 533
#define __NR_x32_preadv 534
#define __NR_x32_pwritev 535
#define __NR_x32_rt_tgsigqueueinfo 536
#define __NR_x32_recvmmsg 537
#define __NR_x32_sendmmsg 538
#define __NR_x32_process_vm_readv 539
#define __NR_x32_process_vm_writev 540
#endif /* _ASM_X86_UNISTD_64_X32_H */
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CUSTOMPROXY_H
#define CUSTOMPROXY_H
#include <QtCore/qtimeline.h>
#include <QtGui/qgraphicsproxywidget.h>
class CustomProxy : public QGraphicsProxyWidget
{
Q_OBJECT
public:
CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
QRectF boundingRect() const;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private slots:
void updateStep(qreal step);
void stateChanged(QTimeLine::State);
void zoomIn();
void zoomOut();
private:
QTimeLine *timeLine;
bool popupShown;
QGraphicsItem *currentPopup;
};
#endif
|
#pragma once
#ifndef MFD_CLOEXEC
#define MFD_CLOEXEC 0x0001U
#define MFD_ALLOW_SEALING 0x0002U
#define MFD_HUGETLB 0x0004U
#endif
// FIXME: Keep all this here until glibc supports it.
#ifndef SYS_memfd_create
#ifdef __x86_64__
#define SYS_memfd_create 319
#endif
#ifdef __i386__
#define SYS_memfd_create 356
#endif
#ifdef __sparc__
#define SYS_memfd_create 348
#endif
#ifdef __ia64__
#define SYS_memfd_create 1340
#endif
#endif
|
/*
* Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TestRunnerUtils_h
#define TestRunnerUtils_h
#include "JSCJSValue.h"
namespace JSC {
class CodeBlock;
class FunctionExecutable;
JS_EXPORT_PRIVATE FunctionExecutable* getExecutableForFunction(JSValue theFunctionValue);
JS_EXPORT_PRIVATE CodeBlock* getSomeBaselineCodeBlockForFunction(JSValue theFunctionValue);
JS_EXPORT_PRIVATE JSValue numberOfDFGCompiles(JSValue function);
JS_EXPORT_PRIVATE JSValue setNeverInline(JSValue function);
JS_EXPORT_PRIVATE JSValue setNeverOptimize(JSValue function);
JS_EXPORT_PRIVATE JSValue optimizeNextInvocation(JSValue function);
JS_EXPORT_PRIVATE JSValue failNextNewCodeBlock(ExecState*);
JS_EXPORT_PRIVATE JSValue numberOfDFGCompiles(ExecState*);
JS_EXPORT_PRIVATE JSValue setNeverInline(ExecState*);
JS_EXPORT_PRIVATE JSValue setNeverOptimize(ExecState*);
JS_EXPORT_PRIVATE JSValue optimizeNextInvocation(ExecState*);
JS_EXPORT_PRIVATE unsigned numberOfExceptionFuzzChecks();
JS_EXPORT_PRIVATE unsigned numberOfExecutableAllocationFuzzChecks();
JS_EXPORT_PRIVATE unsigned numberOfStaticOSRExitFuzzChecks();
JS_EXPORT_PRIVATE unsigned numberOfOSRExitFuzzChecks();
} // namespace JSC
#endif // TestRunnerUtils_h
|
#ifndef LIB_RTEMS_NFS_CLIENT_H
#define LIB_RTEMS_NFS_CLIENT_H
/* public interface to the NFS client library for RTEMS */
/* Author: Till Straumann <strauman@slac.stanford.edu> 2002-2003 */
/*
* Authorship
* ----------
* This software (NFS-2 client implementation for RTEMS) was created by
* Till Straumann <strauman@slac.stanford.edu>, 2002-2007,
* Stanford Linear Accelerator Center, Stanford University.
*
* Acknowledgement of sponsorship
* ------------------------------
* The NFS-2 client implementation for RTEMS was produced by
* the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy.
*
* Government disclaimer of liability
* ----------------------------------
* Neither the United States nor the United States Department of Energy,
* nor any of their employees, makes any warranty, express or implied, or
* assumes any legal liability or responsibility for the accuracy,
* completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned
* rights.
*
* Stanford disclaimer of liability
* --------------------------------
* Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software.
*
* Stanford disclaimer of copyright
* --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction.
*
* Maintenance of notices
* ----------------------
* In the interest of clarity regarding the origin and status of this
* SLAC software, this and all the preceding Stanford University notices
* are to remain affixed to any copy or derivative of this software made
* or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or
* derivative of this software.
*
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/libio_.h>
#include <rtems/seterr.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/stat.h>
#include <dirent.h>
#include <netdb.h>
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef __cplusplus
extern "C" {
#endif
/* RPCIO driver interface.
* If you need RPCIO for other purposes than NFS
* you may want to include <rpcio.h>
#include "rpcio.h"
*/
/* Priority of daemon; may be setup prior to calling rpcUdpInit();
* otherwise the network task priority from the rtems_bsdnet_config
* is used...
*/
extern rtems_task_priority rpciodPriority;
/* Initialize the driver.
*
* Note, called in nfsfs initialise when mount is called.
*
* RETURNS: 0 on success, -1 on failure
*/
int
rpcUdpInit(void);
/* Cleanup/Stop
*
* RETURNS: 0 on success, nonzero if still in use
*/
int
rpcUdpCleanup(void);
/* NFS driver interface */
/* Initialize the NFS driver.
*
* NOTE: The RPCIO driver must have been initialized prior to
* calling this.
*
* Note, called in nfsfs initialise when mount is called with defaults.
*
* ARGS: depth of the small and big
* transaction pools, i.e. how
* many transactions (buffers)
* should always be kept around.
*
* (If more transactions are needed,
* they are created and destroyed
* on the fly).
*
* Supply zero values to have the
* driver chose reasonable defaults.
*/
void
nfsInit(int smallPoolDepth, int bigPoolDepth);
/* Driver cleanup code
*
* RETURNS: 0 on success, nonzero if still in use
*/
int
nfsCleanup(void);
/* Dump a list of the currently mounted NFS to a file
* (stdout is used in case f==NULL)
*/
int
nfsMountsShow(FILE *f);
/*
* Filesystem mount table mount handler. Do not call, use the mount call.
*/
int
rtems_nfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data);
/* A utility routine to find the path leading to a
* rtems_filesystem_location_info_t node.
*
* This should really be present in libcsupport...
*
* INPUT: 'loc' and a buffer 'buf' (length 'len') to hold the
* path.
* OUTPUT: path copied into 'buf'
*
* RETURNS: 0 on success, RTEMS error code on error.
*/
rtems_status_code
rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_info_t *loc);
/* Set the timeout (initial default: 10s) for NFS and mount calls.
*
* RETURNS 0 on success, nonzero if the requested timeout is less than
* a clock tick or if the system clock rate cannot be determined.
*/
int
nfsSetTimeout(uint32_t timeout_ms);
/* Read current timeout (in milliseconds) */
uint32_t
nfsGetTimeout(void);
#ifdef __cplusplus
}
#endif
#endif
|
/* packet-dcerpc-update.c
*
* Routines for dcerpc upserv dissection
* Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
* This information is based off the released idl files from opengroup.
* ftp://ftp.opengroup.org/pub/dce122/dce/src/file.tar.gz file/update/update.idl
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include "packet-dcerpc.h"
#include "packet-dcerpc-dce122.h"
void proto_register_dce_update(void);
void proto_reg_handoff_dce_update(void);
static int proto_dce_update = -1;
static int hf_dce_update_opnum = -1;
static gint ett_dce_update = -1;
static e_uuid_t uuid_dce_update =
{ 0x4d37f2dd, 0xed43, 0x0000, {0x02, 0xc0, 0x37, 0xcf, 0x1e, 0x00, 0x10,
0x00}
};
static guint16 ver_dce_update = 4;
static dcerpc_sub_dissector dce_update_dissectors[] = {
{0, "UPDATE_GetServerInterfaces", NULL, NULL},
{1, "UPDATE_FetchInfo", NULL, NULL},
{2, "UPDATE_FetchFile", NULL, NULL},
{3, "UPDATE_FetchObjectInfo", NULL, NULL},
{0, NULL, NULL, NULL},
};
void
proto_register_dce_update (void)
{
static hf_register_info hf[] = {
{&hf_dce_update_opnum,
{"Operation", "dce_update.opnum", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL}}
};
static gint *ett[] = {
&ett_dce_update,
};
proto_dce_update =
proto_register_protocol ("DCE/RPC UpServer", "dce_update", "dce_update");
proto_register_field_array (proto_dce_update, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
}
void
proto_reg_handoff_dce_update (void)
{
/* Register the protocol as dcerpc */
dcerpc_init_uuid (proto_dce_update, ett_dce_update, &uuid_dce_update,
ver_dce_update, dce_update_dissectors,
hf_dce_update_opnum);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
|
#ifndef __BUFFER_H__
#define __BUFFER_H__
/****************************************************************************
(c) CSR plc 2007
All rights reserved
FILE: buffer.h - message buffers
REVISION: $Revision: #2 $
DESCRIPTION:
************************************************************************/
#include "sched/sched.h"
#include "sched/types.h"
#include "bluetooth.h"
#include "hci.h"
#ifdef __cplusplus
extern "C" {
#endif
/* A buffer handle. 1 or 2 of these are attached to a buffer. */
typedef uint16_t bufhandle;
/* bufhandle zero is never used. The value zero signals "no handle". */
#define NO_BUFHANDLE (0)
/* Opaque structures */
typedef struct MSGSET MSGSET;
/****************************************************************************
MSGSTART - a message delimiter
*/
typedef struct msgstart {
struct msgstart *next; /* next in linked list */
uint16_t start;
} MSGSTART;
/****************************************************************************
BUFFER - a unidirectional data buffer.
*/
typedef struct BUFFER {
bufhandle wrh; /* write */
bufhandle rdh; /* read */
uint16_t index; /* valid data high mark */
uint16_t outdex; /* where to read from next */
uint16_t tail; /* buffer deleted under here */
MSGSET *msgset; /* message delimiters */
uint8_t *theBuffer; /* pmalloc'ed memory */
uint16_t bufSize; /* the allocated buffer size */
} BUFFER;
/****************************************************************************
MSGFRAG - a message fragment
*/
typedef struct MSGFRAG {
BUFFER *b; /* The buffer that holds the frag. */
uint16_t start; /* Buffer index of frag start. */
uint16_t len; /* Length of frag. */
bool_t msg_start; /* Is frag first in a message? */
} MSGFRAG;
/****************************************************************************
NAME
buf_get_size - how many bytes are stored in a buffer
RETURNS
An estimate of the number of bytes currently stored in the buffer
"b", or zero if b is invalid.
*/
extern uint16_t buf_get_size( BUFFER *b );
/****************************************************************************
NAME
buf_map_msgfrag - make msgfrag legible from cpu addr space
RETURNS
Pointer to start of the fragment in 8 bit wide memory or NULL if
something went wrong.
*/
extern uint8_t *buf_map_msgfrag(MSGFRAG *msgfrag);
/****************************************************************************
NAME
buf_clear_msgfrag_out_of_order - clear msgfrag, not necc the head
*/
extern void buf_clear_msgfrag_out_of_order( MSGFRAG *msgfrag ) ;
#include "hostio.h"
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef SVO_RELOCALIZATION_E2_ALIGN_SE3_H_D1I8XULS
#define SVO_RELOCALIZATION_E2_ALIGN_SE3_H_D1I8XULS
#include <Eigen/Core>
#include <vikit/nlls_solver.h>
#include <vikit/abstract_camera.h>
#include <sophus/se2.h>
#include <sophus/so3.h>
namespace reloc
{
class SE2toSE3 : public vk::NLLSSolver <3,Sophus::SE3>
{
public:
SE2toSE3 (const Sophus::SE2& SE2_model, vk::AbstractCamera *camera_model);
virtual ~SE2toSE3 () {};
protected:
virtual double
computeResiduals (
const Sophus::SE3& model,
bool linearize_system,
bool compute_weight_scale = false);
virtual int
solve();
virtual void
update(const Sophus::SE3& old_model, Sophus::SE3& new_model);
private:
vk::AbstractCamera *camera_model_;
Eigen::Vector2d px_trans_ [2]; //! pixel points with SE2 transform
Eigen::Vector3d uv_ [2]; //! px points on image plane coordinates (no transforma)
};
} /* reloc */
#endif /* end of include guard: SVO_RELOCALIZATION_E2_ALIGN_SE3_H_D1I8XULS */
|
/* Defines for NAND Flash Translation Layer */
/* (c) 1999 Machine Vision Holdings, Inc. */
/* Author: David Woodhouse <dwmw2@mvhi.com> */
/* $Id: nftl.h,v 1.1.1.1 2004/06/19 05:02:52 ashieh Exp $ */
#ifndef __MTD_NFTL_H__
#define __MTD_NFTL_H__
#ifndef __BOOT__
#include <linux/mtd/mtd.h>
#endif
/* Block Control Information */
struct nftl_bci {
unsigned char ECCSig[6];
__u8 Status;
__u8 Status1;
}__attribute__((packed));
/* Unit Control Information */
struct nftl_uci0 {
__u16 VirtUnitNum;
__u16 ReplUnitNum;
__u16 SpareVirtUnitNum;
__u16 SpareReplUnitNum;
} __attribute__((packed));
struct nftl_uci1 {
__u32 WearInfo;
__u16 EraseMark;
__u16 EraseMark1;
} __attribute__((packed));
struct nftl_uci2 {
__u16 FoldMark;
__u16 FoldMark1;
__u32 unused;
} __attribute__((packed));
union nftl_uci {
struct nftl_uci0 a;
struct nftl_uci1 b;
struct nftl_uci2 c;
};
struct nftl_oob {
struct nftl_bci b;
union nftl_uci u;
};
/* NFTL Media Header */
struct NFTLMediaHeader {
char DataOrgID[6];
__u16 NumEraseUnits;
__u16 FirstPhysicalEUN;
__u32 FormattedSize;
unsigned char UnitSizeFactor;
} __attribute__((packed));
#define MAX_ERASE_ZONES (8192 - 512)
#define ERASE_MARK 0x3c69
#define SECTOR_FREE 0xff
#define SECTOR_USED 0x55
#define SECTOR_IGNORE 0x11
#define SECTOR_DELETED 0x00
#define FOLD_MARK_IN_PROGRESS 0x5555
#define ZONE_GOOD 0xff
#define ZONE_BAD_ORIGINAL 0
#define ZONE_BAD_MARKED 7
#ifdef __KERNEL__
/* these info are used in ReplUnitTable */
#define BLOCK_NIL 0xffff /* last block of a chain */
#define BLOCK_FREE 0xfffe /* free block */
#define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */
#define BLOCK_RESERVED 0xfffc /* bios block or bad block */
struct NFTLrecord {
struct mtd_info *mtd;
struct semaphore mutex;
__u16 MediaUnit, SpareMediaUnit;
__u32 EraseSize;
struct NFTLMediaHeader MediaHdr;
int usecount;
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
__u16 numvunits;
__u16 lastEUN; /* should be suppressed */
__u16 numfreeEUNs;
__u16 LastFreeEUN; /* To speed up finding a free EUN */
__u32 nr_sects;
int head,sect,cyl;
__u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */
__u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */
unsigned int nb_blocks; /* number of physical blocks */
unsigned int nb_boot_blocks; /* number of blocks used by the bios */
struct erase_info instr;
};
int NFTL_mount(struct NFTLrecord *s);
int NFTL_formatblock(struct NFTLrecord *s, int block);
#ifndef NFTL_MAJOR
#define NFTL_MAJOR 93
#endif
#define MAX_NFTLS 16
#define MAX_SECTORS_PER_UNIT 32
#define NFTL_PARTN_BITS 4
#endif /* __KERNEL__ */
#endif /* __MTD_NFTL_H__ */
|
#include "config.h"
#include <stdlib.h>
#include <assert.h>
#include "requiem.h"
static void test_criteria(idmef_message_t *idmef, const char *criteria_str, int expect_create, int expect_match)
{
idmef_criteria_t *criteria;
if ( expect_create < 0 ) {
assert(idmef_criteria_new_from_string(&criteria, criteria_str) < 0);
return;
} else
assert(idmef_criteria_new_from_string(&criteria, criteria_str) == 0);
assert(idmef_criteria_match(criteria, idmef) == expect_match);
idmef_criteria_destroy(criteria);
}
int main(void)
{
idmef_alert_t *alert;
idmef_message_t *idmef;
idmef_classification_t *classification;
requiem_string_t *str;
assert(requiem_string_new_ref(&str, "A") == 0);
assert(idmef_message_new(&idmef) == 0);
assert(idmef_message_new_alert(idmef, &alert) == 0);
assert(idmef_alert_new_classification(alert, &classification) == 0);
idmef_classification_set_text(classification, str);
test_criteria(idmef, "alert", 0, 1);
test_criteria(idmef, "heartbeat", 0, 0);
test_criteria(idmef, "alert || heartbeat", 0, 1);
test_criteria(idmef, "alert.classification.txt == A", -1, -1);
test_criteria(idmef, "alert.classification.text = (A || B || C || D) || heartbeat", 0, 1);
test_criteria(idmef, "(alert.classification.text == A || heartbeat", -1, -1);
requiem_string_set_ref(str, "My String");
test_criteria(idmef, "alert.classification.text != 'My String'", 0, 0);
test_criteria(idmef, "alert.classification.text != 'random'", 0, 1);
test_criteria(idmef, "alert.classification.text == 'My String'", 0, 1);
test_criteria(idmef, "alert.classification.text <> 'My'", 0, 1);
test_criteria(idmef, "alert.classification.text <> 'my'", 0, 0);
test_criteria(idmef, "alert.classification.text <>* 'my'", 0, 1);
test_criteria(idmef, "alert.classification.text ~ 'My String'", 0, 1);
test_criteria(idmef, "alert.classification.text ~ 'My (String|Check)'", 0, 1);
test_criteria(idmef, "alert.classification.text ~ 'my'", 0, 0);
test_criteria(idmef, "alert.classification.text ~* 'my'", 0, 1);
exit(0);
}
|
#ifndef SAMPGDK_PLUGIN_H
#define SAMPGDK_PLUGIN_H
#pragma once
#include <sampgdk/config.h>
#include <sampgdk/amx.h>
#include <sampgdk/core.h>
#include <sampgdk/sdk/plugin.h>
#endif /* !SAMPGDK_PLUGIN_H */
|
load kernelc-compiled-demo
load kernelc-syntax
kmod KERNELC-MONTE-CARLO is including KERNELC-SYNTAX
macro pMonteCarlo =
#include <stdio.h>
#include <stdlib.h>
int nrand(int n) {
return random()%n;
}
int find(int* a, int n, int x, int k) {
int i = 0; int p;
while (i++<k) {
if (a[p=nrand(n)]==x) return p;
}
return -1;
}
int main() {
int s; int n; int k; int x;
scanf("%d",&s);
srandom(s);
scanf("%d",&n);
scanf("%d",&k);
scanf("%d",&x);
int *a = (int*)malloc(n*sizeof(int));
int i=0;
while (i<n) { scanf("%d",a+i++); }
if (find(a,n,x,k)!=-1) { printf("%d;", 1); } else { printf("%d;", 0); }
return 0;
}
syntax Pgm ::= pMonteCarlo
syntax Id ::= a | n | s | x | k | i | p | nrand | find
endkm
|
#ifndef _ASM_POWERPC_PIXAD_XML_H
#define _ASM_POWERPC_PIXAD_XML_H
/*
* IBM Power Edge of Network (PowerEN)
*
* Copyright 2010-2011 Massimiliano Meneghin, IBM Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, 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.
*/
#include <linux/ioctl.h>
#include <linux/types.h>
#define PIXAD_IOC_TYPE 0xf2
#define PIXAD_IOCTL_GET_VF_INFO _IOR(PIXAD_IOC_TYPE, 1, \
struct pixad_vf_info)
#define PIXAD_IOCTL_MMAP_IMQ _IOWR(PIXAD_IOC_TYPE, 2, \
struct pixad_map_info)
#define PIXAD_IOCTL_MMAP_QPOOL _IOWR(PIXAD_IOC_TYPE, 3, \
struct pixad_map_info)
#define PIXAD_IOCTL_MMAP_MMIO _IO(PIXAD_IOC_TYPE, 4)
#define PIXAD_IOCTL_GET_IMQ_MAX_INDEX _IOR(PIXAD_IOC_TYPE, 7, __u32)
#define PIXAD_IOCTL_GET_IMQ_VALID_BIT _IOR(PIXAD_IOC_TYPE, 8, __u32)
#define PIXAD_IOCTL_GET_IMQ_READ_INDEX _IOR(PIXAD_IOC_TYPE, 9, __u32)
#define PIXAD_IOCTL_SET_IMQ_READ_INDEX _IOW(PIXAD_IOC_TYPE, 10, __u32)
#define PIXAD_IOCTL_MMAP_TAKEDOWN_MPOOL _IOWR(PIXAD_IOC_TYPE, 11, \
struct pixad_map_info)
#define PIXAD_IOCTL_RESET_SESSION_ID _IOW(PIXAD_IOC_TYPE, 12, __u32)
#define PIXAD_IOCTL_SET_ACTIVE_QPOOL_ID _IOW(PIXAD_IOC_TYPE, 13, __u32)
struct pixad_map_info {
__u32 size;
__u64 offset;
};
struct pixad_vf_info {
__u32 vf_id;
__u32 type;
};
#endif /* _ASM_POWERPC_PIXAD_XML_H */
|
/*
This file is part of KOrganizer.
Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.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.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KORG_KDATENAVIGATOR_H
#define KORG_KDATENAVIGATOR_H
#include <QFrame>
#include <KCalCore/IncidenceBase> //for DateList typedef
#include <Akonadi/Calendar/ETMCalendar>
class KODayMatrix;
class NavigatorBar;
namespace Akonadi {
class Item;
}
class QLabel;
class KDateNavigator: public QFrame
{
Q_OBJECT
public:
explicit KDateNavigator( QWidget *parent = 0 );
~KDateNavigator();
/**
Associate date navigator with a calendar. It is used by KODayMatrix.
*/
void setCalendar( const Akonadi::ETMCalendar::Ptr & );
void setBaseDate( const QDate & );
KCalCore::DateList selectedDates() const
{
return mSelectedDates;
}
QSizePolicy sizePolicy () const;
NavigatorBar *navigatorBar() const
{
return mNavigatorBar;
}
QDate startDate() const;
QDate endDate() const;
void setHighlightMode( bool highlightEvents,
bool highlightTodos,
bool highlightJournals ) const;
/**
Returns the current displayed month.
It's a QDate instead of uint so it can be easily feed to KCalendarSystem's
functions.
*/
QDate month() const;
public slots:
void selectDates( const KCalCore::DateList & );
void selectPreviousMonth();
void selectNextMonth();
void updateView();
void updateConfig();
void updateDayMatrix();
void updateToday();
void setUpdateNeeded();
signals:
void datesSelected( const KCalCore::DateList & );
void incidenceDropped( const Akonadi::Item &, const QDate & );
void incidenceDroppedMove( const Akonadi::Item &, const QDate & );
void newEventSignal( const QDate & );
void newTodoSignal( const QDate & );
void newJournalSignal( const QDate & );
void weekClicked( const QDate &week, const QDate &month );
void goPrevious();
void goNext();
void nextMonthClicked();
void prevMonthClicked();
void nextYearClicked();
void prevYearClicked();
void monthSelected( int month );
void yearSelected( int year );
protected:
void updateDates();
void wheelEvent( QWheelEvent * );
bool eventFilter( QObject *, QEvent * );
void setShowWeekNums( bool enabled );
private:
void selectMonthHelper( int monthDifference );
NavigatorBar *mNavigatorBar;
QLabel *mHeadings[ 7 ];
QLabel *mWeeknos[ 7 ];
KODayMatrix *mDayMatrix;
KCalCore::DateList mSelectedDates;
QDate mBaseDate;
Akonadi::ETMCalendar::Ptr mCalendar;
// Disabling copy constructor and assignment operator
KDateNavigator( const KDateNavigator & );
KDateNavigator &operator=( const KDateNavigator & );
};
#endif
|
// ítens conferidos: 1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 10[ ]
#ifndef TCFEMMIDFd8_h
#define TCFEMMIDFd8_h
/*
----------------------------------------------------------------------------
PROJETO: Anaimp
Analise de Imagens de Meios Porosos
----------------------------------------------------------------------------
Desenvolvido por: Laboratorio de Desenvolvimento de Software Cientifico e Propriedades
Termofisicas dos Materiais.
Programadores: Andre D.Bueno, Celso P.Fernandez, Fabio S.Magnani,
Liang Zirong, Paulo C. Philippi, ...
Copyright @1997: Todos os direitos reservados.
Nome deste arquivo: TCFEMMIDFd8.h
Nome da classe: TCFEMMIDFd8
Arquivos de documentacao do projeto em: path\documentacao\*.doc, path\Help
*/
// ----------------------------------------------------------------------------
// Bibliotecas
// ----------------------------------------------------------------------------
#include <AnaliseImagem/Filtro/FEspacial/FEMorfologiaMatematica/TCFEMMIDFdj.h>
// ----------------------------------------------------------------------------
// Classe: TCFEMMIDFd8
// ----------------------------------------------------------------------------
/**
* @brief Matriz IDF de uma imagem usando mascara de chanfro d8.
*/
template<typename T>
class TCFEMMIDFd8 : public TCFEMMIDFdj<T>
{
public:
/// Construtor
TCFEMMIDFd8 (TCMatriz2D<T> * &matriz, int _indice=1, int _fundo=0)
: TCFEMMIDFdj<T> (matriz, 1, 1, _indice, _fundo) {
}
/// Destrutor
virtual ~ TCFEMMIDFd8 () {
}
/// Corrige o erro físico que ocorre (em configurações de equilíbrio) na rotulagem da imagem após a operação de abertura.
virtual void CorrigeAbertura ( TCMatriz2D<T> * &matriz, int ®iao );
};
#include "AnaliseImagem/Filtro/FEspacial/FEMorfologiaMatematica/TCFEMMIDFd8.cpp"
#endif // TCFEMMIDFd8_h
|
#pragma once
#include <Nena\Math.h>
#include <Nena\DirectXTypes.h>
#include "__DbgOut.h"
namespace Demo
{
struct Camera
{
::Nena::Matrix View;
::Nena::Matrix Projection;
::Nena::Vector3 FocusPosition;
::Nena::Vector3 EyeDisplacement;
::FLOAT FieldOfView;
::FLOAT AspectRatio;
::FLOAT NearPlane;
::FLOAT FarPlane;
Demo::Camera::Camera()
{
EyeDisplacement.z = -10.f;
//FocusPosition.y = 2.0f;
FieldOfView = ::Nena::XM_PIDIV4;
AspectRatio = 1.3333f;
NearPlane = 0.010f;
FarPlane = 100.00f;
UpdateView({ 0, 0 }, 0);
UpdateProjection();
}
void Demo::Camera::UpdateView(
::Nena::Vector2 delta,
::FLOAT zoom
)
{
static ::Nena::Vector3 up = { 0.f, 1.f, 0.f }, eye, displacement;
static ::Nena::Quaternion pitchQ, yawQ;
static ::FLOAT pitchA, yawA;
delta *= 0.005f;
zoom *= 0.005f;
pitchA += delta.y;
yawA += delta.x;
pitchQ.w = ::cosf(pitchA * .50f);
pitchQ.x = ::sin(pitchA * .50f);
yawQ.w = ::cosf(yawA *.50f);
yawQ.y = ::sin(yawA *.50f);
EyeDisplacement.z += zoom;
displacement = ::Nena::XMVector3Rotate(
::Nena::XMVector3Rotate(
EyeDisplacement, pitchQ
),
yawQ
);
eye = FocusPosition + displacement;
View = ::Nena::XMMatrixLookAtLH(
eye, FocusPosition, up
);
/*Framework::Output(
"Demo::Camera::UpdateView() >> pitch %f yaw %f\n",
pitchA, yawA
);
Framework::Output(
"Demo::Camera::UpdateView() >> eye %f %f %f\n",
eye.x, eye.y, eye.z
);*/
}
void Demo::Camera::UpdateProjection(
)
{
Projection = ::Nena::XMMatrixPerspectiveFovLH(
FieldOfView, AspectRatio, NearPlane, FarPlane
);
}
};
} |
/*
* Copyright (C) 2009 Martin Willi
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "ha_kernel.h"
typedef u_int32_t u32;
typedef u_int8_t u8;
#include <linux/jhash.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define CLUSTERIP_DIR "/proc/net/ipt_CLUSTERIP"
typedef struct private_ha_kernel_t private_ha_kernel_t;
/**
* Private data of an ha_kernel_t object.
*/
struct private_ha_kernel_t {
/**
* Public ha_kernel_t interface.
*/
ha_kernel_t public;
/**
* Init value for jhash
*/
u_int initval;
/**
* Total number of ClusterIP segments
*/
u_int count;
};
/**
* Implementation of ha_kernel_t.in_segment
*/
static bool in_segment(private_ha_kernel_t *this, host_t *host, u_int segment)
{
if (host->get_family(host) == AF_INET)
{
unsigned long hash;
u_int32_t addr;
addr = *(u_int32_t*)host->get_address(host).ptr;
hash = jhash_1word(ntohl(addr), this->initval);
if ((((u_int64_t)hash * this->count) >> 32) + 1 == segment)
{
return TRUE;
}
}
return FALSE;
}
/**
* Activate/Deactivate a segment for a given clusterip file
*/
static void enable_disable(private_ha_kernel_t *this, u_int segment,
char *file, bool enable)
{
char cmd[8];
int fd;
snprintf(cmd, sizeof(cmd), "%c%d\n", enable ? '+' : '-', segment);
fd = open(file, O_WRONLY);
if (fd == -1)
{
DBG1(DBG_CFG, "opening CLUSTERIP file '%s' failed: %s",
file, strerror(errno));
return;
}
if (write(fd, cmd, strlen(cmd) == -1))
{
DBG1(DBG_CFG, "writing to CLUSTERIP file '%s' failed: %s",
file, strerror(errno));
}
close(fd);
}
/**
* Get the currenlty active segments in the kernel for a clusterip file
*/
static segment_mask_t get_active(private_ha_kernel_t *this, char *file)
{
char buf[256];
segment_mask_t mask = 0;
ssize_t len;
int fd;
fd = open(file, O_RDONLY);
if (fd == -1)
{
DBG1(DBG_CFG, "opening CLUSTERIP file '%s' failed: %s",
file, strerror(errno));
return 0;
}
len = read(fd, buf, sizeof(buf)-1);
if (len == -1)
{
DBG1(DBG_CFG, "reading from CLUSTERIP file '%s' failed: %s",
file, strerror(errno));
}
else
{
enumerator_t *enumerator;
u_int segment;
char *token;
buf[len] = '\0';
enumerator = enumerator_create_token(buf, ",", " ");
while (enumerator->enumerate(enumerator, &token))
{
segment = atoi(token);
if (segment)
{
mask |= SEGMENTS_BIT(segment);
}
}
enumerator->destroy(enumerator);
}
return mask;
}
/**
* Implementation of ha_kernel_t.activate
*/
static void activate(private_ha_kernel_t *this, u_int segment)
{
enumerator_t *enumerator;
char *file;
enumerator = enumerator_create_directory(CLUSTERIP_DIR);
while (enumerator->enumerate(enumerator, NULL, &file, NULL))
{
enable_disable(this, segment, file, TRUE);
}
enumerator->destroy(enumerator);
}
/**
* Implementation of ha_kernel_t.deactivate
*/
static void deactivate(private_ha_kernel_t *this, u_int segment)
{
enumerator_t *enumerator;
char *file;
enumerator = enumerator_create_directory(CLUSTERIP_DIR);
while (enumerator->enumerate(enumerator, NULL, &file, NULL))
{
enable_disable(this, segment, file, FALSE);
}
enumerator->destroy(enumerator);
}
/**
* Disable all not-yet disabled segments on all clusterip addresses
*/
static void disable_all(private_ha_kernel_t *this)
{
enumerator_t *enumerator;
segment_mask_t active;
char *file;
int i;
enumerator = enumerator_create_directory(CLUSTERIP_DIR);
while (enumerator->enumerate(enumerator, NULL, &file, NULL))
{
active = get_active(this, file);
for (i = 1; i <= this->count; i++)
{
if (active & SEGMENTS_BIT(i))
{
enable_disable(this, i, file, FALSE);
}
}
}
enumerator->destroy(enumerator);
}
/**
* Implementation of ha_kernel_t.destroy.
*/
static void destroy(private_ha_kernel_t *this)
{
free(this);
}
/**
* See header
*/
ha_kernel_t *ha_kernel_create(u_int count)
{
private_ha_kernel_t *this = malloc_thing(private_ha_kernel_t);
this->public.in_segment = (bool(*)(ha_kernel_t*, host_t *host, u_int segment))in_segment;
this->public.activate = (void(*)(ha_kernel_t*, u_int segment))activate;
this->public.deactivate = (void(*)(ha_kernel_t*, u_int segment))deactivate;
this->public.destroy = (void(*)(ha_kernel_t*))destroy;
this->initval = 0;
this->count = count;
disable_all(this);
return &this->public;
}
|
/*
* This file is part of the flashrom project.
*
* Copyright (C) 2011 Carl-Daniel Hailfinger
*
* 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.
*/
/* Datasheet: http://download.intel.com/design/network/datashts/82559_Fast_Ethernet_Multifunction_PCI_Cardbus_Controller_Datasheet.pdf */
#include <stdlib.h>
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "hwaccess_physmap.h"
#include "platform/pci.h"
static uint8_t *nicintel_bar;
static uint8_t *nicintel_control_bar;
static const struct dev_entry nics_intel[] = {
{PCI_VENDOR_ID_INTEL, 0x1209, NT, "Intel", "8255xER/82551IT Fast Ethernet Controller"},
{PCI_VENDOR_ID_INTEL, 0x1229, OK, "Intel", "82557/8/9/0/1 Ethernet Pro 100"},
{0},
};
/* Arbitrary limit, taken from the datasheet I just had lying around.
* 128 kByte on the 82559 device. Or not. Depends on whom you ask.
*/
#define NICINTEL_MEMMAP_SIZE (128 * 1024)
#define NICINTEL_MEMMAP_MASK (NICINTEL_MEMMAP_SIZE - 1)
#define NICINTEL_CONTROL_MEMMAP_SIZE 0x10
#define CSR_FCR 0x0c
static void nicintel_chip_writeb(const struct flashctx *flash, uint8_t val,
chipaddr addr)
{
pci_mmio_writeb(val, nicintel_bar + (addr & NICINTEL_MEMMAP_MASK));
}
static uint8_t nicintel_chip_readb(const struct flashctx *flash,
const chipaddr addr)
{
return pci_mmio_readb(nicintel_bar + (addr & NICINTEL_MEMMAP_MASK));
}
static const struct par_master par_master_nicintel = {
.chip_readb = nicintel_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
.chip_readn = fallback_chip_readn,
.chip_writeb = nicintel_chip_writeb,
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
};
static int nicintel_init(void)
{
struct pci_dev *dev = NULL;
uintptr_t addr;
/* FIXME: BAR2 is not available if the device uses the CardBus function. */
dev = pcidev_init(nics_intel, PCI_BASE_ADDRESS_2);
if (!dev)
return 1;
addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_2);
if (!addr)
return 1;
nicintel_bar = rphysmap("Intel NIC flash", addr, NICINTEL_MEMMAP_SIZE);
if (nicintel_bar == ERROR_PTR)
return 1;
addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
if (!addr)
return 1;
nicintel_control_bar = rphysmap("Intel NIC control/status reg", addr, NICINTEL_CONTROL_MEMMAP_SIZE);
if (nicintel_control_bar == ERROR_PTR)
return 1;
/* FIXME: This register is pretty undocumented in all publicly available
* documentation from Intel. Let me quote the complete info we have:
* "Flash Control Register: The Flash Control register allows the CPU to
* enable writes to an external Flash. The Flash Control Register is a
* 32-bit field that allows access to an external Flash device."
* Ah yes, we also know where it is, but we have absolutely _no_ idea
* what we should do with it. Write 0x0001 because we have nothing
* better to do with our time.
*/
pci_rmmio_writew(0x0001, nicintel_control_bar + CSR_FCR);
max_rom_decode.parallel = NICINTEL_MEMMAP_SIZE;
return register_par_master(&par_master_nicintel, BUS_PARALLEL, NULL);
}
const struct programmer_entry programmer_nicintel = {
.name = "nicintel",
.type = PCI,
.devs.dev = nics_intel,
.init = nicintel_init,
.map_flash_region = fallback_map,
.unmap_flash_region = fallback_unmap,
.delay = internal_delay,
};
|
/* Copyright Rudolf Koenig, 2008.
Released under the GPL Licence, Version 2
Inpired by the MyUSB USBtoSerial demo, Copyright (C) Dean Camera, 2008.
*/
#include <avr/boot.h>
#include <avr/power.h>
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/wdt.h>
#include <string.h>
#include "board.h"
#include "spi.h"
#include "cc1100.h"
#include "clock.h"
#include "delay.h"
#include "display.h"
#include "serial.h"
#include "fncollection.h"
#include "led.h"
#include "ringbuffer.h"
#include "rf_receive.h"
#include "rf_send.h"
#include "ttydata.h"
#include "fht.h"
#include "fastrf.h"
#include "rf_router.h"
#include "memory.h"
#ifdef HAS_MEMFN
#include "memory.h"
#endif
#ifdef HAS_INTERTECHNO
#include "intertechno.h"
#endif
#ifdef HAS_ASKSIN
#include "rf_asksin.h"
#endif
#ifdef HAS_MORITZ
#include "rf_moritz.h"
#endif
#ifdef HAS_RWE
#include "rf_rwe.h"
#endif
const PROGMEM t_fntab fntab[] = {
{ 'B', prepare_boot },
{ 'C', ccreg },
{ 'F', fs20send },
#ifdef HAS_INTERTECHNO
{ 'i', it_func },
#endif
#ifdef HAS_ASKSIN
{ 'A', asksin_func },
#endif
#ifdef HAS_MORITZ
{ 'Z', moritz_func },
#endif
#ifdef HAS_RWE
{ 'E', rwe_func },
#endif
#ifdef HAS_RAWSEND
{ 'G', rawsend },
{ 'M', em_send },
#endif
{ 'R', read_eeprom },
{ 'T', fhtsend },
{ 'V', version },
{ 'W', write_eeprom },
{ 'X', set_txreport },
{ 'e', eeprom_factory_reset },
#ifdef HAS_FASTRF
{ 'f', fastrf_func },
#endif
#ifdef HAS_MEMFN
{ 'm', getfreemem },
#endif
{ 't', gettime },
#ifdef HAS_RF_ROUTER
{ 'u', rf_router_func },
#endif
{ 'x', ccsetpa },
{ 0, 0 },
};
int
main(void)
{
wdt_disable();
led_init();
spi_init();
// eeprom_factory_reset("xx");
eeprom_init();
// Setup the timers. Are needed for watchdog-reset
OCR0A = 249; // Timer0: 0.008s = 8MHz/256/250 == 125Hz
TCCR0B = _BV(CS02);
TCCR0A = _BV(WGM01);
TIMSK0 = _BV(OCIE0A);
TCCR1A = 0;
TCCR1B = _BV(CS11) | _BV(WGM12); // Timer1: 1us = 8MHz/8
clock_prescale_set(clock_div_1);
MCUSR &= ~(1 << WDRF); // Enable the watchdog
wdt_enable(WDTO_2S);
uart_init( UART_BAUD_SELECT_DOUBLE_SPEED(UART_BAUD_RATE,F_CPU) );
fht_init();
tx_init();
input_handle_func = analyze_ttydata;
display_channel = DISPLAY_USB;
#ifdef HAS_RF_ROUTER
rf_router_init();
display_channel |= DISPLAY_RFROUTER;
#endif
sei();
for(;;) {
uart_task();
RfAnalyze_Task();
Minute_Task();
#ifdef HAS_FASTRF
FastRF_Task();
#endif
#ifdef HAS_RF_ROUTER
rf_router_task();
#endif
#ifdef HAS_ASKSIN
rf_asksin_task();
#endif
#ifdef HAS_MORITZ
rf_moritz_task();
#endif
#ifdef HAS_RWE
rf_rwe_task();
#endif
}
}
|
/*
* Copyright (C) 2014 Sergey Krukowski <softsr@yahoo.de>
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file subsystems/gps/gps_sim_hitl.c
* GPS subsystem simulation from rotorcrafts horizontal/vertical reference system
*/
#include "subsystems/gps.h"
#include "subsystems/abi.h"
#include "state.h"
#include "guidance/guidance_h.h"
#include "guidance/guidance_v.h"
bool_t gps_available;
uint32_t gps_sim_hitl_timer;
void gps_impl_init(void)
{
gps.fix = GPS_FIX_NONE;
}
void gps_sim_hitl_event(void)
{
if (SysTimeTimer(gps_sim_hitl_timer) > 100000)
{
SysTimeTimerStart(gps_sim_hitl_timer);
gps.last_msg_ticks = sys_time.nb_sec_rem;
gps.last_msg_time = sys_time.nb_sec;
if (state.ned_initialized_i)
{
if (!autopilot_in_flight)
{
struct Int32Vect2 zero_vector;
INT_VECT2_ZERO(zero_vector);
gh_set_ref(zero_vector, zero_vector, zero_vector);
INT_VECT2_ZERO(guidance_h_pos_ref);
INT_VECT2_ZERO(guidance_h_speed_ref);
INT_VECT2_ZERO(guidance_h_accel_ref);
gv_set_ref(0, 0, 0);
guidance_v_z_ref = 0;
guidance_v_zd_ref = 0;
guidance_v_zdd_ref = 0;
}
struct NedCoor_i ned_c;
ned_c.x = guidance_h_pos_ref.x * INT32_POS_OF_CM_DEN / INT32_POS_OF_CM_NUM;
ned_c.y = guidance_h_pos_ref.y * INT32_POS_OF_CM_DEN / INT32_POS_OF_CM_NUM;
ned_c.z = guidance_v_z_ref * INT32_POS_OF_CM_DEN / INT32_POS_OF_CM_NUM;
ecef_of_ned_point_i(&gps.ecef_pos, &state.ned_origin_i, &ned_c);
gps.lla_pos.alt = state.ned_origin_i.lla.alt - ned_c.z;
gps.hmsl = state.ned_origin_i.hmsl - ned_c.z;
ned_c.x = guidance_h_speed_ref.x * INT32_SPEED_OF_CM_S_DEN / INT32_SPEED_OF_CM_S_NUM;
ned_c.y = guidance_h_speed_ref.y * INT32_SPEED_OF_CM_S_DEN / INT32_SPEED_OF_CM_S_NUM;
ned_c.z = guidance_v_zd_ref * INT32_SPEED_OF_CM_S_DEN / INT32_SPEED_OF_CM_S_NUM;
ecef_of_ned_vect_i(&gps.ecef_vel, &state.ned_origin_i, &ned_c);
gps.fix = GPS_FIX_3D;
gps.last_3dfix_ticks = sys_time.nb_sec_rem;
gps.last_3dfix_time = sys_time.nb_sec;
gps_available = TRUE;
}
else
{
struct Int32Vect2 zero_vector;
INT_VECT2_ZERO(zero_vector);
gh_set_ref(zero_vector, zero_vector, zero_vector);
gv_set_ref(0, 0, 0);
}
// publish gps data
uint32_t now_ts = get_sys_time_usec();
gps.last_msg_ticks = sys_time.nb_sec_rem;
gps.last_msg_time = sys_time.nb_sec;
if (gps.fix == GPS_FIX_3D)
{
gps.last_3dfix_ticks = sys_time.nb_sec_rem;
gps.last_3dfix_time = sys_time.nb_sec;
}
AbiSendMsgGPS(GPS_SIM_ID, now_ts, &gps);
}
}
|
// 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 BASE_WIN_ENUM_VARIANT_H_
#define BASE_WIN_ENUM_VARIANT_H_
#include <unknwn.h>
#include "base/memory/scoped_ptr.h"
#include "base/win/iunknown_impl.h"
namespace base {
namespace win {
class BASE_EXPORT EnumVariant
: public IEnumVARIANT,
public IUnknownImpl {
public:
explicit EnumVariant(unsigned long count);
VARIANT* ItemAt(unsigned long index);
ULONG STDMETHODCALLTYPE AddRef() OVERRIDE;
ULONG STDMETHODCALLTYPE Release() OVERRIDE;
STDMETHODIMP QueryInterface(REFIID riid, void** ppv) OVERRIDE;
STDMETHODIMP Next(ULONG requested_count,
VARIANT* out_elements,
ULONG* out_elements_received);
STDMETHODIMP Skip(ULONG skip_count);
STDMETHODIMP Reset();
STDMETHODIMP Clone(IEnumVARIANT** out_cloned_object);
private:
~EnumVariant();
scoped_ptr<VARIANT[]> items_;
unsigned long count_;
unsigned long current_index_;
};
}
}
#endif
|
//=============================================================================
//
// Adventure Game Studio (AGS)
//
// Copyright (C) 1999-2011 Chris Jones and 2011-20xx others
// The full list of copyright holders can be found in the Copyright.txt
// file, which is part of this source code distribution.
//
// The AGS source code is provided under the Artistic License 2.0.
// A copy of this license can be found in the file License.txt and at
// http://www.opensource.org/licenses/artistic-license-2.0.php
//
//=============================================================================
//
// Implementations for missing libc functions
//
//=============================================================================
#include "ags/shared/core/platform.h"
#if ! AGS_PLATFORM_OS_WINDOWS
//include <string.h>
//include <stdio.h>
//include <stdlib.h>
//include <wchar.h>
//include <ctype.h>
size_t mbstowcs(wchar_t *wcstr, const char *mbstr, size_t max)
{
int count = 0;
while ((count < max) && (*mbstr != 0))
{
*wcstr++ = *mbstr++;
count++;
}
return count;
}
size_t wcstombs(char* mbstr, const wchar_t *wcstr, size_t max)
{
int count = 0;
while ((count < max) && (*wcstr != 0))
{
*mbstr++ = *wcstr++;
count++;
}
return count;
}
#endif // ! AGS_PLATFORM_OS_WINDOWS
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "chord/logger/clog.h"
#include "chord/logger/color.h"
#include "chord/logger/file.h"
#include "clog_internal.h"
static int default_level_colors[] = {
FG_PURPLE|MOD_INTENSE_FG, FG_CYAN|MOD_INTENSE_FG, FG_GREEN|MOD_INTENSE_FG, FG_YELLOW|MOD_INTENSE_FG, FG_RED|MOD_INTENSE_FG, FG_WHITE|BG_RED
};
logger_ctx_t *logger_ctx_new_file(const char *name, int min_level, FILE *file)
{
logger_ctx_t *l = malloc(sizeof(logger_ctx_t));
if (logger_ctx_init(l, name, min_level, file, (start_msg_func)start_file_msg,
(printf_func)vfprintf, (write_func)write_file, (end_msg_func)end_file_msg))
return NULL;
return l;
}
int start_file_msg(logger_ctx_t *l, const char *file, int line, const char *func, int level)
{
FILE *fp = (FILE *)l->data;
int color = level >= CLOG_LOG_LEVEL_TRACE && level <= CLOG_LOG_LEVEL_FATAL ? default_level_colors[level] : 0;
start_color(fp, color|ATTR_BOLD);
#ifdef LOG_BRACKET_LEADER
char leader[level+1];
memset(leader, '>', level);
leader[level] = '\0';
fprintf(fp, "%s> ", leader);
#endif
int written = 0;
struct timespec diff_time;
if (clog_time_offset(&diff_time))
written += fprintf(fp, "[<unkwn>] ");
else
written += fprintf(fp, "[%3lu.%.3lu] ", diff_time.tv_sec, diff_time.tv_nsec);
const char *context = clog_get_event_context();
if (context[0] != '\0')
written += fprintf(fp, "<%s> ", context);
/*if (l->name[0] != '\0')
written += fprintf(fp, "{%s} ", l->name);*/
written += fprintf(fp, "(%s) %s@%d: ", func, BASENAME(file), line);
if (written > 0)
written += fprintf(fp, "%*s", -75 + written, "");
default_color(fp);
start_color(fp, color);
return written;
}
ssize_t write_file(FILE *file, const char *buf, size_t size)
{
return fwrite(buf, 1, size, file);
}
int end_file_msg(logger_ctx_t *l)
{
FILE *fp = (FILE *)l->data;
default_color(fp);
int ret = fwrite("\n", 1, 1, fp) != 1;
ret |= fflush(fp);
return ret;
}
ssize_t logger_call_write(logger_ctx_t *l, const char *buf, size_t size)
{
if (l->log_partial)
return l->write(l->data, buf, size);
else
return size;
}
|
/************************************************************
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Hewlett-Packard not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
/***********************************************************************
*
* Function to return the dont-propagate-list for an extension device.
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structs */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "exglobals.h"
#include "swaprep.h"
#include "getprop.h"
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
/***********************************************************************
*
* Handle a request from a client with a different byte order.
*
*/
int
SProcXGetDeviceDontPropagateList(ClientPtr client)
{
REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client));
}
/***********************************************************************
*
* This procedure lists the input devices available to the server.
*
*/
int
ProcXGetDeviceDontPropagateList(ClientPtr client)
{
CARD16 count = 0;
int i, rc;
XEventClass *buf = NULL, *tbuf;
WindowPtr pWin;
xGetDeviceDontPropagateListReply rep;
OtherInputMasks *others;
REQUEST(xGetDeviceDontPropagateListReq);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
rep.repType = X_Reply;
rep.RepType = X_GetDeviceDontPropagateList;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.count = 0;
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if ((others = wOtherInputMasks(pWin)) != 0) {
for (i = 0; i < EMASKSIZE; i++)
ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT);
if (count) {
rep.count = count;
buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass));
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
tbuf = buf;
for (i = 0; i < EMASKSIZE; i++)
tbuf = ClassFromMask(tbuf, others->dontPropagateMask[i], i,
NULL, CREATE);
}
}
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf);
free(buf);
}
return Success;
}
/***********************************************************************
*
* This procedure gets a list of event classes from a mask word.
* A single mask may translate to more than one event class.
*
*/
XEventClass
* ClassFromMask(XEventClass * buf, Mask mask, int maskndx, CARD16 *count,
int mode)
{
int i, j;
int id = maskndx;
Mask tmask = 0x80000000;
for (i = 0; i < 32; i++, tmask >>= 1)
if (tmask & mask) {
for (j = 0; j < ExtEventIndex; j++)
if (EventInfo[j].mask == tmask) {
if (mode == COUNT)
(*count)++;
else
*buf++ = (id << 8) | EventInfo[j].type;
}
}
return buf;
}
/***********************************************************************
*
* This procedure writes the reply for the XGetDeviceDontPropagateList function,
* if the client and server have a different byte ordering.
*
*/
void
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->count);
WriteToClient(client, size, (char *) rep);
}
|
/*
Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
This file is part of GlusterFS.
This file is licensed to you under your choice of the GNU Lesser
General Public License, version 3 or any later version (LGPLv3 or
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
#include <stdint.h>
#include <stdlib.h>
#include "hashfn.h"
#define get16bits(d) (*((const uint16_t *) (d)))
#define DM_DELTA 0x9E3779B9
#define DM_FULLROUNDS 10 /* 32 is overkill, 16 is strong crypto */
#define DM_PARTROUNDS 6 /* 6 gets complete mixing */
uint32_t
ReallySimpleHash (char *path, int len)
{
uint32_t hash = 0;
for (;len > 0; len--)
hash ^= (char)path[len];
return hash;
}
/*
This is apparently the "fastest hash function for strings".
Written by Paul Hsieh <http://www.azillionmonkeys.com/qed/hash.html>
*/
/* In any case make sure, you return 1 */
uint32_t SuperFastHash (const char * data, int32_t len) {
uint32_t hash = len, tmp;
int32_t rem;
if (len <= 1 || data == NULL) return 1;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += get16bits (data);
tmp = (get16bits (data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof (uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += get16bits (data);
hash ^= hash << 16;
hash ^= data[sizeof (uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += get16bits (data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
/* Davies-Meyer hashing function implementation
*/
static int
dm_round (int rounds, uint32_t *array, uint32_t *h0, uint32_t *h1)
{
uint32_t sum = 0;
int n = 0;
uint32_t b0 = 0;
uint32_t b1 = 0;
b0 = *h0;
b1 = *h1;
n = rounds;
do {
sum += DM_DELTA;
b0 += ((b1 << 4) + array[0])
^ (b1 + sum)
^ ((b1 >> 5) + array[1]);
b1 += ((b0 << 4) + array[2])
^ (b0 + sum)
^ ((b0 >> 5) + array[3]);
} while (--n);
*h0 += b0;
*h1 += b1;
return 0;
}
uint32_t
__pad (int len)
{
uint32_t pad = 0;
pad = (uint32_t) len | ((uint32_t) len << 8);
pad |= pad << 16;
return pad;
}
uint32_t
gf_dm_hashfn (const char *msg, int len)
{
uint32_t h0 = 0x9464a485;
uint32_t h1 = 0x542e1a94;
uint32_t array[4];
uint32_t pad = 0;
int i = 0;
int j = 0;
int full_quads = 0;
int full_words = 0;
int full_bytes = 0;
uint32_t *intmsg = NULL;
int word = 0;
intmsg = (uint32_t *) msg;
pad = __pad (len);
full_bytes = len;
full_words = len / 4;
full_quads = len / 16;
for (i = 0; i < full_quads; i++) {
for (j = 0; j < 4; j++) {
word = *intmsg;
array[j] = word;
intmsg++;
full_words--;
full_bytes -= 4;
}
dm_round (DM_PARTROUNDS, &array[0], &h0, &h1);
}
for (j = 0; j < 4; j++) {
if (full_words) {
word = *intmsg;
array[j] = word;
intmsg++;
full_words--;
full_bytes -= 4;
} else {
array[j] = pad;
while (full_bytes) {
array[j] <<= 8;
array[j] |= msg[len - full_bytes];
full_bytes--;
}
}
}
dm_round (DM_FULLROUNDS, &array[0], &h0, &h1);
return h0 ^ h1;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
pid_t pid;
pid = fork();
if(pid < 0) {
printf("fail to fork\n");
exit(1);
} else if(pid == 0) {
execl("./interp.sh", "interp", "arg1", "arg2", NULL);
_exit(0);
}
exit(0);
}
|
/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */
/* AbiWord
* Copyright (C) 1998 AbiSource, Inc.
* Copyright (C) 2009 Hubert Figuiere
*
* 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 AP_Dialog_Styles_H
#define AP_Dialog_Styles_H
#include <string>
#include <map>
#include "xap_Frame.h"
#include "xap_Dialog.h"
#include "fv_View.h"
#include "xap_Dlg_FontChooser.h"
#include "ap_Preview_Abi.h"
class XAP_Frame;
#include "xap_Preview.h"
#include "ap_Preview_Paragraph.h"
class ABI_EXPORT AP_Dialog_Styles : public XAP_Dialog_NonPersistent
{
public:
typedef std::map<std::string,std::string> PropMap;
AP_Dialog_Styles(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
virtual ~AP_Dialog_Styles(void);
virtual void runModal(XAP_Frame * pFrame) = 0;
typedef enum { a_OK, a_CANCEL } tAnswer;
AP_Dialog_Styles::tAnswer getAnswer(void) const;
// wish that this could be protected
void _tabCallback(const char *, const char *);
protected:
void event_paraPreviewUpdated (const gchar * pageLeftMargin,
const gchar * pageRightMargin,
const gchar * align,
const gchar * firstLineIndent,
const gchar * leftIndent,
const gchar * rightIndent,
const gchar * beforeSpacing,
const gchar * afterSpacing,
const gchar * lineSpacing) const;
virtual void event_charPreviewUpdated (void) const;
virtual const char * getCurrentStyle (void) const = 0;
virtual void setDescription (const char * desc) const = 0;
virtual void setModifyDescription (const char * desc) = 0;
virtual void _populatePreviews(bool isModify);
FV_View * getLView(void) const;
PD_Document * getLDoc(void) const;
void drawLocal(void);
void destroyAbiPreview(void);
void fillVecWithProps(const gchar * szStyle, bool bReplaceAttributes);
void fillVecFromCurrentPoint(void);
const gchar * getVecVal(const UT_Vector * v, const gchar * szProp) const;
void ModifyLists(void);
void ModifyFont(void);
void ModifyParagraph(void);
void ModifyTabs(void);
void ModifyLang(void);
void updateCurrentStyle(void);
bool createNewStyle(const gchar * szName);
bool applyModifiedStyleToDoc(void);
void setDoc(PD_Document * pDoc);
void setFrame(XAP_Frame * pFrame);
void setView(FV_View * pView);
FV_View * getView(void) const;
PD_Document * getDoc(void) const;
XAP_Frame * getFrame(void) const;
protected:
void _createParaPreviewFromGC(GR_Graphics * gc, UT_uint32 width, UT_uint32 height);
void _createCharPreviewFromGC(GR_Graphics * gc, UT_uint32 width, UT_uint32 height);
void _createAbiPreviewFromGC(GR_Graphics * gc, UT_uint32 width, UT_uint32 height);
void _populateAbiPreview(bool isNew);
AP_Dialog_Styles::tAnswer m_answer;
PD_Style * m_pCurStyle;
char * m_pszCurStyleName;
std::string m_curStyleDesc;
AP_Preview_Paragraph * m_pParaPreview;
XAP_Preview_FontPreview * m_pCharPreview;
AP_Preview_Abi * m_pAbiPreview;
PP_PropertyVector m_vecAllProps;
PP_PropertyVector m_vecAllAttribs;
private:
XAP_Frame * m_pFrame;
FV_View * m_pView;
PD_Document * m_pDoc;
PT_DocPosition m_posBefore;
PT_DocPosition m_posFocus;
PT_DocPosition m_posAfter;
PropMap m_mapCharProps;
std::string m_ListProps[8];
};
#endif /* AP_Dialog_Styles_H */
|
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2011 David Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef WIDGETS_GROUPBUT_H_INCLUDED
#define WIDGETS_GROUPBUT_H_INCLUDED
/* TODO use some JI_SIGNAL_USER */
#define SIGNAL_GROUP_BUTTON_CHANGE 0x10000
JWidget group_button_new (int w, int h, int first_selected, ...);
int group_button_get_selected (JWidget group);
void group_button_select (JWidget group, int index);
#endif
|
/*
* ap6xxx sdio wifi power management API
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <mach/sys_config.h>
#include <mach/gpio.h>
#include <linux/regulator/consumer.h>
#include "wifi_pm.h"
#define ap6xxx_msg(...) do {printk("[ap6xxx]: "__VA_ARGS__);} while(0)
static int ap6xxx_wl_regon = 0;
static int ap6xxx_bt_regon = 0;
static char * axp_name = NULL;
//gongpiqiang+++ for ap6210 32k clk
#include <linux/gpio.h>
#include <mach/system.h>
static void ap6xxx_config_32k_clk(void) {
unsigned int gpio_index;
unsigned int reg_addr, reg_val;
struct regulator* pm_ldo = NULL;
int ret;
pm_ldo = regulator_get(NULL, "axp22_dldo4");
if (!pm_ldo) {
ap6xxx_msg("get power regulator axp22_dldo4 failed.\n");
} else {
ret = regulator_set_voltage(pm_ldo, 3300000, 3300000);//gongpiqiang,use 3300mv
if (ret < 0) {
ap6xxx_msg("regulator_set_voltage axp22_dldo4 fail, return %d.\n", ret);
regulator_put(pm_ldo);
}
ret = regulator_enable(pm_ldo);
if (ret < 0) {
ap6xxx_msg("regulator_enable axp22_dldo4 fail, return %d.\n", ret);
regulator_put(pm_ldo);
}
regulator_put(pm_ldo);
}
gpio_index = GPIOM(7);
gpio_request(gpio_index, NULL);
sw_gpio_setpull(gpio_index, 1);
sw_gpio_setdrvlevel(gpio_index, 3);
sw_gpio_setcfg(gpio_index, 0x03);
gpio_free(gpio_index);
//enable clk
reg_addr = 0xf1f01400 + 0xf0;
reg_val = readl(reg_addr);
writel( reg_val | (1<<31), reg_addr);
}
//gongpiqiang--- for ap6210 32k clk
// power control by axp
static int ap6xxx_module_power(int onoff)
{
struct regulator* wifi_ldo = NULL;
static int first = 1;
int ret = 0;
ap6xxx_msg("ap6xxx module power set by axp.\n");
wifi_ldo = regulator_get(NULL, axp_name);
if (!wifi_ldo) {
ap6xxx_msg("get power regulator failed.\n");
return -ret;
}
if (first) {
ap6xxx_msg("first time\n");
ret = regulator_force_disable(wifi_ldo);
if (ret < 0) {
ap6xxx_msg("regulator_force_disable fail, return %d.\n", ret);
regulator_put(wifi_ldo);
return ret;
}
first = 0;
}
if (onoff) {
ap6xxx_msg("regulator on.\n");
ret = regulator_set_voltage(wifi_ldo, 3300000, 3300000);
if (ret < 0) {
ap6xxx_msg("regulator_set_voltage fail, return %d.\n", ret);
regulator_put(wifi_ldo);
return ret;
}
ret = regulator_enable(wifi_ldo);
if (ret < 0) {
ap6xxx_msg("regulator_enable fail, return %d.\n", ret);
regulator_put(wifi_ldo);
return ret;
}
} else {
ap6xxx_msg("regulator off.\n");
ret = regulator_disable(wifi_ldo);
if (ret < 0) {
ap6xxx_msg("regulator_disable fail, return %d.\n", ret);
regulator_put(wifi_ldo);
return ret;
}
}
regulator_put(wifi_ldo);
return ret;
}
static int ap6xxx_gpio_ctrl(char* name, int level)
{
int i = 0;
int ret = 0;
int gpio = 0;
unsigned long flags = 0;
char * gpio_name[2] = {"ap6xxx_wl_regon", "ap6xxx_bt_regon"};
for (i = 0; i < 2; i++) {
if (strcmp(name, gpio_name[i]) == 0) {
switch (i)
{
case 0: /*ap6xxx_wl_regon*/
gpio = ap6xxx_wl_regon;
break;
case 1: /*ap6xxx_bt_regon*/
gpio = ap6xxx_bt_regon;
break;
default:
ap6xxx_msg("no matched gpio.\n");
}
break;
}
}
if (1==level)
flags = GPIOF_OUT_INIT_HIGH;
else
flags = GPIOF_OUT_INIT_LOW;
ret = gpio_request_one(gpio, flags, NULL);
if (ret) {
ap6xxx_msg("failed to set gpio %s to %d !\n", name, level);
return -1;
} else {
gpio_free(gpio);
ap6xxx_msg("succeed to set gpio %s to %d !\n", name, level);
}
return 0;
}
void ap6xxx_power(int mode, int *updown)
{
if (mode) {
if (*updown) {
ap6xxx_gpio_ctrl("ap6xxx_wl_regon", 1);
mdelay(200);
} else {
ap6xxx_gpio_ctrl("ap6xxx_wl_regon", 0);
mdelay(100);
}
ap6xxx_msg("sdio wifi power state: %s\n", *updown ? "on" : "off");
}
return;
}
void ap6xxx_gpio_init(void)
{
script_item_u val;
script_item_value_type_e type;
struct wifi_pm_ops *ops = &wifi_select_pm_ops;
type = script_get_item(wifi_para, "wifi_power", &val);
if (SCIRPT_ITEM_VALUE_TYPE_STR != type) {
ap6xxx_msg("failed to fetch wifi_power\n");
return;
}
axp_name = val.str;
ap6xxx_msg("module power name %s\n", axp_name);
type = script_get_item(wifi_para, "ap6xxx_wl_regon", &val);
if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type)
ap6xxx_msg("get ap6xxx ap6xxx_wl_regon gpio failed\n");
else
ap6xxx_wl_regon = val.gpio.gpio;
type = script_get_item(wifi_para, "ap6xxx_bt_regon", &val);
if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type)
ap6xxx_msg("get ap6xxx ap6xxx_bt_regon gpio failed\n");
else
ap6xxx_bt_regon = val.gpio.gpio;
ops->gpio_ctrl = ap6xxx_gpio_ctrl;
ops->power = ap6xxx_power;
ap6xxx_module_power(1);
//gongpiqiang+++
val.val = 0;
type = script_get_item(wifi_para, "ap6xxx_bt_clk_src", &val);
if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
ap6xxx_msg("failed to fetch ap6xxx_bt_clk_src configuration!\n");
return;
}
if (val.val) {
ap6xxx_config_32k_clk();
ap6xxx_msg("ap6xxx_bt_clk_src use PM07\n");
} else {
ap6xxx_msg("ap6xxx_bt_clk_src use external\n");
}
//gongpiqiang---
}
|
/*
* Copyright (C) 1999-2011, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (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: epivers.h.in,v 13.33 2010-09-08 22:08:53 $
*
*/
#ifndef _epivers_h_
#define _epivers_h_
#define EPI_MAJOR_VERSION 1
#define EPI_MINOR_VERSION 15
#define EPI_RC_NUMBER 3
#define EPI_INCREMENTAL_NUMBER 0
#define EPI_BUILD_NUMBER 0
#define EPI_VERSION 1, 15, 3, 1
#define EPI_VERSION_NUM 0x010f0301
#define EPI_VERSION_DEV 1.15.3.1
#define EPI_VERSION_STR "1.15.3.camp.1 (r315426)"
#endif /* _epivers_h_ */
|
/*****************************************************************************/
/* */
/* searchpath.h */
/* */
/* Handling of search paths */
/* */
/* */
/* */
/* (C) 2000-2013, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
/* Exports facilities to search files in a list of directories. */
#ifndef SEARCHPATH_H
#define SEARCHPATH_H
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Convert argument to C string */
#define _STRINGIZE(arg) #arg
#define STRINGIZE(arg) _STRINGIZE(arg)
/* A search path is a pointer to the list */
typedef struct Collection SearchPaths;
/*****************************************************************************/
/* Code */
/*****************************************************************************/
SearchPaths* NewSearchPath (void);
/* Create a new, empty search path list */
void AddSearchPath (SearchPaths* P, const char* NewPath);
/* Add a new search path to the end of an existing list */
void AddSearchPathFromEnv (SearchPaths* P, const char* EnvVar);
/* Add a search path from an environment variable to the end of an existing
** list.
*/
void AddSubSearchPathFromEnv (SearchPaths* P, const char* EnvVar, const char* SubDir);
/* Add a search path from an environment variable, adding a subdirectory to
** the environment variable value.
*/
void AddSubSearchPathFromWinBin (SearchPaths* P, const char* SubDir);
/* Windows only:
** Add a search path from the running binary, adding a subdirectory to
** the parent directory of the directory containing the binary.
*/
int PushSearchPath (SearchPaths* P, const char* NewPath);
/* Add a new search path to the head of an existing search path list, provided
** that it's not already there. If the path is already at the first position,
** return zero, otherwise return a non zero value.
*/
void PopSearchPath (SearchPaths* P);
/* Remove a search path from the head of an existing search path list */
char* GetSearchPath (SearchPaths* P, unsigned Index);
/* Return the search path at the given index, if the index is valid, return an
** empty string otherwise.
*/
char* SearchFile (const SearchPaths* P, const char* File);
/* Search for a file in a list of directories. Return a pointer to a malloced
** area that contains the complete path, if found, return 0 otherwise.
*/
/* End of searchpath.h */
#endif
|
/* KDevelop CMake Support
*
* Copyright 2006-2007 Aleix Pol <aleixpol@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.
*/
#ifndef CMAKEBUILDER_H
#define CMAKEBUILDER_H
#include <interfaces/iplugin.h>
#include <QtCore/QList>
#include <QtCore/QVariant>
#include <QtCore/QPair>
#include <QtCore/QSet>
#include <KUrl>
#include <project/interfaces/iprojectbuilder.h>
class QStringList;
class QSignalMapper;
class KDialog;
namespace KDevelop{
class ProjectBaseItem;
class CommandExecutor;
class OutputModel;
}
/**
* @author Aleix Pol
*/
class CMakeBuilder : public KDevelop::IPlugin, public KDevelop::IProjectBuilder
{
Q_OBJECT
Q_INTERFACES( KDevelop::IProjectBuilder )
public:
explicit CMakeBuilder(QObject *parent = 0, const QVariantList &args = QVariantList());
virtual ~CMakeBuilder();
virtual KJob* build(KDevelop::ProjectBaseItem *dom);
virtual KJob* install(KDevelop::ProjectBaseItem *dom);
virtual KJob* clean(KDevelop::ProjectBaseItem *dom);
virtual KJob* configure(KDevelop::IProject*);
virtual KJob* prune(KDevelop::IProject*);
virtual QList< KDevelop::IProjectBuilder* > additionalBuilderPlugins( KDevelop::IProject* project ) const;
// bool updateConfig( KDevelop::IProject* project );
private Q_SLOTS:
void buildFinished(KDevelop::ProjectBaseItem*);
Q_SIGNALS:
void built(KDevelop::ProjectBaseItem*);
void failed(KDevelop::ProjectBaseItem*);
void installed(KDevelop::ProjectBaseItem*);
void cleaned(KDevelop::ProjectBaseItem*);
void pruned(KDevelop::IProject*);
private:
void addBuilder(const QString& neededfile, const QStringList& generator, KDevelop::IPlugin* i);
KDevelop::IProjectBuilder* builderForProject(KDevelop::IProject* p) const;
QMap<QString, KDevelop::IProjectBuilder*> m_builders;
QSet<KDevelop::ProjectBaseItem*> m_deleteWhenDone;
QMap<QString, IProjectBuilder*> m_buildersForGenerator;
};
#endif // CMAKEBUILDER_H
|
/*-------------------------------------------------------------------------
Compiler Generator Coco/R,
Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz
extended by M. Loeberbauer & A. Woess, Univ. of Linz
ported to C++ by Csaba Balazs, University of Szeged
with improvements by Pat Terry, Rhodes University
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As an exception, it is allowed to write an extension of Coco/R that is
used as a plugin in non-free software.
If not otherwise stated, any source code generated by Coco/R (other than
Coco/R itself) does not fall under the GNU General Public License.
-------------------------------------------------------------------------*/
#if !defined(COCO_SETS_H__)
#define COCO_SETS_H__
#include "BitArray.h"
namespace Coco {
class Sets {
public:
static int First(BitArray *s) {
int max = s->getCount();
for (int i=0; i<max; i++)
if ((*s)[i]) return i;
return -1;
}
static int Elements(BitArray *s) {
int max = s->getCount();
int n = 0;
for (int i=0; i<max; i++)
if ((*s)[i]) n++;
return n;
}
static bool Equals(BitArray *a, BitArray *b) {
int max = a->getCount();
for (int i=0; i<max; i++)
if ((*a)[i] != (*b)[i]) return false;
return true;
}
static bool Includes(BitArray *a, BitArray *b) { // a > b ?
int max = a->getCount();
for (int i=0; i<max; i++)
if ((*b)[i] && ! (*a)[i]) return false;
return true;
}
static bool Intersect(BitArray *a, BitArray *b) { // a * b != {}
int max = a->getCount();
for (int i=0; i<max; i++)
if ((*a)[i] && (*b)[i]) return true;
return false;
}
static void Subtract(BitArray *a, BitArray *b) { // a = a - b
BitArray *c = b->Clone();
c->Not();
a->And(c);
delete c;
}
};
}; // namespace
#endif // !defined(COCO_SETS_H__)
|
/*
* ST40STB1/ST40RA Setup
*
* Copyright (C) 2007 STMicroelectronics Limited
* Author: Stuart Menefy <stuart.menefy@st.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/serial.h>
#include <linux/io.h>
#include <asm/sci.h>
static struct resource rtc_resources[] = {
[0] = {
.start = 0xffc80000,
.end = 0xffc80000 + 0x58 - 1,
.flags = IORESOURCE_IO,
},
[1] = {
/* Period IRQ */
.start = 21,
.flags = IORESOURCE_IRQ,
},
[2] = {
/* Carry IRQ */
.start = 22,
.flags = IORESOURCE_IRQ,
},
[3] = {
/* Alarm IRQ */
.start = 20,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device rtc_device = {
.name = "sh-rtc",
.id = -1,
.num_resources = ARRAY_SIZE(rtc_resources),
.resource = rtc_resources,
};
static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 23, 24, 26, 25 },
}, {
.mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 40, 41, 43, 42 },
}, {
.flags = 0,
}
};
static struct platform_device sci_device = {
.name = "sh-sci",
.id = -1,
.dev = {
.platform_data = sci_platform_data,
},
};
static struct platform_device *st40ra_devices[] __initdata = {
&rtc_device,
&sci_device,
};
static int __init st40ra_devices_setup(void)
{
return platform_add_devices(st40ra_devices,
ARRAY_SIZE(st40ra_devices));
}
__initcall(st40ra_devices_setup);
enum {
UNUSED = 0,
/* interrupt sources */
IRL0, IRL1, IRL2, IRL3, /* only IRLM mode described here */
HUDI,
TMU0, TMU1, TMU2_TUNI, TMU2_TICPI,
RTC_ATI, RTC_PRI, RTC_CUI,
SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI,
WDT,
PCI_SERR, PCI_ERR, PCI_AD, PCI_PWR_DWN,
DMA0, DMA1, DMA2, DMA3, DMA4, DMA_ERR,
PIO0, PIO1, PIO2,
/* interrupt groups */
TMU2, RTC, SCIF1, SCIF2, PCI, DMAC, PIO,
};
static struct intc_vect vectors[] = {
INTC_VECT(HUDI, 0x600),
INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
INTC_VECT(TMU2_TUNI, 0x440), INTC_VECT(TMU2_TICPI, 0x460),
INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0),
INTC_VECT(RTC_CUI, 0x4c0),
INTC_VECT(SCIF1_ERI, 0x4e0), INTC_VECT(SCIF1_RXI, 0x500),
INTC_VECT(SCIF1_BRI, 0x520), INTC_VECT(SCIF1_TXI, 0x540),
INTC_VECT(SCIF2_ERI, 0x700), INTC_VECT(SCIF2_RXI, 0x720),
INTC_VECT(SCIF2_BRI, 0x740), INTC_VECT(SCIF2_TXI, 0x760),
INTC_VECT(WDT, 0x560),
INTC_VECT(PCI_SERR, 0xa00), INTC_VECT(PCI_ERR, 0xa20),
INTC_VECT(PCI_AD, 0xa40), INTC_VECT(PCI_PWR_DWN, 0xa60),
INTC_VECT(DMA0, 0xb00), INTC_VECT(DMA1, 0xb20),
INTC_VECT(DMA1, 0xb40), INTC_VECT(DMA2, 0xb60),
INTC_VECT(DMA4, 0xb80), INTC_VECT(DMA_ERR, 0xbc0),
INTC_VECT(PIO0, 0xc00), INTC_VECT(PIO1, 0xc80),
INTC_VECT(PIO2, 0xd00),
};
static struct intc_group groups[] = {
INTC_GROUP(TMU2, TMU2_TUNI, TMU2_TICPI),
INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI),
INTC_GROUP(PCI, PCI_ERR, PCI_AD, PCI_PWR_DWN),
INTC_GROUP(DMAC, DMA0, DMA1, DMA1, DMA2, DMA4, DMA_ERR),
INTC_GROUP(PIO, PIO0, PIO1, PIO2),
};
static struct intc_prio priorities[] = {
INTC_PRIO(SCIF1, 3),
INTC_PRIO(SCIF2, 3),
INTC_PRIO(DMAC, 7),
};
static struct intc_prio_reg prio_registers[] = {
{ 0xffd00004, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } },
{ 0xffd00008, 0, 16, 4, /* IPRB */ { WDT, 0, SCIF1, 0 } },
{ 0xffd0000c, 0, 16, 4, /* IPRC */ { 0, 0, SCIF2, HUDI } },
{ 0xffd00010, 0, 16, 4, /* IPRD */ { IRL0, IRL1, IRL2, IRL3 } },
{ 0xfe080000, 0, 32, 4, /* INTPRI00 */ { 0, 0, PIO2, PIO1,
PIO0, DMAC, PCI, PCI_SERR } },
};
static struct intc_mask_reg mask_registers[] = {
{ 0xfe080040, 0xfe080060, 32, /* INTMSK00 / INTMSKCLR00 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 31..16 */
0, PIO2, PIO1, PIO0, /* 15..12 */
DMA_ERR, 0, DMA4, DMA3, /* 11...8 */
DMA2, DMA1, DMA0, 0, /* 7...4 */
PCI_PWR_DWN, PCI_AD, PCI_ERR, PCI_SERR } } /* 3...0 */
};
static DECLARE_INTC_DESC(intc_desc, "st40ra", vectors, groups,
priorities, mask_registers, prio_registers, NULL);
static struct intc_vect vectors_irlm[] = {
INTC_VECT(IRL0, 0x240), INTC_VECT(IRL1, 0x2a0),
INTC_VECT(IRL2, 0x300), INTC_VECT(IRL3, 0x360),
};
static DECLARE_INTC_DESC(intc_desc_irlm, "st40ra_irlm", vectors_irlm, NULL,
priorities, NULL, prio_registers, NULL);
void __init plat_irq_setup(void)
{
register_intc_controller(&intc_desc);
}
#define INTC_ICR 0xffd00000UL
#define INTC_ICR_IRLM (1<<7)
/* enable individual interrupt mode for external interupts */
void __init plat_irq_setup_pins(int mode)
{
switch (mode) {
case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */
register_intc_controller(&intc_desc_irlm);
ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
break;
default:
BUG();
}
}
|
/*
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRINITYSERVER_PACKET_BUILDER_H
#define TRINITYSERVER_PACKET_BUILDER_H
class ByteBuffer;
class WorldPacket;
namespace Movement
{
class MoveSpline;
class PacketBuilder
{
static void WriteCommonMonsterMovePart(const MoveSpline& mov, WorldPacket& data);
public:
static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data);
static void WriteCreate(const MoveSpline& mov, ByteBuffer& data);
};
}
#endif // TRINITYSERVER_PACKET_BUILDER_H
|
/**
* Siphon SIP-VoIP for iPhone and iPod Touch
* Copyright (C) 2008-2010 Samuel <samuelv0304@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.
*/
#ifndef __SIPHON_CONSTANTS_H__
#define __SIPHON_CONSTANTS_H__
extern NSString *kAccountType;
extern NSString *kSIPAccount;
extern NSString *kSIPCallState;
extern NSString *kSIPRegState;
extern NSString *kSIPMwiInfo;
#endif /* __SIPHON_CONSTANTS_H__ */
|
/*
alignlib - a library for aligning protein sequences
$Id: alignlib.h,v 1.5 2005/02/24 11:07:25 aheger Exp $
Copyright (C) 2004 Andreas Heger
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.
*/
/** Interface makefile.
*
* Defines all the classes, types, interfaces and functions.
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _ALIGNLIB_H
#define _ALIGNLIB_H 1
#include "alignlib_types.h"
#include "alignlib_fwd.h"
#include "alignlib/alignlib_interfaces.h"
#include "alignlib/alignlib_functions.h"
/** @brief alignlib : a C++ library with python bindings for biological sequence analysis.
*/
namespace alignlib
{
}
#endif /* _ALIGNLIB_H */
|
/*
* ecb_at91.h - AT91RM9200 Programmer, This programmer uses AT91' GPIO lines
*
* Written 2006 by Carlos Camargo
*/
#ifndef ECB_AT91_H
#define ECB_AT91_H
typedef volatile unsigned int AT91_REG; /* Hardware register definition */
typedef struct _AT91S_PIO
{
AT91_REG PIO_PER; // PIO Enable Register
AT91_REG PIO_PDR; // PIO Disable Register
AT91_REG PIO_PSR; // PIO Status Register
AT91_REG Reserved0[1];
AT91_REG PIO_OER; // Output Enable Register
AT91_REG PIO_ODR; // Output Disable Registerr
AT91_REG PIO_OSR; // Output Status Register
AT91_REG Reserved1[1];
AT91_REG PIO_IFER; // Input Filter Enable Register
AT91_REG PIO_IFDR; // Input Filter Disable Register
AT91_REG PIO_IFSR; // Input Filter Status Register
AT91_REG Reserved2[1];
AT91_REG PIO_SODR; // Set Output Data Register
AT91_REG PIO_CODR; // Clear Output Data Register
AT91_REG PIO_ODSR; // Output Data Status Register
AT91_REG PIO_PDSR; // Pin Data Status Register
AT91_REG PIO_IER; // Interrupt Enable Register
AT91_REG PIO_IDR; // Interrupt Disable Register
AT91_REG PIO_IMR; // Interrupt Mask Register
AT91_REG PIO_ISR; // Interrupt Status Register
AT91_REG PIO_MDER; // Multi-driver Enable Register
AT91_REG PIO_MDDR; // Multi-driver Disable Register
AT91_REG PIO_MDSR; // Multi-driver Status Register
AT91_REG Reserved3[1];
AT91_REG PIO_PPUDR; // Pull-up Disable Register
AT91_REG PIO_PPUER; // Pull-up Enable Register
AT91_REG PIO_PPUSR; // Pad Pull-up Status Register
AT91_REG Reserved4[1];
AT91_REG PIO_ASR; // Select A Register
AT91_REG PIO_BSR; // Select B Register
AT91_REG PIO_ABSR; // AB Select Status Register
AT91_REG Reserved5[9];
AT91_REG PIO_OWER; // Output Write Enable Register
AT91_REG PIO_OWDR; // Output Write Disable Register
AT91_REG PIO_OWSR; // Output Write Status Register
} AT91S_PIO, *AT91PS_PIO;
#define MAP_SIZE 4096Ul
#define MAP_MASK (MAP_SIZE - 1)
#define SDATA (1 << 20)
#define SCLK (1 << 22)
#define XRES (1 << 18)
#endif
|
#ifndef TESTCHARGE_H
#define TESTCHARGE_H
#include <iostream>
#include <QtTest>
#include <string>
#include <sstream>
class TestCharge : public QObject {
Q_OBJECT
public:
TestCharge();
private:
private Q_SLOTS:
// functions executed by QtTest before and after test suite
void initTestCase();
void cleanupTestCase();
// functions executed by QtTest before and after each test
void init();
void cleanup();
// test functions - all functions prefixed with "test" will be ran as tests
// this is automatically detected thanks to Qt's meta-information about QObjects
void testChargeWithFormulaNoCompound();
void testChargeWithNoCompoundNoFormula();
void testChargeWithCompoundNoCharge();
void testChargeWithCompoundNoFormula();
void testChargeWithFormulaAndCompound();
};
#endif // TESTLOADDM_H
|
#ifndef PREPOST_H
#define PREPOST_H
#include "plugins.h"
#include <qstringlist.h>
/**
*
* Yann Hodique
**/
class PrePost : public PrePostPlugin {
Q_OBJECT
PLUGIN_OBJECT(PrePost)
public:
typedef QMap<QString,QString> AliasMap;
typedef QMap<QString,AliasMap> Map;
PrePost(PluginManagerInterface* parent);
~PrePost();
void modifiedInternalVariable(const QString& login, const QString& name, const QString& value);
QString treatIncomingMessage(const QString& from, const QString& msg);
QString treatOutgoingMessage(const QString& to, const QString& msg);
void exportCommands();
void incomingUser(const QString& login);
void outgoingUser(const QString& login);
void killedUser(const QString& login);
void renamedUser(const QString&, const QString&);
private:
Map alias;
void aliasCmd(const QString& from, const QStringList&);
void unaliasCmd(const QString& from, const QStringList&);
void realiasCmd(const QString& from, const QStringList&);
void loadAlias(const QString& login);
void storeAlias(const QString& login);
void addAlias(const QString& login, const QString& com, const QString& al);
void delAlias(const QString& login, const QString& com);
QString expandAliases(const QString& login, const QString& msg);
#ifdef _REDIRECT_
QStringList splitCommand(const QString& msg);
#endif
QMap<QString,QStringList> command_queue;
QStringList away_cache;
};
#endif
|
#ifndef _SCSI_SCSI_CMND_H
#define _SCSI_SCSI_CMND_H
#include <linux/dma-mapping.h>
#include <linux/list.h>
#include <linux/types.h>
struct request;
struct scatterlist;
struct scsi_device;
struct scsi_request;
/* embedded in scsi_cmnd */
struct scsi_pointer {
char *ptr; /* data pointer */
int this_residual; /* left in this buffer */
struct scatterlist *buffer; /* which buffer */
int buffers_residual; /* how many buffers left */
dma_addr_t dma_handle;
volatile int Status;
volatile int Message;
volatile int have_data_in;
volatile int sent_command;
volatile int phase;
};
struct scsi_cmnd {
int sc_magic;
struct scsi_device *device;
unsigned short state;
unsigned short owner;
struct scsi_request *sc_request;
struct list_head list; /* scsi_cmnd participates in queue lists */
struct list_head eh_entry; /* entry for the host eh_cmd_q */
int eh_state; /* Used for state tracking in error handlr */
int eh_eflags; /* Used by error handlr */
void (*done) (struct scsi_cmnd *); /* Mid-level done function */
/*
* A SCSI Command is assigned a nonzero serial_number when internal_cmnd
* passes it to the driver's queue command function. The serial_number
* is cleared when scsi_done is entered indicating that the command has
* been completed. If a timeout occurs, the serial number at the moment
* of timeout is copied into serial_number_at_timeout. By subsequently
* comparing the serial_number and serial_number_at_timeout fields
* during abort or reset processing, we can detect whether the command
* has already completed. This also detects cases where the command has
* completed and the SCSI Command structure has already being reused
* for another command, so that we can avoid incorrectly aborting or
* resetting the new command.
*/
unsigned long serial_number;
unsigned long serial_number_at_timeout;
int retries;
int allowed;
int timeout_per_command;
int timeout_total;
int timeout;
/*
* We handle the timeout differently if it happens when a reset,
* abort, etc are in process.
*/
unsigned volatile char internal_timeout;
unsigned char cmd_len;
unsigned char old_cmd_len;
enum dma_data_direction sc_data_direction;
enum dma_data_direction sc_old_data_direction;
/* These elements define the operation we are about to perform */
#define MAX_COMMAND_SIZE 16
unsigned char cmnd[MAX_COMMAND_SIZE];
unsigned request_bufflen; /* Actual request size */
struct timer_list eh_timeout; /* Used to time out the command. */
void *request_buffer; /* Actual requested buffer */
/* These elements define the operation we ultimately want to perform */
unsigned char data_cmnd[MAX_COMMAND_SIZE];
unsigned short old_use_sg; /* We save use_sg here when requesting
* sense info */
unsigned short use_sg; /* Number of pieces of scatter-gather */
unsigned short sglist_len; /* size of malloc'd scatter-gather list */
unsigned short abort_reason; /* If the mid-level code requests an
* abort, this is the reason. */
unsigned bufflen; /* Size of data buffer */
void *buffer; /* Data buffer */
unsigned underflow; /* Return error if less than
this amount is transferred */
unsigned old_underflow; /* save underflow here when reusing the
* command for error handling */
unsigned transfersize; /* How much we are guaranteed to
transfer with each SCSI transfer
(ie, between disconnect /
reconnects. Probably == sector
size */
int resid; /* Number of bytes requested to be
transferred less actual number
transferred (0 if not supported) */
struct request *request; /* The command we are
working on */
#define SCSI_SENSE_BUFFERSIZE 96
unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; /* obtained by REQUEST SENSE
* when CHECK CONDITION is
* received on original command
* (auto-sense) */
/* Low-level done function - can be used by low-level driver to point
* to completion function. Not used by mid/upper level code. */
void (*scsi_done) (struct scsi_cmnd *);
/*
* The following fields can be written to by the host specific code.
* Everything else should be left alone.
*/
struct scsi_pointer SCp; /* Scratchpad used by some host adapters */
unsigned char *host_scribble; /* The host adapter is allowed to
* call scsi_malloc and get some memory
* and hang it here. The host adapter
* is also expected to call scsi_free
* to release this memory. (The memory
* obtained by scsi_malloc is guaranteed
* to be at an address < 16Mb). */
int result; /* Status code from lower level driver */
unsigned char tag; /* SCSI-II queued command tag */
unsigned long pid; /* Process ID, starts at 0 */
};
/*
* These are the values that scsi_cmd->state can take.
*/
#define SCSI_STATE_TIMEOUT 0x1000
#define SCSI_STATE_FINISHED 0x1001
#define SCSI_STATE_FAILED 0x1002
#define SCSI_STATE_QUEUED 0x1003
#define SCSI_STATE_UNUSED 0x1006
#define SCSI_STATE_DISCONNECTING 0x1008
#define SCSI_STATE_INITIALIZING 0x1009
#define SCSI_STATE_BHQUEUE 0x100a
#define SCSI_STATE_MLQUEUE 0x100b
extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, int);
extern void scsi_put_command(struct scsi_cmnd *);
extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
extern void scsi_finish_command(struct scsi_cmnd *cmd);
extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
#endif /* _SCSI_SCSI_CMND_H */
|
/*
Copyright (C) 2013- The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef RMONITOR_POLL_INTERNAL_H
#define RMONITOR_POLL_INTERNAL_H
#include "itable.h"
#include "hash_table.h"
#include "rmonitor_types.h"
#if defined(CCTOOLS_OPSYS_DARWIN) || defined(CCTOOLS_OPSYS_FREEBSD)
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/resource.h>
#else
#include <sys/vfs.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAS_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef HAS_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif
#include "int_sizes.h"
#include "rmonitor_types.h"
#include "rmsummary.h"
#include "rmonitor_poll.h"
void rmonitor_poll_all_processes_once(struct itable *processes, struct rmonitor_process_info *acc);
void rmonitor_poll_all_wds_once( struct hash_table *wdirs, struct rmonitor_wdir_info *acc, int max_time_for_measurement);
void rmonitor_poll_all_fss_once( struct itable *filesysms, struct rmonitor_filesys_info *acc);
int rmonitor_poll_process_once(struct rmonitor_process_info *p);
int rmonitor_poll_wd_once( struct rmonitor_wdir_info *d, int max_time_for_measurement);
int rmonitor_poll_fs_once( struct rmonitor_filesys_info *f);
int rmonitor_poll_maps_once( struct itable *processes, struct rmonitor_mem_info *mem);
void rmonitor_info_to_rmsummary(struct rmsummary *tr, struct rmonitor_process_info *p, struct rmonitor_wdir_info *d, struct rmonitor_filesys_info *f, uint64_t start_time);
int rmonitor_get_cpu_time_usage(pid_t pid, struct rmonitor_cpu_time_info *cpu);
int rmonitor_get_mem_usage( pid_t pid, struct rmonitor_mem_info *mem);
int rmonitor_get_sys_io_usage( pid_t pid, struct rmonitor_io_info *io);
int rmonitor_get_map_io_usage( pid_t pid, struct rmonitor_io_info *io);
int rmonitor_get_dsk_usage( const char *path, struct statfs *disk);
int rmonitor_get_wd_usage(struct rmonitor_wdir_info *d, int max_time_for_measurement);
void acc_cpu_time_usage( struct rmonitor_cpu_time_info *acc, struct rmonitor_cpu_time_info *other);
void acc_mem_usage( struct rmonitor_mem_info *acc, struct rmonitor_mem_info *other);
void acc_sys_io_usage( struct rmonitor_io_info *acc, struct rmonitor_io_info *other);
void acc_map_io_usage( struct rmonitor_io_info *acc, struct rmonitor_io_info *other);
void acc_dsk_usage( struct statfs *acc, struct statfs *other);
void acc_wd_usage( struct rmonitor_wdir_info *acc, struct rmonitor_wdir_info *other);
FILE *open_proc_file(pid_t pid, char *filename);
int get_int_attribute(FILE *fstatus, char *attribute, uint64_t *value, int rewind_flag);
uint64_t usecs_since_epoch();
#endif
|
/*
File: AppDelegate.h
Abstract: Main app controller.
Version: 1.1
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
@import UIKit;
@interface AppDelegate : NSObject
@end
|
/*
Skype Call Recorder
Copyright 2008-2010, 2013, 2015 by jlh (jlh at gmx 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, 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, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The GNU General Public License version 2 is included with the source of
this program under the file name COPYING. You can also get a copy on
http://www.fsf.org/
*/
#ifndef TRAYICON_H
#define TRAYICON_H
#include <QSystemTrayIcon>
#include <QPointer>
#include <QMap>
#include "common.h"
class QAction;
class QMenu;
class QSignalMapper;
class MainWindow;
class TrayIcon : public QSystemTrayIcon {
Q_OBJECT
public:
TrayIcon(QObject *);
~TrayIcon();
signals:
void requestQuit();
void requestAbout();
void requestWebsite();
void requestOpenPreferences();
void requestBrowseCalls();
signals:
void startRecording(int);
void stopRecordingAndDelete(int);
void stopRecording(int);
public slots:
void setColor(bool);
void startedCall(int, const QString &);
void stoppedCall(int);
void startedRecording(int);
void stoppedRecording(int);
private slots:
void checkTrayPresence();
void setWindowedMode();
void createMainWindow();
void activate();
private:
void updateToolTip();
private:
struct CallData {
QString skypeName;
bool isRecording;
QMenu *menu;
QAction *startAction;
QAction *stopAction;
QAction *stopAndDeleteAction;
};
typedef QMap<int, CallData> CallMap;
private:
QMenu *menu;
QMenu *aboutMenu;
QAction *separator;
CallMap callMap;
QSignalMapper *smStart;
QSignalMapper *smStop;
QSignalMapper *smStopAndDelete;
QPointer<MainWindow> window;
bool colored;
DISABLE_COPY_AND_ASSIGNMENT(TrayIcon);
};
#endif
|
/*
FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. *
* *
* Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation *
* *
* Thank you! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS 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 >>!AND MODIFIED BY!<< the FreeRTOS exception.
>>! NOTE: The modification to the GPL is included to allow you to distribute
>>! a combined work that includes FreeRTOS without being obliged to provide
>>! the source code for proprietary components outside of the FreeRTOS
>>! kernel.
FreeRTOS 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. Full license text is available from the following
link: http://www.freertos.org/a00114.html
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24000 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
#define configQUEUE_REGISTRY_SIZE 10
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define configKERNEL_INTERRUPT_PRIORITY ( 0x0f << 4 ) /* Priority 15, or 255 as only the top four bits are implemented. This is the lowest priority. */
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( 5 << 4 ) /* Priority 5, or 80 as only the top four bits are implemented. */
#endif /* FREERTOS_CONFIG_H */
|
/*
* Copyright (C) 2010 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_
#define _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_
#include <generated/utsrelease.h>
#define BOOT_TIME_LABEL "Boot time: "
#define BOOT_KMSG_LABEL "Boot kmsg:\n"
#define BOOT_INFO_LABEL "Boot info: "
#define BOOT_MACH_LABEL "Boot mach: "
#define BOOT_FROM_LABEL "Boot from: "
#define BOOT_STAT_LABEL "Boot stat:\n"
#define BOOT_PARM_LABEL "Boot parm: "
#define BOOT_CMD_LABEL "Boot cmd: "
#define RAM_CONSOLE_BOOT_INFO \
CONFIG_DEFAULT_HOSTNAME ", " \
UTS_RELEASE ", " \
CONFIG_LOCALVERSION "\n"
struct ram_console_platform_data {
const char *bootinfo;
};
#ifdef CONFIG_ANDROID_RAM_CONSOLE
extern void record_normal_reboot_reason(const char *cmd);
#else
#define record_normal_reboot_reason(cmd) do { } while(0);
#endif
#endif /* _INCLUDE_LINUX_PLATFORM_DATA_RAM_CONSOLE_H_ */
|
/*****************************************************************
Copyright (c) 2006 Stephan Kulow <coolo@novell.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#ifndef _media_watcher_
#define _media_watcher_
#include <dcopobject.h>
#include <tqobject.h>
#include <tqstringlist.h>
class MediaWatcher : public TQObject, public DCOPObject
{
Q_OBJECT
K_DCOP
TQStringList m_devices;
void updateDevices();
k_dcop:
void slotMediumAdded(TQString medium, bool a);
signals:
void mediumChanged();
public:
MediaWatcher(TQObject *parent);
TQStringList devices() const { return m_devices; }
};
#endif
|
/*
* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License 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
*
*/
#include "main.h"
#include "hash.h"
/* clears the hash */
static void hash_init(struct hashtable_t *hash)
{
int i;
for (i = 0 ; i < hash->size; i++) {
INIT_HLIST_HEAD(&hash->table[i]);
spin_lock_init(&hash->list_locks[i]);
}
}
/* free only the hashtable and the hash itself. */
void hash_destroy(struct hashtable_t *hash)
{
kfree(hash->list_locks);
kfree(hash->table);
kfree(hash);
}
/* allocates and clears the hash */
struct hashtable_t *hash_new(int size)
{
struct hashtable_t *hash;
hash = kmalloc(sizeof(*hash), GFP_ATOMIC);
if (!hash)
return NULL;
hash->table = kmalloc(sizeof(*hash->table) * size, GFP_ATOMIC);
if (!hash->table)
goto free_hash;
hash->list_locks = kmalloc(sizeof(*hash->list_locks) * size,
GFP_ATOMIC);
if (!hash->list_locks)
goto free_table;
hash->size = size;
hash_init(hash);
return hash;
free_table:
kfree(hash->table);
free_hash:
kfree(hash);
return NULL;
}
|
/*
* HC-05driver.h
*
* Created on: Nov 21, 2014
* Author: Christopher
*/
#ifndef HC_05DRIVER_HP_
#define HC_05DRIVER_HP_
#define MAX_NAME_LENGTH 90
#define MAX_COMMAND_INDEX 300
#include <hw_types.h>
#include <udma.h>
#include <FreeRTOS.h>
#include <queue.h>
#include "ButtonDriver.h"
typedef struct FOTON_LIVE_MESSAGE
{
unsigned char FUNC_CTRL;
unsigned char DATA1;
unsigned char DATA2;
unsigned char DATA3;
}FOTON_LIVE_MESSAGE;
enum FUNCTIONS_MAJOR
{
NONE = 0,
LED_CLEAR,
LED_SET_COLOR,
LED_SET_AT,
LED_READ
};
enum DRAW_MINOR
{
LINE = 0,
SQUARE,
CIRCLE
};
enum HC_05_PARSE_STATES
{
START = 0,
LIVE_FUNCTION_DECODE,
LIVE_DATA1,
LIVE_DATA2,
LIVE_DONE,
};
//#include "queue.h"
extern void BlueToothInterruptHandler();
enum HC_05_AT_COMMAND
{
Test = 0,
Reset,
ReqVersion,
ResetDefaultStatus,
ReqBTAddress,
ReqBTName,
SetBTName,
GetMasterName,
GetModuleRole,
SetModuleRole,
GetDeviceType,
SetDeviceType,
GetAccessCode,
SetAccessCode,
GetAMode,
SetAMode,
GetPassKey,
SetPassKey,
GetBaudRate,
SetBaudRate,
GetConnectMode,
SetConnectMode,
GetBTAddressBind,
SetBTAddressBind,
GetCStatusNotify,
SetCStatusNotify,
GetSecurityMode,
SetSecurityMode,
DeleteAuthentication,
ClearAuthenticationList,
FindAuthenticationFor,
GetAuthenticationCount,
GetMostRecentDevice,
GetCurrentStatus,
DropCurrentDevice,
EnterHibernate,
ExitEnergyMode,
GetDisconnectType
};
typedef struct BLUETOOTH_AT_REQUEST
{
unsigned short CallerID;
HC_05_AT_COMMAND CommandID;
BLUETOOTH_AT_REQUEST(unsigned short callerid, HC_05_AT_COMMAND commandid)
: CallerID(callerid), CommandID(commandid)
{}
}BLUETOOTH_AT_REQUEST;
enum HC_05_Errors
{
AT_COMMAND_ERROR = 0,
DEFAULT_RESULT = 1,
PSKEY_WRITE_ERROR = 2,
NAME_TOO_LONG_ERROR = 3,
};
class HC_05Bluetooth
{
public:
HC_05Bluetooth(unsigned char RX_pin,unsigned long RX_Mode,
unsigned char TX_pin,unsigned long TX_Mode,
unsigned char POWER_pin,unsigned long GPIO_power,
unsigned char STATE_pin,unsigned long GPIO_state);
bool getPower(){return mPoweredON;}
void configureDMATransfers(bool livemode);
void enableDMA();
void enable(void);
void disable(void);
void enterConfigureMode(void);
void enterTransferMode(void);
void sendMessage(const char * message, unsigned int length);
void processATCommandResponse(char command[], int last_index);
void setPowerOn(bool power_on = true);
void powerCycle();
// Bluetooth AT Config Commands Specific to the HC-05 bluetooth
void setATCommand(const char * command){
WaitingForResponse = true;
}
void getATCommand(char * buffer){
WaitingForResponse = true;
}
void getCommand(HC_05_AT_COMMAND command_type, unsigned short caller_id);
void setCommand(char * buffer){
WaitingForResponse = true;
}
void setLiveMode();
void setOtherMode();
void waitForModeChange(void);
/*bool testAT(){return false;}
bool resetBluetooth(){return false;}
bool requestVersion(char[] version_buffer){return false;}
bool resetToDefaultStatus(){return false;}
bool requestBluetoothAddress(){return false;}
bool requestBluetoothName(){return false;}
bool getBluetoothName(char[] name_buffer){return false;}
bool setBluetoothName(const char * name){return false;}
bool getMasterName(char[] mname_buffer){return false;}
bool getModuleRole(char[] module_role){return false;}
bool setModuleRole(const char * module_role){return false;}
bool getDeviceType(char[] device_type_buffer){return false;}
bool setDeviceType(const char * device_type){return false;}
bool setAccessCode(const char * access_code){return false;}
bool getAccessCode(char[] access_code_buffer){return false;}
bool getAMode(char[] access_mode_buffer){return false;}
bool setAMode(const char * access_mode){return false;}
bool getPassKey(char[] pass_key_buffer){return false;}
bool setPassKey(const char * pass_key){return false;}
GetBaudRate,
SetBaudRate,
GetConnectMode,
SetConnectMode,
GetBTAddressBind,
SetBTAddressBind,
GetCStatusNotify,
SetCStatusNotify,
GetSecurityMode,
SetSecurityMode,
DeleteAuthentication,
ClearAuthenticationList,
FindAuthenticationFor,
GetAuthenticationCount,
GetMostRecentDevice,
GetCurrentStatus,
DropCurrentDevice,
EnterHibernate,
ExitEnergyMode,
GetDisconnecType*/
~HC_05Bluetooth();
unsigned short FrontIndex;
unsigned short BackIndex;
bool isTransfering() {return mTransferModeEnabled;}
private:
unsigned short MessageCount;
bool WaitingForResponse;
bool mEnabled;
bool mPoweredON;
bool mTransferModeEnabled;
HC_05_PARSE_STATES mPARSE_STATE;
// port addresses
unsigned long mStatePortAddress;
unsigned long mPowerPortAddress;
// pin numbers
unsigned char mStatePinNumber;
unsigned char mPowerPinNumber;
// pin addresses
unsigned char mStatePinAddress;
unsigned char mPowerPinAddress;
};
extern char RXDATABUFF[MAX_COMMAND_INDEX];
extern HC_05Bluetooth * FOTON_BLUETOOTH;
extern const char * COMMAND_STR_TABLE[GetDisconnectType];
extern void BluetoothReadTask(void *);
extern void BluetoothProcessATTask(void*);
extern TaskHandle_t BLUETOOTH_READ_HNDLE;
extern TaskHandle_t BLUETOOTH_CMD_READ_HNDLE;
extern FOTON_LIVE_MESSAGE * CURRENT_MESSAGE;
extern QueueHandle_t AT_COMMAND_QUEUE;
#endif /* HC_05DRIVER_HPP_ */
|
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)inet_lnaof.c 5.7 (Berkeley) 2/24/91";*/
static char *rcsid = "$Id$";
#endif /* LIBC_SCCS and not lint */
#include <pthread.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
/*
* Return the local network address portion of an
* internet address; handles class a/b/c network
* number formats.
*/
pthread_ipaddr_type
inet_lnaof(in)
struct in_addr in;
{
register pthread_ipaddr_type i = ntohl(in.s_addr);
if (IN_CLASSA(i))
return ((i)&IN_CLASSA_HOST);
else if (IN_CLASSB(i))
return ((i)&IN_CLASSB_HOST);
else
return ((i)&IN_CLASSC_HOST);
}
|
/**
* Copyright (C) 2007 Doug Judd (Zvents, Inc.)
*
* This file is part of Hypertable.
*
* Hypertable is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Hypertable is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SOCKADDRMAP_H
#define SOCKADDRMAP_H
#include <ext/hash_map>
using namespace std;
extern "C" {
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
}
class SockAddrHash {
public:
size_t operator () (struct sockaddr_in addr) const {
return (size_t)(addr.sin_addr.s_addr ^ addr.sin_port);
}
};
struct SockAddrEqual {
bool operator()(struct sockaddr_in addr1, struct sockaddr_in addr2) const {
return (addr1.sin_addr.s_addr == addr2.sin_addr.s_addr) && (addr1.sin_port == addr2.sin_port);
}
};
template<typename _Tp, typename addr=struct sockaddr_in>
class SockAddrMapT : public __gnu_cxx::hash_map<addr, _Tp, SockAddrHash, SockAddrEqual> {
};
#endif // SOCKADDRMAP_H
|
#ifndef PLUGIN_QUERY_REWRITE_INCLUDED
#define PLUGIN_QUERY_REWRITE_INCLUDED
/* Copyright (c) 2015, 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 */
#include "plugin.h"
/**
@file include/mysql/plugin_query_rewrite.h
API for the query rewrite plugin types (MYSQL_REWRITE_PRE_PARSE_PLUGIN and
MYSQL_REWRITE_POST_PARSE_PLUGIN).
*/
/// Must be set by a plugin if the query is rewritten.
#define FLAG_REWRITE_PLUGIN_QUERY_REWRITTEN 1
/// Is set by the server if the query is prepared statement.
#define FLAG_REWRITE_PLUGIN_IS_PREPARED_STATEMENT 2
/// Structure that is passed during each step of a rewriting.
typedef struct Mysql_rewrite_post_parse_param
{
/**
Indicate the status of the current rewrite.
@see FLAG_REWRITE_PLUGIN_QUERY_REWRITTEN
@see FLAG_REWRITE_PLUGIN_IS_PREPARED_STATEMENT
*/
int flags;
/// The current session.
MYSQL_THD thd;
/// Pointer left to the plugin to store any necessary info as needed.
void* data;
} Mysql_rewrite_post_parse_param;
struct st_mysql_rewrite_post_parse
{
int interface_version;
int needs_statement_digest;
int (*rewrite)(Mysql_rewrite_post_parse_param *param);
};
/// Structure that is passed during each step of a rewriting.
typedef struct Mysql_rewrite_pre_parse_param
{
/**
Indicate the status of the current rewrite.
@see FLAG_REWRITE_PLUGIN_QUERY_REWRITTEN
@see FLAG_REWRITE_PLUGIN_IS_PREPARED_STATEMENT
*/
int flags;
/// The current session.
MYSQL_THD thd;
/// Pointer left to the plugin to store any necessary info as needed.
void* data;
/// The query potentially to be rewritten.
const char* query;
/// Length of query potentially to be rewritten.
size_t query_length;
/// The rewritten query, if applicable.
const char* rewritten_query;
/// Length of the rewritten query, if applicable.
size_t rewritten_query_length;
} Mysql_rewrite_pre_parse_param;
struct st_mysql_rewrite_pre_parse
{
int interface_version;
int (*rewrite)(Mysql_rewrite_pre_parse_param *param);
int (*deinit)(Mysql_rewrite_pre_parse_param *param);
};
#endif /* PLUGIN_QUERY_REWRITE_INCLUDED */
|
#ifndef __GAMESERVER_ND_DS2GS_CALLBACK_H__
#define __GAMESERVER_ND_DS2GS_CALLBACK_H__
#include "main/local/NDPreCompiler.h"
class NDDS2GSCallBack : public NDProtocolCallBack
{
public:
NDDS2GSCallBack(void);
~NDDS2GSCallBack(void);
NDBool process( NDIStream& rIStream, NDProtocolHeader& protocolHeader );
private:
NDBool ds2gsSendPlayerMainNtyDispose( NDIStream& rIStream, NDProtocolHeader& protocolHeader );
NDBool ds2gsPlayerLoginResDispose( NDIStream& rIStream, NDProtocolHeader& protocolHeader );
};
#endif
|
#ifndef CONTROLLER_H
#define CONTROLLER_H
class Controller {
public:
Controller();
bool isHoldingSpace;
bool isHoldingCtrl;
bool isHoldingAlt;
bool isHoldingUp;
bool isHoldingDown;
bool isHoldingLeft;
bool isHoldingRight;
};
#endif
|
/*
The contents of this file are subject to the "do whatever you like"-license.
That means: Do, whatver you want, this file is under public domain. It is an
example for ev3c. Copy it and learn from it for your project and release
it under every license you want. ;-)
For feedback and questions about my Files and Projects please mail me,
Alexander Matthes (Ziz) , ziz_at_mailbox.org, http://github.com/theZiz
*/
#include "ev3c.h"
#include <stdio.h>
int main(int argc,char** argv)
{
ev3_init_lcd();
ev3_clear_lcd();
ev3_circle_lcd( 50, 30, 20, 1);
ev3_circle_lcd( 70, 30, 20, 0);
ev3_circle_lcd_out( 50, 30, 25, 1);
ev3_rectangle_lcd( 90, 30, 20, 10, 1);
ev3_rectangle_lcd( 100, 35, 5, 5, 0);
ev3_rectangle_lcd_out( 100, 35, 15, 15, 1);
ev3_ellipse_lcd( 140, 20, 30, 15, 1);
ev3_ellipse_lcd_out( 140, 25, 30, 25, 1);
ev3_line_lcd( 40, 10, 70, 50, 1);
ev3_line_lcd( 5, 5, 5, EV3_Y_LCD -5, 1);
ev3_text_lcd_large( 5, 60, "Large text!");
ev3_text_lcd_normal( 5, 80, "Normal text!");
ev3_text_lcd_small( 5, 90, "Small text!");
ev3_text_lcd_tiny( 5, 100, "Tiny text!");
ev3_quit_lcd();
return 0;
}
|
#ifndef HZFMIS_H
#define HZFMIS_H
void hzfmis(void *var);
#define MKMISS(x) hzfmis(&x)
#endif /* HZFMIS_H */
|
/*
* Copyright (c) 2005, Bull S.A.. All rights reserved.
* Created by: Sebastien Decugis
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* This sample test aims to check the following assertions:
*
* If SA_NODEFER is not set in sa_flags, the caught signal is added to the
* thread's signal mask during the handler execution.
* The steps are:
* -> register a signal handler for SIGQUIT
* -> raise SIGQUIT
* -> In handler, check for reentrance then raise SIGQUIT again.
* The test fails if signal handler if reentered or signal is not pending when raised again.
*/
/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
#define _POSIX_C_SOURCE 200112L
/******************************************************************************/
/*************************** standard includes ********************************/
/******************************************************************************/
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
/******************************************************************************/
/*************************** Test framework *******************************/
/******************************************************************************/
#include "../testfrmw/testfrmw.h"
#include "../testfrmw/testfrmw.c"
/* This header is responsible for defining the following macros:
* UNRESOLVED(ret, descr);
* where descr is a description of the error and ret is an int
* (error code for example)
* FAILED(descr);
* where descr is a short text saying why the test has failed.
* PASSED();
* No parameter.
*
* Both three macros shall terminate the calling process.
* The testcase shall not terminate in any other maneer.
*
* The other file defines the functions
* void output_init()
* void output(char * string, ...)
*
* Those may be used to output information.
*/
/******************************************************************************/
/**************************** Configuration ***********************************/
/******************************************************************************/
#ifndef VERBOSE
#define VERBOSE 1
#endif
#define SIGNAL SIGQUIT
/******************************************************************************/
/*************************** Test case ***********************************/
/******************************************************************************/
int called = 0;
void handler(int sig)
{
int ret;
sigset_t pending;
called++;
if (called == 2)
{
FAILED("Signal was not masked in signal handler");
}
if (called == 1)
{
/* Raise the signal again. It should be masked */
ret = raise(SIGNAL);
if (ret != 0)
{
UNRESOLVED(ret, "Failed to raise SIGQUIT again");
}
/* check the signal is pending */
ret = sigpending(&pending);
if (ret != 0)
{
UNRESOLVED(ret, "Failed to get pending signal set");
}
ret = sigismember(&pending, SIGNAL);
if (ret != 1)
{
FAILED("signal is not pending");
}
}
called++;
}
/* main function */
int main()
{
int ret;
struct sigaction sa;
/* Initialize output */
output_init();
/* Set the signal handler */
sa.sa_flags = 0;
sa.sa_handler = handler;
ret = sigemptyset(&sa.sa_mask);
if (ret != 0)
{
UNRESOLVED(ret, "Failed to empty signal set");
}
/* Install the signal handler for SIGQUIT */
ret = sigaction(SIGNAL, &sa, 0);
if (ret != 0)
{
UNRESOLVED(ret, "Failed to set signal handler");
}
ret = raise(SIGNAL);
if (ret != 0)
{
UNRESOLVED(ret, "Failed to raise SIGQUIT");
}
while (called != 4)
sched_yield();
/* Test passed */
#if VERBOSE > 0
output("Test passed\n");
#endif
PASSED;
}
|
/*
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_TIMER_H
#define MANGOS_TIMER_H
#include "Common.h"
#include <ace/OS_NS_sys_time.h>
class WorldTimer
{
public:
//get current server time
static MANGOS_DLL_SPEC uint32 getMSTime();
//get time difference between two timestamps
static inline uint32 getMSTimeDiff(const uint32& oldMSTime, const uint32& newMSTime)
{
if (oldMSTime > newMSTime)
{
const uint32 diff_1 = (uint32(0xFFFFFFFF) - oldMSTime) + newMSTime;
const uint32 diff_2 = oldMSTime - newMSTime;
return std::min(diff_1, diff_2);
}
return newMSTime - oldMSTime;
}
//get last world tick time
static MANGOS_DLL_SPEC uint32 tickTime();
//get previous world tick time
static MANGOS_DLL_SPEC uint32 tickPrevTime();
//tick world timer
static MANGOS_DLL_SPEC uint32 tick();
private:
WorldTimer();
WorldTimer(const WorldTimer& );
//analogue to getMSTime() but it persists m_SystemTickTime
static uint32 getMSTime_internal(bool savetime = false);
static MANGOS_DLL_SPEC uint32 m_iTime;
static MANGOS_DLL_SPEC uint32 m_iPrevTime;
};
class IntervalTimer
{
public:
IntervalTimer() : _interval(0), _current(0) {}
void Update(time_t diff)
{
_current += diff;
if (_current < 0)
_current = 0;
}
bool Passed() const { return _current >= _interval; }
void Reset()
{
if (_current >= _interval)
_current -= _interval;
}
void SetCurrent(time_t current) { _current = current; }
void SetInterval(time_t interval) { _interval = interval; }
time_t GetInterval() const { return _interval; }
time_t GetCurrent() const { return _current; }
private:
time_t _interval;
time_t _current;
};
class ShortIntervalTimer
{
public:
ShortIntervalTimer() : _interval(0), _current(0) {}
void Update(uint32 diff)
{
_current += diff;
}
bool Passed() const { return _current >= _interval; }
void Reset()
{
if (_current >= _interval)
_current -= _interval;
}
void SetCurrent(uint32 current) { _current = current; }
void SetInterval(uint32 interval) { _interval = interval; }
uint32 GetInterval() const { return _interval; }
uint32 GetCurrent() const { return _current; }
private:
uint32 _interval;
uint32 _current;
};
struct TimeTracker
{
public:
TimeTracker(time_t expiry) : i_expiryTime(expiry) {}
void Update(time_t diff) { i_expiryTime -= diff; }
bool Passed() const { return (i_expiryTime <= 0); }
void Reset(time_t interval) { i_expiryTime = interval; }
time_t GetExpiry() const { return i_expiryTime; }
private:
time_t i_expiryTime;
};
struct ShortTimeTracker
{
public:
ShortTimeTracker(int32 expiry) : i_expiryTime(expiry) {}
void Update(int32 diff) { i_expiryTime -= diff; }
bool Passed() const { return (i_expiryTime <= 0); }
void Reset(int32 interval) { i_expiryTime = interval; }
int32 GetExpiry() const { return i_expiryTime; }
private:
int32 i_expiryTime;
};
#endif |
#include <stdio.h>
#include "global.h"
#include "param_interface.h"
#include "laser_interface.h"
static void
laser_handler(carmen_laser_laser_message *laser)
{
fprintf(stderr, "n_ranges %d, n_remissions %d, fov %lf, maxrange %lf, timestamp %.3lf, host %s\n",
laser->num_readings, laser->num_remissions, laser->config.fov, laser->config.maximum_range, laser->timestamp, laser->host);
}
int
main(int argc, char **argv)
{
int i=atoi(argv[1]);
carmen_ipc_initialize(argc, argv);
carmen_param_check_version(argv[0]);
fprintf(stderr, "dumping laser %d\n", i);
static carmen_laser_laser_message laser;
carmen_laser_subscribe_laser_message(i,&laser, (carmen_handler_t)
laser_handler,
CARMEN_SUBSCRIBE_LATEST);
while(1) IPC_listen(10);
return 0;
}
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Proto_IRC.rc
//
#define IDI_ICON1 105
#define IDI_ICON2 104
#define IDI_ICON3 130
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
/*
*
* Definitions for H3600 Handheld Computer
*
* Copyright 2000 Compaq Computer Corporation.
*
* Use consistent with the GNU GPL is permitted,
* provided that this copyright notice is
* preserved in its entirety in all copies and derived works.
*
* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
* FITNESS FOR ANY PARTICULAR PURPOSE.
*
* Author: Jamey Hicks.
*
* History:
*
* 2001-10-?? Andrew Christian Added support for iPAQ H3800
*
*/
#ifndef _INCLUDE_H3600_H_
#define _INCLUDE_H3600_H_
#include <linux/config.h>
/* generalized support for H3xxx series Compaq Pocket PC's */
#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800())
/* Physical memory regions corresponding to chip selects */
#define H3600_EGPIO_PHYS 0x49000000
#define H3600_BANK_2_PHYS 0x10000000
#define H3600_BANK_4_PHYS 0x40000000
/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
#define H3600_EGPIO_VIRT 0xf0000000
#define H3600_BANK_2_VIRT 0xf1000000
#define H3600_BANK_4_VIRT 0xf3800000
/*
Machine-independent GPIO definitions
--- these are common across all current iPAQ platforms
*/
#define GPIO_H3600_NPOWER_BUTTON GPIO_GPIO (0) /* Also known as the "off button" */
#define GPIO_H3600_PCMCIA_CD1 GPIO_GPIO (10)
#define GPIO_H3600_PCMCIA_IRQ1 GPIO_GPIO (11)
/* UDA1341 L3 Interface */
#define GPIO_H3600_L3_DATA GPIO_GPIO (14)
#define GPIO_H3600_L3_MODE GPIO_GPIO (15)
#define GPIO_H3600_L3_CLOCK GPIO_GPIO (16)
#define GPIO_H3600_PCMCIA_CD0 GPIO_GPIO (17)
#define GPIO_H3600_SYS_CLK GPIO_GPIO (19)
#define GPIO_H3600_PCMCIA_IRQ0 GPIO_GPIO (21)
#define GPIO_H3600_COM_DCD GPIO_GPIO (23)
#define GPIO_H3600_OPT_IRQ GPIO_GPIO (24)
#define GPIO_H3600_COM_CTS GPIO_GPIO (25)
#define GPIO_H3600_COM_RTS GPIO_GPIO (26)
#define IRQ_GPIO_H3600_NPOWER_BUTTON IRQ_GPIO0
#define IRQ_GPIO_H3600_PCMCIA_CD1 IRQ_GPIO10
#define IRQ_GPIO_H3600_PCMCIA_IRQ1 IRQ_GPIO11
#define IRQ_GPIO_H3600_PCMCIA_CD0 IRQ_GPIO17
#define IRQ_GPIO_H3600_PCMCIA_IRQ0 IRQ_GPIO21
#define IRQ_GPIO_H3600_COM_DCD IRQ_GPIO23
#define IRQ_GPIO_H3600_OPT_IRQ IRQ_GPIO24
#define IRQ_GPIO_H3600_COM_CTS IRQ_GPIO25
#ifndef __ASSEMBLY__
enum ipaq_egpio_type {
IPAQ_EGPIO_LCD_POWER, /* Power to the LCD panel */
IPAQ_EGPIO_CODEC_NRESET, /* Clear to reset the audio codec (remember to return high) */
IPAQ_EGPIO_AUDIO_ON, /* Audio power */
IPAQ_EGPIO_QMUTE, /* Audio muting */
IPAQ_EGPIO_OPT_NVRAM_ON, /* Non-volatile RAM on extension sleeves (SPI interface) */
IPAQ_EGPIO_OPT_ON, /* Power to extension sleeves */
IPAQ_EGPIO_CARD_RESET, /* Reset PCMCIA cards on extension sleeve (???) */
IPAQ_EGPIO_OPT_RESET, /* Reset option pack (???) */
IPAQ_EGPIO_IR_ON, /* IR sensor/emitter power */
IPAQ_EGPIO_IR_FSEL, /* IR speed selection 1->fast, 0->slow */
IPAQ_EGPIO_RS232_ON, /* Maxim RS232 chip power */
IPAQ_EGPIO_VPP_ON, /* Turn on power to flash programming */
IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */
};
struct ipaq_model_ops {
const char *generic_name;
void (*control)(enum ipaq_egpio_type, int);
unsigned long (*read)(void);
void (*blank_callback)(int blank);
int (*pm_callback)(int req); /* Primary model callback */
int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */
/* Data to be stashed at wakeup */
u32 gedr;
u32 icpr;
};
extern struct ipaq_model_ops ipaq_model_ops;
#ifdef CONFIG_SA1100_H3XXX
static __inline__ const char * h3600_generic_name( void ) {
return ipaq_model_ops.generic_name;
}
static __inline__ void assign_h3600_egpio( enum ipaq_egpio_type x, int level ) {
if (ipaq_model_ops.control)
ipaq_model_ops.control(x,level);
}
static __inline__ void clr_h3600_egpio( enum ipaq_egpio_type x ) {
if (ipaq_model_ops.control)
ipaq_model_ops.control(x,0);
}
static __inline__ void set_h3600_egpio( enum ipaq_egpio_type x ) {
if (ipaq_model_ops.control)
ipaq_model_ops.control(x,1);
}
static __inline__ unsigned long read_h3600_egpio( void ) {
if (ipaq_model_ops.read)
return ipaq_model_ops.read();
return 0;
}
static __inline__ int h3600_register_blank_callback( void (*f)(int) ) {
ipaq_model_ops.blank_callback = f;
return 0;
}
static __inline__ void h3600_unregister_blank_callback( void (*f)(int) ) {
ipaq_model_ops.blank_callback = NULL;
}
static __inline__ int h3600_register_pm_callback( int (*f)(int) ) {
ipaq_model_ops.pm_callback_aux = f;
return 0;
}
static __inline__ void h3600_unregister_pm_callback( int (*f)(int) ) {
ipaq_model_ops.pm_callback_aux = NULL;
}
static __inline__ int h3600_power_management( int req ) {
if ( ipaq_model_ops.pm_callback )
return ipaq_model_ops.pm_callback(req);
return 0;
}
#else
/*
* This allows some drives to loose some ifdefs
*/
#define assign_h3600_egpio(x,y) do { } while (0)
#define clr_h3600_egpio(x) do { } while (0)
#define set_h3600_egpio(x) do { } while (0)
#define read_h3600_egpio() (0)
#endif
#endif /* ASSEMBLY */
#endif /* _INCLUDE_H3600_H_ */
|
/* Public domain */
#ifndef _AGAR_DEV_DEV_H_
#define _AGAR_DEV_DEV_H_
#include <agar/config/ag_network.h>
#include <agar/config/ag_threads.h>
#include <agar/config/have_jpeg.h>
#include <agar/dev/begin.h>
struct ag_menu_item;
/* Begin generated block */
__BEGIN_DECLS
extern DECLSPEC void DEV_InitSubsystem(Uint);
extern DECLSPEC void DEV_ToolMenu(struct ag_menu_item *);
#if defined(AG_NETWORK) && defined(AG_THREADS) && defined(HAVE_JPEG)
extern DECLSPEC AG_Window *DEV_ScreenshotUploader(void);
#endif
#if defined(AG_NETWORK) && defined(AG_THREADS)
extern DECLSPEC AG_Window *DEV_DebugServer(void);
extern DECLSPEC int DEV_DebugServerStart(void);
#endif
extern DECLSPEC AG_Window *DEV_TimerInspector(void);
extern DECLSPEC AG_Window *DEV_UnicodeBrowser(void);
extern DECLSPEC AG_Window *DEV_DisplaySettings(void);
extern DECLSPEC AG_Window *DEV_CPUInfo(void);
extern DECLSPEC AG_Window *DEV_Browser(void *);
extern DECLSPEC void DEV_BrowserInit(void *);
extern DECLSPEC void DEV_BrowserDestroy(void);
extern DECLSPEC void DEV_BrowserOpenData(void *);
extern DECLSPEC void DEV_BrowserCloseData(void *);
extern DECLSPEC void DEV_BrowserOpenGeneric(AG_Object *);
extern DECLSPEC void DEV_BrowserSaveTo(void *, const char *);
extern DECLSPEC void DEV_BrowserLoadFrom(void *, const char *);
extern DECLSPEC void DEV_BrowserGenericMenu(void *, void *);
extern DECLSPEC void DEV_ConfigShow(void);
extern DECLSPEC void *DEV_ObjectEdit(void *);
extern DECLSPEC AG_Window *DEV_ClassInfo(void);
__END_DECLS
/* Close generated block */
#include <agar/dev/close.h>
#endif /* _AGAR_DEV_DEV_H_ */
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
Turbo veille screensaver
Patrice Mandin
*/
#ifndef _SDL_xbios_tveille_h
#define _SDL_xbios_tveille_h
#include "SDL_xbios.h"
/*--- Structures ---*/
typedef struct {
unsigned long version;
void (*prg_ptr)();
void (*kbd_ptr)();
void (*vbl_ptr)();
unsigned long vbl_count;
void (*oldkbd_ptr)();
unsigned long off_count;
unsigned long prg_size;
unsigned long dummy1[4];
unsigned char dummy2;
unsigned char status;
unsigned short freq;
unsigned short dummy3;
unsigned char clear_first;
unsigned char enabled; /* 0=enabled, 0xff=disabled */
unsigned char serial_redir;
unsigned char dummy4;
void (*oldserial_ptr)();
} tveille_t;
/*--- Functions prototypes ---*/
int SDL_XBIOS_TveillePresent(_THIS);
void SDL_XBIOS_TveilleDisable(_THIS);
void SDL_XBIOS_TveilleEnable(_THIS);
#endif /* _SDL_xbios_tveille_h */
|
/*****************************************************************************
*
* timecheck.c
* Purpose ...............: Timecheck functions
*
*****************************************************************************
* Copyright (C) 2013-2017 Robert James Clay <jame@rocasa.us>
* Copyright (C) 1997-2005 Michiel Broek <mbse@mbse.eu>
*
* This file is part of FTNd.
*
* 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, or (at your option) any later
* version.
*
* FTNd 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 FTNd; see the file COPYING. If not, write to the Free Software
* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*****************************************************************************/
#include "../config.h"
#include "../lib/ftndlib.h"
#include "../lib/ftnd.h"
#include "../lib/users.h"
#include "timecheck.h"
#include "funcs.h"
#include "bye.h"
#include "exitinfo.h"
#include "language.h"
#include "input.h"
#include "term.h"
#include "ttyio.h"
extern pid_t mypid; /* Pid of this program */
extern int chat_with_sysop; /* True if chatting with sysop */
/*
* Check for a personal message, this will go via ftnd. If there
* is a message, it will be displayed, else nothing happens.
*/
void Check_PM(void);
void Check_PM(void)
{
static char buf[200];
char resp[128], msg[81];
snprintf(buf, 200, "CIPM:1,%d;", mypid);
if (socket_send(buf) == 0) {
strcpy(buf, socket_receive());
if (strncmp(buf, "100:0;", 6) == 0)
return;
strncpy(resp, strtok(buf, ":"), 5); /* Should be 100 */
strncpy(resp, strtok(NULL, ","), 3); /* Should be 2 */
strncpy(resp, cldecode(strtok(NULL, ",")), 36); /* From Name */
Enter(2);
PUTCHAR('\007');
colour(CYAN, BLACK);
/* ** Message ** from */
snprintf(msg, 81, "%s %s:", (char *)Language(434), resp);
poutCR(CYAN, BLACK, msg);
strncpy(resp, cldecode(strtok(NULL, "\0")), 80); /* The real message */
PUTSTR(resp);
Enter(1);
Pause();
}
}
/*
* This is the users onlinetime check.
*/
void TimeCheck(void)
{
time_t Now;
int Elapsed;
Now = time(NULL);
/*
* Update the global string for the menu prompt
*/
snprintf(sUserTimeleft, 7, "%d", iUserTimeLeft);
ReadExitinfo();
if (iUserTimeLeft != ((Time2Go - Now) / 60)) {
Elapsed = iUserTimeLeft - ((Time2Go - Now) / 60);
iUserTimeLeft -= Elapsed;
snprintf(sUserTimeleft, 7, "%d", iUserTimeLeft);
/*
* Update users counter if not chatting
*/
if (!CFG.iStopChatTime || (! chat_with_sysop)) {
exitinfo.iTimeLeft -= Elapsed;
exitinfo.iConnectTime += Elapsed;
exitinfo.iTimeUsed += Elapsed;
WriteExitinfo();
}
}
if (exitinfo.iTimeLeft <= 0) {
Enter(1);
poutCR(YELLOW, BLACK, (char *) Language(130));
sleep(3);
Syslog('!', "Users time limit exceeded ... user disconnected!");
iExpired = TRUE;
Good_Bye(FTNERR_TIMEOUT);
}
/*
* Check for a personal message
*/
Check_PM();
}
|
#ifndef COIN_SOLIGHTELEMENT_H
#define COIN_SOLIGHTELEMENT_H
/**************************************************************************\
*
* This file is part of the Coin 3D visualization library.
* Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.GPL at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using Coin with software that can not be combined with the GNU
* GPL, and for taking advantage of the additional benefits of our
* support services, please contact Kongsberg SIM about acquiring
* a Coin Professional Edition License.
*
* See http://www.coin3d.org/ for more information.
*
* Kongsberg SIM, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
* http://www.sim.no/ sales@sim.no coin-support@coin3d.org
*
\**************************************************************************/
#include <Inventor/elements/SoAccumulatedElement.h>
#include <Inventor/lists/SoNodeList.h>
#include <Inventor/lists/SbList.h>
#include <Inventor/SbMatrix.h>
class SoLight;
class COIN_DLL_API SoLightElement : public SoAccumulatedElement {
typedef SoAccumulatedElement inherited;
SO_ELEMENT_HEADER(SoLightElement);
public:
static void initClass(void);
protected:
virtual ~SoLightElement();
public:
virtual void init(SoState * state);
virtual void push(SoState * state);
static void add(SoState * const state, SoLight * const light,
const SbMatrix & matrix);
static const SoNodeList & getLights(SoState * const state);
static const SbMatrix & getMatrix(SoState * const state,
const int index);
protected:
SoNodeList lights;
SbList <SbMatrix> * matrixlist;
private:
// dummy class needed to initialize didalloc when constructed.
class so_light_elem_flag {
public:
so_light_elem_flag(void) {
this->state = FALSE;
}
SbBool state;
};
so_light_elem_flag didalloc;
};
#endif // !COIN_SOLIGHTELEMENT_H
|
#include <testlib.h>
#include <tagfile.h>
#include <list.h>
static struct tagfile g_tf;
void test_tagfile_search()
{
struct list l = { 0 };
int ret;
int index;
struct tag *t;
/* searching for an expected symbol */
ret = tagfile_search(&g_tf, "ta_se", &l);
UVERIFY(ret > 0);
index = l.el[0].index;
t = tagfile_get(&g_tf, index);
UVERIFY(t != NULL);
UCOMPARESTR(t->tagname, "tagfile_search");
/* repeated letters pairs should not be counted twice*/
ret = tagfile_search(&g_tf, "tttttttttttttttt", &l);
UVERIFY(ret > 0);
UVERIFY(l.el[0].metric <= 1000);
/* performance measurement */
UBENCHMARK {
tagfile_search(&g_tf, "ta_se", &l);
}
}
void test_init()
{
tagfile_init(&g_tf);
UVERIFY(tagfile_load(&g_tf, "tags") == 0);
}
void test_cleanup()
{
tagfile_clear(&g_tf);
}
void register_tests()
{
UREGISTER_INIT(test_init);
UREGISTER_CLEANUP(test_cleanup);
UREGISTER_TEST(test_tagfile_search);
}
UTEST_MAIN()
|
/*****************************************************************
* SQUID - a library of functions for biological sequence analysis
* Copyright (C) 1992-2002 Washington University School of Medicine
*
* This source code is freely distributed under the terms of the
* GNU General Public License. See the files COPYRIGHT and LICENSE
* for details.
*****************************************************************/
/* rk.c (originally from rnabob's patsearch.c)
*
* Contains a compiler and a search engine for Rabin-Karp
* based primary sequence pattern searching on encoded
* sequences.
*
* See Sedgewick, _Algorithms_, for a general discussion of
* the Rabin-Karp algorithm. See the rkcomp or rkexec man
* pages for specific details.
*
* RCS $Id: rk.c,v 1.2 1998/10/09 18:07:16 eddy Exp $
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "squid.h" /* seq encoding utilities and typedefs */
#include "rk.h"
#ifdef MEMDEBUG
#include "dbmalloc.h"
#endif
Hashseq
rkcomp(char *probe) /* A,C,G,T/U, N probe string, 0-8 nt long */
{
Hashseq hashprobe = 0;
char coded[RK_HASHSIZE + 1];
int len;
int i;
/* check bounds violation on probe */
if ((len = strlen(probe)) > RK_HASHSIZE) return 0;
/* encode the probe */
if (seqencode(coded, probe) == 0) return 0;
/* pack the probe into a Hashseq */
for (i = 0; i < len; i++)
{
hashprobe <<= 4;
hashprobe |= (Hashseq) coded[i];
}
/* left adjust as needed */
for (; i < RK_HASHSIZE; i++)
{
hashprobe <<= 4;
hashprobe |= (Hashseq) NTN;
}
/* return the compiled probe */
return hashprobe;
}
int
rkseq(Hashseq hashprobe, /* up to 8 nt packed into the probe */
char *sequence) /* encoded sequence */
{
long i;
long pos = 0;
Hashseq target = 0;
/* initialize the target hashseq */
for (i = 0; i < RK_HASHSIZE; i++)
{
if (*(sequence + i) == NTEND)
break;
target <<= 4;
target |= (Hashseq) (*(sequence + i));
}
while (*(sequence + pos + RK_HASHSIZE -1) != NTEND)
{
#ifdef DEBUG
printf("hashprobe: ");
writehash(hashprobe);
printf("\ttarget: ");
writehash(target);
printf("\nhashprobe & target: ");
writehash(hashprobe & target);
printf("\n");
#endif
if ((hashprobe & target) == target)
return ((int) pos);
target <<= 4;
target |= (Hashseq) (*(sequence + pos + RK_HASHSIZE));
pos++;
}
/* now we deal with an end effect */
for (i = 0; i < RK_HASHSIZE; i++)
{
target |= (Hashseq) NTN;
if ((hashprobe & target) == target)
return ((int) pos);
target <<=4;
pos++;
}
return(-1);
}
#ifdef DEBUG /* Debugging aids */
static void
writehash(Hashseq hashseq)
{
int idx;
int sym;
if (hashseq/16)
writehash(hashseq/16);
sym = (int) (hashseq % 16);
if (sym == 0)
putchar('-');
else
{
for (idx = 0; sym != iupac[idx].code && idx < IUPACSYMNUM; idx++);
if (idx > IUPACSYMNUM)
printf("(%d)", sym);
else
putchar(iupac[idx].sym);
}
}
#endif
|
/* linux/arch/arm/mach-s5pv210/include/mach/map.h
*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* S5PV210 - Memory map definitions
*
* 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.
*/
#ifndef __ASM_ARCH_MAP_H
#define __ASM_ARCH_MAP_H __FILE__
#include <plat/map-base.h>
#include <plat/map-s5p.h>
#define S5PV210_PA_SDRAM 0x20000000
#define S5PV210_PA_SROM_BANK1 0x88000000
#define S5PV210_PA_SROM_BANK5 0xA8000000
#define S5PC110_PA_ONENAND 0xB0000000
#define S5PC110_PA_ONENAND_DMA 0xB0600000
#define S5PV210_PA_CHIPID 0xE0000000
#define S5PV210_PA_SYSCON 0xE0100000
#define S5PV210_PA_GPIO 0xE0200000
#define S5PV210_PA_SPDIF 0xE1100000
#define S5PV210_PA_SPI0 0xE1300000
#define S5PV210_PA_SPI1 0xE1400000
#define S5PV210_PA_KEYPAD 0xE1600000
#define S5PV210_PA_ADC 0xE1700000
#define S5PV210_PA_IIC0 0xE1800000
#define S5PV210_PA_IIC1 0xFAB00000
#define S5PV210_PA_IIC2 0xE1A00000
#define S5PV210_PA_AC97 0xE2200000
#define S5PV210_PA_PCM0 0xE2300000
#define S5PV210_PA_PCM1 0xE1200000
#define S5PV210_PA_PCM2 0xE2B00000
#define S5PV210_PA_TIMER 0xE2500000
#define S5PV210_PA_SYSTIMER 0xE2600000
#define S5PV210_PA_WATCHDOG 0xE2700000
#define S5PV210_PA_RTC 0xE2800000
#define S5PV210_PA_UART 0xE2900000
#define S5PV210_PA_SROMC 0xE8000000
#define S5PV210_PA_CFCON 0xE8200000
#define S5PV210_PA_MFC 0xF1700000
#define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000))
#define S5PV210_PA_HSOTG 0xEC000000
#define S5PV210_PA_HSPHY 0xEC100000
#define S5PV210_PA_IIS0 0xEEE30000
#define S5PV210_PA_IIS1 0xE2100000
#define S5PV210_PA_IIS2 0xE2A00000
#define S5PV210_PA_DMC0 0xF0000000
#define S5PV210_PA_DMC1 0xF1400000
#define S5PV210_PA_VIC0 0xF2000000
#define S5PV210_PA_VIC1 0xF2100000
#define S5PV210_PA_VIC2 0xF2200000
#define S5PV210_PA_VIC3 0xF2300000
#define S5PV210_PA_FB 0xF8000000
#define S5PV210_PA_MDMA 0xFA200000
#define S5PV210_PA_PDMA0 0xE0900000
#define S5PV210_PA_PDMA1 0xE0A00000
#define S5PV210_PA_MIPI_CSIS 0xFA600000
#define S5PV210_PA_FIMC0 0xFB200000
#define S5PV210_PA_FIMC1 0xFB300000
#define S5PV210_PA_FIMC2 0xFB400000
#define S5PV210_PA_JPEG 0xFB600000
#define S5PV210_PA_SDO 0xF9000000
#define S5PV210_PA_VP 0xF9100000
#define S5PV210_PA_MIXER 0xF9200000
#define S5PV210_PA_HDMI 0xFA100000
#define S5PV210_PA_IIC_HDMIPHY 0xFA900000
/* Compatibiltiy Defines */
#define S3C_PA_FB S5PV210_PA_FB
#define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0)
#define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1)
#define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2)
#define S3C_PA_HSMMC3 S5PV210_PA_HSMMC(3)
#define S3C_PA_IIC S5PV210_PA_IIC0
#define S3C_PA_IIC1 S5PV210_PA_IIC1
#define S3C_PA_IIC2 S5PV210_PA_IIC2
#define S3C_PA_RTC S5PV210_PA_RTC
#define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG
#define S3C_PA_WDT S5PV210_PA_WATCHDOG
#define S3C_PA_SPI0 S5PV210_PA_SPI0
#define S3C_PA_SPI1 S5PV210_PA_SPI1
#define S5P_PA_CHIPID S5PV210_PA_CHIPID
#define S5P_PA_FIMC0 S5PV210_PA_FIMC0
#define S5P_PA_FIMC1 S5PV210_PA_FIMC1
#define S5P_PA_FIMC2 S5PV210_PA_FIMC2
#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS
#define S5P_PA_MFC S5PV210_PA_MFC
#define S5P_PA_IIC_HDMIPHY S5PV210_PA_IIC_HDMIPHY
#define S5P_PA_SDO S5PV210_PA_SDO
#define S5P_PA_VP S5PV210_PA_VP
#define S5P_PA_MIXER S5PV210_PA_MIXER
#define S5P_PA_HDMI S5PV210_PA_HDMI
#define S5P_PA_ONENAND S5PC110_PA_ONENAND
#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA
#define S5P_PA_SDRAM S5PV210_PA_SDRAM
#define S5P_PA_SROMC S5PV210_PA_SROMC
#define S5P_PA_SYSCON S5PV210_PA_SYSCON
#define S5P_PA_TIMER S5PV210_PA_TIMER
#define S5P_PA_JPEG S5PV210_PA_JPEG
#define SAMSUNG_PA_ADC S5PV210_PA_ADC
#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD
/* UART */
#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
#define S3C_PA_UART S5PV210_PA_UART
#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET))
#define S5P_PA_UART0 S5P_PA_UART(0)
#define S5P_PA_UART1 S5P_PA_UART(1)
#define S5P_PA_UART2 S5P_PA_UART(2)
#define S5P_PA_UART3 S5P_PA_UART(3)
#define S5P_SZ_UART SZ_256
#endif /* __ASM_ARCH_MAP_H */
|
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Vector_h
#define Vector_h
#include "BInline.h"
#include "VMAllocate.h"
#include <cstddef>
#include <cstring>
namespace bmalloc {
// A replacement for std::vector that allocates using vmAllocate instead of
// malloc, shrinks automatically, and supports "popping" from the middle.
template<typename T>
class Vector {
static_assert(std::is_trivially_destructible<T>::value, "Vector must have a trivial destructor.");
public:
typedef T* iterator;
typedef const T* const_iterator;
Vector();
Vector(Vector&&);
~Vector();
iterator begin() { return m_buffer; }
iterator end() { return m_buffer + m_size; }
size_t size() { return m_size; }
size_t capacity() { return m_capacity; }
T& operator[](size_t);
T& last() { return m_buffer[m_size - 1]; }
void push(const T&);
T pop();
T pop(size_t);
T pop(const_iterator it) { return pop(it - begin()); }
void insert(iterator, const T&);
T remove(iterator);
void grow(size_t);
void shrink(size_t);
void resize(size_t);
void shrinkToFit();
private:
static const size_t growFactor = 2;
static const size_t shrinkFactor = 4;
static size_t initialCapacity() { return vmPageSize() / sizeof(T); }
void growCapacity();
void shrinkCapacity();
void reallocateBuffer(size_t);
T* m_buffer;
size_t m_size;
size_t m_capacity;
};
template<typename T>
inline Vector<T>::Vector()
: m_buffer(nullptr)
, m_size(0)
, m_capacity(0)
{
}
template<typename T>
inline Vector<T>::Vector(Vector&& other)
: m_buffer(other.m_buffer)
, m_size(other.m_size)
, m_capacity(other.m_capacity)
{
other.m_buffer = nullptr;
other.m_size = 0;
other.m_capacity = 0;
}
template<typename T>
Vector<T>::~Vector()
{
if (m_buffer)
vmDeallocate(m_buffer, vmSize(m_capacity * sizeof(T)));
}
template<typename T>
inline T& Vector<T>::operator[](size_t i)
{
BASSERT(i < m_size);
return m_buffer[i];
}
template<typename T>
BINLINE void Vector<T>::push(const T& value)
{
if (m_size == m_capacity)
growCapacity();
m_buffer[m_size++] = value;
}
template<typename T>
inline T Vector<T>::pop()
{
BASSERT(m_size);
T value = m_buffer[m_size - 1];
shrink(m_size - 1);
return value;
}
template<typename T>
inline T Vector<T>::pop(size_t i)
{
BASSERT(i < m_size);
std::swap(m_buffer[i], last());
return pop();
}
template<typename T>
void Vector<T>::insert(iterator it, const T& value)
{
size_t index = it - begin();
size_t moveCount = end() - it;
grow(m_size + 1);
std::memmove(&m_buffer[index + 1], &m_buffer[index], moveCount * sizeof(T));
m_buffer[index] = value;
}
template<typename T>
T Vector<T>::remove(iterator it)
{
size_t index = it - begin();
size_t moveCount = end() - it - 1;
T result = *it;
std::memmove(&m_buffer[index], &m_buffer[index + 1], moveCount * sizeof(T));
shrink(m_size - 1);
return result;
}
template<typename T>
inline void Vector<T>::grow(size_t size)
{
BASSERT(size >= m_size);
while (m_size < size)
push(T());
}
template<typename T>
inline void Vector<T>::shrink(size_t size)
{
BASSERT(size <= m_size);
m_size = size;
if (m_size < m_capacity / shrinkFactor && m_capacity > initialCapacity())
shrinkCapacity();
}
template<typename T>
inline void Vector<T>::resize(size_t size)
{
if (size <= m_size)
shrink(size);
else
grow(size);
}
template<typename T>
void Vector<T>::reallocateBuffer(size_t newCapacity)
{
RELEASE_BASSERT(newCapacity < std::numeric_limits<size_t>::max() / sizeof(T));
size_t vmSize = bmalloc::vmSize(newCapacity * sizeof(T));
T* newBuffer = vmSize ? static_cast<T*>(vmAllocate(vmSize)) : nullptr;
if (m_buffer) {
std::memcpy(newBuffer, m_buffer, m_size * sizeof(T));
vmDeallocate(m_buffer, bmalloc::vmSize(m_capacity * sizeof(T)));
}
m_buffer = newBuffer;
m_capacity = vmSize / sizeof(T);
}
template<typename T>
BNO_INLINE void Vector<T>::shrinkCapacity()
{
size_t newCapacity = max(initialCapacity(), m_capacity / shrinkFactor);
reallocateBuffer(newCapacity);
}
template<typename T>
BNO_INLINE void Vector<T>::growCapacity()
{
size_t newCapacity = max(initialCapacity(), m_size * growFactor);
reallocateBuffer(newCapacity);
}
template<typename T>
void Vector<T>::shrinkToFit()
{
if (m_size < m_capacity)
reallocateBuffer(m_size);
}
} // namespace bmalloc
#endif // Vector_h
|
#ifndef CEstatistica_h
#define CEstatistica_h
/**
* @brief Classe base de estatistica, cálculo de atributos básicos como média, desvio padrão e variância.
*
* Deve:
* Receber um vetor de dados, que pode ser um CVetor, um vetor de funções,
* ou seja um grupo de objetos.
*/
// Esta classe é herdeira da CEstatistica e vai usar objetos
// de CEstatistica, precisa ser declarada como friend
class CETesteMediaDuasAmostras;
/**
* @brief Classe estatística básica, determina informações como média, desvio padrão, variância, covariancia.
* A classe CEstatistica deve ter objetos agregados para a realização de cálculos estatisticos.
* */
class CEstatistica
{
friend class CETesteMediaDuasAmostras;
// Atributos
protected:
double media; ///< Valor da média
double desvioPadrao; ///< Valor do desvio padrão
double variancia; ///< Valor da variância =desvioPadrao*desvioPadrao;
double covariancia; ///< Valor da covariância
// Verificar pois covariancia relaciona duas variáveis.
protected:
int hasMissingData; ///< Dados inválidos
double missingCode; ///< Tipo de erro nos dados
int numeroDados; ///< Tamanho do vetor de dados
double sum; ///< soma
double sumX; ///< Potenciais das somas
double sumX2; ///< Potenciais das somas
double sumX3; ///< Potenciais das somas
double sumX4; ///< Potenciais das somas
// Métodos
public:
/// Construtor
CEstatistica ()
{
Inicializa (false, 0);
}
/// Construtor
CEstatistica (int HasMissingData, double MissingCode)
{
Inicializa (HasMissingData, MissingCode);
}
/// Destrutor
virtual ~ CEstatistica ()
{
}
/// Definir valores padrões
void Inicializa (int HasMissingData, double MissingCode);
/// Calcula e retorna média
double Media (double *Re_data, int NX, int NY, int NZ);
/// Calcula e retorna o desvio padrão.
double DesvioPadrao (double *x, int numData);
/// Calcula e retorna variância
double Variancia (double *Re_data, int NX, int NY, int NZ);
/// Calcula covariância de um vetor Re_data
double Covariancia (double *Re_data, int NX, int NY, int NZ);
/// Retorna numero dados
int NumeroDados ()
{
return numeroDados;
}
/// Retorna soma
double Soma ()
{
return sum;
}
/// Retorna media
double Media ()
{
return media;
}
/// Retorna desvio padrao
double DesvioPadrao ()
{
return desvioPadrao;
}
/// Retorna variancia
double Variancia ()
{
return variancia;
}
/// Retorna covariancia
double Covariancia ()
{
return covariancia;
}
};
// Quando deve-se comparar dois vetores de dados
/// Falta implementar.
class CEstatistica2D
{
public:
double covariancia;
};
#endif
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "econfig.h"
int main(int argc, char **argv) {
export_config_t config;
if (argc < 2) {
printf("test_config <file>\n");
return -1;
}
if (export_config_initialize(&config, argv[1]) != 0) {
perror("failed to initialize config");
return -1;
}
export_config_print(&config);
export_config_release(&config);
return 0;
}
|
/*
* timer.c
*
* Timer 0 is used for stepper timing
* Timer 1 is used as solenoid PWM, through OC1B output
* Timer 2 is used as overall (slow) event timer, as well sleep delay timer.
* Timer 3 is used to generate tones on the speaker through OC3A output,
* period is adjusted for tone.
*
* This file is part of FreeExpression.
*
* https://github.com/thetazzbot/FreeExpression
*
*
* FreeExpression is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2.
*
* FreeExpression 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 FreeExpression. If not, see http://www.gnu.org/licenses/.
*
*/
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <string.h>
#include <stdio.h>
#include "timer.h"
#include "stepper.h"
#include "display.h"
static uint8_t count_Hz = 250;
static uint8_t count_25Hz = 10;
volatile uint8_t flag_Hz;
volatile uint8_t flag_25Hz;
static int current_pen_pressure;
static int current_stepper_speed;
/*
* called @250 Hz, divide further in software for slow events
TCCR2A = (1 << WGM21); // CTC
TCCR2B = (1 << CS21) | (1 << CS20) ; //timer2's prescaler is different than the rest... set two bits instead of one
OCR2A = 249; // value to count to, CTC interrupts when this value is met
TIMSK2 = (1 << OCIE2A); // enable interrupt
*/
ISR( TIMER2_COMPA_vect )
{
if( --count_25Hz == 0 )
{
count_25Hz = 10;
flag_25Hz = 1;
}
if( --count_Hz == 0 )
{
count_Hz = 250;
flag_Hz = 1;
}
}
/*
* Timer 0 compare match, update stepper motors.
TCCR0A = (1 << WGM01); // CTC
TCCR0B = (1 << CS00) ; // prescaler 1/256 -> 250 kHz
OCR0A = 99; // value to count to, CTC interrupts when this value is met
TIMSK0 = (1 << OCIE0A); // enable interrupt
*/
ISR( TIMER0_COMPA_vect )
{
stepper_tick( );
}
/*
* Turn on beeper. Hz specifies frequency of the tone.
*/
void beeper_on( int Hz )
{
DDRE |= (1 << DDE3);
OCR3A = (F_CPU + Hz/2) / Hz - 1;
}
void beeper_off( void )
{
DDRE &= ~(1 << DDE3);
}
/*
* usleep: sleep (approximate/minimum) number of microseconds. We use timer2
* which runs at 62.50 kHz, or at 16 usec/tick. Maximum delay is about 2
* milliseconds . For longer delays, use msleep().
*
*/
void usleep( int usecs )
{
signed char end = TCNT2 + usecs / 16;
while( (signed char) (TCNT2 - end) < 0 )
continue;
}
void msleep( unsigned msecs )
{
while( msecs-- != 0 )
usleep( 1000 );
}
int timer_get_stepper_speed()
{
return current_stepper_speed;
// return OCR0A+1;
}
void beep()
{
beeper_on( 1760 );
msleep( 10 );
beeper_off( );
}
void timer_set_stepper_speed( int delay )
{
// delay is displayed in single increment steps 1 through MAX_STEPPER_SPEED_RANGES
// but internally each step represents ~25 usecs delay in timer
if (delay > MAX_STEPPER_SPEED_RANGES)
delay = MAX_STEPPER_SPEED_RANGES;
else if (delay < 1 )
delay =1;
current_stepper_speed = delay;
delay=(255 - (delay*25)); // inverse
TCCR0B &= ~7; // stop timer, and clear prescaler bit
OCR0A = delay - 1;
TCCR0B |= 4; // default 1:64 prescaler
//display_update();
}
int timer_get_pen_pressure()
{
return current_pen_pressure;
}
/**
* Sets the pen pressure according to a value from MIN_PEN_PRESSURE to MAX_PEN_PRESSURE.
*
* @param pressure Integer
*/
void timer_set_pen_pressure( int pressure )
{
// pen pressure is displayed in single increment steps
// but internally each step represents 50 usecs delay in pwm
// MAX_PEN_PWM is the max value for the PWM, not the maximum pressure
// maximum value of 500 is basically no pressure at all
// it could go as high as 1000 but that is pointless
// since anything between 500 and 1000 results in 6 volts
// which the solenoid doesn't care about.
if( pressure > MAX_CUTTER_P_RANGES )
pressure = MAX_CUTTER_P_RANGES;
else if( pressure < 1)
pressure=1;
current_pen_pressure = pressure;
unsigned pwm = (pressure) * (( MAX_PEN_PWM - MIN_PEN_PWM)/MAX_CUTTER_P_RANGES);
OCR1B = (MAX_PEN_PWM -pwm);
//display_update();
}
/*
* Init timers
*/
void timer_init( void )
{
//ATMega1281 - Used in Cricut Expression CREX001
// set timer 0, variable period for stepper
TCCR0A = (1 << WGM01); // CTC
TCCR0B = (1 << CS00) | (1<<CS01) ; // prescaler 1/256 -> 250 kHz << this doesnt compute @16mhz/256=62500
OCR0A = 99; // value to count to, CTC interrupts when this value is met
TIMSK0 = (1 << OCIE0A); // enable interrupt
// set timer 2 for 250 Hz period
TCCR2A = (1 << WGM21); // CTC
TCCR2B = (1 << CS21) | (1 << CS20) ; //timer2's prescaler is different than the rest... set two bits instead of one
OCR2A = 249; // value to count to, CTC interrupts when this value is met
TIMSK2 = (1 << OCIE2A); // enable interrupt
DDRB |= (1 << PB6); // PB6 is PWM output, oc1b
// set timer 1, WGM mode 7, fast PWM 10 bit
// PWM, Phase Correct, 10-bit
//Clear OCnA/OCnB/OCnC on compare match, set OCnA/OCnB/OCnC at BOTTOM (non-inverting mode)
TCCR1A = (1 << WGM11) | (1 << WGM10) | (1 << COM1B1);
OCR1B = 1023;
TCCR1B = (1 << WGM12) | (1 << CS10); // 00001001 wave form generation mode,CLKio no prescaling
// Timer 3, WGM mode 15 (1111), Fast PWM using OCR3A
// this is used by the beeper, OCR3A is set in beeper_on(hz)
TCCR3A = (1 << COM3A0) | (1 << WGM31) | (1 << WGM30);
TCCR3B = (1 << WGM33) | (1 << WGM32) | 1;
}
|
/*
* Copyright © 2014, Varun Chitre "varun.chitre15" <varun.chitre15@gmail.com>
*
* Sound control engine for WCD9304
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/module.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/kernel.h>
#include <linux/kallsyms.h>
#include <linux/mfd/wcd9xxx/wcd9304_registers.h>
#define ENGINE_VERSION 1
#define ENGINE_VERSION_SUB 5
#define REG_HSGAIN_DEF 18
#define REG_HSGAIN_BOOSTED 0
extern struct snd_soc_codec *tz_codec_pointer;
unsigned int sitar_read(struct snd_soc_codec *codec, unsigned int reg);
int sitar_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value);
static int is_boosted = 0;
static ssize_t speaker_boost_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%u", sitar_read(tz_codec_pointer, SITAR_A_CDC_RX1_VOL_CTL_B2_CTL));
}
static ssize_t speaker_boost_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
unsigned int val;
sscanf(buf, "%u", &val);
if (val>8)
{
pr_info("[thundersonic-engine] Too much gain value can damage your speakers: Reverting to safer value 8\n");
val=8;
}
sitar_write(tz_codec_pointer, SITAR_A_CDC_RX1_VOL_CTL_B2_CTL, val);
return count;
}
static ssize_t headphone_boost_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
int status;
sscanf(buf, "%u", &status);
if(status==1)
{
sitar_write(tz_codec_pointer, SITAR_A_RX_HPH_L_GAIN, REG_HSGAIN_BOOSTED);
sitar_write(tz_codec_pointer, SITAR_A_RX_HPH_R_GAIN, REG_HSGAIN_BOOSTED);
pr_info("[thundersonic-engine] Headphone boost enabled\n");
is_boosted=1;
}
else if(status==0)
{
sitar_write(tz_codec_pointer, SITAR_A_RX_HPH_L_GAIN, REG_HSGAIN_DEF);
sitar_write(tz_codec_pointer, SITAR_A_RX_HPH_R_GAIN, REG_HSGAIN_DEF);
pr_info("[thundersonic-engine] Headphone boost disabled\n");
is_boosted=0;
}
else
{
pr_info("Invalid choice: 1 for boost, 0 for unboost");
}
return count;
}
static ssize_t headphone_boost_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
if(is_boosted==1)
return sprintf(buf, "1");
else
return sprintf(buf, "0");
}
static ssize_t thundersonic_version_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "version: %u.%u\n", ENGINE_VERSION, ENGINE_VERSION_SUB);
}
static struct kobj_attribute speaker_boost_attribute =
__ATTR(speaker_boost,
0666,
speaker_boost_show,
speaker_boost_store);
static struct kobj_attribute headphone_boost_attribute =
__ATTR(headphone_boost,
0666,
headphone_boost_show,
headphone_boost_store);
static struct kobj_attribute thundersonic_version_attribute =
__ATTR(engine_version,
0444,
thundersonic_version_show, NULL);
static struct attribute *thundersonic_engine_attrs[] =
{
&speaker_boost_attribute.attr,
&headphone_boost_attribute.attr,
&thundersonic_version_attribute.attr,
NULL,
};
static struct attribute_group sound_control_attr_group =
{
.attrs = thundersonic_engine_attrs,
};
static struct kobject *sound_control_kobj;
static int sound_control_init(void)
{
int sysfs_result;
printk(KERN_DEBUG "[%s]\n",__func__);
sound_control_kobj =
kobject_create_and_add("thundersonic_engine", kernel_kobj);
if (!sound_control_kobj) {
pr_err("%s Interface create failed!\n",
__FUNCTION__);
return -ENOMEM;
}
sysfs_result = sysfs_create_group(sound_control_kobj,
&sound_control_attr_group);
if (sysfs_result) {
pr_info("%s sysfs create failed!\n", __FUNCTION__);
kobject_put(sound_control_kobj);
}
return sysfs_result;
}
static void sound_control_exit(void)
{
if (sound_control_kobj != NULL)
kobject_put(sound_control_kobj);
}
module_init(sound_control_init);
module_exit(sound_control_exit);
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("Varun Chitre <varun.chitre15@gmail.com>");
MODULE_DESCRIPTION("ThunderSonic Sound Engine - A control driver for WCD9304 sound card");
|
#ifndef lsrpHEADER
#define lsrpHEADER
#include "commonItems.h"
#include "sw.h"
#include "socket.h"
void lsrp_outgoingmessage(struct data_segment ds, int size, char * IP);
int lsrp_incomingmessage(struct packet pkt);
struct packet packet_encapsulation(struct data_segment ds, int size, char * IP);
struct data_segment packet_decapsulation(struct packet pkt);
struct packet lsrp_createACK(struct packet recv);
void lsrp_readInCfg();
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright 2018 MediaTek 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.
*/
#ifndef SOC_MEDIATEK_PMIC_WRAP_COMMON_H
#define SOC_MEDIATEK_PMIC_WRAP_COMMON_H
#include <arch/io.h>
#include <console/console.h>
#include <timer.h>
#define PWRAPTAG "[PWRAP] "
#define pwrap_err(fmt, arg ...) printk(BIOS_ERR, PWRAPTAG "ERROR,line=%d" fmt, \
__LINE__, ## arg)
/* external API */
s32 pwrap_wacs2(u32 write, u16 adr, u16 wdata, u16 *rdata, u32 init_check);
s32 pwrap_init(void);
static inline s32 pwrap_read(u16 addr, u16 *rdata)
{
return pwrap_wacs2(0, addr, 0, rdata, 1);
}
static inline s32 pwrap_write(u16 addr, u16 wdata)
{
return pwrap_wacs2(1, addr, wdata, 0, 1);
}
static inline u16 pwrap_read_field(u16 reg, u16 mask, u16 shift)
{
u16 rdata;
pwrap_read(reg, &rdata);
rdata &= (mask << shift);
rdata = (rdata >> shift);
return rdata;
}
static inline void pwrap_write_field(u16 reg, u16 val, u16 mask, u16 shift)
{
u16 old, new;
pwrap_read(reg, &old);
new = old & ~(mask << shift);
new |= (val << shift);
pwrap_write(reg, new);
}
/* internal API */
s32 pwrap_reset_spislv(void);
static inline s32 pwrap_read_nochk(u16 addr, u16 *rdata)
{
return pwrap_wacs2(0, addr, 0, rdata, 0);
}
static inline s32 pwrap_write_nochk(u16 addr, u16 wdata)
{
return pwrap_wacs2(1, addr, wdata, 0, 0);
}
/* dewrapper defaule value */
enum {
DEFAULT_VALUE_READ_TEST = 0x5aa5,
WRITE_TEST_VALUE = 0xa55a
};
/* timeout setting */
enum {
TIMEOUT_READ_US = 255,
TIMEOUT_WAIT_IDLE_US = 255
};
/* manual commnd */
enum {
OP_WR = 0x1,
OP_CSH = 0x0,
OP_CSL = 0x1,
OP_OUTS = 0x8,
};
enum {
RDATA_WACS_RDATA_SHIFT = 0,
RDATA_WACS_FSM_SHIFT = 16,
RDATA_WACS_REQ_SHIFT = 19,
RDATA_SYNC_IDLE_SHIFT,
RDATA_INIT_DONE_SHIFT,
RDATA_SYS_IDLE_SHIFT,
};
enum {
RDATA_WACS_RDATA_MASK = 0xffff,
RDATA_WACS_FSM_MASK = 0x7,
RDATA_WACS_REQ_MASK = 0x1,
RDATA_SYNC_IDLE_MASK = 0x1,
RDATA_INIT_DONE_MASK = 0x1,
RDATA_SYS_IDLE_MASK = 0x1,
};
/* WACS_FSM */
enum {
WACS_FSM_IDLE = 0x00,
WACS_FSM_REQ = 0x02,
WACS_FSM_WFDLE = 0x04, /* wait for dle, wait for read data done */
WACS_FSM_WFVLDCLR = 0x06, /* finish read data, wait for valid flag
* clearing */
WACS_INIT_DONE = 0x01,
WACS_SYNC_IDLE = 0x01,
WACS_SYNC_BUSY = 0x00
};
/* error information flag */
enum {
E_PWR_INVALID_ARG = 1,
E_PWR_INVALID_RW = 2,
E_PWR_INVALID_ADDR = 3,
E_PWR_INVALID_WDAT = 4,
E_PWR_INVALID_OP_MANUAL = 5,
E_PWR_NOT_IDLE_STATE = 6,
E_PWR_NOT_INIT_DONE = 7,
E_PWR_NOT_INIT_DONE_READ = 8,
E_PWR_WAIT_IDLE_TIMEOUT = 9,
E_PWR_WAIT_IDLE_TIMEOUT_READ = 10,
E_PWR_INIT_SIDLY_FAIL = 11,
E_PWR_RESET_TIMEOUT = 12,
E_PWR_TIMEOUT = 13,
E_PWR_INIT_RESET_SPI = 20,
E_PWR_INIT_SIDLY = 21,
E_PWR_INIT_REG_CLOCK = 22,
E_PWR_INIT_ENABLE_PMIC = 23,
E_PWR_INIT_DIO = 24,
E_PWR_INIT_CIPHER = 25,
E_PWR_INIT_WRITE_TEST = 26,
E_PWR_INIT_ENABLE_CRC = 27,
E_PWR_INIT_ENABLE_DEWRAP = 28,
E_PWR_INIT_ENABLE_EVENT = 29,
E_PWR_READ_TEST_FAIL = 30,
E_PWR_WRITE_TEST_FAIL = 31,
E_PWR_SWITCH_DIO = 32
};
typedef u32 (*loop_condition_fp)(u32);
static inline u32 wait_for_fsm_vldclr(u32 x)
{
return ((x >> RDATA_WACS_FSM_SHIFT) & RDATA_WACS_FSM_MASK) !=
WACS_FSM_WFVLDCLR;
}
static inline u32 wait_for_sync(u32 x)
{
return ((x >> RDATA_SYNC_IDLE_SHIFT) & RDATA_SYNC_IDLE_MASK) !=
WACS_SYNC_IDLE;
}
static inline u32 wait_for_idle_and_sync(u32 x)
{
return ((((x >> RDATA_WACS_FSM_SHIFT) & RDATA_WACS_FSM_MASK) !=
WACS_FSM_IDLE) || (((x >> RDATA_SYNC_IDLE_SHIFT) &
RDATA_SYNC_IDLE_MASK) != WACS_SYNC_IDLE));
}
static inline u32 wait_for_cipher_ready(u32 x)
{
return x != 3;
}
u32 wait_for_state_idle(u32 timeout_us, void *wacs_register,
void *wacs_vldclr_register, u32 *read_reg);
u32 wait_for_state_ready(loop_condition_fp fp, u32 timeout_us,
void *wacs_register, u32 *read_reg);
#endif /* SOC_MEDIATEK_PMIC_WRAP_COMMON_H */
|
#ifndef __SOUND_HDA_BEEP_H
#define __SOUND_HDA_BEEP_H
#include "hda_codec.h"
#define HDA_BEEP_MODE_OFF 0
#define HDA_BEEP_MODE_ON 1
#define HDA_BEEP_MODE_SWREG 2
/* beep information */
struct hda_beep {
struct input_dev *dev;
struct hda_codec *codec;
unsigned int mode;
char phys[32];
int tone;
hda_nid_t nid;
unsigned int enabled:1;
unsigned int request_enable:1;
unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */
struct work_struct register_work; /* registration work */
struct delayed_work unregister_work; /* unregistration work */
struct work_struct beep_work; /* scheduled task for beep event */
struct mutex mutex;
};
#ifdef CONFIG_SND_HDA_INPUT_BEEP
int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
void snd_hda_detach_beep_device(struct hda_codec *codec);
#else
#define snd_hda_attach_beep_device(...) 0
#define snd_hda_detach_beep_device(...)
#endif
#endif
|
#ifndef _XT_MARK_H_target
#define _XT_MARK_H_target
/* Version 0 */
struct xt_mark_target_info {
unsigned long mark;
};
/* Version 1 */
enum {
XT_MARK_SET=0,
XT_MARK_AND,
XT_MARK_OR,
XT_MARK_COPYXID,
};
struct xt_mark_target_info_v1 {
unsigned long mark;
u_int8_t mode;
};
struct xt_mark_tginfo2 {
u_int32_t mark, mask;
};
#endif /*_XT_MARK_H_target */
|
/*
C-Dogs SDL
A port of the legendary (and fun) action/arcade cdogs.
Copyright (c) 2014-2016, 2020-2021 Cong Xu
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include "net_util.h"
#include "proto/nanopb/pb_decode.h"
#include "proto/nanopb/pb_encode.h"
ENetPacket *NetEncode(const GameEventType e, const void *data)
{
uint8_t buffer[1024];
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof buffer);
const pb_msgdesc_t *fields = GameEventGetEntry(e).Fields;
const bool status =
(data && fields) ? pb_encode(&stream, fields, data) : true;
CASSERT(status, "Failed to encode pb");
int msgId = (int)e;
ENetPacket *packet = enet_packet_create(
&msgId, NET_MSG_SIZE + stream.bytes_written,
ENET_PACKET_FLAG_RELIABLE);
memcpy(packet->data + NET_MSG_SIZE, buffer, stream.bytes_written);
return packet;
}
bool NetDecode(ENetPacket *packet, void *dest, const pb_msgdesc_t *fields)
{
pb_istream_t stream = pb_istream_from_buffer(
packet->data + NET_MSG_SIZE, packet->dataLength - NET_MSG_SIZE);
bool status = pb_decode(&stream, fields, dest);
CASSERT(status, "Failed to decode pb");
return status;
}
NPlayerData NMakePlayerData(const PlayerData *p)
{
NPlayerData d = NPlayerData_init_default;
d.has_Colors = d.has_Stats = d.has_Totals = true;
const Character *c = &p->Char;
strcpy(d.Name, p->name);
strcpy(d.CharacterClass, p->Char.Class->Name);
if (p->Char.Hair)
{
strcpy(d.Hair, p->Char.Hair);
}
d.Colors = CharColors2Net(c->Colors);
d.Weapons_count = MAX_WEAPONS;
for (int i = 0; i < (int)d.Weapons_count; i++)
{
strcpy(d.Weapons[i], p->guns[i] != NULL ? p->guns[i]->name : "");
}
d.Lives = p->Lives;
d.Stats = p->Stats;
d.Totals = p->Totals;
d.MaxHealth = p->Char.maxHealth;
d.LastMission = p->lastMission;
d.UID = p->UID;
Ammo2Net(&d.Ammo_count, d.Ammo, &p->ammo);
return d;
}
NCampaignDef NMakeCampaignDef(const Campaign *co)
{
NCampaignDef def;
memset(&def, 0, sizeof def);
if (co->Entry.Path)
{
strcpy((char *)def.Path, co->Entry.Path);
}
def.GameMode = co->Entry.Mode;
def.Mission = co->MissionIndex;
return def;
}
NMissionComplete NMakeMissionComplete(const struct MissionOptions *mo)
{
NMissionComplete mc;
mc.ShowMsg = MissionHasRequiredObjectives(mo);
return mc;
}
struct vec2i Net2Vec2i(const NVec2i v)
{
return svec2i(v.x, v.y);
}
NVec2i Vec2i2Net(const struct vec2i v)
{
NVec2i nv;
nv.x = v.x;
nv.y = v.y;
return nv;
}
struct vec2 NetToVec2(const NVec2 v)
{
return svec2(v.x, v.y);
}
NVec2 Vec2ToNet(const struct vec2 v)
{
NVec2 nv;
nv.x = v.x;
nv.y = v.y;
return nv;
}
color_t Net2Color(const NColor c)
{
color_t co;
co.r = (uint8_t)((c.RGBA & 0xff000000) >> 24);
co.g = (uint8_t)((c.RGBA & 0x00ff0000) >> 16);
co.b = (uint8_t)((c.RGBA & 0x0000ff00) >> 8);
co.a = (uint8_t)(c.RGBA & 0x000000ff);
return co;
}
NColor Color2Net(const color_t c)
{
NColor co;
co.RGBA = (c.r << 24) | (c.g << 16) | (c.b << 8) | c.a;
return co;
}
NCharColors CharColors2Net(const CharColors c)
{
NCharColors co;
co.has_Skin = co.has_Arms = co.has_Body = co.has_Legs = co.has_Hair =
co.has_Feet = true;
co.Skin = Color2Net(c.Skin);
co.Arms = Color2Net(c.Arms);
co.Body = Color2Net(c.Body);
co.Legs = Color2Net(c.Legs);
co.Hair = Color2Net(c.Hair);
co.Feet = Color2Net(c.Feet);
return co;
}
CharColors Net2CharColors(const NCharColors c)
{
CharColors co;
co.Skin = Net2Color(c.Skin);
co.Arms = Net2Color(c.Arms);
co.Body = Net2Color(c.Body);
co.Legs = Net2Color(c.Legs);
co.Hair = Net2Color(c.Hair);
co.Feet = Net2Color(c.Feet);
return co;
}
void Ammo2Net(pb_size_t *ammoCount, NAmmo *ammo, const CArray *a)
{
*ammoCount = 0;
CA_FOREACH(int, amount, *a)
if (*amount > 0)
{
ammo[*ammoCount].Id = _ca_index;
ammo[*ammoCount].Amount = *amount;
(*ammoCount)++;
}
CA_FOREACH_END()
}
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:40 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/frame/pointer.h */
|
/******************************************************************************
* Icinga 2 *
* Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software Foundation *
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
#ifndef CLRCHECKTASK_H
#define CLRCHECKTASK_H
#include "methods/i2-methods.h"
#include "base/process.h"
#include "icinga/service.h"
namespace icinga
{
/**
* Implements service checks based CLR libraries.
*
* @ingroup methods
*/
class I2_METHODS_API ClrCheckTask
{
public:
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr);
private:
ClrCheckTask(void);
static void ProcessFinishedHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr, const ProcessResult& pr);
};
}
#endif /* CLRCHECKTASK_H */
|
/* $Id: scatterlist.h,v 1.1.1.1 2004/09/28 06:06:55 sure Exp $ */
#ifndef _SPARC_SCATTERLIST_H
#define _SPARC_SCATTERLIST_H
#include <linux/types.h>
struct scatterlist {
/* This will disappear in 2.5.x */
char *address;
/* These two are only valid if ADDRESS member of this
* struct is NULL.
*/
struct page *page;
unsigned int offset;
unsigned int length;
__u32 dvma_address; /* A place to hang host-specific addresses at. */
__u32 dvma_length;
};
#define sg_dma_address(sg) ((sg)->dvma_address)
#define sg_dma_len(sg) ((sg)->dvma_length)
#define ISA_DMA_THRESHOLD (~0UL)
#endif /* !(_SPARC_SCATTERLIST_H) */
|
/* base64.h
* Base-64 conversion
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __BASE64_H__
#define __BASE64_H__
#include <epan/tvbuff.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* In-place decoding of a base64 string. Resulting string is NULL terminated */
size_t epan_base64_decode(char *s);
extern tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __BASE64_H__ */
|
/*-------------------------------------------------------------------------*/
/**
\file ui.h
\author Copyright (C) 2014, 2015 Klearnel-Devs
\brief User interface header
*/
/*--------------------------------------------------------------------------*/
#ifndef _KLEARNEL_UI_H
#define _KLEARNEL_UI_H
/*---------------------------------------------------------------------------
Definitions
---------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*/
/**
\brief Get the maximum size of a type pid_t
*/
/*-------------------------------------------------------------------------*/
#define PID_MAX_S sizeof(pid_t)
/*---------------------------------------------------------------------------
Prototypes
---------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*/
/**
\brief Send KL_EXIT to all Klearnel services
\return 0 on success, -1 if Klearnel does not shutdown successfully
Ask to all Klearnel services to shutdown with the KL_EXIT signal.
*/
/*--------------------------------------------------------------------------*/
int stop_action();
/*-------------------------------------------------------------------------*/
/**
\brief Allow to send a query to the quarantine
\param commands Commands to execute
\param action The action to take
\return 0 on success, -1 on error
*/
/*--------------------------------------------------------------------------*/
int qr_query(char **commands, int action);
/*-------------------------------------------------------------------------*/
/**
\brief Allow to send a query to the scanner
\param commands Commands to execute
\param action The action to take
\return 0 on success, -1 on error
*/
/*--------------------------------------------------------------------------*/
int scan_query(char **commands, int action);
/*-------------------------------------------------------------------------*/
/**
\brief Function that executes commands
\param nb The number of commands
\param commands The commands to execute
\return void
Main function that calls the right routine
according to the passed arguments
*/
/*--------------------------------------------------------------------------*/
void execute_commands(int nb, char **commands);
#endif /* _KLEARNEL_UI_H */ |
#pragma once
#include "Cute/Component.h"
CUTE_NS_BEGIN
class CUTE_CORE_API Transform : public Component
{
DECLARE_RTTI(Transform, Component, OID_TRANSFORM)
public:
Transform();
~Transform();
protected:
};
CUTE_NS_END
|
/*
* Copyright (c) 1993-1997, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
*/
/*
* polys.c
* This program demonstrates polygon stippling.
*/
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif
#include <stdlib.h>
void display(void)
{
GLubyte fly[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60,
0x04, 0x60, 0x06, 0x20, 0x04, 0x30, 0x0C, 0x20,
0x04, 0x18, 0x18, 0x20, 0x04, 0x0C, 0x30, 0x20,
0x04, 0x06, 0x60, 0x20, 0x44, 0x03, 0xC0, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x66, 0x01, 0x80, 0x66, 0x33, 0x01, 0x80, 0xCC,
0x19, 0x81, 0x81, 0x98, 0x0C, 0xC1, 0x83, 0x30,
0x07, 0xe1, 0x87, 0xe0, 0x03, 0x3f, 0xfc, 0xc0,
0x03, 0x31, 0x8c, 0xc0, 0x03, 0x33, 0xcc, 0xc0,
0x06, 0x64, 0x26, 0x60, 0x0c, 0xcc, 0x33, 0x30,
0x18, 0xcc, 0x33, 0x18, 0x10, 0xc4, 0x23, 0x08,
0x10, 0x63, 0xC6, 0x08, 0x10, 0x30, 0x0c, 0x08,
0x10, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x08};
GLubyte halftone[] = {
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
/* draw one solid, unstippled rectangle, */
/* then two stippled rectangles */
glRectf (25.0, 25.0, 125.0, 125.0);
glEnable (GL_POLYGON_STIPPLE);
glPolygonStipple (fly);
glRectf (125.0, 25.0, 225.0, 125.0);
glPolygonStipple (halftone);
glRectf (225.0, 25.0, 325.0, 125.0);
glDisable (GL_POLYGON_STIPPLE);
glFlush ();
}
void init (void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluOrtho2D (0.0, (GLdouble) w, 0.0, (GLdouble) h);
}
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (350, 150);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc (keyboard);
glutMainLoop();
return 0;
}
|
/*
Copyright (C) 2001 Tensilica, Inc. All Rights Reserved.
Revised to support Tensilica processors and to improve overall performance
*/
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU General Public License along
with this program; if not, write the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston MA 02111-1307, USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef __IPC_COMPILE_H__
#define __IPC_COMPILE_H__
#ifndef __IPC_LINK_H__
#include "ipc_link.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
void ipa_compile_init ();
void ipacom_process_symtab (char* symtab_file);
size_t ipacom_process_file (char* input_file, const PU_Info* pu,
UINT32 ProMP_id);
void ipacom_add_comment(size_t n, const char* comment);
void ipacom_doit ( char *ipa_filename );
#ifdef __cplusplus
} // Close extern "C"
#endif
#endif /* __IPC_COMPILE_H__ */
|
/****************************************************************************
* Copyright (c) 1999-2004,2005 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey <dickey@clark.net> 1999 *
****************************************************************************/
#include <curses.priv.h>
MODULE_ID("$Id: version.c 317 2005-10-02 21:32:49Z pepsiman $")
NCURSES_EXPORT(const char *)
curses_version(void)
{
T((T_CALLED("curses_version()")));
returnCPtr("ncurses " NCURSES_VERSION_STRING);
}
|
/**
******************************************************************************
* @file SPI/SPI_FullDuplex_AdvComPolling/Master/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.0.1
* @date 26-February-2014
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void EXTI0_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
pr_comp.h
(description)
Copyright (C) 1996-1997 Id Software, 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:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
// this file is shared by quake and qcc
#ifndef _PR_COMP_H
#define _PR_COMP_H
#include "qtypes.h"
typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
#define OFS_NULL 0
#define OFS_RETURN 1
#define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors
#define OFS_PARM1 7
#define OFS_PARM2 10
#define OFS_PARM3 13
#define OFS_PARM4 16
#define OFS_PARM5 19
#define OFS_PARM6 22
#define OFS_PARM7 25
#define RESERVED_OFS 28
enum {
OP_DONE,
OP_MUL_F,
OP_MUL_V,
OP_MUL_FV,
OP_MUL_VF,
OP_DIV_F,
OP_ADD_F,
OP_ADD_V,
OP_SUB_F,
OP_SUB_V,
OP_EQ_F,
OP_EQ_V,
OP_EQ_S,
OP_EQ_E,
OP_EQ_FNC,
OP_NE_F,
OP_NE_V,
OP_NE_S,
OP_NE_E,
OP_NE_FNC,
OP_LE,
OP_GE,
OP_LT,
OP_GT,
OP_LOAD_F,
OP_LOAD_V,
OP_LOAD_S,
OP_LOAD_ENT,
OP_LOAD_FLD,
OP_LOAD_FNC,
OP_ADDRESS,
OP_STORE_F,
OP_STORE_V,
OP_STORE_S,
OP_STORE_ENT,
OP_STORE_FLD,
OP_STORE_FNC,
OP_STOREP_F,
OP_STOREP_V,
OP_STOREP_S,
OP_STOREP_ENT,
OP_STOREP_FLD,
OP_STOREP_FNC,
OP_RETURN,
OP_NOT_F,
OP_NOT_V,
OP_NOT_S,
OP_NOT_ENT,
OP_NOT_FNC,
OP_IF,
OP_IFNOT,
OP_CALL0,
OP_CALL1,
OP_CALL2,
OP_CALL3,
OP_CALL4,
OP_CALL5,
OP_CALL6,
OP_CALL7,
OP_CALL8,
OP_STATE,
OP_GOTO,
OP_AND,
OP_OR,
OP_BITAND,
OP_BITOR
};
typedef struct statement_s
{
unsigned short op;
short a,b,c;
} dstatement_t;
typedef struct
{
unsigned short type; // if DEF_SAVEGLOBGAL bit is set
// the variable needs to be saved in savegames
unsigned short ofs;
int s_name;
} ddef_t;
#define DEF_SAVEGLOBAL (1<<15)
#define MAX_PARMS 8
typedef struct
{
int first_statement; // negative numbers are builtins
int parm_start;
int locals; // total ints of parms + locals
int profile; // runtime
int s_name;
int s_file; // source file defined in
int numparms;
byte parm_size[MAX_PARMS];
} dfunction_t;
#define PROG_VERSION 6
typedef struct
{
int version;
int crc; // check of header file
int ofs_statements;
int numstatements; // statement 0 is an error
int ofs_globaldefs;
int numglobaldefs;
int ofs_fielddefs;
int numfielddefs;
int ofs_functions;
int numfunctions; // function 0 is an empty
int ofs_strings;
int numstrings; // first string is a null string
int ofs_globals;
int numglobals;
int entityfields;
} dprograms_t;
#endif // _PR_COMP_H
|
/*
** string.h for string in /home/champi_f/Kernel/ProjectOne/fromScratch
**
** Made by Florian Champin
** Login <champi_f@champi-f>
**
** Started on Mon Oct 12 14:47:11 2015 Florian Champin
** Last update Mon Oct 12 14:47:59 2015 Florian Champin
*/
#ifndef STRING_H_
# define STRING_H_
void *memset(void *, int, int);
#endif /* !STRING_H_ */
|
/*
* Copyright (C) 2011-2015 Alexander Saprykin <xelfium@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.
*/
#ifndef NSRKINETICSCROLLER_H
#define NSRKINETICSCROLLER_H
#include <QObject>
#include <QPoint>
#include <QTime>
#include <QList>
#include "iscrollable.h"
struct TrackingPoint {
TrackingPoint (const QTime& t, const QPoint& p) :
time (t),
point (p)
{}
QTime time;
QPoint point;
};
class NSRKineticScroller : public QObject
{
Q_OBJECT
public:
explicit NSRKineticScroller (QObject *parent = 0);
virtual ~NSRKineticScroller ();
void setScrollerObject (IScrollable *obj);
void setScrollEnabled (bool enabled);
void stopMoving();
void stopMovingSilent();
protected:
bool eventFilter (QObject *obj, QEvent *ev);
void timerEvent(QTimerEvent *ev);
signals:
void scrollStarted();
void scrollChanged();
void scrollStopped();
void doubleClicked(const QPoint& pos);
void prevPageRequest();
void nextPageRequest();
void firstClick (const QPoint& pos);
private:
void startMoving();
IScrollable *_scrollObject;
bool _isPressed;
bool _isTracking;
int _actionsToIgnore;
QPoint _velocity;
QPoint _lastPosition;
QPoint _lastVelocity;
int _timerId;
bool _xScroll;
bool _yScroll;
bool _canGoPrevPage;
bool _canGoNextPage;
bool _isScrollEnabled;
QList<TrackingPoint> _trackingPoints;
int _trackingIndex;
QTime _lastClickTime;
QPoint _lastClickPos;
};
#endif // NSRKINETICSCROLLER_H
|
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/module.h>
#include <net/checksum.h>
#include <asm/byteorder.h>
/*
* copy from fs while checksumming, otherwise like csum_partial
*/
__wsum
csum_partial_copy_from_user(const void __user *src, void *dst, int len,
__wsum sum, int *csum_err)
{
int missing;
missing = __copy_from_user(dst, src, len);
if (missing) {
memset(dst + len - missing, 0, missing);
*csum_err = -EFAULT;
} else
*csum_err = 0;
return csum_partial(dst, len, sum);
}
EXPORT_SYMBOL(csum_partial_copy_from_user);
/* These are from csum_64plus.S */
EXPORT_SYMBOL(csum_partial);
EXPORT_SYMBOL(csum_partial_copy);
EXPORT_SYMBOL(ip_compute_csum);
EXPORT_SYMBOL(ip_fast_csum);
|
macro_line|#include "../git-compat-util.h"
DECL|function|gitmkdtemp
r_char
op_star
id|gitmkdtemp
c_func
(paren
r_char
op_star
r_template
)paren
(brace
r_if
c_cond
(paren
op_logical_neg
op_star
id|mktemp
c_func
(paren
r_template
)paren
op_logical_or
id|mkdir
c_func
(paren
r_template
comma
l_int|0700
)paren
)paren
r_return
l_int|NULL
suffix:semicolon
r_return
r_template
suffix:semicolon
)brace
eof
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.