text
stringlengths 4
6.14k
|
|---|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "../../process/process.h"
#include "../../process/message.h"
#define PROC_TABLE_OFFSET 0x2029A0
typedef void (*sys_command)(process*, unsigned char*);
void rawDump(process* proc, unsigned char* ram);
void ctxDump(process* proc, unsigned char* ram);
void msgDump(process* proc, unsigned char* ram);
#define CMD_COUNT 3
char* cmdWord[CMD_COUNT] = {
"dump",
"msg",
"context"
};
sys_command cmdFunc[CMD_COUNT] = {
(sys_command)&rawDump,
(sys_command)&msgDump,
(sys_command)&ctxDump
};
char cmdbuf[50];
void ctxDump(process* proc, unsigned char* ram) {
printf(" esp: %08x cr3: %08x eip: %08x eflags: %08x\n", proc->ctx.esp, proc->ctx.cr3, proc->ctx.eip, proc->ctx.eflags);
printf(" eax: %08x ecx: %08x edx: %08x ebx: %08x\n", proc->ctx.eax, proc->ctx.ecx, proc->ctx.edx, proc->ctx.ebx);
printf(" ebp: %08x esi: %08x edi: %08x\n", proc->ctx.ebp, proc->ctx.esi, proc->ctx.edi);
printf(" es: %04x cs: %04x ss: %04x ds: %04x fs: %04x gs: %04x\n", proc->ctx.es, proc->ctx.cs, proc->ctx.ss, proc->ctx.ds, proc->ctx.fs, proc->ctx.gs);
printf(" err: %08x vif: %02x type: %02x\n", proc->ctx.err, proc->ctx.vif, proc->ctx.type);
}
void msgDump(process* proc, unsigned char* ram) {
unsigned int cur_msg_idx = (unsigned int)proc->root_msg;
message* cur_msg;
if(!cur_msg_idx) {
printf("Empty message queue\n");
return;
}
printf("Message queue for process %u\n-----------------------------\n", proc->id);
while(cur_msg_idx) {
cur_msg = (message*)(&ram[cur_msg_idx]);
printf("from pid: %08x\n", cur_msg->source);
printf("command: %08x\n", cur_msg->command);
printf("payload: %08x\n", cur_msg->source);
printf("-----------------------------\n");
cur_msg_idx = (unsigned int)cur_msg->next;
}
}
void rawDump(process* proc, unsigned char* ram) {
printf(" id: %d\n", proc->id);
printf(" root_page: %08x\n", (unsigned int)proc->root_page);
printf(" root_msg: %08x\n", (unsigned int)proc->root_msg);
printf(" usr: %08x\n", (unsigned int)proc->usr);
printf(" base: %08x\n", proc->base);
printf(" size: %08x\n", proc->size);
printf(" flags: %08x\n", proc->flags);
printf(" wait_pid: %08x\n", proc->wait_pid);
printf(" wait_cmd: %08x\n", proc->wait_cmd);
printf(" called_count: %d\n", proc->called_count);
printf(" cpu_pct: %d\n", proc->cpu_pct);
}
int main(int argc, char* argv[]) {
FILE* ramfile;
process *procTable, *cur_proc;
unsigned char* rawbuf;
int i, pid;
if(argc != 2) {
printf("Usage: %s ramdump.file\n", argv[0]);
return 0;
}
if(!(rawbuf = (unsigned char*)malloc(0xA00000))) {
printf("Couldn't allocate memory space for the memory image\n");
return 0;
}
if(!(ramfile = fopen(argv[1], "rb"))) {
printf("Couldn't open file %s\n", argv[1]);
free(rawbuf);
return 0;
}
if(fread((void*)rawbuf, 0x100000, 10, ramfile) != 10) {
printf("Failed reading image into ram\n");
fclose(ramfile);
free(procTable);
return 0;
}
fclose(ramfile);
procTable = (process*)(&rawbuf[PROC_TABLE_OFFSET]);
while(1) {
//Prompt for process number
printf("Process table:\n");
for(i = 0; i < 256; i++) {
if(procTable[i].id) printf(" [%d]: id: %d\n", i, procTable[i].id);
}
while(1) {
printf("Which pid do you want to explore?: ");
scanf("%u", &pid);
for(i = 0; i < 256; i++) {
if(procTable[i].id == pid)
break;
}
if(i == 256)
printf("No such pid\n");
else
break;
}
cur_proc = &procTable[i];
while(1) {
printf("Do what with pid %u?: ", pid);
scanf("%49s", cmdbuf);
if(!strcmp("back", cmdbuf))
break;
if(!strcmp("quit", cmdbuf)) {
free(rawbuf);
return 0;
}
for(i = 0; i < CMD_COUNT; i++) {
if(!strcmp(cmdWord[i], cmdbuf)) {
cmdFunc[i](cur_proc, rawbuf);
break;
}
}
if(i == CMD_COUNT) {
printf("Unknown command ");
printf(cmdbuf);
printf("\n");
}
}
}
}
|
/***************************************************************************
* test-object.c
*
* Tue Sep 27 19:37:28 2005
* Copyright 2005 GnuCash team
****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/*
* Lightly test the QofObject infrastructure.
*/
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"
#define TEST_MODULE_NAME "object-test"
#define TEST_MODULE_DESC "Test Object"
static void obj_foreach (const QofCollection *, QofInstanceForeachCB, gpointer);
static const char * printable (gpointer obj);
static void test_printable (const char *name, gpointer obj);
static void test_foreach (QofBook *, const char *);
static QofObject bus_obj =
{
interface_version:
QOF_OBJECT_VERSION,
e_type:
TEST_MODULE_NAME,
type_label:
TEST_MODULE_DESC,
create:
NULL,
book_begin:
NULL,
book_end:
NULL,
is_dirty:
NULL,
mark_clean:
NULL,
foreach:
obj_foreach,
printable:
printable,
version_cmp:
NULL,
};
static void
test_object (void)
{
QofBook *book = qof_book_new();
do_test ((NULL != book), "book null");
/* Test the global registration and lookup functions */
{
do_test (!qof_object_register (NULL), "register NULL");
do_test (qof_object_register (&bus_obj), "register test object");
do_test (!qof_object_register (&bus_obj), "register test object again");
do_test (qof_object_lookup (TEST_MODULE_NAME) == &bus_obj,
"lookup our installed object");
do_test (qof_object_lookup ("snm98sn snml say dyikh9y9ha") == NULL,
"lookup non-existant object object");
do_test (!g_strcmp0 (qof_object_get_type_label (TEST_MODULE_NAME),
_(TEST_MODULE_DESC)),
"test description return");
}
test_foreach (book, TEST_MODULE_NAME);
test_printable (TEST_MODULE_NAME, (gpointer)1);
}
static void
obj_foreach (const QofCollection *col, QofInstanceForeachCB cb, gpointer u_d)
{
int *foo = u_d;
do_test (col != NULL, "foreach: NULL collection");
success ("called foreach callback");
*foo = 1;
}
static void foreachCB (QofInstance *ent, gpointer u_d)
{
do_test (FALSE, "FAIL");
}
static const char *
printable (gpointer obj)
{
do_test (obj != NULL, "printable: object is NULL");
success ("called printable callback");
return ((const char *)obj);
}
static void
test_foreach (QofBook *book, const char *name)
{
int res = 0;
qof_object_foreach (NULL, NULL, NULL, &res);
do_test (res == 0, "object: Foreach: NULL, NULL, NULL");
qof_object_foreach (NULL, NULL, foreachCB, &res);
do_test (res == 0, "object: Foreach: NULL, NULL, foreachCB");
qof_object_foreach (NULL, book, NULL, &res);
do_test (res == 0, "object: Foreach: NULL, book, NULL");
qof_object_foreach (NULL, book, foreachCB, &res);
do_test (res == 0, "object: Foreach: NULL, book, foreachCB");
qof_object_foreach (name, NULL, NULL, &res);
do_test (res == 0, "object: Foreach: name, NULL, NULL");
qof_object_foreach (name, NULL, foreachCB, &res);
do_test (res == 0, "object: Foreach: name, NULL, foreachCB");
qof_object_foreach (name, book, NULL, &res);
do_test (res != 0, "object: Foreach: name, book, NULL");
res = 0;
qof_object_foreach (name, book, foreachCB, &res);
do_test (res != 0, "object: Foreach: name, book, foreachCB");
}
static void
test_printable (const char *name, gpointer obj)
{
const char *res;
do_test (qof_object_printable (NULL, NULL) == NULL,
"object: Printable: NULL, NULL");
do_test (qof_object_printable (NULL, obj) == NULL,
"object: Printable: NULL, object");
do_test (qof_object_printable (name, NULL) == NULL,
"object: Printable: mod_name, NULL");
res = qof_object_printable (name, obj);
do_test (res != NULL, "object: Printable: mod_name, object");
}
int
main (int argc, char **argv)
{
qof_init();
if (cashobjects_register())
{
test_object();
print_test_results();
}
qof_close();
return get_rv();
}
|
//
// TableViewController.h
// TableViewCell_advanced
//
// Created by CornerZhang on 14-10-6.
// Copyright (c) 2014年 NeXtreme.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TableViewController : UITableView
@end
|
/*
* Copyright Boris Koprinarov <crumpz@gmail.com>
*
* cobra5282.c, v 1.14 2005/08/31 13:24:14
*
* 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 SOFTWARE IS PROVIDED ``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 AUTHOR 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.
*
* 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/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#define FLASH_PHYS_ADDR 0xffc00000
#define FLASH_SIZE 0x400000
#define FLASH_PARTITION0_ADDR 0xFFC00000
#define FLASH_PARTITION0_SIZE 0x400000
struct map_info flagadm_map = {
.name = "Flash chip on COBRA5282",
.size = FLASH_SIZE,
.bankwidth = 2,
};
struct mtd_partition flagadm_parts[] = {
{
.name = "boot (256K)",
.offset = 0x0,
.size = 0x40000
},
{
.name = "kernel (1408K)",
.offset = 0x40000,
.size = 0x160000
},
{
.name = "rootfs (2048K)",
.offset = 0x1A0000,
.size = 0x200000
},
{
.name = "spare (32K)",
.offset = 0x0,
.size = 0x8000
},
{
.name = "user 1 (384K)",
.offset = 0x3A0000,
.size = 0x60000
},
{
.name = "user 2 (2432K)",
.offset = 0x1A0000,
.size = 0x260000
},
{
.name = "complete (4096K)",
.offset = 0x0,
.size = 0x400000
}
};
#define PARTITION_COUNT (sizeof(flagadm_parts)/sizeof(struct mtd_partition))
static struct mtd_info *mymtd;
int __init init_flagadm(void)
{
printk(KERN_NOTICE "COBRA5282 flash device: %x at %x\n",
FLASH_SIZE, FLASH_PHYS_ADDR);
flagadm_map.phys = FLASH_PHYS_ADDR;
flagadm_map.virt = ioremap(FLASH_PHYS_ADDR,
FLASH_SIZE);
if (!flagadm_map.virt) {
printk("Failed to ioremap\n");
return -EIO;
}
simple_map_init(&flagadm_map);
mymtd = do_map_probe("cfi_probe", &flagadm_map);
if (mymtd) {
mymtd->owner = THIS_MODULE;
mtd_device_register(mymtd, flagadm_parts, PARTITION_COUNT);
printk(KERN_NOTICE "COBRA5282 flash device initialized\n");
return 0;
}
iounmap((void *)flagadm_map.virt);
return -ENXIO;
}
static void __exit cleanup_flagadm(void)
{
if (mymtd) {
mtd_device_unregister(mymtd);
map_destroy(mymtd);
}
if (flagadm_map.virt) {
iounmap((void *)flagadm_map.virt);
flagadm_map.virt = 0;
}
}
module_init(init_flagadm);
module_exit(cleanup_flagadm);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Boris Koprinarov <crumpz@gmail.com>");
MODULE_DESCRIPTION("MTD map driver for COBRA5282 board");
|
/*
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
#include <hidef.h> /* common defines and macros */
#include "TickTimer.h"
/* This port requires the compiler to generate code for the BANKED memory
model. */
#define BANKED_MODEL
/*-----------------------------------------------------------
* 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 1
#define configUSE_TICK_HOOK 0
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 10240 ) )
#define configMAX_TASK_NAME_LEN ( 1 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 1
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* This parameter is normally required in order to set the RTOS tick timer.
This port is a bit different in that hardware setup uses the code generated by
the Processor Expert, making this definition obsolete.
#define configCPU_CLOCK_HZ ( ( unsigned long ) 25000000 )
*/
/* 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
#endif /* FREERTOS_CONFIG_H */
|
/* a osoaren aurkakoa modular b kalkulatzen du
* Ad: mod_inv(5, 7) = 3
* 5*3 mod 7 = 15 mod 7 = 1 mod 7
*/
int mod_inv(int a, int b)
{
// assert(a > 0 && b > 1);
int b0 = b, t, q;
int x0 = 0, x1 = 1;
if (a == 1) return b + 1;
while (a > 1 && b != 0) {
q = a / b;
t = b, b = a % b, a = t;
t = x0, x0 = x1 - q * x0, x1 = t;
}
if (a > 1 && b == 0) return 0;
if (x1 < 0) x1 += b0;
return x1;
}
|
/**
\mainpage libusbnet API documentation.
libusbnet is a libusb network proxy, which enables
communication with USB over TCP/IP network.
<h2>Installation</h2>
Unpack source package or clone latest git. Installation requires CMake >= 2.6, GCC and libusb development headers.
\code
user@localhost# mkdir build && cd build # Create build directory
user@localhost# cmake .. # Create Makefiles using CMake
user@localhost# make # Build
user@localhost# sudo make install # Install
\endcode
<h2>Project modules</h2>
- \ref proto.
- \ref protocpp
- \ref client
- \ref server
- \ref libusbnet
<h2>Example usage (probing remote USB bus)</h2>
\code
john@server# usbexportd
jack@client# usbnet -h server:22222 -l libusbnet.so "lsusb"
\endcode
See <strong>usbnet --help</strong>.
<br/>
<table>
<tr>
<td style="border: 0;">\copydoc proto_page</td>
<td style="border: 0; border-left: 1px dashed #ccc; vertical-align: top;">\copydoc protopp_page</td>
</tr>
</table>
<h2>Wrapping function declaration</h2>
- Include original declaration and reimplement
- Build as shared library
- Preload with "usbnet".
<h3>Example reimplementation</h3>
Initialize remote socket descriptor and synchronize call to ensure thread-safe result.
\code
int function_call(int param)
{
Packet* pkt_claim(); // Claim shared buffer (efficient and synchronous)
int fd = session_get(); // Get remote socket descriptor
\endcode
Send packet with opcode and paramter.
\code
pkt_init(pkt, OpCode1); // Initialize packet
pkt_addint(pkt, param); // Append parameter
pkt_send(pkt, fd); // Send packet
\endcode
Receive and store result value.
\code
Iterator it;
int res = -1;
if(pkt_recv(fd, pkt) > 0) { // Receive packet
pkt_begin(pkt, &it); // Initialize iterator
res = iter_getint(&it); // Save result
}
\endcode
Release call lock and return value.
\code
pkt_release(); // Release shared buffer
return res;
}
\endcode
<br/>
Marek Vavrusa <marek@vavrusa.com><br/>
Zdenek Vasicek <vasicek@fit.vutbr.cz>
*/
/* Modules. */
/** \defgroup proto Protocol definitions and C API.
* \defgroup protocpp Protocol abstraction in C++.
* \defgroup client Client executable wrapper.
* \defgroup server Server executable.
* \defgroup libusbnet Protocol implementation for libusb.
*/
|
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include "inline/stringops.h"
static void h_can_send(void *vdata);
mapi_hfn_list_av1 nonotices_hfnlist[] = {
{ "can_send", (hookfn) h_can_send },
{ NULL, NULL }
};
static unsigned int mymode;
static int
_modinit(void)
{
mymode = cflag_add('T', chm_simple);
if (mymode == 0)
return -1;
return 0;
}
static void
_moddeinit(void)
{
cflag_orphan('T');
}
DECLARE_MODULE_AV1(chm_nonotices, _modinit, _moddeinit, NULL, NULL, nonotices_hfnlist, "SporksNet coding committee");
static void
h_can_send(void *vdata)
{
hook_data_channel_approval *data = (hook_data_channel_approval *) vdata;
if (!(data->cmd == COMMAND_NOTICE))
return;
if(data->chptr->mode.mode & mymode &&
(!ConfigChannel.exempt_cmode_T || !is_any_op(data->msptr)))
{
sendto_one_numeric(data->client, 404,
"%s :Cannot send to channel - Notices are disallowed (+T set)",
data->chptr->chname);
data->approved = CAN_SEND_NO_NONOTIFY;
}
return;
}
|
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2017 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef _U2_MSA_COMBO_BOX_CONTROLLER_H_
#define _U2_MSA_COMBO_BOX_CONTROLLER_H_
#include <U2Core/DNAAlphabet.h>
#include <U2Core/U2SafePoints.h>
#include <U2Gui/GroupedComboBoxDelegate.h>
#include <U2View/MSAEditor.h>
#include <QComboBox>
class QStandardItemModel;
namespace U2 {
class ComboBoxSignalHandler : public QObject {
Q_OBJECT
public:
ComboBoxSignalHandler(QWidget *parent = NULL) : QObject(parent) {
comboBox = new QComboBox(parent);
comboBox->setItemDelegate(new GroupedComboBoxDelegate(comboBox));
connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sl_indexChanged(int)));
}
QComboBox* getComboBox() {
return comboBox;
}
signals:
void si_dataChanged(const QString &newScheme);
private slots:
void sl_indexChanged(int index) {
emit si_dataChanged(comboBox->itemData(index).toString());
}
protected:
QComboBox *comboBox;
};
template <class Factory, class Registry>
class MsaSchemeComboBoxController : public ComboBoxSignalHandler {
public:
MsaSchemeComboBoxController(MSAEditor *msa, Registry *registry, QWidget *parent = NULL);
void init();
void setCurrentItemById(const QString& id);
private:
void fillCbWithGrouping();
void createAndFillGroup(QList<Factory *> rawSchemesFactories, const QString& groupName);
MSAEditor *msa;
Registry *registry;
};
template <class Factory, class Registry>
MsaSchemeComboBoxController<Factory, Registry>::MsaSchemeComboBoxController(MSAEditor *msa, Registry *registry, QWidget *parent /*= NULL*/)
: ComboBoxSignalHandler(parent), msa(msa), registry(registry) {
init();
}
template <class Factory, class Registry>
void MsaSchemeComboBoxController<Factory, Registry>::init() {
CHECK(registry != NULL, );
bool isAlphabetRaw = msa->getMaObject()->getAlphabet()->getType() == DNAAlphabet_RAW;
comboBox->blockSignals(true);
comboBox->clear();
if (isAlphabetRaw) {
fillCbWithGrouping();
} else {
CHECK(msa->getMaObject(), );
CHECK(msa->getMaObject()->getAlphabet(), );
DNAAlphabetType alphabetType = msa->getMaObject()->getAlphabet()->getType();
QList<Factory *> schemesFactories = registry->getAllSchemes(alphabetType);
Factory* emptySchemeFactory = registry->getEmptySchemeFactory();
schemesFactories.removeAll(emptySchemeFactory);
schemesFactories.prepend(emptySchemeFactory);
foreach(Factory *factory, schemesFactories) {
comboBox->addItem(factory->getName(), factory->getId());
}
}
comboBox->blockSignals(false);
}
template <class Factory, class Registry>
void MsaSchemeComboBoxController<Factory, Registry>::setCurrentItemById(const QString& id) {
comboBox->setCurrentIndex(comboBox->findData(id));
}
template <class Factory, class Registry>
void MsaSchemeComboBoxController<Factory, Registry>::fillCbWithGrouping() {
QMap<AlphabetFlags, QList<Factory*> > schemesFactories = registry->getAllSchemesGrouped();
Factory *emptySchemeFactory = registry->getEmptySchemeFactory();
QList<Factory *> commonSchemesFactories = schemesFactories[DNAAlphabet_RAW | DNAAlphabet_AMINO | DNAAlphabet_NUCL];
QList<Factory *> aminoSchemesFactories = schemesFactories[DNAAlphabet_RAW | DNAAlphabet_AMINO];
QList<Factory *> nucleotideSchemesFactories = schemesFactories[DNAAlphabet_RAW | DNAAlphabet_NUCL];
commonSchemesFactories.removeAll(emptySchemeFactory);
commonSchemesFactories.prepend(emptySchemeFactory);
createAndFillGroup(commonSchemesFactories, tr("All alphabets"));
createAndFillGroup(aminoSchemesFactories, tr("Amino acid alphabet"));
createAndFillGroup(nucleotideSchemesFactories, tr("Nucleotide alphabet"));
}
template <class Factory, class Registry>
void MsaSchemeComboBoxController<Factory, Registry>::createAndFillGroup(QList<Factory *> rawSchemesFactories, const QString& groupName) {
CHECK(!rawSchemesFactories.isEmpty(), );
GroupedComboBoxDelegate *schemeDelegate = qobject_cast<GroupedComboBoxDelegate*>(comboBox->itemDelegate());
QStandardItemModel *schemeModel = qobject_cast<QStandardItemModel*>(comboBox->model());
CHECK(schemeDelegate != NULL, );
CHECK(schemeModel != NULL, );
schemeDelegate->addParentItem(schemeModel, groupName);
foreach(Factory *factory, rawSchemesFactories) {
schemeDelegate->addChildItem(schemeModel, factory->getName(), factory->getId());
}
}
}
#endif
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express 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.
*/
#include "SDL_config.h"
extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
/* vi: set ts=4 sw=4 expandtab: */
|
#include "usbcontrol.h"
#include "device.h"
#include "clock.h"
#include "usb_conf.h"
#include "usbd_cdc_core.h"
#include "usbd_audio_core.h"
#include "usbd_usr.h"
#include "usbd_desc.h"
#include "usb_dcd_int.h"
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
/* De-initialise the USB peripheral.
* Turns off interrupt and de-initialises USB subsystem.
*/
void usb_deinit(void){
NVIC_InitTypeDef NVIC_InitStructure;
/* Turn off interrupt */
NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = USB_IRQ_PRIORITY;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = USB_IRQ_SUBPRIORITY;
NVIC_InitStructure.NVIC_IRQChannelCmd = DISABLE;
NVIC_Init(&NVIC_InitStructure);
/* De-initialise the USB subsystem */
USBD_DeInit(&USB_OTG_dev);
}
/* Initialise the USB serial device,
* including the relevant I/O pins.
*/
void usb_init(void){
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/* Enable clocks */
RCC_AHB1PeriphClockCmd(USB_DATA_GPIO_CLK, ENABLE);
RCC_AHB1PeriphClockCmd(USB_VBUS_GPIO_CLK, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_OTG_FS, ENABLE) ;
/* Configure USB data pins */
GPIO_InitStructure.GPIO_Pin = USB_DP_PIN | USB_DM_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
GPIO_Init(USB_DATA_GPIO_PORT, &GPIO_InitStructure);
GPIO_PinAFConfig(USB_DATA_GPIO_PORT, GPIO_PinSource11, GPIO_AF_OTG1_FS) ;
GPIO_PinAFConfig(USB_DATA_GPIO_PORT, GPIO_PinSource12, GPIO_AF_OTG1_FS) ;
/* Configure VBUS Pin */
GPIO_InitStructure.GPIO_Pin = USB_VBUS_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
GPIO_Init(USB_VBUS_GPIO_PORT, &GPIO_InitStructure);
/* Configure and enable USB interrupt */
NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = USB_IRQ_PRIORITY;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = USB_IRQ_SUBPRIORITY;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* Initialise USB OTG device */
USBD_Init(&USB_OTG_dev,
USB_OTG_FS_CORE_ID,
&USR_desc,
&AUDIO_cb, //&USBD_CDC_cb,
&USR_cb);
}
/* Handler for USB interrupts */
void OTG_FS_IRQHandler(void){
USBD_OTG_ISR_Handler (&USB_OTG_dev);
}
|
/***********************************************************************
*
* File: stgfb/Gamma/stb7100/stb7100dvo.h
* Copyright (c) 2005 STMicroelectronics Limited.
*
* 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.
*
\***********************************************************************/
#ifndef _STb7100DVO_H
#define _STb7100DVO_H
#include <Generic/Output.h>
class CDisplayDevice;
class CSTb7100MainOutput;
class CSTb7100DVO: public COutput
{
public:
CSTb7100DVO(CDisplayDevice *, CSTb7100MainOutput *);
virtual ~CSTb7100DVO(void);
ULONG GetCapabilities(void) const;
bool Start(const stm_mode_line_t*, ULONG tvStandard);
bool Stop(void);
void Suspend(void);
void Resume(void);
bool HandleInterrupts(void);
bool CanShowPlane(stm_plane_id_t planeID);
bool ShowPlane (stm_plane_id_t planeID);
void HidePlane (stm_plane_id_t planeID);
bool SetPlaneDepth(stm_plane_id_t planeID, int depth, bool activate);
bool GetPlaneDepth(stm_plane_id_t planeID, int *depth) const;
ULONG SupportedControls(void) const;
void SetControl(stm_output_control_t, ULONG ulNewVal);
ULONG GetControl(stm_output_control_t) const;
protected:
CSTb7100MainOutput *m_pMainOutput;
ULONG *m_pDevRegs;
ULONG m_ulVOSOffset;
ULONG m_ulClkOffset;
void WriteVOSReg(ULONG reg, ULONG val) { g_pIOS->WriteRegister(m_pDevRegs + ((m_ulVOSOffset+reg)>>2), val); }
ULONG ReadVOSReg(ULONG reg) { return g_pIOS->ReadRegister(m_pDevRegs + ((m_ulVOSOffset+reg)>>2)); }
void WriteClkReg(ULONG reg, ULONG val) { g_pIOS->WriteRegister(m_pDevRegs + ((m_ulClkOffset+reg)>>2), val); }
ULONG ReadClkReg(ULONG reg) { return g_pIOS->ReadRegister(m_pDevRegs + ((m_ulClkOffset+reg)>>2)); }
};
class CSTb7109Cut3DVO: public CSTb7100DVO
{
public:
CSTb7109Cut3DVO(CDisplayDevice *, CSTb7100MainOutput *);
virtual ~CSTb7109Cut3DVO(void);
ULONG SupportedControls(void) const;
void SetControl(stm_output_control_t, ULONG ulNewVal);
ULONG GetControl(stm_output_control_t) const;
private:
ULONG m_ulSysCfgOffset;
bool m_bOutputToDVP;
void WriteSysCfgReg(ULONG reg, ULONG val) { g_pIOS->WriteRegister(m_pDevRegs + ((m_ulSysCfgOffset+reg)>>2), val); }
ULONG ReadSysCfgReg(ULONG reg) { return g_pIOS->ReadRegister(m_pDevRegs + ((m_ulSysCfgOffset+reg)>>2)); }
};
#endif //_STb7100DVO_H
|
/****************************************************************************
**
** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the tools applications of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef QDBUSCONTEXT_H
#define QDBUSCONTEXT_H
#include <QtCore/qstring.h>
#include <QtDBus/qdbuserror.h>
QT_BEGIN_HEADER
class QDBusConnection;
class QDBusMessage;
class QDBusContextPrivate;
class QDBUS_EXPORT QDBusContext
{
public:
QDBusContext();
~QDBusContext();
bool calledFromDBus() const;
QDBusConnection connection() const;
const QDBusMessage &message() const;
// convenience methods
bool isDelayedReply() const;
// yes, they are const, so that you can use them even from const methods
void setDelayedReply(bool enable) const;
void sendErrorReply(const QString &name, const QString &msg = QString()) const;
void sendErrorReply(QDBusError::ErrorType type, const QString &msg = QString()) const;
private:
QDBusContextPrivate *d_ptr;
Q_DECLARE_PRIVATE(QDBusContext)
};
QT_END_HEADER
#endif
|
/**
* Copyright (C) 2012 Martin Sandsmark <martin.sandsmark@kde.org>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LYRICSWIDGET_H
#define LYRICSWIDGET_H
#include <QTextBrowser>
#include "filehandle.h"
class QNetworkAccessManager;
class QNetworkReply;
class LyricsWidget : public QTextBrowser
{
Q_OBJECT
public:
explicit LyricsWidget(QWidget *parent);
virtual ~LyricsWidget();
QSize minimumSize() const { return QSize(100, 0); }
public Q_SLOTS:
void playing(const FileHandle &file);
protected:
virtual void showEvent(QShowEvent*);
virtual bool eventFilter(QObject *watched, QEvent *e);
private:
void makeLyricsRequest();
private Q_SLOTS:
void receiveListReply(QNetworkReply*);
void receiveLyricsReply(QNetworkReply*);
void saveConfig();
void slotUpdateMenus();
private:
FileHandle m_playingFile;
QNetworkAccessManager *m_networkAccessManager;
QString m_title;
bool m_lyricsCurrent;
};
#endif//LYRICSWIDGET_H
|
#include <kernel.h>
#include <memory.h>
#include <task.h>
#include <fs.h>
struct inode *ramfs_root;
int ramfs_sane(struct inode *i);
unsigned int ramfs_node_num=1;
int ramfs_op_dummy()
{
return 0;
}
int ramfs_unlink(struct inode *i)
{
i->f_count=0;
i->count=1;
return 0;
}
struct inode_operations rfs_inode_ops = {
rfs_read,
rfs_write,
(void *)ramfs_op_dummy,
rfs_create,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_unlink,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
(void *)ramfs_op_dummy,
};
struct inode *init_ramfs()
{
struct inode *i = (struct inode *)kmalloc(sizeof(struct inode));
i->mode = S_IFDIR | 0x1FF;
create_mutex(&i->lock);
_strcpy(i->name, "rfs");
ramfs_root = i;
i->i_ops = &rfs_inode_ops;
return i;
}
struct inode *init_tmpfs()
{
struct inode *i = (struct inode *)kmalloc(sizeof(struct inode));
i->mode = S_IFDIR | 0x1FF;
create_mutex(&i->lock);
_strcpy(i->name, "rfs");
i->i_ops = &rfs_inode_ops;
return i;
}
int rfs_read(struct inode *i, off_t off, size_t len, char *b)
{
size_t pl = len;
if(off >= i->len)
return 0;
if((off+len) >= (unsigned)i->len)
len = i->len-off;
if(!len)
return 0;
memcpy((void *)b, (void *)(i->start+(addr_t)off), len);
return len;
}
static void rfs_resize(struct inode *i, off_t s)
{
if(s == i->len)
return;
addr_t new = (addr_t)kmalloc(s);
if(i->len > s)
{
memcpy((void *)new, (void *)i->start, s);
}
else
{
memcpy((void *)new, (void *)i->start, i->len);
}
kfree((void *)i->start);
i->start = new;
i->len = s;
}
int rfs_write(struct inode *i, off_t off, size_t len, char *b)
{
if(!len)
return -EINVAL;
if(off > i->len || off+len > (unsigned)i->len)
{
mutex_on(&i->lock);
rfs_resize(i, len+off);
mutex_off(&i->lock);
}
memcpy((void *)(i->start+(addr_t)off), (void *)b, len);
return len;
}
struct inode *rfs_create(struct inode *__p, char *name, mode_t mode)
{
struct inode *r, *p=__p;
if(!__p)
p = ramfs_root;
if((r = (struct inode *)get_idir(name, p)))
{
return r;
}
struct inode *node;
node = (struct inode *)kmalloc(sizeof(struct inode));
strncpy(node->name, name, INAME_LEN);
node->uid = current_task->uid;
node->gid = current_task->gid;
node->len = 0;
node->i_ops = &rfs_inode_ops;
node->mode = mode | 0x1FF;
node->start = (int)kmalloc(1);
task_critical();
node->num = ramfs_node_num++;
task_uncritical();
create_mutex(&node->lock);
if(!__p) add_inode(p, node);
return node;
}
|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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 __GIMP_LAYER_PROP_UNDO_H__
#define __GIMP_LAYER_PROP_UNDO_H__
#include "gimpitemundo.h"
#define GIMP_TYPE_LAYER_PROP_UNDO (gimp_layer_prop_undo_get_type ())
#define GIMP_LAYER_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_PROP_UNDO, GimpLayerPropUndo))
#define GIMP_LAYER_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_PROP_UNDO, GimpLayerPropUndoClass))
#define GIMP_IS_LAYER_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LAYER_PROP_UNDO))
#define GIMP_IS_LAYER_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_PROP_UNDO))
#define GIMP_LAYER_PROP_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LAYER_PROP_UNDO, GimpLayerPropUndoClass))
typedef struct _GimpLayerPropUndoClass GimpLayerPropUndoClass;
struct _GimpLayerPropUndo
{
GimpItemUndo parent_instance;
gint position;
GimpLayerModeEffects mode;
gdouble opacity;
gboolean lock_alpha;
};
struct _GimpLayerPropUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_layer_prop_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_LAYER_PROP_UNDO_H__ */
|
/* This file is part of KDevelop
Copyright 2008 Niko Sams <niko.sams@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef TESTDUCHAIN_H
#define TESTDUCHAIN_H
#include "tests/duchaintestbase.h"
namespace Php
{
class TestDUChain : public DUChainTestBase
{
Q_OBJECT
public:
TestDUChain();
private slots:
void declareFunction();
void declareVar();
void varTypehint();
void declareClass();
void classMemberVar();
void declareTypehintFunction();
void declareVariadicFunction();
void declareTypehintVariadicFunction();
void declareTypehintArrayFunction();
void declareTypehintCallableFunction();
void returnTypeClass();
void declarationReturnType();
void declarationReturnTypeInRecursingFunction();
void returnTypeViaMember();
void declarationMultipleReturnTypes();
void declarationReturnTypeDocBlock();
void declarationReturnTypeDocBlockIntegral();
void declarationReturnTypeClassChain();
void classImplementsInterface();
void classExtends();
void staticMethod();
void ownStaticMethod();
void thisVar();
void objectFunctionCall();
void objectFunctionCall2();
void objectFunctionCall3();
void objectVariable();
void staticMemberVariable();
void ownStaticMemberVariable();
void classConst();
void classConst_data();
void fileConst();
void fileConst_data();
void define();
void defaultFunctionParam();
void globalFunction();
void globalVariableFromInternalFunctions();
void newObjectFromOtherFile();
void unknownReturnType();
void staticFunctionCallFromOtherFile();
void classConstantFromOtherFile();
void globalFunctionCallFromOtherFile();
void constantFromOtherFile();
void singleton();
void internalFunctions();
void trueFalse();
void null();
void array();
void functionDocBlock();
void variableDocBlock();
void functionDocBlockParams();
void memberFunctionDocBlockParams();
void foreachLoop();
void php4StyleConstructor();
void constructor();
void destructor();
void functionInFunction();
void objectWithClassName();
void largeNumberOfDeclarations();
void staticVariable();
void returnTypeTwoDeclarations();
void globalVariableNotVisibleInFunction();
void globalVariableInFunction();
void nonGlobalVariableInFunction();
void superglobalInFunction();
void returnWithoutFunction();
void circularInheritance();
void findDeclarations();
void memberTypeAfterMethod();
void catchDeclaration();
void resourceType();
void foreachIterator();
void foreachIterator2();
void foreachIterator3();
void foreachIterator4();
void returnThis();
void unsureReturnType();
void unsureReturnType2();
void unsureReturnType3();
void unsureReturnType4();
void referencedArgument();
void unsureReferencedArgument();
void defaultArgument();
void declareMemberOutOfClass();
void declareMemberOutOfClass2();
void declareMemberInClassMethod();
void thisRedeclaration();
void implicitArrayDeclaration();
void implicitReferenceDeclaration();
void classContextRange();
void lateClassMembers();
void list();
void alternateDocCommentTypeHints();
void findFunctionArgs();
void undeclaredPropertyInString();
void undeclaredVarPropertyInString();
void upcommingClassInString();
void namespaces();
void namespacesNoCurly();
void useNamespace();
void namespaceStaticVar();
void namespacedCatch();
void errorRecovery_data();
void errorRecovery();
void varStatic();
void staticNowdoc();
void curlyVarAfterObj();
void embeddedHTML_data();
void embeddedHTML();
void cases();
void closureParser();
void closures();
void closureEmptyUse();
void iifeParser();
void iife();
void gotoTest();
void ternary();
void bug296709();
void declareFinalMethod();
void testTodoExtractor();
void useThisAsArray();
void wrongUseOfThisAsArray();
void staticFunctionClassPhp54();
void functionArgumentUnpacking_data();
void functionArgumentUnpacking();
};
}
#endif
|
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id$
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 2006-2020 by The Odamex Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// DESCRIPTION:
// The not so system specific sound interface.
//
//-----------------------------------------------------------------------------
#ifndef __S_SOUND__
#define __S_SOUND__
#include "m_fixed.h"
#include <string>
#define MAX_SNDNAME 63
class AActor;
//
// SoundFX struct.
//
typedef struct sfxinfo_struct sfxinfo_t;
struct sfxinfo_struct
{
char name[MAX_SNDNAME+1]; // [RH] Sound name defined in SNDINFO
unsigned normal; // Normal sample handle
unsigned looping; // Looping sample handle
void* data;
struct sfxinfo_struct *link;
int lumpnum; // lump number of sfx
unsigned int ms; // [RH] length of sfx in milliseconds
unsigned int next, index; // [RH] For hashing
unsigned int frequency; // [RH] Preferred playback rate
unsigned int length; // [RH] Length of the sound in bytes
};
// the complete set of sound effects
extern sfxinfo_t *S_sfx;
// [RH] Number of defined sounds
extern int numsfx;
// Initializes sound stuff, including volume
// Sets channels, SFX and music volume,
// allocates channel buffer, sets S_sfx lookup.
//
void S_Init (float sfxVolume, float musicVolume);
// Per level startup code.
// Kills playing sounds at start of level,
// determines music if any, changes music.
//
void S_Stop(void);
void S_Start(void);
// Start sound for thing at <ent>
void S_Sound (int channel, const char *name, float volume, int attenuation);
void S_Sound (AActor *ent, int channel, const char *name, float volume, int attenuation);
void S_Sound (fixed_t *pt, int channel, const char *name, float volume, int attenuation);
void S_Sound (fixed_t x, fixed_t y, int channel, const char *name, float volume, int attenuation);
void S_PlatSound (fixed_t *pt, int channel, const char *name, float volume, int attenuation); // [Russell] - Hack to stop multiple plat stop sounds
void S_LoopedSound (AActor *ent, int channel, const char *name, float volume, int attenuation);
void S_LoopedSound (fixed_t *pt, int channel, const char *name, float volume, int attenuation);
void S_SoundID (int channel, int sfxid, float volume, int attenuation);
void S_SoundID (fixed_t x, fixed_t y, int channel, int sound_id, float volume, int attenuation);
void S_SoundID (AActor *ent, int channel, int sfxid, float volume, int attenuation);
void S_SoundID (fixed_t *pt, int channel, int sfxid, float volume, int attenuation);
void S_LoopedSoundID (AActor *ent, int channel, int sfxid, float volume, int attenuation);
void S_LoopedSoundID (fixed_t *pt, int channel, int sfxid, float volume, int attenuation);
// sound channels
// channel 0 never willingly overrides
// other channels (1-8) always override a playing sound on that channel
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
#define CHAN_VOICE 2
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_ANNOUNCER 5
#define CHAN_GAMEINFO 6
#define CHAN_INTERFACE 7
// modifier flags
//#define CHAN_NO_PHS_ADD 8 // send to all clients, not just ones in PHS (ATTN 0 will also do this)
//#define CHAN_RELIABLE 16 // send by reliable message, not datagram
// sound attenuation values
#define ATTN_NONE 0 // full volume the entire level
#define ATTN_NORM 1
#define ATTN_IDLE 2
#define ATTN_STATIC 3 // diminish very rapidly with distance
// Stops a sound emanating from one of an entity's channels
void S_StopSound (AActor *ent, int channel);
void S_StopSound (fixed_t *pt, int channel);
void S_StopSound (fixed_t *pt);
// Stop sound for all channels
void S_StopAllChannels (void);
// Is the sound playing on one of the entity's channels?
bool S_GetSoundPlayingInfo (AActor *ent, int sound_id);
bool S_GetSoundPlayingInfo (fixed_t *pt, int sound_id);
// Moves all sounds from one mobj to another
void S_RelinkSound (AActor *from, AActor *to);
// Start music using <music_name>
void S_StartMusic (const char *music_name);
// Start music using <music_name>, and set whether looping
void S_ChangeMusic (std::string music_name, int looping);
// Stops the music fer sure.
void S_StopMusic (void);
// Stop and resume music, during game PAUSE.
void S_PauseSound (void);
void S_ResumeSound (void);
//
// Updates music & sounds
//
void S_UpdateSounds (void *listener);
void S_UpdateMusic();
void S_SetMusicVolume (float volume);
void S_SetSfxVolume (float volume);
// [RH] Activates an ambient sound. Called when the thing is added to the map.
// (0-biased)
void S_ActivateAmbient (AActor *mobj, int ambient);
// [RH] S_sfx "maintenance" routines
void S_ParseSndInfo (void);
void S_HashSounds (void);
int S_FindSound (const char *logicalname);
int S_FindSoundByLump (int lump);
int S_AddSound (char *logicalname, char *lumpname); // Add sound by lumpname
int S_AddSoundLump (char *logicalname, int lump); // Add sound by lump index
void S_ClearSoundLumps (void);
void UV_SoundAvoidPlayer (AActor *mo, byte channel, const char *name, byte attenuation);
// [RH] Prints sound debug info to the screen.
// Modelled after Hexen's noise cheat.
void S_NoiseDebug (void);
#endif
|
// MAH: start
#include <linux/kernel.h>
#include <linux/slab.h>
//#include "packets.h"
#include "switch-port.h"
// The following four functions must be defined for the red-black tree code.
void PortKeyDest(void* a) {
kfree((unsigned int*)a);
}
int PortKeyComp(const void* a,const void* b) {
if( *(unsigned int*)a > *(unsigned int*)b) return(1);
if( *(unsigned int*)a < *(unsigned int*)b) return(-1);
return(0);
}
void PortKeyPrint(const void* a) {
printk("vport #%u",*(unsigned int*)a);
}
void PortEntryPrint(void* a) {
struct vport_table_entry *vpe = (struct vport_table_entry *)a;
printk("VPortTableEntry:\nvport = %u actions_len = %u\n", vpe->vport, vpe->port_acts->actions_len);
}
void PortEntryDest(void *a){
struct vport_table_entry *vpe = (struct vport_table_entry *)a;
free_vport_table_entry(vpe);
}
void vport_table_init(struct vport_table_t *vport_table)
{
//printk("vport_table_init invoked\n");
// Create the red-black tree to store the port tables entries.
vport_table->table = RBTreeCreate(PortKeyComp,PortKeyDest,PortEntryDest,PortKeyPrint,PortEntryPrint);
if (vport_table->table == NULL) printk("did not create tree!\n");
vport_table->active_vports = 0;
vport_table->lookup_count = 0;
vport_table->max_vports = MAX_VPORT_TABLE_SIZE;
vport_table->port_match_count = 0;
vport_table->chain_match_count = 0;
}
/* Allocates and returns a new flow with room for 'actions_len' actions.
* Returns the new flow or a null pointer on failure. */
struct vport_table_entry *
vport_table_entry_alloc(size_t actions_len)
{
struct sw_vport_actions *svpa;
size_t size = sizeof *svpa + actions_len;
struct vport_table_entry *vpe = SafeMalloc(sizeof *vpe);
if (!vpe) {
printk("could not allocate virtual port table entry\n");
return NULL;
}
svpa = SafeMalloc(size);
if (!svpa) {
printk("could not allocate actions for virtual port table entry\n");
kfree(vpe);
return NULL;
}
svpa->actions_len = actions_len;
vpe->vport = 0;
vpe->parent_port_ptr = NULL;
vpe->packet_count = 0;
vpe->byte_count = 0;
vpe->port_acts = svpa;
return vpe;
}
/* free the vport_table_entry struct.
* remove_port_table_entry will remove an entry from the vport
* table and call this function.
* */
void free_vport_table_entry(struct vport_table_entry *vpe) {
kfree(vpe->port_acts);
kfree(vpe);
}
/* lookup a virtual port table entry using the virtual port number.
* The virtual port number should be between OFPP_VP_START and OFPP_VP_END. */
struct vport_table_entry
*vport_table_lookup(struct vport_table_t *vport_table, unsigned int vport)
{
rb_red_blk_node* newNode;
unsigned int port = vport;
if (vport_table->table == NULL) {
printk("vport table is NULL!\n");
}
//printk("vport_table_lookup invoked with vport = %u\n", vport);
newNode = RBExactQuery(vport_table->table, &port);
if (newNode) {
return newNode->info;
}
return NULL;
}
/* insert a virtual port table entry. */
int insert_vport_table_entry(struct vport_table_t *vport_table, struct vport_table_entry *vpe)
{
unsigned int *newKey;
struct vport_table_entry *pvpe;
newKey = (unsigned int *)SafeMalloc(sizeof(unsigned int));
*newKey = vpe->vport;
// parent port should obviously not be the current port.
if (vpe->parent_port == vpe->vport) {
printk("could not insert port table entry, "
"invalid parent_port %u\n", vpe->parent_port);
return EINVAL;
}
// find the parent port.
if (vpe->parent_port < OFPP_VP_START) {
// parent port is a physical port... set the parent_port_ptr to null.
vpe->parent_port_ptr = NULL;
} else if (vpe->parent_port >= OFPP_VP_START && vpe->parent_port <= OFPP_VP_END) {
// parent port is a virtual port.
// lookup the parent port's virtual port table entry.
pvpe = vport_table_lookup(vport_table, vpe->parent_port);
if (pvpe == NULL) {
printk("could not insert port table entry, "
"parent_port %u not found!\n", vpe->parent_port);
return EINVAL;
}
// set the parent_port_ptr.
vpe->parent_port_ptr = pvpe;
/*} else if (parent_port >= OFPP_VPL_START && parent_port <= OFPP_VPL_END) {
// XXX TODO: handle virtual port lists
}*/
} else {
printk("could not insert port table entry, "
"invalid parent_port %u!\n", vpe->parent_port);
return EINVAL;
}
// Note that with the red-black tree implementation that if
// we run out of memory on an insert the program will exit.
vpe->node = RBTreeInsert(vport_table->table, newKey, vpe);
vport_table->active_vports++;
return 0;
}
/* removes a virtual port table entry from the virtual port table. */
int remove_vport_table_entry(struct vport_table_t *vport_table, unsigned int vport)
{
struct vport_table_entry *vpe;
vpe = vport_table_lookup(vport_table, vport);
if (vpe != NULL) {
// delete will call PortEntryDest and PortKeyDest which will
// free all memory. The call should not fail.
RBDelete(vport_table->table, vpe->node);
vport_table->active_vports--;
} else {
printk("could not free virtual port table entry, "
"virtual port %u does not exist!\n", vport);
return EINVAL;
}
return 0;
}
/* increments counters for the virtual port table entry. */
void vport_used(struct vport_table_entry *vpe, struct sk_buff *skb)
{
vpe->packet_count++;
vpe->byte_count += skb->len;
}
// MAH: end
|
/* ResidualVM - A 3D game interpreter
*
* ResidualVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the AUTHORS
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GFX_OPENGL_SHADERS_H_
#define GFX_OPENGL_SHADERS_H_
#include "common/rect.h"
#include "math/rect2d.h"
#include "graphics/opengles2/shader.h"
#include "engines/myst3/gfx.h"
namespace Myst3 {
class ShaderRenderer : public BaseRenderer {
public:
ShaderRenderer(OSystem *_system);
virtual ~ShaderRenderer();
virtual void init() override;
virtual void clear() override;
virtual void setupCameraOrtho2D(bool noScaling) override;
virtual void setupCameraPerspective(float pitch, float heading, float fov) override;
virtual Texture *createTexture(const Graphics::Surface *surface) override;
virtual void freeTexture(Texture *texture) override;
virtual void drawRect2D(const Common::Rect &rect, uint32 color) override;
virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture,
float transparency = -1.0, bool additiveBlending = false) override;
virtual void drawTexturedRect3D(const Math::Vector3d &topLeft, const Math::Vector3d &bottomLeft,
const Math::Vector3d &topRight, const Math::Vector3d &bottomRight,
Texture *texture) override;
virtual void drawCube(Texture **textures) override;
virtual void draw2DText(const Common::String &text, const Common::Point &position) override;
virtual Graphics::Surface *getScreenshot() override;
virtual void screenPosToDirection(const Common::Point screen, float &pitch, float &heading) override;
private:
void setupQuadEBO();
Math::Vector2d scaled(float x, float y) const;
Graphics::Shader *_box_shader;
Graphics::Shader *_cube_shader;
Graphics::Shader *_rect3d_shader;
Graphics::Shader *_text_shader;
GLuint _boxVBO;
GLuint _cubeVBO;
GLuint _rect3dVBO;
GLuint _textVBO;
GLuint _quadEBO;
Math::Matrix4 _mvpMatrix;
Math::Rect2d _currentViewport;
Common::String _prevText;
Common::Point _prevTextPosition;
};
} // End of namespace Myst3
#endif
|
/****************************************************************************
**
** 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 QtXmlPatterns module 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$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
#ifndef Patternist_ElementAvailableFN_H
#define Patternist_ElementAvailableFN_H
#include "qstaticnamespacescontainer_p.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
namespace QPatternist
{
/**
* @short Implements the function <tt>fn:unparsed-text()</tt>.
*
* @ingroup Patternist_functions
* @see <a href="http://www.w3.org/TR/xslt20/#unparsed-text">XSL
* Transformations (XSLT) Version 2.0, 16.2 unparsed-text</a>
* @author Frans Englich <frans.englich@nokia.com>
* @since 4.5
*/
class ElementAvailableFN : public StaticNamespacesContainer
{
public:
ElementAvailableFN();
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const;
private:
static QSet<QString> allXSLTInstructions();
const QSet<QString> m_xsltInstructions;
};
}
QT_END_NAMESPACE
QT_END_HEADER
#endif
|
#ifndef __BOOT_MODE_
#define __BOOT_MODE__
extern int is_charging_mode(void);
extern int is_display_logo(void);
#endif
|
#ifndef SW_VIDEO_BACKEND_H_
#define SW_VIDEO_BACKEND_H_
#include "VideoBackendBase.h"
namespace SW
{
class VideoSoftware : public VideoBackend
{
bool Initialize(void *&) override;
void Shutdown() override;
std::string GetName() override;
void EmuStateChange(EMUSTATE_CHANGE newState) override;
void RunLoop(bool enable) override;
void ShowConfig(void* parent) override;
void Video_Prepare() override;
void Video_Cleanup() override;
void Video_EnterLoop() override;
void Video_ExitLoop() override;
void Video_BeginField(u32, u32, u32) override;
void Video_EndField() override;
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) override;
u32 Video_GetQueryResult(PerfQueryType type) override;
void Video_AddMessage(const char* pstr, unsigned int milliseconds) override;
void Video_ClearMessages() override;
bool Video_Screenshot(const char* filename) override;
int Video_LoadTexture(char *imagedata, u32 width, u32 height);
void Video_DeleteTexture(int texID);
void Video_DrawTexture(int texID, float *coords);
void Video_SetRendering(bool bEnabled) override;
void Video_GatherPipeBursted() override;
bool Video_IsPossibleWaitingSetDrawDone() override;
void Video_AbortFrame() override;
void Video_UpdateWantDeterminism() override;
readFn16 Video_CPRead16() override;
writeFn16 Video_CPWrite16() override;
readFn16 Video_PERead16() override;
writeFn16 Video_PEWrite16() override;
writeFn32 Video_PEWrite32() override;
void UpdateFPSDisplay(const char*) override;
unsigned int PeekMessages() override;
void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) override;
void DoState(PointerWrap &p) override;
public:
void CheckInvalidState() override;
};
}
#endif
|
/*
sshadt_list.h
Author: Antti Huima <huima@ssh.fi>
Copyright:
Copyright (c) 2002, 2003 SFNT Finland Oy.
All rights reserved.
Created Tue Sep 14 09:21:41 1999.
*/
#ifndef SSH_ADT_LIST_H_INCLUDED
#define SSH_ADT_LIST_H_INCLUDED
#include "sshadt.h"
extern const SshADTContainerType ssh_adt_list_type;
#define SSH_ADT_LIST (ssh_adt_list_type)
/* Sort a list destructively in ascending order (smallest objects
first). */
void ssh_adt_list_sort(SshADTContainer c);
/* Type for inlined list headers. (Users only need to know the type
of this; it is only provided so that one doesn't need to store the
20 bytes of SshADTHeader.) */
typedef struct {
void *a, *b;
} SshADTListHeaderStruct;
#endif /* SSH_ADT_LIST_H_INCLUDED */
|
/*
** Copyright (C) 2009-2017 Quadrant Information Security <quadrantsec.com>
** Copyright (C) 2009-2017 Champ Clark III <cclark@quadrantsec.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License Version 2 as
** published by the Free Software Foundation. You may not use, modify or
** distribute this program under any other version of the GNU General
** Public 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h" /* From autoconf */
#endif
int Sagan_Dynamic_Rules ( _Sagan_Proc_Syslog *, int, _Sagan_Processor_Info *, char *, char * );
|
/*
* Generic GPIO card-detect helper
*
* Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/mmc/cd-gpio.h>
#include <linux/mmc/host.h>
#include <linux/module.h>
#include <linux/slab.h>
struct mmc_cd_gpio {
unsigned int gpio;
char label[0];
bool status;
};
static int mmc_cd_get_status(struct mmc_host *host)
{
int ret = -ENOSYS;
struct mmc_cd_gpio *cd = host->hotplug.handler_priv;
if (!cd || !gpio_is_valid(cd->gpio))
goto out;
ret = !gpio_get_value_cansleep(cd->gpio) ^
!!(host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH);
out:
return ret;
}
static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id)
{
struct mmc_host *host = dev_id;
struct mmc_cd_gpio *cd = host->hotplug.handler_priv;
int status;
status = mmc_cd_get_status(host);
if (unlikely(status < 0))
goto out;
if (status ^ cd->status) {
pr_info("%s: slot status change detected (%d -> %d), GPIO_ACTIVE_%s\n",
mmc_hostname(host), cd->status, status,
(host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) ?
"HIGH" : "LOW");
cd->status = status;
#if defined(CONFIG_MACH_ACER_A12)
if (cd->status == 0) {
host->init_fail = false;
printk("clear sd init_fail\n");
}
#endif
/* Schedule a card detection after a debounce timeout */
mmc_detect_change(host, msecs_to_jiffies(100));
}
out:
return IRQ_HANDLED;
}
int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio)
{
size_t len = strlen(dev_name(host->parent)) + 4;
struct mmc_cd_gpio *cd;
int irq = gpio_to_irq(gpio);
int ret;
if (irq < 0)
return irq;
cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL);
if (!cd)
return -ENOMEM;
snprintf(cd->label, len, "%s cd", dev_name(host->parent));
ret = gpio_request_one(gpio, GPIOF_DIR_IN, cd->label);
if (ret < 0)
goto egpioreq;
cd->gpio = gpio;
host->hotplug.irq = irq;
host->hotplug.handler_priv = cd;
ret = mmc_cd_get_status(host);
if (ret < 0)
goto eirqreq;
cd->status = ret;
ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
cd->label, host);
if (ret < 0)
goto eirqreq;
#if defined(CONFIG_MACH_ACER_A12)
printk("SD CD %d as wake up ", irq);
ret = enable_irq_wake(irq);
if (ret < 0)
printk("fail: %d\n", ret);
else
printk("ok\n");
#endif
return 0;
eirqreq:
gpio_free(gpio);
egpioreq:
kfree(cd);
return ret;
}
EXPORT_SYMBOL(mmc_cd_gpio_request);
void mmc_cd_gpio_free(struct mmc_host *host)
{
struct mmc_cd_gpio *cd = host->hotplug.handler_priv;
free_irq(host->hotplug.irq, host);
gpio_free(cd->gpio);
kfree(cd);
}
EXPORT_SYMBOL(mmc_cd_gpio_free);
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2012 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <sys/syscall.h>
#include <string.h>
#include "util.h"
#include "syscall-list.h"
static const struct syscall_name* lookup_syscall(register const char *str,
register unsigned int len);
#include "syscall-to-name.h"
#include "syscall-from-name.h"
const char *syscall_to_name(int id) {
id = SYSCALL_TO_INDEX(id);
if (id < 0 || id >= (int) ELEMENTSOF(syscall_names))
return NULL;
return syscall_names[id];
}
int syscall_from_name(const char *name) {
const struct syscall_name *sc;
assert(name);
sc = lookup_syscall(name, strlen(name));
if (!sc)
return -1;
return sc->id;
}
int syscall_max(void) {
return ELEMENTSOF(syscall_names);
}
|
/* $Id$ */
/*
* UNIX-Connect, a ZCONNECT(r) Transport and Gateway/Relay.
* Copyright (C) 1999-2000 Dirk Meyer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* ------------------------------------------------------------------------
* Eine deutsche Zusammenfassung zum Copyright dieser Programme sowie der
* GNU General Public License finden Sie in der Datei README.1st.
* ------------------------------------------------------------------------
*
* Bugreports, suggestions for improvement, patches, ports to other systems
* etc. are welcome. Contact the maintainer by e-mail:
* dirk.meyer@dinoex.sub.org or snail-mail:
* Dirk Meyer, Im Grund 4, 34317 Habichtswald
*
* There is a mailing-list for user-support:
* unix-connect-users@lists.sourceforge.net,
* write a mail with subject "Help" to
* unix-connect-users-request@lists.sourceforge.net
* for instructions on how to join this list.
*/
/*
* uudebug.h
*
* Logfile-Routinen fuer den ZCONNECT/RFC GateWay
*
*/
void logcwd(const char *func);
|
/*
* This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
*
* 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 MANGOSSERVER_TOTEM_H
#define MANGOSSERVER_TOTEM_H
#include "Creature.h"
enum TotemType
{
TOTEM_PASSIVE = 0,
TOTEM_ACTIVE = 1,
TOTEM_STATUE = 2
};
class Totem : public Creature
{
public:
explicit Totem();
virtual ~Totem() {};
bool Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, Unit* owner);
void Update(uint32 update_diff, uint32 time) override;
void Summon(Unit* owner);
void UnSummon();
uint32 GetSpell() const { return m_spells[0]; }
uint32 GetTotemDuration() const { return m_duration; }
Unit* GetOwner();
TotemType GetTotemType() const { return m_type; }
void SetTypeBySummonSpell(SpellEntry const* spellProto);
void SetDuration(uint32 dur) { m_duration = dur; }
void SetOwner(Unit* owner);
bool UpdateStats(Stats /*stat*/) override { return true; }
bool UpdateAllStats() override { return true; }
void UpdateResistances(uint32 /*school*/) override {}
void UpdateArmor() override {}
void UpdateMaxHealth() override {}
void UpdateMaxPower(Powers /*power*/) override {}
void UpdateAttackPowerAndDamage(bool /*ranged*/) override {}
void UpdateDamagePhysical(WeaponAttackType /*attType*/) override {}
bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const override;
protected:
TotemType m_type;
uint32 m_duration;
};
#endif
|
/* vim:set ts=4 sw=4 sts=4 et cindent: */
/*
* nanodc - The ncurses DC++ client
* Copyright © 2005-2006 Markus Lindqvist <nanodc.developer@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.
*
* Contributor(s):
*
*/
#ifndef _SCREEN_H_
#define _SCREEN_H_
#include <stdexcept>
#include <string>
#include <utils/ncurses.h>
namespace display {
/** Wrapper for general ncurses functions. */
class Screen {
public:
/** Initialize the curses-stuff.
* @throw std::runtime_error if something fails. */
static void initialize() throw(std::runtime_error);
/** Returns the width of the screen. */
static unsigned int get_width() { return get_xymax().first; }
/** Returns the height of the screen. */
static unsigned int get_height() { return get_xymax().second; }
/** Check if screen has been resized since last call.
* @return True if screen has been resized, false otherwise. */
static bool is_resized();
/** Copy the buffer to the screen. */
static void do_update() { doupdate(); }
private:
static std::pair<unsigned int, unsigned int> get_xymax() { int x, y; getmaxyx(stdscr, y, x); return{ x, y }; }
Screen(); //!< Forbidden
Screen(const Screen &); //!< Forbidden
Screen& operator=(const Screen &); //!< Forbidden
};
} // namespace display
#endif // _SCREEN_H_
|
#ifndef FUNCTIONS_H_
#define FUNCTIONS_H_
void USART_Init( unsigned int ubrr , unsigned char usart_no);
void USART_Transmit(uint8_t ByteToSend);
#endif /* FUNCTIONS_H_ */
|
#ifndef _PPC64PHP_H
#define _PPC64PHP_H
#include <linux/pci.h>
#include <linux/pci_hotplug.h>
#define DR_INDICATOR 9002
#define DR_ENTITY_SENSE 9003
#define POWER_ON 100
#define POWER_OFF 0
#define LED_OFF 0
#define LED_ON 1
#define LED_ID 2
#define LED_ACTION 3
#define EMPTY 0
#define PRESENT 1
#define MY_NAME "rpaphp"
extern int rpaphp_debug;
#define dbg(format, arg...) \
do { \
if (rpaphp_debug) \
printk(KERN_DEBUG "%s: " format, \
MY_NAME , ## arg); \
} while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
#define NOT_VALID 3
#define NOT_CONFIGURED 2
#define CONFIGURED 1
#define EMPTY 0
struct slot {
struct list_head rpaphp_slot_list;
int state;
u32 index;
u32 type;
u32 power_domain;
char *name;
struct device_node *dn;
struct pci_bus *bus;
struct list_head *pci_devs;
struct hotplug_slot *hotplug_slot;
};
extern struct hotplug_slot_ops rpaphp_hotplug_slot_ops;
extern struct list_head rpaphp_slot_head;
extern int rpaphp_enable_slot(struct slot *slot);
extern int rpaphp_get_sensor_state(struct slot *slot, int *state);
extern int rpaphp_add_slot(struct device_node *dn);
extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
char **drc_name, char **drc_type, int *drc_power_domain);
extern void dealloc_slot_struct(struct slot *slot);
extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
extern int rpaphp_register_slot(struct slot *slot);
extern int rpaphp_deregister_slot(struct slot *slot);
#endif
|
/*
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2013 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NET_EATHENA_BUYSELLHANDLER_H
#define NET_EATHENA_BUYSELLHANDLER_H
#include "net/buysellhandler.h"
#include "net/ea/buysellhandler.h"
#include "net/eathena/messagehandler.h"
namespace EAthena
{
class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler
{
public:
BuySellHandler();
A_DELETE_COPY(BuySellHandler)
virtual void handleMessage(Net::MessageIn &msg);
virtual void processNpcBuy(Net::MessageIn &msg);
virtual void processNpcSellResponse(Net::MessageIn &msg) const;
};
} // namespace EAthena
#endif // NET_EATHENA_BUYSELLHANDLER_H
|
/* Target value mapping utilities needed by the simulator and gdb. */
/* This file is machine generated by gentmap.c. */
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include "ansidecl.h"
#include "gdb/callback.h"
#include "targ-vals.h"
/* syscall mapping table */
CB_TARGET_DEFS_MAP cb_init_syscall_map[] = {
{ -1, -1 }
};
/* errno mapping table */
CB_TARGET_DEFS_MAP cb_init_errno_map[] = {
#ifdef E2BIG
{ E2BIG, TARGET_E2BIG },
#endif
#ifdef EACCES
{ EACCES, TARGET_EACCES },
#endif
#ifdef EADDRINUSE
{ EADDRINUSE, TARGET_EADDRINUSE },
#endif
#ifdef EADDRNOTAVAIL
{ EADDRNOTAVAIL, TARGET_EADDRNOTAVAIL },
#endif
#ifdef EAFNOSUPPORT
{ EAFNOSUPPORT, TARGET_EAFNOSUPPORT },
#endif
#ifdef EAGAIN
{ EAGAIN, TARGET_EAGAIN },
#endif
#ifdef EALREADY
{ EALREADY, TARGET_EALREADY },
#endif
#ifdef EBADF
{ EBADF, TARGET_EBADF },
#endif
#ifdef EBADMSG
{ EBADMSG, TARGET_EBADMSG },
#endif
#ifdef EBUSY
{ EBUSY, TARGET_EBUSY },
#endif
#ifdef ECANCELED
{ ECANCELED, TARGET_ECANCELED },
#endif
#ifdef ECHILD
{ ECHILD, TARGET_ECHILD },
#endif
#ifdef ECONNABORTED
{ ECONNABORTED, TARGET_ECONNABORTED },
#endif
#ifdef ECONNREFUSED
{ ECONNREFUSED, TARGET_ECONNREFUSED },
#endif
#ifdef ECONNRESET
{ ECONNRESET, TARGET_ECONNRESET },
#endif
#ifdef EDEADLK
{ EDEADLK, TARGET_EDEADLK },
#endif
#ifdef EDESTADDRREQ
{ EDESTADDRREQ, TARGET_EDESTADDRREQ },
#endif
#ifdef EDOM
{ EDOM, TARGET_EDOM },
#endif
#ifdef EDQUOT
{ EDQUOT, TARGET_EDQUOT },
#endif
#ifdef EEXIST
{ EEXIST, TARGET_EEXIST },
#endif
#ifdef EFAULT
{ EFAULT, TARGET_EFAULT },
#endif
#ifdef EFBIG
{ EFBIG, TARGET_EFBIG },
#endif
#ifdef EFTYPE
{ EFTYPE, TARGET_EFTYPE },
#endif
#ifdef EHOSTDOWN
{ EHOSTDOWN, TARGET_EHOSTDOWN },
#endif
#ifdef EHOSTUNREACH
{ EHOSTUNREACH, TARGET_EHOSTUNREACH },
#endif
#ifdef EIDRM
{ EIDRM, TARGET_EIDRM },
#endif
#ifdef EILSEQ
{ EILSEQ, TARGET_EILSEQ },
#endif
#ifdef EINPROGRESS
{ EINPROGRESS, TARGET_EINPROGRESS },
#endif
#ifdef EINTR
{ EINTR, TARGET_EINTR },
#endif
#ifdef EINVAL
{ EINVAL, TARGET_EINVAL },
#endif
#ifdef EIO
{ EIO, TARGET_EIO },
#endif
#ifdef EISCONN
{ EISCONN, TARGET_EISCONN },
#endif
#ifdef EISDIR
{ EISDIR, TARGET_EISDIR },
#endif
#ifdef ELOOP
{ ELOOP, TARGET_ELOOP },
#endif
#ifdef EMFILE
{ EMFILE, TARGET_EMFILE },
#endif
#ifdef EMLINK
{ EMLINK, TARGET_EMLINK },
#endif
#ifdef EMSGSIZE
{ EMSGSIZE, TARGET_EMSGSIZE },
#endif
#ifdef EMULTIHOP
{ EMULTIHOP, TARGET_EMULTIHOP },
#endif
#ifdef ENAMETOOLONG
{ ENAMETOOLONG, TARGET_ENAMETOOLONG },
#endif
#ifdef ENETDOWN
{ ENETDOWN, TARGET_ENETDOWN },
#endif
#ifdef ENETRESET
{ ENETRESET, TARGET_ENETRESET },
#endif
#ifdef ENETUNREACH
{ ENETUNREACH, TARGET_ENETUNREACH },
#endif
#ifdef ENFILE
{ ENFILE, TARGET_ENFILE },
#endif
#ifdef ENOBUFS
{ ENOBUFS, TARGET_ENOBUFS },
#endif
#ifdef ENODATA
{ ENODATA, TARGET_ENODATA },
#endif
#ifdef ENODEV
{ ENODEV, TARGET_ENODEV },
#endif
#ifdef ENOENT
{ ENOENT, TARGET_ENOENT },
#endif
#ifdef ENOEXEC
{ ENOEXEC, TARGET_ENOEXEC },
#endif
#ifdef ENOLCK
{ ENOLCK, TARGET_ENOLCK },
#endif
#ifdef ENOLINK
{ ENOLINK, TARGET_ENOLINK },
#endif
#ifdef ENOMEM
{ ENOMEM, TARGET_ENOMEM },
#endif
#ifdef ENOMSG
{ ENOMSG, TARGET_ENOMSG },
#endif
#ifdef ENOPROTOOPT
{ ENOPROTOOPT, TARGET_ENOPROTOOPT },
#endif
#ifdef ENOSPC
{ ENOSPC, TARGET_ENOSPC },
#endif
#ifdef ENOSR
{ ENOSR, TARGET_ENOSR },
#endif
#ifdef ENOSTR
{ ENOSTR, TARGET_ENOSTR },
#endif
#ifdef ENOSYS
{ ENOSYS, TARGET_ENOSYS },
#endif
#ifdef ENOTCONN
{ ENOTCONN, TARGET_ENOTCONN },
#endif
#ifdef ENOTDIR
{ ENOTDIR, TARGET_ENOTDIR },
#endif
#ifdef ENOTEMPTY
{ ENOTEMPTY, TARGET_ENOTEMPTY },
#endif
#ifdef ENOTRECOVERABLE
{ ENOTRECOVERABLE, TARGET_ENOTRECOVERABLE },
#endif
#ifdef ENOTSOCK
{ ENOTSOCK, TARGET_ENOTSOCK },
#endif
#ifdef ENOTSUP
{ ENOTSUP, TARGET_ENOTSUP },
#endif
#ifdef ENOTTY
{ ENOTTY, TARGET_ENOTTY },
#endif
#ifdef ENXIO
{ ENXIO, TARGET_ENXIO },
#endif
#ifdef EOPNOTSUPP
{ EOPNOTSUPP, TARGET_EOPNOTSUPP },
#endif
#ifdef EOVERFLOW
{ EOVERFLOW, TARGET_EOVERFLOW },
#endif
#ifdef EOWNERDEAD
{ EOWNERDEAD, TARGET_EOWNERDEAD },
#endif
#ifdef EPERM
{ EPERM, TARGET_EPERM },
#endif
#ifdef EPFNOSUPPORT
{ EPFNOSUPPORT, TARGET_EPFNOSUPPORT },
#endif
#ifdef EPIPE
{ EPIPE, TARGET_EPIPE },
#endif
#ifdef EPROTO
{ EPROTO, TARGET_EPROTO },
#endif
#ifdef EPROTONOSUPPORT
{ EPROTONOSUPPORT, TARGET_EPROTONOSUPPORT },
#endif
#ifdef EPROTOTYPE
{ EPROTOTYPE, TARGET_EPROTOTYPE },
#endif
#ifdef ERANGE
{ ERANGE, TARGET_ERANGE },
#endif
#ifdef EROFS
{ EROFS, TARGET_EROFS },
#endif
#ifdef ESPIPE
{ ESPIPE, TARGET_ESPIPE },
#endif
#ifdef ESRCH
{ ESRCH, TARGET_ESRCH },
#endif
#ifdef ESTALE
{ ESTALE, TARGET_ESTALE },
#endif
#ifdef ETIME
{ ETIME, TARGET_ETIME },
#endif
#ifdef ETIMEDOUT
{ ETIMEDOUT, TARGET_ETIMEDOUT },
#endif
#ifdef ETOOMANYREFS
{ ETOOMANYREFS, TARGET_ETOOMANYREFS },
#endif
#ifdef ETXTBSY
{ ETXTBSY, TARGET_ETXTBSY },
#endif
#ifdef EWOULDBLOCK
{ EWOULDBLOCK, TARGET_EWOULDBLOCK },
#endif
#ifdef EXDEV
{ EXDEV, TARGET_EXDEV },
#endif
{ 0, 0 }
};
/* open flags mapping table */
CB_TARGET_DEFS_MAP cb_init_open_map[] = {
#ifdef O_ACCMODE
{ O_ACCMODE, TARGET_O_ACCMODE },
#endif
#ifdef O_APPEND
{ O_APPEND, TARGET_O_APPEND },
#endif
#ifdef O_CREAT
{ O_CREAT, TARGET_O_CREAT },
#endif
#ifdef O_EXCL
{ O_EXCL, TARGET_O_EXCL },
#endif
#ifdef O_NOCTTY
{ O_NOCTTY, TARGET_O_NOCTTY },
#endif
#ifdef O_NONBLOCK
{ O_NONBLOCK, TARGET_O_NONBLOCK },
#endif
#ifdef O_RDONLY
{ O_RDONLY, TARGET_O_RDONLY },
#endif
#ifdef O_RDWR
{ O_RDWR, TARGET_O_RDWR },
#endif
#ifdef O_SYNC
{ O_SYNC, TARGET_O_SYNC },
#endif
#ifdef O_TRUNC
{ O_TRUNC, TARGET_O_TRUNC },
#endif
#ifdef O_WRONLY
{ O_WRONLY, TARGET_O_WRONLY },
#endif
{ -1, -1 }
};
|
/*
* progress.h
*
* Copyright 2009 Brett Mravec <brett.mravec@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 __PROGRESS_H__
#define __PROGRESS_H__
#include <gtk/gtk.h>
#define PROGRESS_TYPE (progress_get_type ())
#define PROGRESS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PROGRESS_TYPE, Progress))
#define PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROGRESS_TYPE, ProgressClass))
#define IS_PROGRESS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PROGRESS_TYPE))
#define IS_PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROGRESS_TYPE))
#define PROGRESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROGRESS_TYPE, ProgressClass))
G_BEGIN_DECLS
typedef struct _Progress Progress;
typedef struct _ProgressClass ProgressClass;
typedef struct _ProgressPrivate ProgressPrivate;
struct _Progress {
GObject parent;
ProgressPrivate *priv;
};
struct _ProgressClass {
GObjectClass parent;
};
Progress *progress_new (const gchar *label);
GType progress_get_type (void);
void progress_set_text (Progress *self, const gchar *text);
void progress_set_percent (Progress *self, gdouble frac);
GtkWidget *progress_get_widget ();
G_END_DECLS
#endif /* __PROGRESS_H__ */
|
/////////////////////////////////////////////////////////////////////////
// File: $URL$
// Module: Loads images in a seperate thread.
// Part of: VitaminSEE
//
// ID: $Id: ApplicationController.m 123 2005-04-18 00:21:02Z elliot $
// Revision: $Revision$
// Last edited: $Date$
// Author: $Author$
// Copyright: (c) 2005 Elliot Glaysher
// Created: 9/13/05
//
/////////////////////////////////////////////////////////////////////////
//
// 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.
//
////////////////////////////////////////////////////////////////////////
#import <Cocoa/Cocoa.h>
// Scale value constants
extern NSString* SCALE_IMAGE_PROPORTIONALLY;
extern NSString* SCALE_IMAGE_TO_FIT;
extern NSString* SCALE_IMAGE_TO_FIT_WIDTH;
extern NSString* SCALE_IMAGE_TO_FIT_HEIGHT;
// Smoothing value constants
extern NSString* NO_SMOOTHING;
extern NSString* LOW_SMOOTHING;
extern NSString* HIGH_SMOOTHING;
// ImageLoader structure constants
extern NSString* IL_REQUESTER;
extern NSString* IL_PATH;
extern NSString* IL_PARTIAL;
extern NSString* IL_SCALE_MODE;
extern NSString* IL_VIEWING_AREA_HEIGHT;
extern NSString* IL_VIEWING_AREA_WIDTH;
extern NSString* IL_SMOOTHING;
extern NSString* IL_IMAGE;
extern NSString* IL_PIXEL_WIDTH;
extern NSString* IL_PIXEL_HEIGHT;
extern NSString* IL_SCALE_RATIO;
extern NSString* IL_DATE;
extern NSString* IL_IMAGE_REP;
extern NSString* IL_DATA_SIZE;
@class EGPath;
@interface ImageLoader : NSObject {
}
+(void)loadTask:(NSMutableDictionary*)task;
+(void)preloadImage:(EGPath*)file;
+(void)unregisterRequester:(id)requester;
+(void)clearAllCaches;
// Functions used in unit testing.
+(NSArray*)imagesInCache;
@end
|
#ifndef _CLUSTERDEFINES_H
#define _CLUSTERDEFINES_H
enum NodeTypes
{
NODE_TYPE_SINGLE = 0, // Deprecated
NODE_TYPE_MASTER = 1, // Master-Node (only this Node should be write data on our DB, if smt. is global or logon couldn't write it)
NODE_TYPE_SLAVE = 2, // Slave-Node is a Map-Node
NODE_TYPE_CUSTOM = 3, // World-Node provides an own World
NODE_TYPE_POOL = 4 // Pool-Node is a node for realmpools
};
//Defines at which point our init fails
enum NodeAck
{
NODE_INIT_ACK_FAIL = 0,
NODE_INIT_ACK_ITEM_GUID_FAIL = 1,
NODE_INIT_ACK_MAIL_GUID_FAIL = 2,
NODE_INIT_ACK_CORPSE_GUID_FAIL = 3,
NODE_INIT_ACK_OK = 254
};
enum AchievementData
{
CL_DEF_COMPLETED_ACHIEVEMENT = 0, //uint32(ID)
CL_DEF_CRITERIA_UPDATE, //uint32 entry, changeValue, uint8 ptype;
CL_DEF_RESET_ACHIEVEMENTS,
CL_DEF_RESET_ACHIEVEMENT_CRITERIA, //uint32 type,miscvalue1,miscvalue2,bool evenIfCriteriaComplete;
//Syncs L/N
CL_DEF_GUID_SYNC, //Logon sends Highest GUID, Node sends if any GUID was taken
CL_DEF_SHUTDOWN, //Sends shutdown in uint32 Seconds
CL_DEF_GUILDBANK_ITEM_ADD, //Add an item to GUILD-BANK
CL_DEF_GUILDBANK_ITEM_REMOVE, //remove an item from GUILD-BANK
CL_DEF_TRANSFER_TO_NODE, //uint32 (NODE)
CL_DEF_TRANSFER_OK,
CL_DEF_TRANSFER_ACC,
CL_DEF_REP_SET_REPUTATION = 0,
CL_DEF_REP,
CL_DEF_TEST,
CL_DEF_TELE,
};
enum EntityIDType
{
ENTITYID_ITEM = 1,
ENTITYID_MAIL,
ENTITYID_CORPSE,
ENTITYID_GROUP
};
#endif
|
/*****************************************************************************
* flv_bytestream.c: flv muxer utilities
*****************************************************************************
* Copyright (C) 2009-2012 x264 project
*
* Authors: Kieran Kunhya <kieran@kunhya.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 02111, USA.
*****************************************************************************/
#include "output.h"
#include "flv_bytestream.h"
uint64_t flv_dbl2int( double value )
{
return (union {double f; uint64_t i;}){value}.i;
}
/* Put functions */
void flv_put_byte( flv_buffer *c, uint8_t b )
{
flv_append_data( c, &b, 1 );
}
void flv_put_be32( flv_buffer *c, uint32_t val )
{
flv_put_byte( c, val >> 24 );
flv_put_byte( c, val >> 16 );
flv_put_byte( c, val >> 8 );
flv_put_byte( c, val );
}
void flv_put_be64( flv_buffer *c, uint64_t val )
{
flv_put_be32( c, val >> 32 );
flv_put_be32( c, val );
}
void flv_put_be16( flv_buffer *c, uint16_t val )
{
flv_put_byte( c, val >> 8 );
flv_put_byte( c, val );
}
void flv_put_be24( flv_buffer *c, uint32_t val )
{
flv_put_be16( c, val >> 8 );
flv_put_byte( c, val );
}
void flv_put_tag( flv_buffer *c, const char *tag )
{
while( *tag )
flv_put_byte( c, *tag++ );
}
void flv_put_amf_string( flv_buffer *c, const char *str )
{
uint16_t len = strlen( str );
flv_put_be16( c, len );
flv_append_data( c, (uint8_t*)str, len );
}
void flv_put_amf_double( flv_buffer *c, double d )
{
flv_put_byte( c, AMF_DATA_TYPE_NUMBER );
flv_put_be64( c, flv_dbl2int( d ) );
}
/* flv writing functions */
flv_buffer *flv_create_writer( const char *filename )
{
flv_buffer *c = malloc( sizeof(*c) );
if( !c )
return NULL;
memset( c, 0, sizeof(*c) );
if( !strcmp( filename, "-" ) )
c->fp = stdout;
else
c->fp = fopen( filename, "wb" );
if( !c->fp )
{
free( c );
return NULL;
}
return c;
}
int flv_append_data( flv_buffer *c, uint8_t *data, unsigned size )
{
unsigned ns = c->d_cur + size;
if( ns > c->d_max )
{
void *dp;
unsigned dn = 16;
while( ns > dn )
dn <<= 1;
dp = realloc( c->data, dn );
if( !dp )
return -1;
c->data = dp;
c->d_max = dn;
}
memcpy( c->data + c->d_cur, data, size );
c->d_cur = ns;
return 0;
}
void flv_rewrite_amf_be24( flv_buffer *c, unsigned length, unsigned start )
{
*(c->data + start + 0) = length >> 16;
*(c->data + start + 1) = length >> 8;
*(c->data + start + 2) = length >> 0;
}
int flv_flush_data( flv_buffer *c )
{
if( !c->d_cur )
return 0;
if( fwrite( c->data, c->d_cur, 1, c->fp ) != 1 )
return -1;
c->d_total += c->d_cur;
c->d_cur = 0;
return 0;
}
|
/*
** FamiTracker - NES/Famicom sound tracker
** Copyright (C) 2005-2014 Jonathan Liss
**
** SnevenTracker is (C) HertzDevil 2016
**
** 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
** Library General Public License for more details. To obtain a
** copy of the GNU Library General Public License, write to the Free
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Any permitted reproduction of these routines, in whole or in part,
** must bear this legend.
*/
#pragma once
#include "Base.h"
// // // SN76489 specialization of the writer class
class CVGMWriterSN76489 : public CVGMWriterBase
{
public:
enum class Mode {GameGear, BBCMicro, SN76496};
public:
CVGMWriterSN76489(CVGMLogger &logger, Mode m = Mode::GameGear);
void SetClockRate(uint32_t hz);
private:
VGMChip GetChip() const override final;
void UpdateHeader(CVGMLogger::Header &h) const override final;
std::vector<char> Command(uint32_t adr, uint32_t val, uint32_t port) const override final;
protected:
Mode m_iMode;
uint32_t m_iClockRate;
};
|
#ifndef H_DEFINES
#define H_DEFINES
#define success 1
#define failure 0
#endif // H_DEFINES
|
/**
* $Id$
* Copyright (C) 2008 - 2014 Nils Asmussen
*
* 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 <sys/common.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscalls.h>
#include <dirent.h>
int mount(int ms,int fs,const char *path) {
/* root is a special case; we cannot create it before, which is why it doesn't exist before
* mounting something there */
if(path[0] == '/' && path[1] == '\0')
return syscall3(SYSCALL_MOUNT,ms,fs,(ulong)"/");
char apath[MAX_PATH_LEN];
ssize_t res = canonpath(apath,sizeof(apath),path);
if(res < 0)
return res;
return syscall3(SYSCALL_MOUNT,ms,fs,(ulong)apath);
}
int remount(int ms,int dir,uint perm) {
return syscall3(SYSCALL_REMOUNT,ms,dir,perm);
}
int unmount(int ms,const char *path) {
char apath[MAX_PATH_LEN];
ssize_t res = canonpath(apath,sizeof(apath),path);
if(res < 0)
return res;
return syscall2(SYSCALL_UNMOUNT,ms,(ulong)apath);
}
|
/****************************************************************************
**
** 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 QtOpenGL module 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 QGLFRAMEBUFFEROBJECT_H
#define QGLFRAMEBUFFEROBJECT_H
#include <QtOpenGL/qgl.h>
#include <QtGui/qpaintdevice.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(OpenGL)
class QGLFramebufferObjectPrivate;
class Q_OPENGL_EXPORT QGLFramebufferObject : public QPaintDevice
{
Q_DECLARE_PRIVATE(QGLFramebufferObject)
public:
enum Attachment {
NoAttachment,
CombinedDepthStencil,
Depth
};
QGLFramebufferObject(const QSize &size, GLenum target = GL_TEXTURE_2D);
QGLFramebufferObject(int width, int height, GLenum target = GL_TEXTURE_2D);
#if !defined(QT_OPENGL_ES) || defined(Q_QDOC)
QGLFramebufferObject(const QSize &size, Attachment attachment,
GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA8);
QGLFramebufferObject(int width, int height, Attachment attachment,
GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA8);
#else
QGLFramebufferObject(const QSize &size, Attachment attachment,
GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA);
QGLFramebufferObject(int width, int height, Attachment attachment,
GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA);
#endif
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
QGLFramebufferObject(const QSize &size, QMacCompatGLenum target = GL_TEXTURE_2D);
QGLFramebufferObject(int width, int height, QMacCompatGLenum target = GL_TEXTURE_2D);
QGLFramebufferObject(const QSize &size, Attachment attachment,
QMacCompatGLenum target = GL_TEXTURE_2D, QMacCompatGLenum internal_format = GL_RGBA8);
QGLFramebufferObject(int width, int height, Attachment attachment,
QMacCompatGLenum target = GL_TEXTURE_2D, QMacCompatGLenum internal_format = GL_RGBA8);
#endif
virtual ~QGLFramebufferObject();
bool isValid() const;
bool isBound() const;
bool bind();
bool release();
GLuint texture() const;
QSize size() const;
QImage toImage() const;
Attachment attachment() const;
QPaintEngine *paintEngine() const;
GLuint handle() const;
static bool hasOpenGLFramebufferObjects();
void drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D);
void drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D);
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
void drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D);
void drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D);
#endif
protected:
int metric(PaintDeviceMetric metric) const;
int devType() const { return QInternal::FramebufferObject; }
private:
Q_DISABLE_COPY(QGLFramebufferObject)
QGLFramebufferObjectPrivate *d_ptr;
friend class QGLDrawable;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QGLFRAMEBUFFEROBJECT_H
|
/* arch/arm/plat-s3c/include/plat/watchdog-reset.h
*
* Copyright (c) 2008 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* S3C2410 - System define for arch_reset() function
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <plat/regs-watchdog.h>
#include <mach/map.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <mach/regs-clock.h>
static inline void arch_wdt_reset(void)
{
struct clk *wdtclk;
struct clk;
#if 0
printk("arch_reset: attempting watchdog reset\n");
__raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
wdtclk = clk_get(NULL, "watchdog");
if (!IS_ERR(wdtclk)) {
clk_enable(wdtclk);
} else
printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
#endif
__raw_writel(0x3FFFF, S5P_CLKGATE_IP_PERIR);
/* put initial values into count and data */
__raw_writel(0x80, S3C2410_WTCNT);
__raw_writel(0x80, S3C2410_WTDAT);
/* set the watchdog to go and reset... */
__raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
/* wait for reset to assert... */
mdelay(500);
printk(KERN_ERR "Watchdog reset failed to assert reset\n");
/* delay to allow the serial port to show the message */
mdelay(50);
}
|
#ifndef H_WORLD
#define H_WORLD
#include <vector>
#include <stdint.h>
#include <iostream>
#include <SFML/Graphics.hpp>
#include "line.h"
#include "entity.h"
#include "entitygroup.h"
#include "vec2f.h"
namespace zen
{
class World
{
public:
World();
~World();
//void addEntity(Entity* entity);
void addEntityGroup(EntityGroup* group, float paralaxAmount);
void update(float frameTime);
void addPlatformLine(Line* line);
float getGravity();
std::vector<Line*>* getPlatformLines();
EntityGroup* getMainGroup();
private:
struct Layer
{
EntityGroup* eGroup;
float paralaxAmount;
};
//std::vector<Entity*> entities;
std::vector<Layer> layers;
EntityGroup mainGroup;
float gravity;
};
}
#endif
|
/*! @file slu_scomplex.h
* \brief Header file for complex operations
* <pre>
* -- SuperLU routine (version 2.0) --
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
* and Lawrence Berkeley National Lab.
* November 15, 1997
*
* Contains definitions for various complex operations.
* This header file is to be included in source files c*.c
* </pre>
*/
#ifndef __SUPERLU_SCOMPLEX /* allow multiple inclusions */
#define __SUPERLU_SCOMPLEX
#ifndef SCOMPLEX_INCLUDE
#define SCOMPLEX_INCLUDE
typedef struct { float r, i; } complex;
/* Macro definitions */
/*! \brief Complex Addition c = a + b */
#define c_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
(c)->i = (a)->i + (b)->i; }
/*! \brief Complex Subtraction c = a - b */
#define c_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
(c)->i = (a)->i - (b)->i; }
/*! \brief Complex-Double Multiplication */
#define cs_mult(c, a, b) { (c)->r = (a)->r * (b); \
(c)->i = (a)->i * (b); }
/*! \brief Complex-Complex Multiplication */
#define cc_mult(c, a, b) { \
float cr, ci; \
cr = (a)->r * (b)->r - (a)->i * (b)->i; \
ci = (a)->i * (b)->r + (a)->r * (b)->i; \
(c)->r = cr; \
(c)->i = ci; \
}
#define cc_conj(a, b) { \
(a)->r = (b)->r; \
(a)->i = -((b)->i); \
}
/*! \brief Complex equality testing */
#define c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
#ifdef __cplusplus
extern "C" {
#endif
/* Prototypes for functions in scomplex.c */
void c_div(complex *, complex *, complex *);
double c_abs(complex *); /* exact */
double c_abs1(complex *); /* approximate */
void c_exp(complex *, complex *);
void r_cnjg(complex *, complex *);
double r_imag(complex *);
complex c_sgn(complex *);
complex c_sqrt(complex *);
#ifdef __cplusplus
}
#endif
#endif
#endif /* __SUPERLU_SCOMPLEX */
|
#ifndef ENTITY_RAW_CONTRACT
#define ENTITY_RAW_CONTRACT
#include <memory>
#include <string>
#include <vector>
/// can not be used across multiple threads
namespace entity {
class Contract;
class RawContract {
public:
explicit RawContract(std::vector<std::string>&& constractStringVector);
explicit RawContract(const std::vector<std::string>& constractStringVector);
~RawContract();
std::shared_ptr<Contract> getContract();
std::shared_ptr<std::vector<std::string>> getLocalPathList();
private:
std::vector<std::string> constractStringVector;
std::shared_ptr<Contract> contract;
std::shared_ptr<std::vector<std::string>> localPathList;
void rafine();
void assertRawContract() const;
};
}
#endif
|
/* From uart401.c */
int probe_uart401 (struct address_info *hw_config, struct module *owner);
void unload_uart401 (struct address_info *hw_config);
void uart401intr (int irq, void *dev_id, struct pt_regs * dummy);
/* From mpu401.c */
int probe_mpu401(struct address_info *hw_config);
void attach_mpu401(struct address_info * hw_config, struct module *owner);
void unload_mpu401(struct address_info *hw_info);
int intchk_mpu401(void *dev_id);
void mpuintr(int irq, void *dev_id, struct pt_regs * dummy);
|
#ifndef STOPWATCH_H
#define STOPWATCH_H
#include <cstdio>
#include <sys/time.h>
class StopWatch {
public:
void Start() {
is_running_ = true;
gettimeofday(&t1_, NULL);
}
void Stop() {
is_running_ = false;
gettimeofday(&t2_, NULL);
}
// Returns elapsed time in centi seconds.
double ElapsedTime() {
if (is_running_) {
gettimeofday(&t2_, NULL);
}
return static_cast<double>((t2_.tv_usec - t1_.tv_usec) +
(t2_.tv_sec - t1_.tv_sec) * 1000000) /
10000;
}
private:
struct timeval t1_;
struct timeval t2_;
bool is_running_;
};
#endif
|
/*
* linux/arch/i386/mm/extable.c
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
extern const struct exception_table_entry __start___ex_table[];
extern const struct exception_table_entry __stop___ex_table[];
//exception_table_entry
//二分法搜索异常表
static inline unsigned long
search_one_table(const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long value)
{
while (first <= last) {
const struct exception_table_entry *mid;
long diff;
mid = (last - first) / 2 + first;
diff = mid->insn - value;
if (diff == 0)
return mid->fixup;
else if (diff < 0)
first = mid+1;
else
last = mid-1;
}
return 0;
}
unsigned long
search_exception_table(unsigned long addr)
{
unsigned long ret;
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
if (ret) return ret;
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) return ret;
}
#endif
return 0;
}
|
// ライセンス: GPL2
//
// 埋め込み画像クラス
//
#ifndef _EMVEDDEDIMAGE_H
#define _EMVEDDEDIMAGE_H
#include <gtkmm.h>
#include "skeleton/dispatchable.h"
#include "jdlib/constptr.h"
#include "jdlib/jdthread.h"
#include "jdlib/imgloader.h"
namespace DBIMG
{
class Img;
}
namespace ARTICLE
{
class EmbeddedImage : public SKELETON::Dispatchable
{
std::string m_url;
Glib::RefPtr< Gdk::Pixbuf > m_pixbuf;
JDLIB::ConstPtr< DBIMG::Img > m_img;
JDLIB::Thread m_thread;
Glib::RefPtr< JDLIB::ImgLoader > m_imgloader;
public:
explicit EmbeddedImage( const std::string& url );
~EmbeddedImage();
Glib::RefPtr< Gdk::Pixbuf > get_pixbuf(){ return m_pixbuf; }
void show();
void resize_thread();
private:
void stop();
void wait();
void callback_dispatch() override;
};
}
#endif
|
// line_button.h
//
// Line button for CallCommander
//
// (C) Copyright 2002-2011 Fred Gleason <fredg@paravelsystems.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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef LINE_BUTTON_H
#define LINE_BUTTON_H
#include <QtGui/QPushButton>
#include <QtGui/QBitmap>
#include <QtGui/QPixmap>
#include <bus_driver.h>
#include <mlconfig.h>
class LineButton : public QPushButton
{
Q_OBJECT
public:
LineButton(int line,int bank,MlConfig *config,QWidget *parent=0);
void setState(BusDriver::LineState state);
void setFrame(int frame);
private:
void UpdateCap();
void InitIcons();
void MakeIcon(QPainter *p,QBitmap *map,int offset,int frame,
const QColor &color);
BusDriver::LineState line_state;
int line_line;
int line_bank;
MlConfig *line_config;
QPixmap *line_icons[13][3];
int line_index;
int line_frame;
QFont line_font;
};
#endif // LINE_BUTTON_H
|
/*
* fm-file-launcher.h
*
* Copyright 2009 - 2010 Hong Jen Yee (PCMan) <pcman.tw@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 __FM_FILE_LAUNCHER_H__
#define __FM_FILE_LAUNCHER_H__
#include <glib.h>
#include <gio/gio.h>
#include "fm-file-info.h"
G_BEGIN_DECLS
typedef gboolean (*FmLaunchFolderFunc)(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data, GError** err);
typedef enum {
FM_FILE_LAUNCHER_EXEC = 1,
FM_FILE_LAUNCHER_EXEC_IN_TERMINAL,
FM_FILE_LAUNCHER_EXEC_OPEN,
FM_FILE_LAUNCHER_EXEC_CANCEL
} FmFileLauncherExecAction;
typedef struct _FmFileLauncher FmFileLauncher;
struct _FmFileLauncher
{
GAppInfo* (*get_app)(GList* file_infos, FmMimeType* mime_type, gpointer user_data, GError** err);
/* gboolean (*before_open)(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data); */
gboolean (*open_folder)(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data, GError** err);
FmFileLauncherExecAction (*exec_file)(FmFileInfo* file, gpointer user_data);
gboolean (*error)(GAppLaunchContext* ctx, GError* err, gpointer user_data);
int (*ask)(const char* msg, char* const* btn_labels, int default_btn, gpointer user_data);
};
gboolean fm_launch_files(GAppLaunchContext* ctx, GList* file_infos, FmFileLauncher* launcher, gpointer user_data);
gboolean fm_launch_paths(GAppLaunchContext* ctx, GList* paths, FmFileLauncher* launcher, gpointer user_data);
gboolean fm_launch_desktop_entry(GAppLaunchContext* ctx, const char* file_or_id, GList* uris, FmFileLauncher* launcher, gpointer user_data);
G_END_DECLS
#endif
|
// -*- C++ -*-
/*
Copyright 2004,2005,2006 Manuel Baptista
This file is part of LASS
LASS 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.
LASS 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 LASS_H
#define LASS_H
#include "cgsolver/cgsolver.h"
#include "cgsolver/cgsolver_matrix.h"
#include "vzdeigen/vzdeigen.h"
#endif
|
#ifndef STM32F4DISCOVERY_H
#define STM32F4DISCOVERY_H
#include <stdint.h>
#ifndef PIN
#define PIN GPIO11
#endif /* PIN */
#ifndef NTIMES
#define NTIMES 4
#endif /* NTIMES */
int32_t board_init(void);
int32_t board_exit(void);
void transmit(uint32_t nhigh, uint32_t nlow, uint32_t pulse_len);
#endif /* RPI_H */
|
/****************************************************************************************
* Copyright (c) 2011 Stefan Derkits <stefan@derkits.at> *
* Copyright (c) 2011 Christian Wagner <christian.wagner86@gmx.at> *
* Copyright (c) 2011 Felix Winter <ixos01@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, see <http://www.gnu.org/licenses/>. *
****************************************************************************************/
#ifndef GROOVESHARKSERVICEMODEL_H_
#define GROOVESHARKSERVICEMODEL_H_
#include <QAbstractItemModel>
#include <QStringList>
//#include "NetworkAccessManagerProxy.h"
#include <QNetworkReply>
#include "GroovesharkTreeItem.h"
#include "grooveshark/QGroovesharkSong.h"
#include "grooveshark/QGrooveshark.h"
class GroovesharkTreeItem;
class GroovesharkServiceModel: public QAbstractItemModel
{
Q_OBJECT
public:
explicit GroovesharkServiceModel( QGrooveshark &manager, QObject *parent = 0 );
virtual ~GroovesharkServiceModel();
// QAbstractItemModel methods
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex &index ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
virtual bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
// virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
void insertPodcastList( QStringList podcasts, const QModelIndex &parentItem, bool isMain = false );
private slots:
void topTagsRequestError( QNetworkReply::NetworkError error );
void topTagsParseError();
void insertTagList();
void onSearchResultsReceived(QList<QGroovesharkSong*> songlist);
protected:
virtual bool canFetchMore( const QModelIndex &parent ) const;
virtual void fetchMore( const QModelIndex &parent );
private:
GroovesharkTreeItem *rootItem;
};
#endif /* GROOVESHARKSERVICEMODEL_H_ */
|
#include <linux/types.h>
#include <linux/buffer_head.h>
#include "nilfs.h"
#include "mdt.h"
#include "alloc.h"
#include "ifile.h"
struct nilfs_ifile_info {
struct nilfs_mdt_info mi;
struct nilfs_palloc_cache palloc_cache;
};
static inline struct nilfs_ifile_info *NILFS_IFILE_I(struct inode *ifile)
{
return (struct nilfs_ifile_info *)NILFS_MDT(ifile);
}
int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
struct buffer_head **out_bh)
{
struct nilfs_palloc_req req;
int ret;
req.pr_entry_nr = 0; /* 0 says find free inode from beginning of
a group. dull code!! */
req.pr_entry_bh = NULL;
ret = nilfs_palloc_prepare_alloc_entry(ifile, &req);
if (!ret) {
ret = nilfs_palloc_get_entry_block(ifile, req.pr_entry_nr, 1,
&req.pr_entry_bh);
if (ret < 0)
nilfs_palloc_abort_alloc_entry(ifile, &req);
}
if (ret < 0) {
brelse(req.pr_entry_bh);
return ret;
}
nilfs_palloc_commit_alloc_entry(ifile, &req);
nilfs_mdt_mark_buffer_dirty(req.pr_entry_bh);
nilfs_mdt_mark_dirty(ifile);
*out_ino = (ino_t)req.pr_entry_nr;
*out_bh = req.pr_entry_bh;
return 0;
}
int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
{
struct nilfs_palloc_req req = {
.pr_entry_nr = ino, .pr_entry_bh = NULL
};
struct nilfs_inode *raw_inode;
void *kaddr;
int ret;
ret = nilfs_palloc_prepare_free_entry(ifile, &req);
if (!ret) {
ret = nilfs_palloc_get_entry_block(ifile, req.pr_entry_nr, 0,
&req.pr_entry_bh);
if (ret < 0)
nilfs_palloc_abort_free_entry(ifile, &req);
}
if (ret < 0) {
brelse(req.pr_entry_bh);
return ret;
}
kaddr = kmap_atomic(req.pr_entry_bh->b_page, KM_USER0);
raw_inode = nilfs_palloc_block_get_entry(ifile, req.pr_entry_nr,
req.pr_entry_bh, kaddr);
raw_inode->i_flags = 0;
kunmap_atomic(kaddr, KM_USER0);
nilfs_mdt_mark_buffer_dirty(req.pr_entry_bh);
brelse(req.pr_entry_bh);
nilfs_palloc_commit_free_entry(ifile, &req);
return 0;
}
int nilfs_ifile_get_inode_block(struct inode *ifile, ino_t ino,
struct buffer_head **out_bh)
{
struct super_block *sb = ifile->i_sb;
int err;
if (unlikely(!NILFS_VALID_INODE(sb, ino))) {
nilfs_error(sb, __func__, "bad inode number: %lu",
(unsigned long) ino);
return -EINVAL;
}
err = nilfs_palloc_get_entry_block(ifile, ino, 0, out_bh);
if (unlikely(err)) {
if (err == -EINVAL)
nilfs_error(sb, __func__, "ifile is broken");
else
nilfs_warning(sb, __func__,
"unable to read inode: %lu",
(unsigned long) ino);
}
return err;
}
struct inode *nilfs_ifile_new(struct nilfs_sb_info *sbi, size_t inode_size)
{
struct inode *ifile;
int err;
ifile = nilfs_mdt_new(sbi->s_nilfs, sbi->s_super, NILFS_IFILE_INO,
sizeof(struct nilfs_ifile_info));
if (ifile) {
err = nilfs_palloc_init_blockgroup(ifile, inode_size);
if (unlikely(err)) {
nilfs_mdt_destroy(ifile);
return NULL;
}
nilfs_palloc_setup_cache(ifile,
&NILFS_IFILE_I(ifile)->palloc_cache);
}
return ifile;
}
|
/////////////////////////////////////////////////////////////
// EXAMPLE PROGRAM #3A
// 04.2006 aralbrec
//
// We're back to ex1.c with 10 masked sprites but this time
// 9 of them are drawn on top of each other in the centre of
// the screen and do not move. The 10th is moved left to
// right across the screen, with a moment where it overlaps
// the other static 9.
//
// SP1 only draws areas of the screen that change, so the 9
// static sprites are not redrawn only the 10th moving one.
// As the 10th moving sprite overlaps the nine others the
// speed dramatically slows down since the engine needs to
// draw all 9 sprites underneath the 10th moving one.
/////////////////////////////////////////////////////////////
// zcc +zx -vn ex3a.c -o ex3a.bin -create-app -lsp1 -lmalloc
#include <sprites/sp1.h>
#include <malloc.h>
#include <spectrum.h>
#pragma output STACKPTR=53248 // place stack at $d000 at startup
long heap; // malloc's heap pointer
// Memory Allocation Policy // the sp1 library will call these functions
// to allocate and deallocate dynamic memory
void *u_malloc(uint size) {
return malloc(size);
}
void u_free(void *addr) {
free(addr);
}
// Clipping Rectangle for Sprites
struct sp1_Rect cr = {0, 0, 32, 24}; // rectangle covering the full screen
// Table Holding Movement Data for Each Sprite
struct sprentry {
struct sp1_ss *s; // sprite handle returned by sp1_CreateSpr()
char dx; // signed horizontal speed in pixels
char dy; // signed vertical speed in pixels
};
struct sprentry sprtbl[] = {
{0,1,0}, {0,0,1}, {0,1,2}, {0,2,1}, {0,1,3},
{0,3,1}, {0,2,3}, {0,3,2}, {0,1,1}, {0,2,2}
};
// A Hashed UDG for Background
uchar hash[] = {0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa};
// Attach C Variable to Sprite Graphics Declared in ASM at End of File
extern uchar gr_window[]; // gr_window will hold the address of the asm label _gr_window
main()
{
uchar i;
struct sp1_ss *s;
struct sprentry *se;
void *temp;
#asm
di
#endasm
// Initialize MALLOC.LIB
heap = 0L; // heap is empty
sbrk(40000, 10000); // add 40000-49999 to malloc
// Initialize SP1.LIB
zx_border(INK_BLACK);
sp1_Initialize(SP1_IFLAG_MAKE_ROTTBL | SP1_IFLAG_OVERWRITE_TILES | SP1_IFLAG_OVERWRITE_DFILE, INK_BLACK | PAPER_WHITE, ' ');
sp1_TileEntry(' ', hash); // redefine graphic associated with space character
sp1_Invalidate(&cr); // invalidate entire screen so that it is all initially drawn
sp1_UpdateNow(); // draw screen area managed by sp1 now
// Create Ten Masked Software-Rotated Sprites
for (i=0; i!=10; i++) {
s = sprtbl[i].s = sp1_CreateSpr(SP1_DRAW_MASK2LB, SP1_TYPE_2BYTE, 3, 0, i);
sp1_AddColSpr(s, SP1_DRAW_MASK2, 0, 48, i);
sp1_AddColSpr(s, SP1_DRAW_MASK2RB, 0, 0, i);
sp1_MoveSprAbs(s, &cr, gr_window, 10, 14, 0, 4);
};
while (1) { // main loop
sp1_UpdateNow(); // draw screen now
for (i=0; i!=1; i++) { // move the first sprite only (dx=1, dy=0)
se = &sprtbl[i];
sp1_MoveSprRel(se->s, &cr, 0, 0, 0, se->dy, se->dx);
if (se->s->row > 21) // if sprite went off screen, reverse direction
se->dy = - se->dy;
if (se->s->col > 29) // notice if coord moves less than 0, it becomes
se->dx = - se->dx; // 255 which is also caught by these cases
}
} // end main loop
}
#asm
defb @11111111, @00000000
defb @11111111, @00000000
defb @11111111, @00000000
defb @11111111, @00000000
defb @11111111, @00000000
defb @11111111, @00000000
defb @11111111, @00000000
; ASM source file created by SevenuP v1.20
; SevenuP (C) Copyright 2002-2006 by Jaime Tejedor Gomez, aka Metalbrain
;GRAPHIC DATA:
;Pixel Size: ( 16, 24)
;Char Size: ( 2, 3)
;Sort Priorities: Mask, Char line, Y char, X char
;Data Outputted: Gfx
;Interleave: Sprite
;Mask: Yes, before graphic
._gr_window
DEFB 128,127, 0,192, 0,191, 30,161
DEFB 30,161, 30,161, 30,161, 0,191
DEFB 0,191, 30,161, 30,161, 30,161
DEFB 30,161, 0,191, 0,192,128,127
DEFB 255, 0,255, 0,255, 0,255, 0
DEFB 255, 0,255, 0,255, 0,255, 0
DEFB 1,254, 0, 3, 0,253,120,133
DEFB 120,133,120,133,120,133, 0,253
DEFB 0,253,120,133,120,133,120,133
DEFB 120,133, 0,253, 0, 3, 1,254
DEFB 255, 0,255, 0,255, 0,255, 0
DEFB 255, 0,255, 0,255, 0,255, 0
#endasm
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_
#define CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_
#include "cc/base/cc_export.h"
namespace cc {
class CC_EXPORT LayerPositionConstraint {
public:
LayerPositionConstraint();
void set_is_fixed_position(bool fixed) { is_fixed_position_ = fixed; }
bool is_fixed_position() const { return is_fixed_position_; }
void set_is_fixed_to_right_edge(bool fixed) {
is_fixed_to_right_edge_ = fixed;
}
bool is_fixed_to_right_edge() const { return is_fixed_to_right_edge_; }
void set_is_fixed_to_bottom_edge(bool fixed) {
is_fixed_to_bottom_edge_ = fixed;
}
bool is_fixed_to_bottom_edge() const { return is_fixed_to_bottom_edge_; }
bool operator==(const LayerPositionConstraint&) const;
bool operator!=(const LayerPositionConstraint&) const;
private:
bool is_fixed_position_ : 1;
bool is_fixed_to_right_edge_ : 1;
bool is_fixed_to_bottom_edge_ : 1;
};
}
#endif
|
// ***********************************************************************
// Filename : Timer.h
// Author : LIZHENG
// Created : 2014-10-26
// Description :
//
// Last Modified By : LIZHENG
// Last Modified On : 2014-11-23
//
// Copyright (c) lizhenghn@gmail.com. All rights reserved.
// ***********************************************************************
#ifndef ZL_TIMER_H
#define ZL_TIMER_H
#include "Define.h"
#include "base/Timestamp.h"
#include "base/NonCopy.h"
NAMESPACE_ZL_NET_START
using zl::base::Timestamp;
class TimerQueue;
class Timer
{
friend class TimerQueue;
public:
typedef std::function<void()> TimerCallBack;
public:
explicit Timer(TimerQueue *tqueue);
Timer(TimerQueue *tqueue, const Timestamp& when);
Timer(TimerQueue *tqueue, size_t millsec);
~Timer();
void wait();
void async_wait(TimerCallBack callback);
size_t cancel();
Timestamp expires_at(const Timestamp& expiry_time);
Timestamp expires_at() const;
Timestamp expires_from_now(size_t millsec_time);
size_t expires_from_now() const;
private:
void trigger();
private:
TimerQueue *timerQueue_;
Timestamp when_;
TimerCallBack callback_;
};
inline bool operator<(const Timer& lhs, const Timer& rhs)
{
return lhs.expires_at() < rhs.expires_at();
}
NAMESPACE_ZL_NET_END
#endif /* ZL_TIMER_H */
|
#define BCM2708_PERI_BASE 0x20000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define PAGE_SIZE (4*1024)
#define BLOCK_SIZE (4*1024)
int mem_fd;
char *gpio_mem, *gpio_map;
char *spi0_mem, *spi0_map;
// I/O access
volatile unsigned *gpio;
// GPIO setup macros. Always use INP_GPIO(x) before using OUT_GPIO(x) or SET_GPIO_ALT(x,y)
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
#define OUT_GPIO(g) *(gpio+((g)/10)) |= (1<<(((g)%10)*3))
#define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))
#define GPIO_SET *(gpio+7) // sets bits which are 1 ignores bits which are 0
#define GPIO_CLR *(gpio+10) // clears bits which are 1 ignores bits which are 0
void singlet();
void doublet();
void triplet();
void quadruplet();
void quintuplet();
void intro_0();
void intro_1();
void singlet()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(1250);
// printf("1");
}
//1= 15 samples ON, 55 samples OFF
//2= 15 samples ON, 13 samples OFF, 15 samples ON, 55 samples OFF
//3 = 15 samples ON, 12 samples OFF, 15 samples ON, 12 samples OFF, 15 samples ON, 55 samples OFF
void doublet()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(242);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(1250);
// printf("2");
}
//3 = 15 samples ON, 12 samples OFF, 15 samples ON, 12 samples OFF, 15 samples ON, 55 samples OFF
void triplet()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(220);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(220);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(1250);
// printf("3");
//Divide all numbers by
//1.23529411765
//10 = 227us = 184us
//15 = 340us = 275 us
//45 = 1020us = 826 us
//55 = 1247us = 1009 us
}
void quadruplet()
{
//3 = 15 samples ON, 10 samples OFF, 15 samples ON, 10 samples OFF, 15 samples ON, 15 samples ON, 10 samples OFF. 55 samples OFF
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(1250);
// printf("4");
}
void quintuplet()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(184);
GPIO_CLR = 1<<g;
usleep(231);
GPIO_SET = 1<<g;
usleep(1250);
// printf("5");
}
//Divide all numbers by
//1.23529411765
//10 = 227us = 184us
//15 = 340us = 275 us
//45 = 1020us = 826 us
//55 = 1247us = 1009 us
//0= 15 samples ON then 45 samples OFF
//1= 45 samples ON then 15 samples OFF
void intro_1()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(847);
GPIO_SET = 1<<g;
usleep(300);
// printf("1");
}
void intro_0()
{
int g;
g=18;
GPIO_CLR = 1<<g;
usleep(253);
GPIO_SET = 1<<g;
usleep(970);
// printf("0");
}
|
/*
* drivers/power/process.c - Functions for starting/stopping processes on
* suspend transitions.
*
* Originally from swsusp.
*/
#undef DEBUG
#include <linux/interrupt.h>
#include <linux/oom.h>
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/kmod.h>
/*
* Timeout for stopping processes
*/
unsigned int __read_mostly freeze_timeout_msecs = 20 * MSEC_PER_SEC;
static int try_to_freeze_tasks(bool user_only)
{
struct task_struct *g, *p;
unsigned long end_time;
unsigned int todo;
bool wq_busy = false;
struct timeval start, end;
u64 elapsed_csecs64;
unsigned int elapsed_csecs;
bool wakeup = false;
do_gettimeofday(&start);
end_time = jiffies + msecs_to_jiffies(freeze_timeout_msecs);
if (!user_only)
freeze_workqueues_begin();
while (true) {
todo = 0;
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p == current || !freeze_task(p))
continue;
if (!freezer_should_skip(p))
todo++;
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
if (!user_only) {
wq_busy = freeze_workqueues_busy();
todo += wq_busy;
}
if (!todo || time_after(jiffies, end_time))
break;
if (pm_wakeup_pending()) {
wakeup = true;
break;
}
/*
* We need to retry, but first give the freezing tasks some
* time to enter the refrigerator.
*/
msleep(10);
}
do_gettimeofday(&end);
elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
elapsed_csecs = elapsed_csecs64;
if (todo) {
printk("\n");
printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
"(%d tasks refusing to freeze, wq_busy=%d):\n",
wakeup ? "aborted" : "failed",
elapsed_csecs / 100, elapsed_csecs % 100,
todo - wq_busy, wq_busy);
if (!wakeup) {
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p != current && !freezer_should_skip(p)
&& freezing(p) && !frozen(p))
sched_show_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
}
} else {
printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
elapsed_csecs % 100);
}
return todo ? -EBUSY : 0;
}
/**
* freeze_processes - Signal user space processes to enter the refrigerator.
*
* On success, returns 0. On failure, -errno and system is fully thawed.
*/
int freeze_processes(void)
{
int error;
error = __usermodehelper_disable(UMH_FREEZING);
if (error)
return error;
if (!pm_freezing)
atomic_inc(&system_freezing_cnt);
printk("Freezing user space processes ... ");
pm_freezing = true;
error = try_to_freeze_tasks(true);
if (!error) {
printk("done.");
__usermodehelper_set_disable_depth(UMH_DISABLED);
oom_killer_disable();
}
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_processes();
return error;
}
/**
* freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
*
* On success, returns 0. On failure, -errno and only the kernel threads are
* thawed, so as to give a chance to the caller to do additional cleanups
* (if any) before thawing the userspace tasks. So, it is the responsibility
* of the caller to thaw the userspace tasks, when the time is right.
*/
int freeze_kernel_threads(void)
{
int error;
printk("Freezing remaining freezable tasks ... ");
pm_nosig_freezing = true;
error = try_to_freeze_tasks(false);
if (!error)
printk("done.");
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_kernel_threads();
return error;
}
void thaw_processes(void)
{
struct task_struct *g, *p;
if (pm_freezing)
atomic_dec(&system_freezing_cnt);
pm_freezing = false;
pm_nosig_freezing = false;
oom_killer_enable();
printk("Restarting tasks ... ");
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
usermodehelper_enable();
schedule();
printk("done.\n");
}
void thaw_kernel_threads(void)
{
struct task_struct *g, *p;
pm_nosig_freezing = false;
printk("Restarting kernel threads ... ");
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
schedule();
printk("done.\n");
}
|
/*----------------------------------------------------------------------------
* U S B - K e r n e l
*----------------------------------------------------------------------------
* Name: usbdesc.h
* Purpose: USB Descriptors Definitions
* Version: V1.20
*----------------------------------------------------------------------------
* This file is part of the uVision/ARM development tools.
* This software may only be used under the terms of a valid, current,
* end user licence from KEIL for a compatible version of KEIL software
* development tools. Nothing else gives you the right to use this software.
*
* This software is supplied "AS IS" without warranties of any kind.
*
* Copyright (c) 2008 Keil - An ARM Company. All rights reserved.
*----------------------------------------------------------------------------*/
#ifndef __USBDESC_H__
#define __USBDESC_H__
#define WBVAL(x) (x & 0xFF),((x >> 8) & 0xFF)
#define USB_DEVICE_DESC_SIZE (sizeof(USB_DEVICE_DESCRIPTOR))
#define USB_CONFIGUARTION_DESC_SIZE (sizeof(USB_CONFIGURATION_DESCRIPTOR))
#define USB_INTERFACE_DESC_SIZE (sizeof(USB_INTERFACE_DESCRIPTOR))
#define USB_ENDPOINT_DESC_SIZE (sizeof(USB_ENDPOINT_DESCRIPTOR))
extern const U8 USB_DeviceDescriptor[];
extern const U8 USB_ConfigDescriptor[];
extern const U8 USB_StringDescriptor[];
#endif /* __USBDESC_H__ */
|
/* packet-git.c
* Routines for git packet dissection
* RFC 1939
* Copyright 2010, Jelmer Vernooij <jelmer@samba.org>
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Copied from packet-pop.c
*
* 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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/prefs.h>
#include "packet-tcp.h"
static int proto_git = -1;
static gint ett_git = -1;
static gint hf_git_packet_len = -1;
static gint hf_git_packet_data = -1;
static gint hf_git_packet_terminator = -1;
#define TCP_PORT_GIT 9418
/* desegmentation of Git over TCP */
static gboolean git_desegment = TRUE;
static gboolean tvb_get_packet_length(tvbuff_t *tvb, int offset,
guint16 *length)
{
guint8 *lenstr;
lenstr = tvb_get_ephemeral_string(tvb, offset, 4);
return (sscanf(lenstr, "%hx", length) == 1);
}
static guint
get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
guint16 plen;
if (!tvb_get_packet_length(tvb, offset, &plen))
return 0; /* No idea what this is */
if (plen == 0) {
/* Terminator packet */
return 4;
} else {
return plen;
}
}
static void
dissect_git_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *git_tree;
proto_item *ti;
int offset = 0;
guint16 plen;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GIT");
col_set_str(pinfo->cinfo, COL_INFO, "Git Smart Protocol");
ti = proto_tree_add_item(tree, proto_git, tvb, offset, -1, ENC_NA);
git_tree = proto_item_add_subtree(ti, ett_git);
if (!tvb_get_packet_length(tvb, 0, &plen))
return;
if (plen == 0) {
proto_tree_add_uint(git_tree, hf_git_packet_terminator, tvb, offset,
4, plen);
return;
}
if (git_tree)
{
proto_tree_add_uint(git_tree, hf_git_packet_len, tvb, offset,
4, plen);
proto_tree_add_item(git_tree, hf_git_packet_data, tvb, offset+4,
plen-4, ENC_NA);
}
}
static void
dissect_git(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
tcp_dissect_pdus(tvb, pinfo, tree, git_desegment, 4, get_git_pdu_len,
dissect_git_pdu);
}
void
proto_register_git(void)
{
static hf_register_info hf[] = {
{ &hf_git_packet_len,
{ "Packet length", "git.length", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL },
},
{ &hf_git_packet_data,
{ "Packet data", "git.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL },
},
{ &hf_git_packet_terminator,
{ "Terminator packet", "git.terminator", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL },
},
};
static gint *ett[] = {
&ett_git,
};
module_t *git_module;
proto_git = proto_register_protocol("Git Smart Protocol", "GIT", "git");
register_dissector("git", dissect_git, proto_git);
proto_register_field_array(proto_git, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
git_module = prefs_register_protocol(proto_git, NULL);
prefs_register_bool_preference(git_module, "desegment",
"Reassemble GIT messages spanning multiple TCP segments",
"Whether the GIT dissector should reassemble messages spanning multiple TCP segments."
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&git_desegment);
}
void
proto_reg_handoff_git(void)
{
dissector_handle_t git_handle;
git_handle = find_dissector("git");
dissector_add_uint("tcp.port", TCP_PORT_GIT, git_handle);
}
|
//
// ZHFModel.h
// FMDBTest
//
// Created by Alvaro Barbeira on 3/21/14.
// Copyright (c) 2014 Zauber. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "FCModel.h"
@interface ZHFCollection : FCModel
// table
@property (nonatomic, assign) int64_t id;
@property (nonatomic, copy) NSString *name;
// non table
- (NSArray *)members;
@end
|
/*
FILE
{{cProject}}/interfaces/bootstrap/interface.h
Template unxsRAD/templates/default/bootstrap/interface.h
AUTHOR
(C) 2006-2009 Gary Wallis and Hugo Urquiza for Unixservice
(C) 2015-2017 Gary Wallis for Unixservice, LLC.
*/
#define INTERFACE_HEADER_TITLE "{{cProject}}"
#define INTERFACE_COPYRIGHT "<font color=gray>Mobile Centric Software by <a target='_blank' href='https://unixservice.com'>Unixservice, LLC.</a></font>"
#include "mysqlrad.h"
#include "local.h"
#include <ctype.h>
#include <openisp/template.h>
//libtemplate required
#define MAXPOSTVARS 64
#define MAXGETVARS 8
#define BO_CUSTOMER "Backend Customer"
#define BO_RESELLER "Backend Reseller"
#define BO_ADMIN "Backend Admin"
#define BO_ROOT "Backend Root"
#define BO_CUSTOMER "Backend Customer"
#define BO_RESELLER "Backend Reseller"
#define BO_ADMIN "Backend Admin"
#define BO_ROOT "Backend Root"
#define ORG_CUSTOMER "Organization Customer"
#define ORG_WEBMASTER "Organization Webmaster"
#define ORG_SALES "Organization Sales Force"
#define ORG_SERVICE "Organization Customer Service"
#define ORG_ACCT "Organization Bookkeeper"
#define ORG_ADMIN "Organization Admin"
#define IP_BLOCK_CIDR 1
#define IP_BLOCK_DASH 2
//Depend on correctly preconfigured tTemplateSet
#define uDEFAULT 1
//and tTemplateType:
#define uRAD4 1
#define uBOOTSTRAP 14
void InterfaceConnectDb(void);
//In main.c
const char *cUserLevel(unsigned uPermLevel);
void htmlFatalError(const char *cErrMsg);
void textFatalError(const char *cErrMsg);
void htmlHeader(char *cTitle, char *cTemplateName);
void htmlFooter(char *cTemplateName);
void htmlErrorPage(char *cTitle, char *cTemplateName);
void htmlForgotPage(char *cTitle, char *cTemplateName);
void htmlHelpPage(char *cTitle, char *cTemplateName);
char *IPNumber(char *cInput);
const char *cUserLevel(unsigned uPermLevel);
char *TextAreaSave(char *cField);
char *FQDomainName(char *cInput);
void iDNSLog(unsigned uTablePK, char *cTableName, char *cLogEntry);
const char *cForeignKey(const char *cTableName, const char *cFieldName, unsigned uKey);
const char *cForeignKeyStr(const char *cTableName, const char *cFieldName, const char *cKey);
void fpTemplate(FILE *fp,char *cTemplateName,struct t_template *template);
void InterfaceLogoutFirewallJobs(unsigned uLoginClient);
void InterfaceLoginFirewallJobs(unsigned uLoginClient);
char *cEndAtSpace(char *cBuffer);
//Global vars all declared in main.c
//libtemplate.a required
extern MYSQL gMysql;
//Multipurpose buffer
extern char gcQuery[];
//Login related
extern char gcCookie[];
extern char gcLogin[];
extern char gcPasswd[];
extern char gcPasswd2[];
extern char gcEmailCode[];
extern unsigned guSSLCookieLogin;
extern int guPermLevel;
extern char gcuPermLevel[];
extern unsigned guLoginClient;
extern unsigned guOrg;
extern char gcUser[];
extern char gcName[];
extern char gcOrgName[];
extern char gcHost[];
extern char *gcBrand;
extern unsigned guBrowserFirefox;
extern unsigned guYear;
extern unsigned guMonth;
extern unsigned guHelp;
extern unsigned guHeat;
extern unsigned guEvent;
extern unsigned guRound;
extern unsigned guHeat;
extern unsigned guRider;
extern unsigned guValidJobLoaded;
extern char *gcCPShow;
//Cgi form commands and major area function
extern char gcFunction[];
extern char gcPage[];
extern char *gcMessage;
extern char gcModStep[];
extern char gcNewStep[];
extern char gcDelStep[];
extern char gcInputStatus[];
extern unsigned guRequireOTPLogin;
extern char gcOTPSecret[];
extern char gcOTPInfo[];
//Menu
//
{{funcBootstrapModulePrototypes}}
//judge.c
void ProcessJudgeVars(pentry entries[], int x);
void BestTrickGetHook(entry gentries[],int x);
void OverlayGetHook(entry gentries[],int x);
void WindGetHook(entry gentries[],int x);
void RiderGetHook(entry gentries[],int x);
void TournamentGetHook(entry gentries[],int x);
void HeatEndGetHook(entry gentries[],int x);
void HeatGetHook(entry gentries[],int x);
void JudgeGetHook(entry gentries[],int x);
void AdminGetHook(entry gentries[],int x);
void EventGetHook(entry gentries[],int x);
void LiveGetHook(entry gentries[],int x);
void JudgeCommands(pentry entries[], int x);
void htmlHeat(void);
void htmlBestTrick(void);
void htmlHeatEnd(void);
void htmlEvent(void);
void htmlLive(void);
void htmlAdmin(void);
void htmlJudge(void);
void htmlWind(void);
void htmlRider(void);
void htmlTournament(void);
void htmlBestTrick(void);
void htmlOverlay(void);
void htmlJudgePage(char *cTitle, char *cTemplateName);
void funcJudge(FILE *fp);
void funcEvent(FILE *fp);
void funcLive(FILE *fp);
void funcAdmin(FILE *fp);
//overlay
void funcTournament(FILE *fp);
void funcOverlay(FILE *fp);
void funcWind(FILE *fp);
void funcRider(FILE *fp);
void funcHeat(FILE *fp);
void funcHeatEnd(FILE *fp);
void funcBestTrick(FILE *fp);
|
/*****************************************************************************\
* Copyright (c) 2016 Lawrence Livermore National Security, LLC. Produced at
* the Lawrence Livermore National Laboratory (cf, AUTHORS, DISCLAIMER.LLNS).
* LLNL-CODE-658032 All rights reserved.
*
* This file is part of the Flux resource manager framework.
* For details, see https://github.com/flux-framework.
*
* 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.
*
* Flux 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 terms and conditions of 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.
* See also: http://www.gnu.org/licenses/
\*****************************************************************************/
#include <flux/core.h>
#include <flux/optparse.h>
#include "src/common/libutil/xzmalloc.h"
#include "src/common/libutil/log.h"
typedef int (*register_cmd_f) (optparse_t *p);
struct builtin_cmd {
const char * name;
register_cmd_f reg_fn;
};
void usage (optparse_t *p);
flux_t *builtin_get_flux_handle (optparse_t *p);
|
/*************************************************************************
* All portions of code are copyright by their respective author/s.
* Copyright (C) 2007 Bryan Christ <bryan.christ@hp.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., 675 Mass Ave, Cambridge, MA 02139, USA.
*----------------------------------------------------------------------*/
#include <string.h>
#include "viper.h"
#include "private.h"
#include "viper_states.h"
#include "viper_kmio.h"
void
viper_window_set_key_func(vwnd_t *vwnd, ViperWkeyFunc func)
{
if(vwnd == NULL) return;
if(vwnd != NULL) vwnd->key_func = func;
return;
}
ViperWkeyFunc
viper_window_get_key_func(vwnd_t *vwnd)
{
if(vwnd == NULL) return NULL;
return vwnd->key_func;
}
|
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief a-Law to Signed linear conversion
*
* \author Mark Spencer <markster@digium.com>
*/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 106306 $")
#include "asterisk/alaw.h"
#ifndef G711_NEW_ALGORITHM
#define AMI_MASK 0x55
static inline unsigned char linear2alaw(short int linear)
{
int mask;
int seg;
int pcm_val;
static int seg_end[8] =
{
0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF
};
pcm_val = linear;
if (pcm_val >= 0) {
/* Sign (7th) bit = 1 */
mask = AMI_MASK | 0x80;
} else {
/* Sign bit = 0 */
mask = AMI_MASK;
pcm_val = -pcm_val;
}
/* Convert the scaled magnitude to segment number. */
for (seg = 0; seg < 8; seg++) {
if (pcm_val <= seg_end[seg]) {
break;
}
}
/* Combine the sign, segment, and quantization bits. */
return ((seg << 4) | ((pcm_val >> ((seg) ? (seg + 3) : 4)) & 0x0F)) ^ mask;
}
#else
static unsigned char linear2alaw(short sample, int full_coding)
{
static const unsigned exp_lut[128] = {
1,1,2,2,3,3,3,3,
4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7 };
unsigned sign, exponent, mantissa, mag;
unsigned char alawbyte;
ast_alaw_get_sign_mag(sample, &sign, &mag);
if (mag > 32767)
mag = 32767; /* clip the magnitude for -32768 */
exponent = exp_lut[(mag >> 8) & 0x7f];
mantissa = (mag >> (exponent + 3)) & 0x0f;
if (mag < 0x100)
exponent = 0;
if (full_coding) {
/* full encoding, with sign and xform */
alawbyte = (unsigned char)(sign | (exponent << 4) | mantissa);
alawbyte ^= AST_ALAW_AMI_MASK;
} else {
/* half-cooked coding -- mantissa+exponent only (for lookup tab) */
alawbyte = (exponent << 4) | mantissa;
}
return alawbyte;
}
#endif
#ifndef G711_NEW_ALGORITHM
static inline short int alaw2linear (unsigned char alaw)
{
int i;
int seg;
alaw ^= AMI_MASK;
i = ((alaw & 0x0F) << 4) + 8 /* rounding error */;
seg = (((int) alaw & 0x70) >> 4);
if (seg) {
i = (i + 0x100) << (seg - 1);
}
return (short int) ((alaw & 0x80) ? i : -i);
}
#else
static inline short alaw2linear(unsigned char alawbyte)
{
unsigned exponent, mantissa;
short sample;
alawbyte ^= AST_ALAW_AMI_MASK;
exponent = (alawbyte & 0x70) >> 4;
mantissa = alawbyte & 0x0f;
sample = (mantissa << 4) + 8 /* rounding error */;
if (exponent)
sample = (sample + 0x100) << (exponent - 1);
if (!(alawbyte & 0x80))
sample = -sample;
return sample;
}
#endif
#ifndef G711_NEW_ALGORITHM
unsigned char __ast_lin2a[8192];
#else
unsigned char __ast_lin2a[AST_ALAW_TAB_SIZE];
#endif
short __ast_alaw[256];
void ast_alaw_init(void)
{
int i;
/*
* Set up mu-law conversion table
*/
#ifndef G711_NEW_ALGORITHM
for (i = 0; i < 256; i++) {
__ast_alaw[i] = alaw2linear(i);
}
/* set up the reverse (mu-law) conversion table */
for (i = -32768; i < 32768; i++) {
__ast_lin2a[((unsigned short)i) >> 3] = linear2alaw(i);
}
#else
for (i = 0; i < 256; i++) {
__ast_alaw[i] = alaw2linear(i);
}
/* set up the reverse (a-law) conversion table */
for (i = 0; i <= 32768; i += AST_ALAW_STEP) {
AST_LIN2A_LOOKUP(i) = linear2alaw(i, 0 /* half-cooked */);
}
#endif
#ifdef TEST_CODING_TABLES
for (i = -32768; i < 32768; ++i) {
#ifndef G711_NEW_ALGORITHM
unsigned char e1 = linear2alaw(i);
#else
unsigned char e1 = linear2alaw(i, 1);
#endif
short d1 = alaw2linear(e1);
unsigned char e2 = AST_LIN2A(i);
short d2 = alaw2linear(e2);
short d3 = AST_ALAW(e1);
if (e1 != e2 || d1 != d3 || d2 != d3) {
ast_log(LOG_WARNING, "a-Law coding tables test failed on %d: e1=%u, e2=%u, d1=%d, d2=%d\n",
i, (unsigned)e1, (unsigned)e2, (int)d1, (int)d2);
}
}
ast_log(LOG_NOTICE, "a-Law coding tables test complete.\n");
#endif /* TEST_CODING_TABLES */
#ifdef TEST_TANDEM_TRANSCODING
/* tandem transcoding test */
for (i = -32768; i < 32768; ++i) {
unsigned char e1 = AST_LIN2A(i);
short d1 = AST_ALAW(e1);
unsigned char e2 = AST_LIN2A(d1);
short d2 = AST_ALAW(e2);
unsigned char e3 = AST_LIN2A(d2);
short d3 = AST_ALAW(e3);
if (e1 != e2 || e2 != e3 || d1 != d2 || d2 != d3) {
ast_log(LOG_WARNING, "a-Law tandem transcoding test failed on %d: e1=%u, e2=%u, d1=%d, d2=%d, d3=%d\n",
i, (unsigned)e1, (unsigned)e2, (int)d1, (int)d2, (int)d3);
}
}
ast_log(LOG_NOTICE, "a-Law tandem transcoding test complete.\n");
#endif /* TEST_TANDEM_TRANSCODING */
}
|
/*
* Copyright (c) 2009 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property
* and proprietary rights in and to this software and related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
*/
#include "nvodm_usbmux.h"
#include "usb_mux_null.h"
NvOdmUsbMuxHandle null_NvOdmUsbMuxOpen(NvU32 Instance)
{
// NULL implementation that does nothing.
return NULL;
}
void null_NvOdmUsbMuxClose(NvOdmUsbMuxHandle hOdmUsbMux)
{
// NULL implementation that does nothing.
return;
}
NvBool null_NvOdmUsbMuxSelectConnector(NvU32 Instance,NvOdmUsbMuxHandle hOdmUsbMux,
NvOdmUsbMuxConnectionEventType Event)
{
// NULL implementation that does nothing.
return NV_FALSE;
}
|
/* packet-p7.c
* Routines for X.413 (P7) packet dissection
* Graeme Lunt 2007
*
* $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.
*/
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/oids.h>
#include <epan/asn1.h>
#include "packet-ber.h"
#include "packet-acse.h"
#include "packet-ros.h"
#include "packet-rtse.h"
#include "packet-p7.h"
#include "packet-p1.h"
#include <epan/strutil.h>
#define PNAME "X.413 Message Store Service"
#define PSNAME "P7"
#define PFNAME "p7"
void proto_register_p7(void);
void proto_reg_handoff_p7(void);
static guint global_p7_tcp_port = 102;
static dissector_handle_t tpkt_handle;
static int seqno = 0;
static void prefs_register_p7(void); /* forward declaration for use in preferences registration */
/* Initialize the protocol and registered fields */
static int proto_p7 = -1;
#include "packet-p7-val.h"
#include "packet-p7-hf.c"
/* Initialize the subtree pointers */
static gint ett_p7 = -1;
#include "packet-p7-ett.c"
#include "packet-p7-table.c" /* operation and error codes */
#include "packet-p7-fn.c"
#include "packet-p7-table11.c" /* operation argument/result dissectors */
#include "packet-p7-table21.c" /* error dissector */
static const ros_info_t p7_ros_info = {
"P7",
&proto_p7,
&ett_p7,
p7_opr_code_string_vals,
p7_opr_tab,
p7_err_code_string_vals,
p7_err_tab
};
/*--- proto_register_p7 -------------------------------------------*/
void proto_register_p7(void) {
/* List of fields */
static hf_register_info hf[] =
{
#include "packet-p7-hfarr.c"
};
/* List of subtrees */
static gint *ett[] = {
&ett_p7,
#include "packet-p7-ettarr.c"
};
module_t *p7_module;
/* Register protocol */
proto_p7 = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
proto_register_field_array(proto_p7, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register our configuration options for P7, particularly our port */
p7_module = prefs_register_protocol_subtree("OSI/X.400", proto_p7, prefs_register_p7);
prefs_register_uint_preference(p7_module, "tcp.port", "P7 TCP Port",
"Set the port for P7 operations (if other"
" than the default of 102)",
10, &global_p7_tcp_port);
}
/*--- proto_reg_handoff_p7 --- */
void proto_reg_handoff_p7(void) {
#include "packet-p7-dis-tab.c"
/* APPLICATION CONTEXT */
oid_add_from_string("id-ac-ms-access","2.6.0.1.11");
oid_add_from_string("id-ac-ms-reliable-access","2.6.0.1.12");
/* ABSTRACT SYNTAXES */
/* Register P7 with ROS (with no use of RTSE) */
register_ros_protocol_info("2.6.0.2.9", &p7_ros_info, 0, "id-as-ms", FALSE);
register_ros_protocol_info("2.6.0.2.5", &p7_ros_info, 0, "id-as-mrse", FALSE);
register_ros_protocol_info("2.6.0.2.1", &p7_ros_info, 0, "id-as-msse", FALSE);
/* remember the tpkt handler for change in preferences */
tpkt_handle = find_dissector("tpkt");
}
static void
prefs_register_p7(void)
{
static guint tcp_port = 0;
/* de-register the old port */
/* port 102 is registered by TPKT - don't undo this! */
if((tcp_port > 0) && (tcp_port != 102) && tpkt_handle)
dissector_delete_uint("tcp.port", tcp_port, tpkt_handle);
/* Set our port number for future use */
tcp_port = global_p7_tcp_port;
if((tcp_port > 0) && (tcp_port != 102) && tpkt_handle)
dissector_add_uint("tcp.port", global_p7_tcp_port, tpkt_handle);
}
|
/***************************************************************************
* Copyright (C) 2003-2005 by David Saxton *
* david@bluehaze.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. *
***************************************************************************/
#ifndef ASMFORMATTER_H
#define ASMFORMATTER_H
#include <qstringlist.h>
/**
@author David Saxton
*/
class InstructionParts
{
public:
/**
* Breaks up the line into parts.
*/
InstructionParts( QString line );
QString label() const { return m_label; }
QString operand() const { return m_operand; }
QString operandData() const { return m_operandData; }
QString comment() const { return m_comment; }
protected:
QString m_label;
QString m_operand;
QString m_operandData;
QString m_comment; ///< includes the ";" part
};
/**
@author David Saxton
*/
class AsmFormatter
{
public:
AsmFormatter();
~AsmFormatter();
enum LineType
{
Equ,
Instruction, // could include label
Other // eg comments, __config
};
QString tidyAsm( QStringList lines );
static LineType lineType( QString line );
protected:
QString tidyInstruction( const QString & line );
QString tidyEqu( const QString & line );
/**
* Appends spaces to the end of text until it is greater or equakl to
* length.
*/
static void pad( QString & text, int length );
int m_indentAsmName;
int m_indentAsmData;
int m_indentEqu;
int m_indentEquValue;
int m_indentEquComment;
int m_indentComment;
};
#endif
|
//
// ViewController.h
// rccsimulator
//
// Created by Zaki Shaheen on 4/11/15.
// Copyright (c) 2015 Zaki Shaheen. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#include <acpi/acpi.h>
#include "accommon.h"
#include "acresrc.h"
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME("rslist")
acpi_status
acpi_rs_convert_aml_to_resources(u8 * aml,
u32 length,
u32 offset, u8 resource_index, void **context)
{
struct acpi_resource **resource_ptr =
ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context);
struct acpi_resource *resource;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_convert_aml_to_resources);
resource = *resource_ptr;
if (ACPI_IS_MISALIGNED(resource)) {
ACPI_WARNING((AE_INFO,
"Misaligned resource pointer %p", resource));
}
status =
acpi_rs_convert_aml_to_resource(resource,
ACPI_CAST_PTR(union aml_resource,
aml),
acpi_gbl_get_resource_dispatch
[resource_index]);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not convert AML resource (Type %X)",
*aml));
return_ACPI_STATUS(status);
}
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
acpi_ut_get_resource_type(aml), length,
resource->length));
*resource_ptr = ACPI_ADD_PTR(void, resource, resource->length);
return_ACPI_STATUS(AE_OK);
}
acpi_status
acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
acpi_size aml_size_needed, u8 * output_buffer)
{
u8 *aml = output_buffer;
u8 *end_aml = output_buffer + aml_size_needed;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_convert_resources_to_aml);
while (aml < end_aml) {
if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
ACPI_ERROR((AE_INFO,
"Invalid descriptor type (%X) in resource list",
resource->type));
return_ACPI_STATUS(AE_BAD_DATA);
}
status = acpi_rs_convert_resource_to_aml(resource, ACPI_CAST_PTR(union
aml_resource,
aml),
acpi_gbl_set_resource_dispatch
[resource->type]);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not convert resource (type %X) to AML",
resource->type));
return_ACPI_STATUS(status);
}
status =
acpi_ut_validate_resource(ACPI_CAST_PTR
(union aml_resource, aml), NULL);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
if (resource->type == ACPI_RESOURCE_TYPE_END_TAG) {
return_ACPI_STATUS(AE_OK);
}
aml += acpi_ut_get_descriptor_length(aml);
resource =
ACPI_ADD_PTR(struct acpi_resource, resource,
resource->length);
}
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
}
|
//-----------------------------------------------------------------------------
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Low frequency T55xx commands
//-----------------------------------------------------------------------------
#ifndef CMDLFPYRAMID_H__
#define CMDLFPYRAMID_H__
int CmdLFPyramid(const char *Cmd);
int CmdPyramidClone(const char *Cmd);
int CmdPyramidSim(const char *Cmd);
int usage_lf_pyramid_clone(void);
int usage_lf_pyramid_sim(void);
#endif
|
/*
VeryNice -- a dynamic process re-nicer
Copyright (C) 1992-1999 Stephen D. Holland
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include "linklist.h"
/* linklist.c -- This API is derived from the link list routines
that were included as part of the original Amiga operating system.
The basic idea is to provide a doubly linked-list system with a
minimum of special cases required in the handling code. This is
achieved by having two permanent members ("nodes") of the list,
called the Head and the Tail, that are never removed and have no
actual data associated with them. Because these members are permanent,
there are no special cases involved with removing or adding the first
or last nodes of the list.
The head and tail nodes are contained within the "List" structure, and
actually overlap! The "Predecessor" field of the head node is the
same as the "Successor" field of the tail node (both are always NULL).
Lists must be initialized with NewList() before they can be used. */
void
Insert(struct List *ThisList, struct Node *AddNode, struct Node *Pred)
{
if (AddNode == NULL)
return;
if (Pred == NULL) {
Pred = (struct Node *)&ThisList->lh_Head;
}
AddNode->ln_Pred = Pred;
AddNode->ln_Succ = Pred->ln_Succ;
Pred->ln_Succ = AddNode;
AddNode->ln_Succ->ln_Pred = AddNode;
}
void
Remove(struct Node *RemNode)
{
RemNode->ln_Pred->ln_Succ = RemNode->ln_Succ;
RemNode->ln_Succ->ln_Pred = RemNode->ln_Pred;
RemNode->ln_Pred = NULL;
RemNode->ln_Succ = NULL;
}
void
AddHead(struct List *ThisList, struct Node *AddNode)
{
Insert(ThisList, AddNode, NULL);
}
struct Node *
RemHead(struct List *ThisList)
{
struct Node *Head;
Head = ThisList->lh_Head;
if (Head->ln_Succ == NULL) {
return NULL;
}
Remove(Head);
return Head;
}
void
AddTail(struct List *ThisList, struct Node *AddNode)
{
Insert(ThisList, AddNode, ThisList->lh_TailPred);
}
struct Node *
RemTail(struct List *ThisList)
{
struct Node *Tail;
Tail = ThisList->lh_TailPred;
if (Tail->ln_Pred == NULL) {
return NULL;
}
Remove(Tail);
return Tail;
}
void
Enqueue(struct List *ThisList, struct Node *AddNode)
{
struct Node *CurrentSucc;
for (CurrentSucc = ThisList->lh_Head;
(CurrentSucc->ln_Succ != NULL)
&& (CurrentSucc->ln_Pri >= AddNode->ln_Pri);
CurrentSucc = CurrentSucc->ln_Succ);
Insert(ThisList, AddNode, CurrentSucc->ln_Pred);
}
struct Node *
FindName(struct List *ThisList, char *Name)
{
struct Node *CurrentNode;
for (CurrentNode = ThisList->lh_Head;
CurrentNode->ln_Succ->ln_Succ != NULL;
CurrentNode = CurrentNode->ln_Succ) {
if (strcmp(CurrentNode->ln_Name, Name) == 0) {
return CurrentNode;
}
}
return NULL;
}
void
NewList(struct List *List)
/* set up a list for use */
{
if (!List)
return;
List->lh_Head = (struct Node *)&List->lh_Tail;
List->lh_Tail = NULL;
List->lh_TailPred = (struct Node *)&List->lh_Head;
List->lh_Type = 0;
}
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 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, see <http://www.gnu.org/licenses/>.
*/
/// \addtogroup world
/// @{
/// \file
#ifndef __WEATHER_H
#define __WEATHER_H
#include "Common.h"
#include "SharedDefines.h"
#include "Timer.h"
class Player;
#define WEATHER_SEASONS 4
struct WeatherSeasonChances
{
uint32 rainChance;
uint32 snowChance;
uint32 stormChance;
};
struct WeatherData
{
WeatherSeasonChances data[WEATHER_SEASONS];
uint32 ScriptId;
};
enum WeatherState
{
WEATHER_STATE_FINE = 0,
WEATHER_STATE_FOG = 1,
WEATHER_STATE_LIGHT_RAIN = 3,
WEATHER_STATE_MEDIUM_RAIN = 4,
WEATHER_STATE_HEAVY_RAIN = 5,
WEATHER_STATE_LIGHT_SNOW = 6,
WEATHER_STATE_MEDIUM_SNOW = 7,
WEATHER_STATE_HEAVY_SNOW = 8,
WEATHER_STATE_LIGHT_SANDSTORM = 22,
WEATHER_STATE_MEDIUM_SANDSTORM = 41,
WEATHER_STATE_HEAVY_SANDSTORM = 42,
WEATHER_STATE_THUNDERS = 86,
WEATHER_STATE_BLACKRAIN = 90,
WEATHER_STATE_BLACKSNOW = 106
};
/// Weather for one zone
class Weather
{
public:
Weather(uint32 zone, WeatherData const* weatherChances);
~Weather() { };
bool Update(uint32 diff);
bool ReGenerate();
bool UpdateWeather();
void SendWeatherUpdateToPlayer(Player* player);
void SetWeather(WeatherType type, float grade);
/// For which zone is this weather?
uint32 GetZone() const { return m_zone; };
uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
private:
WeatherState GetWeatherState() const;
uint32 m_zone;
WeatherType m_type;
float m_grade;
IntervalTimer m_timer;
WeatherData const* m_weatherChances;
};
#endif
|
#ifndef KMAINWINDOW_H
#define KMAINWINDOW_H
#include <qmainwindow.h>
#include <qmenubar.h>
#include <qtoolbar.h>
#include "qptrlist.h"
#include "kstatusbar.h"
#include "ktoolbar.h"
#include "kaction.h"
#ifdef WIN32
# include "Registry.h"
# pragma warning(disable: 4309)
# pragma warning(disable: 4305)
#endif
#include <iostream>
using std::cout;
using std::endl;
class KMainWindow: public QMainWindow {
Q_OBJECT
public:
KMainWindow(QWidget *parent, const char *name, int flags);
virtual ~KMainWindow();
virtual KStatusBar* statusBar() { return _bar; }
virtual QObject* actionCollection() { return &_actionCollection; }
KToolBar * toolBar(const QString& name) {
QObject *c = child(name);
if(c != NULL)
if(c->inherits("KToolBar"))
return (KToolBar*) c;
return _toolBar;
}
void saveMainWindowSettings(KConfig *config, const QString& name);
void applyMainWindowSettings(KConfig *config, const QString& name);
void createGUI(QWidget *);
static bool canBeRestored(int) { return false; }
void restore(int) { }
virtual void closeEvent(QCloseEvent *e);
virtual bool queryExit() { return true; }
virtual bool queryClose() { return true; }
protected:
void saveToolBar(KConfig *config, QToolBar *tb);
void restoreToolBar(KConfig *config, QToolBar *tb);
KStatusBar *_bar;
KToolBar *_toolBar;
// QPtrList<KMainWindow>* memberList;
QObject _actionCollection;
};
#endif
|
/*
* Copyright (c) 2009 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
*/
/**
* @file
* <b>NVIDIA Tegra ODM Kit:
* NV3P Server Query Interface</b>
*
* @b Description: Defines ODM query interface used by
* the 3P server. Implementation is optional.
*/
#ifndef INCLUDED_NVODM_QUERY_NV3P_H
#define INCLUDED_NVODM_QUERY_NV3P_H
#include "nvcommon.h"
/**
* @defgroup nvodm_query_nv3p NV3P Server Query Interface
* This is the ODM query interface for NV3P Server.
* @ingroup nvodm_query
* @{
*/
#ifdef __cplusplus
extern "C"
#endif
/**
* Gets values for the interface parameters of the USB
* configuration descriptor that is returned during initial
* device setup.
*
* @param pIfcClass A pointer to the interface class.
* @param pIfcSubclass A pointer to the interface subclass.
* @param pIfcProtocol A pointer to the interface protocol.
* @return NV_TRUE to use the returned values in the descriptor,
* or NV_FALSE to use the default Nv3p parameters (required
* when running the recovery-mode server).
*/
NvBool NvOdmQueryUsbConfigDescriptorInterface(
NvU32* pIfcClass,
NvU32* pIfcSubclass,
NvU32* pIfcProtocol);
/**
* Gets the vendor, product, and BCD device IDs that
* are provided in the device descriptor packet during USB setup.
*
* @param pOdmVendorId A pointer to the vendor ID.
* @param pOdmProductId A pointer to the product ID.
* @param pOdmBcdDeviceId A pointer to the BCD device ID.
*
* @return NV_TRUE If the returned values should be used in the
* descriptor, or NV_FALSE if the Nv3p server's default values
* should be used (required when entering recovery mode).
*/
NvBool NvOdmQueryUsbDeviceDescriptorIds(
NvU32 *pOdmVendorId,
NvU32 *pOdmProductId,
NvU32 *pOdmBcdDeviceId);
/**
* Gets the product ID string that is provided to the host during
* USB setup.
*
* @return NULL-terminated string that the 3P server should transmit
* during device setup, or NULL to use the default string (required
* when running the recovery-mode server).
*/
NvU8 *NvOdmQueryUsbProductIdString(void);
#ifdef __cplusplus
}
#endif
/** @} */
#endif
|
/* $Id: VBoxCredProvCredential.h 46385 2013-06-04 14:12:21Z vboxsync $ */
/** @file
* VBoxCredProvCredential - Class for keeping and handling the passed credentials.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___VBOX_CREDPROV_CREDENTIAL_H___
#define ___VBOX_CREDPROV_CREDENTIAL_H___
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <Windows.h>
#include <NTSecAPI.h>
#define SECURITY_WIN32
#include <Security.h>
#include <ShlGuid.h>
#include <strsafe.h>
#pragma warning(push)
#pragma warning(disable : 4995)
#include <Shlwapi.h>
#pragma warning(pop)
#include <iprt/string.h>
#include "VBoxCredentialProvider.h"
class VBoxCredProvProvider;
class VBoxCredProvCredential : public ICredentialProviderCredential
{
public:
VBoxCredProvCredential(void);
virtual ~VBoxCredProvCredential(void);
/** @name IUnknown methods
* @{ */
IFACEMETHODIMP_(ULONG) AddRef(void);
IFACEMETHODIMP_(ULONG) Release(void);
IFACEMETHODIMP QueryInterface(REFIID interfaceID, void **ppvInterface);
/** @} */
/** @name ICredentialProviderCredential methods.
* @{ */
IFACEMETHODIMP Advise(ICredentialProviderCredentialEvents* pcpce);
IFACEMETHODIMP UnAdvise(void);
IFACEMETHODIMP SetSelected(PBOOL pfAutoLogon);
IFACEMETHODIMP SetDeselected(void);
IFACEMETHODIMP GetFieldState(DWORD dwFieldID,
CREDENTIAL_PROVIDER_FIELD_STATE* pcpfs,
CREDENTIAL_PROVIDER_FIELD_INTERACTIVE_STATE* pcpfis);
IFACEMETHODIMP GetStringValue(DWORD dwFieldID, PWSTR *ppwsz);
IFACEMETHODIMP GetBitmapValue(DWORD dwFieldID, HBITMAP *phbmp);
IFACEMETHODIMP GetCheckboxValue(DWORD dwFieldID, PBOOL pfChecked, PWSTR *ppwszLabel);
IFACEMETHODIMP GetComboBoxValueCount(DWORD dwFieldID, DWORD* pcItems, DWORD *pdwSelectedItem);
IFACEMETHODIMP GetComboBoxValueAt(DWORD dwFieldID, DWORD dwItem, PWSTR *ppwszItem);
IFACEMETHODIMP GetSubmitButtonValue(DWORD dwFieldID, DWORD *pdwAdjacentTo);
IFACEMETHODIMP SetStringValue(DWORD dwFieldID, PCWSTR pcwzString);
IFACEMETHODIMP SetCheckboxValue(DWORD dwFieldID, BOOL fChecked);
IFACEMETHODIMP SetComboBoxSelectedValue(DWORD dwFieldID, DWORD dwSelectedItem);
IFACEMETHODIMP CommandLinkClicked(DWORD dwFieldID);
IFACEMETHODIMP GetSerialization(CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE *pcpGetSerializationResponse,
CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION *pcpCredentialSerialization,
PWSTR *ppwszOptionalStatusText, CREDENTIAL_PROVIDER_STATUS_ICON *pcpsiOptionalStatusIcon);
IFACEMETHODIMP ReportResult(NTSTATUS ntStatus, NTSTATUS ntSubStatus,
PWSTR *ppwszOptionalStatusText,
CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon);
/** @} */
HRESULT Reset(void);
HRESULT Initialize(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus);
int RetrieveCredentials(void);
BOOL TranslateAccountName(PWSTR pwszDisplayName, PWSTR *ppwszAccoutName);
BOOL ExtractAccoutData(PWSTR pwszAccountData, PWSTR *ppwszAccoutName, PWSTR *ppwszDomain);
protected:
HRESULT RTUTF16ToUnicode(PUNICODE_STRING pUnicodeDest, PRTUTF16 pwszSource, bool fCopy);
HRESULT AllocateLogonPackage(const KERB_INTERACTIVE_UNLOCK_LOGON &rUnlockLogon,
BYTE **ppPackage, DWORD *pcbPackage);
private:
/** Internal reference count. */
LONG m_cRefs;
/** The usage scenario for which we were enumerated. */
CREDENTIAL_PROVIDER_USAGE_SCENARIO m_enmUsageScenario;
/** The actual credential strings. */
PRTUTF16 m_apwszCredentials[VBOXCREDPROV_NUM_FIELDS];
/** Pointer to event handler. */
ICredentialProviderCredentialEvents *m_pEvents;
/** Flag indicating whether credentials already were retrieved. */
bool m_fHaveCreds;
};
#endif /* !___VBOX_CREDPROV_CREDENTIAL_H___ */
|
/*
* drivers/video/tegra/dc/edid_quirks.c
*
* Copyright (c) 2015, NVIDIA CORPORATION, All rights reserved.
* Author: Anshuman Nath Kar <anshumank@nvidia.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "edid.h"
static const struct hdmi_blacklist {
char manufacturer[4];
u32 model;
char monitor[14];
u32 quirks;
} edid_blacklist[] = {
/* Bauhn ATVS65-815 65" 4K TV */
{ "CTV", 48, "Tempo 4K TV", TEGRA_EDID_QUIRK_NO_YUV },
};
u32 tegra_edid_lookup_quirks(const char *manufacturer, u32 model,
const char *monitor)
{
int i;
for (i = 0; i < ARRAY_SIZE(edid_blacklist); i++)
if (!strcmp(edid_blacklist[i].manufacturer, manufacturer) &&
edid_blacklist[i].model == model &&
!strcmp(edid_blacklist[i].monitor, monitor))
return edid_blacklist[i].quirks;
return TEGRA_EDID_QUIRK_NONE;
}
|
/*
* NWNeXalt - Empty File
* (c) 2007 Doug Swarin (zac@intertex.net)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
* $HeadURL$
*
*/
#ifndef _NX_NWN_STRUCT_CNWSENCOUNTER_
#define _NX_NWN_STRUCT_CNWSENCOUNTER_
struct CNWSEncounter_s {
CNWSObject obj;
uint8_t field_1C0;
uint8_t field_1C1;
uint8_t field_1C2;
uint8_t field_1C3;
uint32_t enc_faction; /* 01C8 */
CExoLocString enc_localized_name; /* 01CC */
uint8_t enc_is_active; /* 01D4 */
uint8_t field_1D5;
uint8_t field_1D6;
uint8_t field_1D7;
uint8_t enc_reset; /* 01D8 */
uint8_t field_1D9;
uint8_t field_1DA;
uint8_t field_1DB;
int32_t enc_reset_time; /* 01DC */
int32_t enc_spawn_option; /* 01E0 */
int32_t enc_difficulty; /* 01E4 */
int32_t enc_difficulty_index; /* 01E8 */
int32_t enc_rec_creatures; /* 01EC */
int32_t enc_max_creatures; /* 01F0 */
int32_t enc_number_spawned; /* 01F4 */
uint32_t enc_heartbeat_day; /* 01F8 */
uint32_t enc_heartbeat_time; /* 01FC */
uint32_t enc_last_spawn_day; /* 0200 */
uint32_t enc_last_spawn_time; /* 0204 */
uint8_t enc_started; /* 0208 */
uint8_t field_209;
uint8_t field_20A;
uint8_t field_20B;
uint8_t enc_exhausted; /* 020C */
uint8_t field_20C;
uint8_t field_20D;
uint8_t field_20E;
int32_t enc_area_list_max_size; /* 0210 */
uint8_t spacer[51]; /* 0214 */
CSpawnPoint *enc_spawn_points; /* 0248 */
uint32_t enc_spawn_points_len; /* 024C */
int32_t enc_respawns; /* 0250 */
int32_t enc_spawns_max; /* 0254 */
int32_t enc_spawns_current; /* 0258 */
uint32_t field_25C;
uint32_t field_260;
float enc_area_points; /* 0264 */
uint32_t field_268;
float enc_spawn_pool_active; /* 026C */
nwn_objid_t enc_last_entered; /* 0270 */
nwn_objid_t enc_last_left; /* 0274 */
CExoString enc_scripts[5]; /* 0278 */
uint32_t field_2A0;
int32_t enc_custom_script_id; /* 02A4 */
uint8_t enc_player_only; /* 02A8 */
uint8_t field_2A9;
uint8_t field_2AA;
uint8_t field_2AB;
};
#endif /* _NX_NWN_STRUCT_CNWSENCOUNTER_ */
/* vim: set sw=4: */
|
#pragma once
class GameTime
{
public:
GameTime();
~GameTime();
enum GametimePredefs { GAMEDAY_1_MINUTE = 24 * 60, GAMEDAY_20_SECONDS = 24 * 60 * 3, GAMEDAY_10_SECONDS = 24 * 60 * 6 };
private:
LONGLONG now;
LONGLONG last;
LONGLONG ticks_per_sec;
LONGLONG start;
LONGLONG ticks_per_game_day;
LONGLONG gameday;
LARGE_INTEGER qwTime;
double timeOfDay;
double timeAbs;
double timeDelta;
public:
// advances time, should be called once for every frame
void advanceTime();
// returns time of day as double in range 0..24
double getTimeOfDay();
// get number of hours (and fractions) since game timer creation
// NEVER user time values as float: precision is not enough and you will get same time value for actually different times
double getTimeAbs();
// get absolute number of seconds (and fractions)
// NEVER user time values as float: precision is not enough and you will get same time value for actually different times
double GameTime::getTimeAbsSeconds();
// get delta in seconds since last time
double getDeltaTime();
// get real time
LONGLONG getRealTime();
// get ticks per second
LONGLONG getTicksPerSec();
// get duration in seconds
double getSecondsBetween(LONGLONG &past, LONGLONG &present);
// set how much faster a game day passes, 1 == real time, 24*60 is a one minute day
// init needs be called before any other time method
void init(LONGLONG gamedayFactor);
};
|
/* queue.h -- Concurrent Time Queue Support */
extern double dfDelayedActionTime;
extern double dfWaitEventTime;
int nDelayedAction;
int nWaitEvent;
// global function prototypes
void ClearQueue(void);
BOOL EvalDelayedAction
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
BOOL EvalGlobalDelayedAction
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
BOOL EvalWaitForNextEvent
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
void MarkTimeQueue(void);
void DumpQueue(void);
void DumpQueueEvents(LINEARPLANP plpLinearPlan);
void QueueDelete
(
LINEARPLANP plp
);
BOOL EvalInhibitDelayedAction
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
CELLP ComputeCurrentTime
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
BOOL EvalReachableEvent
(
CELLP pcFormula,
LINEARPLANP plpLinearPlan,
BINDINGP pbBindings
);
|
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 2003 The R Development Core Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "R.h"
#include "Rinternals.h"
SEXP do_mapply(SEXP f, SEXP varyingArgs, SEXP constantArgs, SEXP rho)
{
int i, j, m,nc, *lengths, *counters, named, longest=0;
SEXP vnames, fcall, mindex, nindex, tmp1, tmp2, ans;
m = length(varyingArgs);
nc = length(constantArgs);
vnames = PROTECT(getAttrib(varyingArgs, R_NamesSymbol));
named = vnames!=R_NilValue;
lengths = (int *) R_alloc(m, sizeof(int));
for(i = 0; i < m; i++){
lengths[i] = length(VECTOR_ELT(varyingArgs,i));
if (lengths[i] > longest) longest=lengths[i];
}
counters = (int *) R_alloc(m, sizeof(int));
for(i = 0; i < m; counters[i++]=0);
mindex=PROTECT(allocVector(VECSXP, m));
nindex=PROTECT(allocVector(VECSXP, m));
/* build a call
f(dots[[1]][[4]],dots[[2]][[4]],dots[[3]][[4]],d=7)
*/
if (constantArgs == R_NilValue)
PROTECT(fcall=R_NilValue);
else
PROTECT(fcall=VectorToPairList(constantArgs));
for(j = m-1; j >= 0;j--) {
SET_VECTOR_ELT(mindex,j, allocVector(INTSXP,1));
SET_VECTOR_ELT(nindex,j, allocVector(INTSXP,1));
INTEGER(VECTOR_ELT(mindex,j))[0] = j+1;
PROTECT(tmp1=lang3(R_Bracket2Symbol,
install("dots"),
VECTOR_ELT(mindex,j)));
PROTECT(tmp2=lang3(R_Bracket2Symbol,
tmp1,
VECTOR_ELT(nindex,j)));
UNPROTECT(3);
PROTECT(fcall=LCONS(tmp2, fcall));
if (named && CHAR(STRING_ELT(vnames,j))[0]!='\0')
SET_TAG(fcall, install(CHAR(STRING_ELT(vnames,j))));
}
UNPROTECT(1);
PROTECT(fcall=LCONS(f, fcall));
PROTECT(ans=allocVector(VECSXP, longest));
for(i = 0; i < longest; i++) {
for(j = 0; j < m; j++) {
counters[j] = (++counters[j]>lengths[j]) ? 1 : counters[j];
INTEGER(VECTOR_ELT(nindex,j))[0] = counters[j];
}
SET_VECTOR_ELT(ans, i, eval(fcall, rho));
}
for(j = 0; j < m; j++) {
if (counters[j] != lengths[j])
warning("longer argument not a multiple of length of shorter");
}
UNPROTECT(5);
return(ans);
}
|
/* This file is part of the KDE Project
Copyright (C) 1999 Klaas Freitag <freitag@suse.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __IMG_CANVAS_H__
#define __IMG_CANVAS_H__
#include <qwidget.h>
#include <qrect.h>
#include <stdlib.h>
#include <qsize.h>
#include <qwmatrix.h>
#include <qscrollview.h>
#include <qstrlist.h>
#ifdef USE_KPIXMAPIO
#include <kpixmapio.h>
#endif
class QPopupMenu;
class QPixmap;
class QImage;
class QPainter;
enum preview_state {
MOVE_NONE,
MOVE_TOP_LEFT,
MOVE_TOP_RIGHT,
MOVE_BOTTOM_LEFT,
MOVE_BOTTOM_RIGHT,
MOVE_LEFT,
MOVE_RIGHT,
MOVE_TOP,
MOVE_BOTTOM,
MOVE_WHOLE
};
enum cursor_type {
CROSS,
VSIZE,
HSIZE,
BDIAG,
FDIAG,
ALL,
HREN
};
const int MIN_AREA_WIDTH = 3;
const int MIN_AREA_HEIGHT = 3;
const int delta = 3;
#ifdef __PREVIEW_CPP__
int max_dpi = 600;
#else
extern int max_dpi;
#endif
class ImageCanvas: public QScrollView
{
Q_OBJECT
Q_ENUMS( PopupIDs )
Q_PROPERTY( int brightness READ getBrightness WRITE setBrightness )
Q_PROPERTY( int contrast READ getContrast WRITE setContrast )
Q_PROPERTY( int gamma READ getGamma WRITE setGamma )
Q_PROPERTY( int scale_factor READ getScaleFactor WRITE setScaleFactor )
public:
ImageCanvas( QWidget *parent = 0,
const QImage *start_image = 0,
const char *name = 0);
~ImageCanvas( );
int getBrightness() const;
int getContrast() const;
int getGamma() const;
int getScaleFactor() const;
const QImage *rootImage();
bool hasImage( void ) { return acquired; }
QPopupMenu* contextMenu() { return m_contextMenu; }
QRect sel( void );
enum ScaleKinds { UNSPEC, DYNAMIC, FIT_ORIG, FIT_WIDTH, FIT_HEIGHT, ZOOM };
enum PopupIDs { ID_POP_ZOOM, ID_POP_CLOSE, ID_FIT_WIDTH,
ID_FIT_HEIGHT, ID_ORIG_SIZE };
bool selectedImage( QImage* );
ScaleKinds scaleKind();
const QString scaleKindString();
ScaleKinds defaultScaleKind();
const QString imageInfoString( int w=0, int h=0, int d=0 );
public slots:
void setBrightness(int);
void setContrast(int );
void setGamma(int );
void toggleAspect( int aspect_in_mind )
{
maintain_aspect = aspect_in_mind;
repaint();
}
virtual QSize sizeHint() const;
void newImage( QImage* );
void newImageHoldZoom( QImage* );
void deleteView( QImage *);
void newRectSlot();
void newRectSlot( QRect newSel );
void noRectSlot( void );
void setScaleFactor( int i );
void handle_popup(int item );
void enableContextMenu( bool wantContextMenu );
void setKeepZoom( bool k );
void setScaleKind( ScaleKinds k );
void setDefaultScaleKind( ScaleKinds k );
/**
* Highlight a rectangular area on the current image using the given brush
* and pen.
* The function returns a id that needs to be given to the remove method.
*/
int highlight( const QRect&, const QPen&, const QBrush&, bool ensureVis=false );
/**
* reverts the highlighted region back to normal view.
*/
void removeHighlight( int idx = -1 );
/**
* permit to do changes to the image that are saved back to the file
*/
void setReadOnly( bool );
bool readOnly();
signals:
void noRect( void );
void newRect( void );
void newRect( QRect );
void scalingRequested();
void closingRequested();
void scalingChanged( const QString& );
/**
* signal emitted if the permission of the currently displayed image changed,
* ie. if it goes from writeable to readable.
* @param shows if the image is now read only (true) or not.
*/
void imageReadOnly( bool isRO );
protected:
void drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph );
void timerEvent(QTimerEvent *);
void viewportMousePressEvent(QMouseEvent *);
void viewportMouseReleaseEvent(QMouseEvent *);
void viewportMouseMoveEvent(QMouseEvent *);
void resizeEvent( QResizeEvent * event );
private:
QStrList urls;
int scale_factor;
const QImage *image;
int brightness, contrast, gamma;
#ifdef USE_KPIXMAPIO
KPixmapIO pixIO;
#endif
QWMatrix scale_matrix;
QWMatrix inv_scale_matrix;
QPixmap *pmScaled;
float used_yscaler;
float used_xscaler;
QPopupMenu *m_contextMenu;
bool maintain_aspect;
int timer_id;
QRect *selected;
preview_state moving;
int cr1,cr2;
int lx,ly;
bool acquired;
/* private functions for the running ant */
void drawHAreaBorder(QPainter &p,int x1,int x2,int y,int r = FALSE);
void drawVAreaBorder(QPainter &p,int x,int y1,int y2,int r = FALSE);
void drawAreaBorder(QPainter *p,int r = FALSE);
void update_scaled_pixmap( void );
preview_state classifyPoint(int x,int y);
class ImageCanvasPrivate;
ImageCanvasPrivate *d;
};
#endif
|
//
// AKBandPassButterworthFilterAudioUnit.h
// AudioKit
//
// Created by Aurelius Prochazka, revision history on Github.
// Copyright (c) 2017 Aurelius Prochazka. All rights reserved.
//
#pragma once
#import "AKAudioUnit.h"
@interface AKBandPassButterworthFilterAudioUnit : AKAudioUnit
@property (nonatomic) float centerFrequency;
@property (nonatomic) float bandwidth;
@end
|
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2017 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef _U2_SEQUENCEWALKER_TESTS_H_
#define _U2_SEQUENCEWALKER_TESTS_H_
#include <U2Test/XMLTestUtils.h>
#include <U2Core/GObject.h>
#include <QDomElement>
#include <U2Core/SequenceWalkerTask.h>
namespace U2 {
class GTest_SW_CheckRegion : public GTest, public SequenceWalkerCallback {
Q_OBJECT
public:
SIMPLE_XML_TEST_BODY_WITH_FACTORY(GTest_SW_CheckRegion, "sw-check-region");
ReportResult report();
void onRegion(SequenceWalkerSubtask* t,TaskStateInfo& ti) {Q_UNUSED(t); Q_UNUSED(ti);}
private:
int chunkSize;
int overlap;
int extraLen;
U2Region region;
bool reventNorm;
QVector<U2Region> result;
protected:
};
class SequenceWalkerTests {
public:
static QList<XMLTestFactory*> createTestFactories();
};
}//namespace
#endif
|
#ifndef ARTERY_DCCENTITYBASE_H_VLQQNLKF
#define ARTERY_DCCENTITYBASE_H_VLQQNLKF
#include "artery/networking/AccessInterface.h"
#include "artery/networking/IDccEntity.h"
#include <vanetza/dcc/flow_control.hpp>
#include <vanetza/geonet/dcc_information_sharing.hpp>
#include <omnetpp/clistener.h>
#include <omnetpp/csimplemodule.h>
#include <memory>
namespace artery
{
class RadioDriverBase;
class Router;
class DccEntityBase : public IDccEntity, public omnetpp::cSimpleModule, public omnetpp::cListener
{
public:
// cSimpleModule
int numInitStages() const override;
void initialize(int stage) override;
void finish() override;
// cListener
void receiveSignal(omnetpp::cComponent*, omnetpp::simsignal_t, double, omnetpp::cObject*) override;
// IDccEntity
vanetza::dcc::ChannelProbeProcessor* getChannelProbeProcessor() override { return mCbrProcessor.get(); }
vanetza::dcc::RequestInterface* getRequestInterface() override { return mFlowControl.get(); }
vanetza::geonet::DccFieldGenerator* getGeonetFieldGenerator() override { return mNetworkEntity.get(); }
void reportLocalChannelLoad(vanetza::dcc::ChannelLoad) override;
protected:
virtual void initializeNetworkEntity(const std::string&);
virtual void initializeChannelProbeProcessor(const std::string&);
virtual void initializeTransmitRateControl() = 0;
virtual void onLocalCbr(vanetza::dcc::ChannelLoad);
virtual void onGlobalCbr(vanetza::dcc::ChannelLoad) = 0;
virtual vanetza::dcc::TransmitRateControl* getTransmitRateControl() = 0;
std::unique_ptr<vanetza::dcc::ChannelProbeProcessor> mCbrProcessor;
std::unique_ptr<vanetza::geonet::DccInformationSharing> mNetworkEntity;
std::unique_ptr<vanetza::dcc::FlowControl> mFlowControl;
vanetza::dcc::ChannelLoad mTargetCbr;
Router* mRouter;
vanetza::Runtime* mRuntime;
std::unique_ptr<AccessInterface> mAccessInterface;
};
} // namespace artery
#endif /* ARTERY_DCCENTITYBASE_H_VLQQNLKF */
|
//
// HttpRequestDelegate.h
// openshop
//
// Created by sihai on 25/8/14.
// Copyright (c) 2014 openteach inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol HttpRequestDelegate <NSObject>
-(void) succeed: (id) request;
-(void) failed: (id) request;
-(void) timeout: (id) request;
@end
|
/*
* ev-module.h
* This file is part of Evince
*
* Copyright (C) 2005 - Paolo Maggi
*
* 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.
*/
/* This is a modified version of gedit-module.h from Epiphany source code.
* Here the original copyright assignment:
*
* Copyright (C) 2003 Marco Pesenti Gritti
* Copyright (C) 2003, 2004 Christian Persch
*
*/
/*
* Modified by the gedit Team, 2005. See the AUTHORS file for a
* list of people on the gedit Team.
* See the ChangeLog files for a list of changes.
*
* $Id: gedit-module.h 5263 2006-10-08 14:26:02Z pborelli $
*/
/* Modified by Evince Team */
#pragma once
#if !defined (EVINCE_COMPILATION)
#error "This is a private header."
#endif
#include <glib-object.h>
G_BEGIN_DECLS
#define EV_TYPE_MODULE (_ev_module_get_type ())
#define EV_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_MODULE, EvModule))
#define EV_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_MODULE, EvModuleClass))
#define EV_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_MODULE))
#define EV_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EV_TYPE_MODULE))
#define EV_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EV_TYPE_MODULE, EvModuleClass))
typedef struct _EvModule EvModule;
GType _ev_module_get_type (void) G_GNUC_CONST;
EvModule *_ev_module_new (const gchar *path,
gboolean resident);
const gchar *_ev_module_get_path (EvModule *module);
GObject *_ev_module_new_object (EvModule *module);
GType _ev_module_get_object_type (EvModule *module);
G_END_DECLS
|
//
// LQTrackManager.h
// Geotracks
//
// Created by Kenichi Nakamura on 9/11/12.
// Copyright (c) 2012 Geoloqi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LQTrackManager : NSObject
// returns the singleton track manager object
//
+ (LQTrackManager *)sharedManager;
// returns an immutable copy of the activeTracks array
//
- (NSArray *)activeTracks;
// returns count of active tracks
//
- (NSInteger)activeTracksCount;
// returns an immutable copy of the inactiveTracks array
//
- (NSArray *)inactiveTracks;
// returns count of inactive tracks
//
- (NSInteger)inactiveTracksCount;
// returns a total count of tracks
//
- (NSInteger)totalTracksCount;
// reloads all tracks from API call, optionally setting the tracker profile, and calls
// completion() if present after response is received.
// * clears DB tables
// * loads arrays and tables from API
//
- (void)reloadTracksFromAPI:(BOOL)setProfile withCompletion:(void (^)(NSHTTPURLResponse *response, NSDictionary *responseDictionary, NSError *error))completion;
// convenience for the above: calls the above with setProfile:YES
//
- (void)reloadTracksFromAPI:(void (^)(NSHTTPURLResponse *response, NSDictionary *responseDictionary, NSError *error))completion;
// reloads tracks arrays from the database
//
- (void)reloadTracksFromDB;
// sets the tracker profile:
// * if no active tracks, turn tracker off
// * if active tracks and location enabled, turn tracker on (realtime)
// * if active tracks and location disabled, turn tracker off
//
- (void)setTrackerProfile;
@end
|
#ifndef _IP_QUEUE_H
#define _IP_QUEUE_H
#ifdef __KERNEL__
#ifdef DEBUG_IPQ
#define QDEBUG(x...) printk(KERN_DEBUG ## x)
#else
#define QDEBUG(x...)
#endif /* DEBUG_IPQ */
#else
#include <net/if.h>
#endif /* ! __KERNEL__ */
/* Messages sent from kernel */
typedef struct ipq_packet_msg {
unsigned long packet_id; /* ID of queued packet */
unsigned long mark; /* Netfilter mark value */
long timestamp_sec; /* Packet arrival time (seconds) */
long timestamp_usec; /* Packet arrvial time (+useconds) */
unsigned int hook; /* Netfilter hook we rode in on */
char indev_name[IFNAMSIZ]; /* Name of incoming interface */
char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
__be16 hw_protocol; /* Hardware protocol (network order) */
unsigned short hw_type; /* Hardware type */
unsigned char hw_addrlen; /* Hardware address length */
unsigned char hw_addr[8]; /* Hardware address */
size_t data_len; /* Length of packet data */
unsigned char payload[0]; /* Optional packet data */
} ipq_packet_msg_t;
/* Messages sent from userspace */
typedef struct ipq_mode_msg {
unsigned char value; /* Requested mode */
size_t range; /* Optional range of packet requested */
} ipq_mode_msg_t;
typedef struct ipq_verdict_msg {
unsigned int value; /* Verdict to hand to netfilter */
unsigned long id; /* Packet ID for this verdict */
size_t data_len; /* Length of replacement data */
unsigned char payload[0]; /* Optional replacement packet */
} ipq_verdict_msg_t;
typedef struct ipq_peer_msg {
union {
ipq_verdict_msg_t verdict;
ipq_mode_msg_t mode;
} msg;
} ipq_peer_msg_t;
/* Packet delivery modes */
enum {
IPQ_COPY_NONE, /* Initial mode, packets are dropped */
IPQ_COPY_META, /* Copy metadata */
IPQ_COPY_PACKET /* Copy metadata + packet (range) */
};
#define IPQ_COPY_MAX IPQ_COPY_PACKET
/* Types of messages */
#define IPQM_BASE 0x10 /* standard netlink messages below this */
#define IPQM_MODE (IPQM_BASE + 1) /* Mode request from peer */
#define IPQM_VERDICT (IPQM_BASE + 2) /* Verdict from peer */
#define IPQM_PACKET (IPQM_BASE + 3) /* Packet from kernel */
#define IPQM_MAX (IPQM_BASE + 4)
#endif /*_IP_QUEUE_H*/
|
#ifndef max7347_h
#define max7347_h
//#include <stdio.h>
#include <linux/clk.h>
#include <asm/arch/at91_twi.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/arch/at91_pmc.h>
typedef unsigned short int U16;
#define AT91_PIOA_BASE AT91_PIOA + AT91_BASE_SYS
#define AT91_PIOC_BASE AT91_PIOC + AT91_BASE_SYS
#define AT91_PIOB_BASE AT91_PIOB + AT91_BASE_SYS
#define AT91_AIC_BASE AT91_AIC + AT91_BASE_SYS
#define AT91_PMC_BASE AT91_PMC + AT91_BASE_SYS
static void __iomem *twi_base;
static void __iomem *aic_base;
static void __iomem *pmc_base;
#define at91_pmc_read(reg) __raw_readl(pmc_base + (reg))
#define at91_pmc_write(reg, val) __raw_writel((val), pmc_base + (reg))
#define at91_aic_read(reg) __raw_readl(aic_base + (reg))
#define at91_aic_write(reg, val) __raw_writel((val), aic_base + (reg))
#define at91_twi_read(reg) __raw_readl(twi_base + (reg))
#define at91_twi_write(reg, val) __raw_writel((val), twi_base + (reg))
#define AT91_MAX7347_I2C_ADDRESS (0x38<<16) /* Internal addr: 0x38 */
#define IRQ0 (0x1 << AT91SAM9261_ID_IRQ0)
/*****************************************************************
*
****************************************************************/
#define MAX_BUF_NUM 16
/* MAX7347 register offset */
#define MAX7347_KEYFIFO_REG 0x00
#define MAX7347_DEBOUNCE_REG 0x01
#define MAX7347_AUTOREPEAT_REG 0x02
#define MAX7347_INTERRUPT_REG 0x03
#define MAX7347_CONFIGURATION_REG 0x04
#define MAX7347_PORT_REG 0x05
#define MAX7347_KEYSOUND_REG 0x06
#define MAX7347_ALERTSOUND_REG 0x07
#define AT91_PA7_TWD (unsigned int) (0x1 << 7)
#define AT91_PA8_TWCK (unsigned int) (0x1 << 8)
#define TWI_NULL 0xff
#define TWI_READ 0x1
#define TWI_WRITE 0x0
//#define AT91_TWI_SWRST ((unsigned int) 0x1 << 7)
/************************************************************************
*
* ioctl
*
***********************************************************************/
#define KEYB_CMD_CLRBUF 0x005
#define KEYB_CMD_HAVEKEY 0x006
/************************************************************************
*
*
*
************************************************************************/
#define PVK_DELETECHAR 0x08
#define PVK_RETURN 0x0D
#define PVK_ESCAPE 0x1B
#define PVK_PAGEUP 0x21
#define PVK_PAGEDOWN 0x22
#define PVK_END 0x23
#define PVK_HOME 0x24
#define PVK_INSERT 0x2D
#define PVK_DELETE 0x2E
#define PVK_LEFT 0x25
#define PVK_UP 0x26
#define PVK_RIGHT 0x27
#define PVK_DOWN 0x28
#if 1
const unsigned char key_scan_map[] = {0x0b, 0x02, 0x03, //0x00='0', 0x01='1', 0x02='4'
0x08, 'f', 0x7b, //0x03='7', 0x04=fun, 0x05=right
0x7f, 'f', 0x34, //0x06=esc, 0x07=shift, 0x08='.'
0x03, 0x06, 0x09, //0x09='2', 0x0a='5', 0x0b='8'
'f', 0x1f, 0x7e, //0x0c=tab, 0x0d=down, 0x0e=up
'f', 0x0e, 0x04, //0x0f=banklight, 0x10=del, 0x11='3'
0x07, 0x0a, 'f', //0x12='6', 0x13='9', 0x14=help
0x79, 0x7d, 'f'}; //0x15=left, 0x16=enter, 0x17=power
const unsigned char key_cook_map[] = {'0', '1', '4', //0x00='0', 0x01='1', 0x02='4'
'7', 'f', PVK_LEFT, //0x03='7', 0x04=fun, 0x05=left
PVK_ESCAPE, 'f', '.', //0x06=esc, 0x07=shift, 0x08='.'
'2', '5', '8', //0x09='2', 0x0a='5', 0x0b='8'
'f', PVK_DOWN, PVK_UP, //0x0c=tab, 0x0d=down, 0x0e=up
'f', PVK_DELETE, '3', //0x0f=banklight, 0x10=del, 0x11='3'
'6', '9', 'f', //0x12='6', 0x13='9', 0x14=help
PVK_RIGHT, PVK_RETURN, 'f'}; //0x15=right, 0x16=enter, 0x17=power
const unsigned short int key_zzcooked_map[24][5] = {
{0x00,0x0B30,0x1655,0x2F56,0x1157}, //"K00","0","U","v","W"
{0x01,0x0231,0x3920,0x324D,0x314E}, //"K01","1"," ","M","N"
{0x02,0x0534,0x0C2D,0x2247,0x2348}, //"K02","4","-","G","H"
{0x03,0x0837,0x0D2B,0x1E41,0x3042}, //"K03","7","+","A","B"
{0x04,0x8200,0x8214,0x0000,0x0000}, //"K04","¹¦ÄÜ","shift+¹¦ÄÜ"
{0x05,0x4B00,0x4700,0x0000,0x0000}, //"K05","<","shift+<"
{0x06,0x011B,0x2E03,0x0000,0x0000}, //"K06","Í˳ö","shift+Í˳ö"
{0x07,0x0000,0x0000,0x0000,0x0000}, //"K07","»»µµ"
{0x08,0x342E,0x2D58,0x1559,0x2C5A}, //"K08",".","X","Y","Z"
{0x09,0x0332,0x184F,0x1950,0x1051}, //"K09","2","O","P","Q"
{0x0A,0x0635,0x352F,0x1749,0x244A}, //"K10","5","/","I","J"
{0x0B,0x0938,0x092A,0x2E43,0x2044}, //"K11","8","*","C","D"
{0x0C,0x9600,0x9AF1,0x0000,0x0000}, //"K12"Çл»"
{0x0D,0x5000,0x5100,0x0000,0x0000}, //"K13","V","shift+V"
{0x0E,0x4800,0x4900,0x0000,0x0000}, //"K14","^","shift+^"
{0x0F,0x9700,0x0000,0x0000,0x0000}, //"K15","±³¹â"
{0x10,0x0E08,0x2E04,0x0000,0x0000}, //"K16","ɾ³ý","shift+ɾ³ý"
{0x11,0x0433,0x1352,0x1F53,0x1454}, //"K17","3","R","S","T"
{0x12,0x0736,0x0B29,0x254B,0x264C}, //"K18","6",")","K","L"
{0x13,0x0A39,0x0A28,0x1245,0x2146}, //"K19","9","(","E","F"
{0x14,0x3B00,0x5400,0x0000,0x0000}, //"K20","°ïÖú","shift+°ïÖú"
{0x15,0x4D00,0x4f00,0x0000,0x0000}, //"K21",">","shift+>"
{0x16,0x1C0D,0x0E00,0x0000,0x0000}, //"K22","È·¶¨","shift+È·¶¨"
{0x17,0x0000,0x0000,0x0000,0x0000}}; //"K23","¹Ø»ú"
#endif
/* inline function */
inline unsigned char raw2scancode (int num);
inline int kbufin (U16 key);
inline U16 readkey(void);
int Key_Read (char data);
#endif
|
/*
* Artery V2X Simulation Framework
* Copyright 2019 Raphael Riebl
* Licensed under GPLv2, see COPYING file for detailed license and warranty terms.
*/
#ifndef ARTERY_VANETRADIO_H_FNQDI1V8
#define ARTERY_VANETRADIO_H_FNQDI1V8
#include "artery/nic/ChannelLoadSampler.h"
#include "inet/physicallayer/ieee80211/packetlevel/Ieee80211Radio.h"
namespace artery
{
/**
* Specialised INET-based IEEE 802.11 radio for VANET communication.
*
* - emit RadioFrame signal on each incoming radio frame for CBR measurements
*/
class VanetRadio : public inet::physicallayer::Ieee80211Radio
{
public:
static const omnetpp::simsignal_t RadioFrameSignal;
protected:
void handleLowerPacket(inet::physicallayer::RadioFrame*) override;
};
} // namespace artery
#endif /* ARTERY_VANETRADIO_H_FNQDI1V8 */
|
/* $Id: road_widget.h 23600 2011-12-19 20:46:17Z truebrain $ */
/*
* 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 road_widget.h Types related to the road widgets. */
#ifndef WIDGETS_ROAD_WIDGET_H
#define WIDGETS_ROAD_WIDGET_H
/** Widgets of the #BuildRoadToolbarWindow class. */
enum RoadToolbarWidgets {
/* Name starts with RO instead of R, because of collision with RailToolbarWidgets */
WID_ROT_CAPTION, ///< Caption of the window
WID_ROT_ROAD_X, ///< Build road in x-direction.
WID_ROT_ROAD_Y, ///< Build road in y-direction.
WID_ROT_AUTOROAD, ///< Autorail.
WID_ROT_DEMOLISH, ///< Demolish.
WID_ROT_DEPOT, ///< Build depot.
WID_ROT_BUS_STATION, ///< Build bus station.
WID_ROT_TRUCK_STATION, ///< Build truck station.
WID_ROT_ONE_WAY, ///< Build one-way road.
WID_ROT_BUILD_BRIDGE, ///< Build bridge.
WID_ROT_BUILD_TUNNEL, ///< Build tunnel.
WID_ROT_REMOVE, ///< Remove road.
WID_ROT_CONVERT_ROAD, ///< Convert road.
};
/** Widgets of the #BuildRoadDepotWindow class. */
enum BuildRoadDepotWidgets {
/* Name starts with BRO instead of BR, because of collision with BuildRailDepotWidgets */
WID_BROD_CAPTION, ///< Caption of the window.
WID_BROD_DEPOT_NE, ///< Depot with NE entry.
WID_BROD_DEPOT_SE, ///< Depot with SE entry.
WID_BROD_DEPOT_SW, ///< Depot with SW entry.
WID_BROD_DEPOT_NW, ///< Depot with NW entry.
};
/** Widgets of the #BuildRoadStationWindow class. */
enum BuildRoadStationWidgets {
/* Name starts with BRO instead of BR, because of collision with BuildRailStationWidgets */
WID_BROS_CAPTION, ///< Caption of the window.
WID_BROS_BACKGROUND, ///< Background of the window.
WID_BROS_STATION_NE, ///< Terminal station with NE entry.
WID_BROS_STATION_SE, ///< Terminal station with SE entry.
WID_BROS_STATION_SW, ///< Terminal station with SW entry.
WID_BROS_STATION_NW, ///< Terminal station with NW entry.
WID_BROS_STATION_X, ///< Drive-through station in x-direction.
WID_BROS_STATION_Y, ///< Drive-through station in y-direction.
WID_BROS_LT_OFF, ///< Turn off area highlight.
WID_BROS_LT_ON, ///< Turn on area highlight.
WID_BROS_INFO, ///< Station acceptance info.
};
#endif /* WIDGETS_ROAD_WIDGET_H */
|
/* version.h
Copyright (C) 2017 Ferdinand Blomqvist
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
Written by Ferdinand Blomqvist. */
#ifndef FB_LIBLATTICE_VERSION_H
#define FB_LIBLATTICE_VERSION_H
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_PATCH 0
#define RELEASE_YEAR 2017
#define RELEASE_MONTH 7
#define RELEASE_DAY 18
#define PACKAGE_NAME "lattice-tools"
struct version
{
unsigned major;
unsigned minor;
unsigned patch;
};
extern const struct version g_current_version;
int print_version(FILE* file);
#endif /* FB_LIBLATTICE_VERSION_H */
|
/*
* Copyright (C) 2012 Red Hat, Inc.
*
* Authors: Steven Dake <sdake@redhat.com>
* Angus Salkeld <asalkeld@redhat.com>
*
* This file is part of pacemaker-cloud.
*
* pacemaker-cloud 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.
*
* pacemaker-cloud is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with pacemaker-cloud. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAPE_H_DEFINED
#define CAPE_H_DEFINED
#include <libssh2.h>
#include <qb/qblist.h>
#include <qb/qbmap.h>
#include <qb/qbutil.h>
#include <qb/qbloop.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "pcmk_pe.h"
/*
* Limits of the system
*/
#define ASSEMBLY_NAME_MAX 1024 /* Maximum assembly length in bytes */
#define RESOURCE_NAME_MAX 1024 /* Maximum resource length in bytes */
#define COMMAND_MAX 32000 /* Maximum command length in bytes */
#define METHOD_NAME_MAX 20 /* Maximum method name in bytes */
#define OP_NAME_MAX 15 /* Maximum interval length in bytes */
#define RESOURCE_COMMAND_MAX 4096 /* Command maximum */
#define RESOURCE_ENVIRONMENT_MAX 2048 /* Maximum environment allowed */
/*
* Timers of the system
*/
#define KEEPALIVE_TIMEOUT 15 /* seconds */
#define SSH_TIMEOUT 5000 /* milliseconds */
#define PENDING_TIMEOUT 250 /* milliseconds */
#define HEALTHCHECK_TIMEOUT 3000 /* milliseconds */
#define OCF_ROOT "/usr/lib/ocf" /* OCF root directory */
struct application {
char *name;
char *uuid;
qb_map_t *node_map;
};
enum recover_state {
RECOVER_STATE_UNKNOWN,
RECOVER_STATE_RUNNING,
RECOVER_STATE_FAILED,
RECOVER_STATE_STOPPED,
RECOVER_STATE_UNRECOVERABLE,
};
#define NODE_NUM_STATES 3 /* only the first 3 states used by matahari.cpp */
typedef void (*recover_restart_fn_t)(void* inst);
typedef void (*recover_escalate_fn_t)(void* inst);
typedef void (*recover_state_changing_fn_t)(void* inst,
enum recover_state from,
enum recover_state to);
struct recover {
void * instance;
enum recover_state state;
int num_failures;
int failure_period;
qb_util_stopwatch_t *sw;
recover_restart_fn_t restart;
recover_escalate_fn_t escalate;
recover_state_changing_fn_t state_changing;
};
void recover_init(struct recover* r,
const char * escalation_failures,
const char * escalation_period,
recover_restart_fn_t recover_restart_fn,
recover_escalate_fn_t recover_escalate_fn,
recover_state_changing_fn_t recover_state_changing_fn);
void recover_state_set(struct recover* r, enum recover_state state);
struct assembly {
char *name;
char *uuid;
char *address;
char instance_id[64];
char image_id[64];
struct application *application;
qb_map_t *resource_map;
int fd;
void *transport;
qb_util_stopwatch_t *sw_instance_create;
qb_util_stopwatch_t *sw_instance_connected;
struct recover recover;
};
struct reference_param {
char *name;
char *assembly;
char *parameter;
xmlNode *xmlnode;
};
struct resource {
char *name;
char *type;
char *rclass;
char *rprovider;
struct assembly *assembly;
struct pe_operation *monitor_op;
qb_loop_timer_handle monitor_timer;
struct recover recover;
qb_map_t *ref_params_map;
};
void resource_action_completed(struct pe_operation *op, enum ocf_exitcode rc);
void cape_init(int debug);
int cape_load(const char * name);
void cape_load_from_buffer(const char *buffer);
int32_t cape_admin_init(void);
void cape_admin_event_send(const char *app,
struct assembly *a,
struct resource *r,
const char *state,
const char *reason);
void cape_admin_fini(void);
int32_t instance_create(struct assembly *assembly);
int instance_destroy(struct assembly *assembly);
void cape_exit(void);
#ifdef __cplusplus
}
#endif
#endif /* CAPE_H_DEFINED */
|
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/pthread.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( AIX_ONCE_INIT_1_CHECK )
#define PTHREAD_ONCE_INIT \
{{ \
#endif /* AIX_ONCE_INIT_1_CHECK */
#if defined( AIX_ONCE_INIT_2_CHECK )
0 \
}}
#endif /* AIX_ONCE_INIT_2_CHECK */
#if defined( AIX_PTHREAD_CHECK )
#define PTHREAD_MUTEX_INITIALIZER \
{...init stuff...}
#endif /* AIX_PTHREAD_CHECK */
#if defined( GLIBC_MUTEX_INIT_CHECK )
#define PTHREAD_MUTEX_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0 } }
#ifdef __USE_GNU
# if __WORDSIZE == 64
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } }
# else
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
{ { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } }
# endif
#endif
# if __WORDSIZE == 64
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
# else
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0 } }
# endif
# ifdef __USE_GNU
# if __WORDSIZE == 64
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
# else
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
# endif
# endif
#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
#endif /* GLIBC_MUTEX_INIT_CHECK */
#if defined( PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK )
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
#if defined( SOLARIS_MUTEX_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, 0}
#else
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, {0}}
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* DEFAULTCV */
#else
#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}} /* DEFAULTCV */
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
{{0, 0, 0, DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}
#else
#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
{{0, 0, 0, DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, {0}}
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \
{{{0, 0, 0, 0}, DEFAULT_TYPE, _COND_MAGIC}, 0}
#else
#define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \
{{{0, 0, 0, 0}, DEFAULT_TYPE, _COND_MAGIC}, {0}}
#endif
#endif /* SOLARIS_MUTEX_INIT_2_CHECK */
#if defined( SOLARIS_RWLOCK_INIT_1_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_RWLOCK_INITIALIZER {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
#else
#define PTHREAD_RWLOCK_INITIALIZER {0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}
#endif
#endif /* SOLARIS_RWLOCK_INIT_1_CHECK */
#if defined( SOLARIS_ONCE_INIT_1_CHECK )
#pragma ident "@(#)pthread.h 1.37 04/09/28 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_ONCE_INIT {{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
#else
#define PTHREAD_ONCE_INIT {{{0}, {0}, {0}, {PTHREAD_ONCE_NOTDONE}}}
#endif
#endif /* SOLARIS_ONCE_INIT_1_CHECK */
#if defined( SOLARIS_ONCE_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_ONCE_INIT {{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
#else
#define PTHREAD_ONCE_INIT {{{0}, {0}, {0}, {PTHREAD_ONCE_NOTDONE}}}
#endif
#endif /* SOLARIS_ONCE_INIT_2_CHECK */
#if defined( THREAD_KEYWORD_CHECK )
extern int pthread_create (pthread_t *__restrict __thr,
extern int pthread_kill (pthread_t __thr, int __signo);
extern int pthread_cancel (pthread_t __thr);
#endif /* THREAD_KEYWORD_CHECK */
|
/*************************************************************************
*
* Copyright 2005, Huawei Technologies Co. Ltd.
* ALL RIGHTS RESERVED
*
*-----------------------------------------------------------------------*
*
* if_sh_ipv6.h
*
* Project Code: VISP1.5
* Module Name: IFNET
* Date Created: 2003/12/23
* Author: Sachin
* Description: To avoid direct call to different component functions ,
shell functions are moved to ifnet
*
*-----------------------------------------------------------------------*
* Modification History
* DATE NAME DESCRIPTION
* 2003/12/23 Sachin Create File
* 2006/03/30 liai Adjust for D00654
* 2006/04/21 liai Adjust for D00878
*
************************************************************************/
#ifndef _IF_SH_IPV6_H_
#define _IF_SH_IPV6_H_
#ifdef __cplusplus
extern "C"{
#endif
VOID IP6_ND_SH_PhyUpDownNotify(IFNET_S *pIf,ULONG ulCmd,CHAR * pData);
VOID IP6_ND_SH_ShutDownNotify(ULONG ulIfIndex);
VOID IP6_ND_SH_UpDownNotify(IFNET_S *pIf,ULONG ulCmd,CHAR * pData);
VOID IP6_SH_ND_LLAddrNotify(IFNET_S *pstIf, CHAR * pData );
ULONG IP6_SH_ND_GetVlinkStatus();
ULONG IP6_Addr_SH_PhyUpDownNotify(IFNET_S *pstIf, ULONG ulCmd, CHAR *pcData);
ULONG IP6_Addr_SH_LLC_Notify(IFNET_S *pstIf, ULONG ulCmd, CHAR *pcData);
ULONG IP6_SH_IF_Attach( IFNET_S *pstIf );
ULONG IP6_SH_IF_Detach( IFNET_S *pstIf );
VOID IP6_SH_IF_GetIPv6ComIntVtbl();
ULONG IP6_SH_Addr_IF_HaveIp6Addr(IFNET_S * pstIf);
/* Added by fengjing physicalµØÖ··¢Éú¸Ä±ä£¬²»Ï·¢DOWN */
#define IP6_IS_MAC_CHANGE 1
#define IP6_IS_NOT_MAC_CHANGE 0
extern ULONG g_ulMacChangedIpv6Statewitch;
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef QGSSYMBOLV2SELECTORDIALOG_H
#define QGSSYMBOLV2SELECTORDIALOG_H
#include <QDialog>
#include "ui_qgssymbolv2selectordialogbase.h"
class QgsStyleV2;
class QgsSymbolV2;
class QMenu;
class GUI_EXPORT QgsSymbolV2SelectorDialog : public QDialog, private Ui::QgsSymbolV2SelectorDialogBase
{
Q_OBJECT
public:
QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, QWidget* parent = NULL, bool embedded = false );
//! return menu for "advanced" button - create it if doesn't exist and show the advanced button
QMenu* advancedMenu();
protected:
void populateSymbolView();
void updateSymbolPreview();
void updateSymbolColor();
void updateSymbolInfo();
//! Reimplements dialog keyPress event so we can ignore it
void keyPressEvent( QKeyEvent * event );
private:
/**Displays alpha value as transparency in mTransparencyLabel*/
void displayTransparency( double alpha );
public slots:
void changeSymbolProperties();
void setSymbolFromStyle( const QModelIndex & index );
void setSymbolColor();
void setMarkerAngle( double angle );
void setMarkerSize( double size );
void setLineWidth( double width );
void addSymbolToStyle();
void on_mSymbolUnitComboBox_currentIndexChanged( const QString & text );
void on_mTransparencySlider_valueChanged( int value );
signals:
void symbolModified();
protected:
QgsStyleV2* mStyle;
QgsSymbolV2* mSymbol;
QMenu* mAdvancedMenu;
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.