text stringlengths 4 6.14k |
|---|
#pragma once
#include <string>
#include <cstdint>
namespace EightBit {
class ProfileLineEventArgs
{
private:
int m_address;
std::string m_source;
uint64_t m_cycles;
public:
ProfileLineEventArgs(int address, std::string source, uint64_t cycles)
: m_address(address), m_source(source), m_cycles(cycles) {}
int address() const { return m_address; }
const std::string& source() const { return m_source; }
uint64_t cycles() const { return m_cycles; }
};
} |
/*
* Simple CAD System
*
* Copyright (C) 2010 Artemy Kolesnikov <artemy.kolesnikov@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, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef CUT_ACTION_HEADER
#define CUT_ACTION_HEADER
#include <TopoDS_Shape.hxx>
#include <QObject>
#include "boolean.h"
namespace Action
{
class Cut : public Boolean
{
public:
Cut(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2);
virtual QString getName() const
{
return QObject::tr("Fillet");
}
protected:
virtual TopoDS_Shape execute(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2) const;
};
}
#endif // CUT_ACTION_HEADER
|
/* BGP carrying Label information
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of GNU Zebra.
*
* GNU Zebra is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _BGP_LABEL_H
#define _BGP_LABEL_H
#define BGP_LABEL_BYTES 3
#define BGP_LABEL_BITS 24
#define BGP_WITHDRAW_LABEL 0x800000
struct bgp_node;
struct bgp_info;
struct peer;
extern void bgp_reg_dereg_for_label (struct bgp_node *rn, struct bgp_info *ri,
int reg);
extern int bgp_parse_fec_update(void);
extern u_char * bgp_adv_label(struct bgp_node *rn, struct bgp_info *ri,
struct peer *to, afi_t afi, safi_t safi);
extern int bgp_nlri_parse_label (struct peer *peer, struct attr *attr,
struct bgp_nlri *packet);
static inline int
bgp_labeled_safi (safi_t safi)
{
if ((safi == SAFI_LABELED_UNICAST) || (safi == SAFI_MPLS_VPN))
return 1;
return 0;
}
static inline int
bgp_is_withdraw_label (u_char *pkt)
{
if ((pkt[0] == 0x80) && (pkt[1] == 0x00) && (pkt[2] == 0x00))
return 1;
return 0;
}
static inline u_char *
bgp_encode_withdraw_label (u_char *pkt)
{
*pkt++ = 0x80; *pkt++ = 0x00; *pkt++ = 0x00;
return pkt;
}
static inline int
bgp_is_valid_label (u_char *t)
{
if (!t)
return 0;
return (t[2] & 0x02);
}
static inline void
bgp_set_valid_label (u_char *t)
{
if (t)
t[2] |= 0x02;
}
static inline void
bgp_unset_valid_label (u_char *t)
{
if (t)
t[2] &= ~0x02;
}
static inline void
bgp_register_for_label (struct bgp_node *rn, struct bgp_info *ri)
{
bgp_reg_dereg_for_label (rn, ri, 1);
}
static inline void
bgp_unregister_for_label (struct bgp_node *rn)
{
bgp_reg_dereg_for_label (rn, NULL, 0);
}
/* Label stream to value */
static inline u_int32_t
label_pton (u_char t[])
{
return ((((unsigned int) t[0]) << 12) | (((unsigned int) t[1]) << 4) |
((unsigned int) ((t[2] & 0xF0) >> 4)));
}
/* Encode label values */
static inline void
label_ntop (u_int32_t l, int bos, u_char t[])
{
t[0] = ((l & 0x000FF000) >> 12);
t[1] = ((l & 0x00000FF0) >> 4);
t[2] = ((l & 0x0000000F) << 4);
if (bos)
t[2] |= 0x01;
}
/* Return BOS value of label stream */
static inline u_char
label_bos (u_char t[])
{
return (t[2] & 0x01);
};
#endif /* _BGP_LABEL_H */
|
// ==================================================
// Copyright (C) 2006 Intel Corporation
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// 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.
//
/**
* @file FindDialogImpl.h
*/
#ifndef FINDDIALOGIMPL_H
#define FINDDIALOGIMPL_H
// Dreams includes.
#include "dDB/DralDBSyntax.h"
#include "dDB/DRALTag.h"
#include "dDB/ClockDomainMgr.h"
#include "dialogs/find/FindDialog.h"
#include "DreamsDefs.h"
#include "TagValueType.h"
// Class forwarding.
class DralDB;
class DreamsDB;
class DAvtView;
class DisDockWin;
/**
* Short desc.
* Long desc.
*
* @author Federico Ardanaz
* Santiago Galan
* @date started at 2002-11-21
* @date revisioned at 2004-07-14
* @version 0.2
*/
class FindDialogImpl : public FindDialog
{
Q_OBJECT
public:
FindDialogImpl(DreamsDB * _dreamsdb, DAvtView * avt, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0);
~FindDialogImpl();
void aboutToFind();
public:
void find_next();
bool hadSucessFullSearch();
public slots:
void knownTagsClicked(void);
void findClicked(void);
void cancelClicked(void);
void tagNameTextChanged(const QString&);
void reToggled(bool);
protected:
virtual void doFind(QString str, TAG_ID tagId, TagValueType tgtype, CYCLE startCycle, bool resetSearch = false) = 0;
protected:
DralDB * draldb; ///< Pointer to the database.
DreamsDB * dreamsdb; ///< Pointer to the trace.
DAvtView * myAvt; ///< Pointer to the avt.
DisDockWin * disWin; ///< Pointer to the disasembly window.
bool sucessFullSearch;
TAG_ID lastTagId; ///< Last tag id that was searched.
TagValueType lastTagValueType; ///< Type of the last tag id searched.
QString lastValue;
CYCLE lastCycle;
bool lastCS;
bool lastEM;
bool lastRE;
};
#endif
|
//
// hyundai.h
//
// Copyright 2012, 2013 by John Pietrzak (jpietrzak8@gmail.com)
//
// This file is part of Pierogi.
//
// Pierogi 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.
//
// Pierogi 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 HYUNDAI_H
#define HYUNDAI_H
#include "pirkeysetmetadata.h"
class QObject;
class HyundaiDVD1: public PIRKeysetMetaData
{
public:
HyundaiDVD1(
unsigned int index);
virtual void populateProtocol(
QObject *guiObject);
};
class HyundaiAudio1: public PIRKeysetMetaData
{
public:
HyundaiAudio1(
unsigned int index);
virtual void populateProtocol(
QObject *guiObject);
};
class HyundaiTV1: public PIRKeysetMetaData
{
public:
HyundaiTV1(
unsigned int index);
virtual void populateProtocol(
QObject *guiObject);
};
#endif // HYUNDAI_H
|
/* ---------------------------------------------------------------------------
TEMPLATE.c : template for creating library sources
Copyright (C) 2005, Raphael Neider <rneider AT web.de>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2.1, or (at your option) any
later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
|
/* cpo_file file */
#include <fcntl.h>
#include "cpo_file.h"
#ifdef _WIN32
#include <io.h>
#endif
int cpo_file_open(const char *filename, int flags)
{
#ifdef _WIN32
int fd = _open(filename, O_RDONLY, _O_RANDOM | _O_SEQUENTIAL);
_setmode( fd, _O_BINARY);
#else
int fd = open(filename, O_RDONLY | O_NONBLOCK | flags, 0644);
#endif
return fd;
}
|
/*
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
*
* Copyright (c) 2003-2016 ircd-hybrid development team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
/*! \file userhost.h
* \brief A header for global user limits.
* \version $Id$
*/
#ifndef INCLUDED_userhost_h
#define INCLUDED_userhost_h
struct NameHost
{
dlink_node node; /* Point to other names on this hostname */
char name[USERLEN + 1];
unsigned int icount; /* Number of =local= identd on this name*/
unsigned int gcount; /* Global user count on this name */
unsigned int lcount; /* Local user count on this name */
};
struct UserHost
{
dlink_list list; /* List of names on this hostname */
struct UserHost *next;
char host[HOSTLEN + 1];
};
extern void userhost_init(void);
extern void userhost_count(const char *, const char *, unsigned int *, unsigned int *, unsigned int *);
extern void userhost_add(const char *, const char *, int);
extern void userhost_del(const char *, const char *, int);
#endif /* INCLUDED_userhost_h */
|
#ifndef COLOR_SYSTEM_H
#define COLOR_SYSTEM_H
/*
@brief systeme de coloration des log
*/
enum Color
{
};
class ColorToLevel
{
public:
ColorToLevel()
{
for(int i = LogLevel::MIN_LOG_LEVEL;i<LogLevel::MAX_LOG_LEVEL;i++)
{
_colorsMap.insert(std::make_pair(i,COLOR));
}
}
private:
std::map<LogLevel,Color> _colorsMap;
};
#endif
|
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <optional>
#include <vector>
#include "Common/CommonTypes.h"
class PointerWrap;
namespace DiscIO
{
struct Partition;
}
namespace DVDInterface
{
enum class ReplyType : u32;
}
namespace DiscIO
{
enum class Platform;
class Volume;
} // namespace DiscIO
namespace IOS
{
namespace ES
{
class TMDReader;
class TicketReader;
} // namespace ES
} // namespace IOS
namespace DVDThread
{
void Start();
void Stop();
void DoState(PointerWrap& p);
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
bool HasDisc();
bool IsEncryptedAndHashed();
DiscIO::Platform GetDiscType();
u64 PartitionOffsetToRawOffset(u64 offset, const DiscIO::Partition& partition);
IOS::ES::TMDReader GetTMD(const DiscIO::Partition& partition);
IOS::ES::TicketReader GetTicket(const DiscIO::Partition& partition);
bool IsInsertedDiscRunning();
// This function returns true and calls SConfig::SetRunningGameMetadata(Volume&, Partition&)
// if both of the following conditions are true:
// - A disc is inserted
// - The title_id argument doesn't contain a value, or its value matches the disc's title ID
bool UpdateRunningGameMetadata(const DiscIO::Partition& partition,
std::optional<u64> title_id = {});
void StartRead(u64 dvd_offset, u32 length, const DiscIO::Partition& partition,
DVDInterface::ReplyType reply_type, s64 ticks_until_completion);
void StartReadToEmulatedRAM(u32 output_address, u64 dvd_offset, u32 length,
const DiscIO::Partition& partition, DVDInterface::ReplyType reply_type,
s64 ticks_until_completion);
} // namespace DVDThread
|
/*
* linux/drivers/pcmcia/pxa2xx_palmld.c
*
* Driver for Palm LifeDrive PCMCIA
*
* Copyright (C) 2006 Alex Osborne <ato@meshy.org>
* Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <mach-pxa/palmld.h>
#include "soc_common.h"
static struct gpio palmld_pcmcia_gpios[] = {
{ GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" },
{ GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },
};
static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{
int ret;
ret = gpio_request_array(palmld_pcmcia_gpios,
ARRAY_SIZE(palmld_pcmcia_gpios));
skt->stat[SOC_STAT_RDY].gpio = GPIO_NR_PALMLD_PCMCIA_READY;
skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready";
return ret;
}
static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
{
gpio_free_array(palmld_pcmcia_gpios, ARRAY_SIZE(palmld_pcmcia_gpios));
}
static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
struct pcmcia_state *state)
{
state->detect = 1; /* always inserted */
state->vs_3v = 1;
state->vs_Xv = 0;
}
static int palmld_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
const socket_state_t *state)
{
gpio_set_value(GPIO_NR_PALMLD_PCMCIA_POWER, 1);
gpio_set_value(GPIO_NR_PALMLD_PCMCIA_RESET,
!!(state->flags & SS_RESET));
return 0;
}
static struct pcmcia_low_level palmld_pcmcia_ops = {
.owner = THIS_MODULE,
.first = 1,
.nr = 1,
.hw_init = palmld_pcmcia_hw_init,
.hw_shutdown = palmld_pcmcia_hw_shutdown,
.socket_state = palmld_pcmcia_socket_state,
.configure_socket = palmld_pcmcia_configure_socket,
};
static struct platform_device *palmld_pcmcia_device;
static int __init palmld_pcmcia_init(void)
{
int ret;
if (!machine_is_palmld())
return -ENODEV;
palmld_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
if (!palmld_pcmcia_device)
return -ENOMEM;
ret = platform_device_add_data(palmld_pcmcia_device, &palmld_pcmcia_ops,
sizeof(palmld_pcmcia_ops));
if (!ret)
ret = platform_device_add(palmld_pcmcia_device);
if (ret)
platform_device_put(palmld_pcmcia_device);
return ret;
}
static void __exit palmld_pcmcia_exit(void)
{
platform_device_unregister(palmld_pcmcia_device);
}
module_init(palmld_pcmcia_init);
module_exit(palmld_pcmcia_exit);
MODULE_AUTHOR("Alex Osborne <ato@meshy.org>,"
" Marek Vasut <marek.vasut@gmail.com>");
MODULE_DESCRIPTION("PCMCIA support for Palm LifeDrive");
MODULE_ALIAS("platform:pxa2xx-pcmcia");
MODULE_LICENSE("GPL");
|
/*
Copyright (C) 2003-2008 FreeIPMI 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, 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 _IPMI_SEL_CMDS_H
#define _IPMI_SEL_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SEL_GET_RECORD_ID_FIRST_ENTRY 0x0000
#define IPMI_SEL_GET_RECORD_ID_LAST_ENTRY 0xFFFF
#define IPMI_SEL_CLEAR_OPERATION_INITIATE_ERASE 0xAA
#define IPMI_SEL_CLEAR_OPERATION_GET_ERASURE_STATUS 0x0
#define IPMI_SEL_CLEAR_OPERATION_VALID(__val) \
(((__val) == IPMI_SEL_CLEAR_OPERATION_INITIATE_ERASE \
|| (__val) == IPMI_SEL_CLEAR_OPERATION_GET_ERASURE_STATUS) ? 1 : 0)
#define IPMI_SEL_CLEAR_ERASURE_IN_PROGRESS 0x0
#define IPMI_SEL_CLEAR_ERASE_COMPLETED 0x1
#define IPMI_SEL_READ_ENTIRE_RECORD_BYTES_TO_READ 0xFF
#define IPMI_AUXILIARY_LOG_TYPE_MCA 0x00
#define IPMI_AUXILIARY_LOG_TYPE_OEM1 0x01
#define IPMI_AUXILIARY_LOG_TYPE_OEM2 0x02
#define IPMI_AUXILIARY_LOG_TYPE_VALID(__val) \
(((__val) == IPMI_AUXILIARY_LOG_TYPE_MCA \
|| (__val) == IPMI_AUXILIARY_LOG_TYPE_OEM1 \
|| (__val) == IPMI_AUXILIARY_LOG_TYPE_OEM2) ? 1 : 0)
extern fiid_template_t tmpl_cmd_get_sel_info_rq;
extern fiid_template_t tmpl_cmd_get_sel_info_rs;
extern fiid_template_t tmpl_cmd_get_sel_allocation_info_rq;
extern fiid_template_t tmpl_cmd_get_sel_allocation_info_rs;
extern fiid_template_t tmpl_cmd_reserve_sel_rq;
extern fiid_template_t tmpl_cmd_reserve_sel_rs;
extern fiid_template_t tmpl_cmd_get_sel_entry_rq;
extern fiid_template_t tmpl_cmd_get_sel_entry_rs;
extern fiid_template_t tmpl_cmd_delete_sel_entry_rq;
extern fiid_template_t tmpl_cmd_delete_sel_entry_rs;
extern fiid_template_t tmpl_cmd_clear_sel_rq;
extern fiid_template_t tmpl_cmd_clear_sel_rs;
extern fiid_template_t tmpl_cmd_get_sel_time_rq;
extern fiid_template_t tmpl_cmd_get_sel_time_rs;
extern fiid_template_t tmpl_cmd_set_sel_time_rq;
extern fiid_template_t tmpl_cmd_set_sel_time_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_rq;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_mca_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_oem_rs;
extern fiid_template_t tmpl_cmd_set_auxiliary_log_status_rq;
extern fiid_template_t tmpl_cmd_set_auxiliary_log_status_rs;
int8_t fill_cmd_get_sel_info (fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_get_sel_allocation_info (fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_reserve_sel (fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_get_sel_entry (uint16_t reservation_id,
uint16_t record_id,
uint8_t offset_into_record,
uint8_t bytes_to_read,
fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_delete_sel_entry (uint16_t reservation_id,
uint16_t record_id,
fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_clear_sel (uint16_t reservation_id,
uint8_t operation,
fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_get_sel_time (fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_set_sel_time (uint32_t time, fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_get_auxiliary_log_status (uint8_t log_type,
fiid_obj_t obj_cmd_rq);
int8_t fill_cmd_set_auxiliary_log_status (uint8_t log_type,
uint8_t *log_data,
uint8_t log_data_len,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif
|
/* ----------------------------------------------------------------------
LIGGGHTS - LAMMPS Improved for General Granular and Granular Heat
Transfer Simulations
www.liggghts.com | www.cfdem.com
Christoph Kloss, christoph.kloss@cfdem.com
LIGGGHTS is based on LAMMPS
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef DUMP_CLASS
DumpStyle(mesh/gran/VTK,DumpMesh)
#else
#ifndef LMP_DUMP_MESH_H
#define LMP_DUMP_MESH_H
#include "dump.h"
#include "stl_tri.h"
enum{
DUMP_STRESS = 1,
DUMP_ID = 2,
DUMP_WEAR = 4,
DUMP_VEL = 8,
DUMP_STRESSCOMPONENTS = 16,
};
namespace LAMMPS_NS {
class DumpMesh : public Dump {
public:
DumpMesh(LAMMPS *, int, char**);
~DumpMesh();
void init();
private:
STLtri** STLList;
int STLList_len;
char **meshid;
int meshid_len;
int dump_what;
char *columns; // column labels
int lasttimestep;
int modify_param(int, char **);
void write_header(int);
int count();
int pack();
void write_data(int, double *);
typedef void (DumpMesh::*FnPtrHeader)(int);
FnPtrHeader header_choice; // ptr to write header functions
void header_item(int);
void footer_item();
typedef int (DumpMesh::*FnPtrPack)();
FnPtrPack pack_choice; // ptr to pack functions
int pack_item();
typedef void (DumpMesh::*FnPtrData)(int, double *);
FnPtrData write_choice; // ptr to write data functions
void write_item(int, double *);
};
}
#endif
#endif
|
#include <stdio.h>
#include <setjmp.h>
jmp_buf env;
int div(int a, int b)
{
if ( b == 0 )
longjmp(env, 1);
return a / b;
}
int wuliao( void )
{
printf("input:");
int i;
scanf("%d", &i);
if ( i == 0 )
longjmp(env, 2);
}
int main( void )
{
int ret;
//setjmp将环境信息保存到全局变量env中,如果是第一次调用返回0,以后当遇到longjmp时,跳转到setjmp这里,并且会使setjmp的返回值为longjmp的第二个参数的值
if ( (ret=setjmp(env)) == 0) {
div(2, 1);
wuliao();
printf("正常执行结束!\n");
} else if ( ret == 1) {
printf("除数不能为0!\n");
} else if ( ret == 2) {
printf("太无聊!\n");
}
}
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* matecomponent-selector-widget.h: MateComponent Component Selector
*
* Author:
* Michael Meeks (michael@helixcode.com)
*
* Copyright 2000 Helix Code, Inc.
*/
#ifndef MATECOMPONENT_SELECTOR_WIDGET_H
#define MATECOMPONENT_SELECTOR_WIDGET_H
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MATECOMPONENT_TYPE_SELECTOR_WIDGET (matecomponent_selector_widget_get_type ())
#define MATECOMPONENT_SELECTOR_WIDGET(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, matecomponent_selector_widget_get_type (), MateComponentSelectorWidget)
#define MATECOMPONENT_SELECTOR_WIDGET_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, matecomponent_selector_widget_get_type (), MateComponentSelectorWidgetClass)
#define MATECOMPONENT_IS_SELECTOR_WIDGET(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, matecomponent_selector_widget_get_type ())
typedef struct _MateComponentSelectorWidgetPrivate MateComponentSelectorWidgetPrivate;
typedef struct {
GtkVBox parent;
MateComponentSelectorWidgetPrivate *priv;
} MateComponentSelectorWidget;
typedef struct {
GtkVBoxClass parent_class;
/* Virtual methods */
gchar *(* get_id) (MateComponentSelectorWidget *sel);
gchar *(* get_name) (MateComponentSelectorWidget *sel);
gchar *(* get_description) (MateComponentSelectorWidget *sel);
void (* set_interfaces) (MateComponentSelectorWidget *sel,
const gchar **interfaces);
/* User select */
void (* final_select) (MateComponentSelectorWidget *sel);
gpointer dummy[2];
} MateComponentSelectorWidgetClass;
GType matecomponent_selector_widget_get_type (void) G_GNUC_CONST;
GtkWidget *matecomponent_selector_widget_new (void);
void matecomponent_selector_widget_set_interfaces (MateComponentSelectorWidget *sel,
const gchar **interfaces_required);
gchar *matecomponent_selector_widget_get_id (MateComponentSelectorWidget *sel);
gchar *matecomponent_selector_widget_get_name (MateComponentSelectorWidget *sel);
gchar *matecomponent_selector_widget_get_description (MateComponentSelectorWidget *sel);
#ifdef __cplusplus
}
#endif
#endif /* MATECOMPONENT_SELECTOR_H */
|
#include "config.h"
#include <vdr/plugin.h>
bool cNoepgChannelID::NoEpgForceEval = false;
cMutex cNoepgChannelID::NoEpgMutex;
cConfig<cNoepgChannelID> cNoepgChannelID::NoEpgChannels;
cNoepgChannelID::cNoepgChannelID(void)
:mode(enemUnknown)
,id(tChannelID::InvalidID)
,comment(NULL)
{
}
cNoepgChannelID::cNoepgChannelID(eNoEpgMode Mode, tChannelID Id, cString *Comment)
:mode(Mode)
,id(Id)
,comment(Comment)
{
}
cNoepgChannelID::~cNoepgChannelID(void)
{
if (comment != NULL) {
delete comment;
comment = NULL;
}
}
bool cNoepgChannelID::Parse(const char *s)
{
comment = NULL;
if (strncmp(s, "mode=w", 6) == 0) {
mode = enemWhitelist;
return true;
}
if (strncmp(s, "mode=b", 6) == 0) {
mode = enemBlacklist;
return true;
}
// allow comments after first space
int spos = 0;
int slen = strlen(s);
while ((spos < slen) && (s[spos] != ' '))
spos++;
if (spos < slen) {
char *tmp = new char[spos + 1];
memcpy(tmp, s, spos);
tmp[spos] = 0;
id = tChannelID::FromString(tmp);
delete tmp;
tmp = skipspace(s + spos);
if ((tmp != NULL) && (strlen(tmp) > 0)) {
if ((strlen(tmp) <= 3) || !startswith(tmp, "//="))
comment = new cString(tmp);
}
}
else
id = tChannelID::FromString(s);
return id.Valid();
}
bool cNoepgChannelID::Save(FILE *f)
{
if (id.Valid()) {
if (comment == NULL) {
cChannel *c = Channels.GetByChannelID(id);
if (c != NULL)
return fprintf(f, "%s //= %s\n", *id.ToString(), c->Name()) > 0;
return fprintf(f, "%s\n", *id.ToString()) > 0;
}
return fprintf(f, "%s %s\n", *id.ToString(), **comment) > 0;
}
if (mode == enemWhitelist)
return fprintf(f, "mode=whitelist\n") > 0;
if (mode == enemBlacklist)
return fprintf(f, "mode=blacklist\n") > 0;
return false;
}
static cMutex sFileMutex;
bool cNoepgChannelID::ReadConfig(cConfig<cNoepgChannelID> &Config, cMutex *Mutex)
{
cMutexLock filelock(&sFileMutex);
cMutexLock lock(Mutex);
cString filename = cString::sprintf("%s/settings.conf", cPlugin::ConfigDirectory("noepg"));
return Config.Load(*filename, true, true);
}
bool cNoepgChannelID::SaveConfig(cConfig<cNoepgChannelID> &Config, cMutex *Mutex)
{
cMutexLock filelock(&sFileMutex);
cMutexLock lock(Mutex);
return Config.Save();
}
|
enum {
_DUMMY_ELEMENT_
}; |
/*
* Copyright (c) 2002, Intel Corporation. All rights reserved.
* Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
Test that sigdelset() will remove signo to the set signal set.
Test steps:
1) Initialize an empty or full signal set.
--> if argv[1] = 0, empty
--> if argv[1] = 1, full
2) Add the SIGALRM signal to the empty signal set.
3) Verify that SIGALRM is a member of the signal set.
4) Remove the SIGALRM signal from the signal set.
5) Verify that SIGALRM is not a member of the signal set.
*/
#include <stdio.h>
#include <signal.h>
#include "posixtest.h"
int main(int argc, char *argv[])
{
sigset_t signalset;
if (argc < 2) {
printf("Usage: %s [0|1]\n", argv[0]);
return PTS_UNRESOLVED;
}
if ('0' == argv[1][0]) {
if (sigemptyset(&signalset) == -1) {
perror("sigemptyset failed -- test aborted");
return PTS_UNRESOLVED;
}
} else if ('1' == argv[1][0]) {
if (sigfillset(&signalset) == -1) {
perror("sigfillset failed -- test aborted");
return PTS_UNRESOLVED;
}
} else {
printf("Usage: %s [0|1]\n", argv[0]);
return PTS_UNRESOLVED;
}
if (sigaddset(&signalset, SIGALRM) == 0) {
if (sigismember(&signalset, SIGALRM) == 0) {
printf("sigaddset returned, sigismember failed\n");
return PTS_UNRESOLVED;
}
} else {
printf("sigaddset did not successfully add signal\n");
return PTS_UNRESOLVED;
}
if (sigdelset(&signalset, SIGALRM) == 0) {
if (sigismember(&signalset, SIGALRM) == 0) {
printf("sigdelset successfully removed signal\n");
return PTS_PASS;
} else {
printf("Signal is still in signal set.\n");
return PTS_FAIL;
}
} else {
printf("sigdelset() failed\n");
return PTS_FAIL;
}
}
|
#include <asm-arm/div64.h>
|
#ifndef PROFILE_NETNODE_H
#define PROFILE_NETNODE_H
#include "netnode.h"
class AProfile;
class ProfileNetNode : public ANetNode{
Q_OBJECT
public:
ProfileNetNode();
virtual ~ProfileNetNode();
virtual const QString pixmapName()
{ return "Devices/commprofile"; }
virtual const QString nodeDescription() ;
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char ** provides( void );
private:
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
};
extern "C"
{
void create_plugin( QList<ANetNode> & PNN );
};
#endif
|
/*
NSCIImageRep.h
Application Kit
Copyright (c) 2003-2009, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSImageRep.h>
#import <AppKit/NSGraphics.h>
#import <QuartzCore/CIImage.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@class NSBitmapImageRep;
@interface NSCIImageRep : NSImageRep
{
CIImage *_ciImage;
}
+ (id)imageRepWithCIImage:(CIImage *)image;
- (id)initWithCIImage:(CIImage *)image;
- (CIImage *)CIImage;
@end
@interface CIImage (NSAppKitAdditions)
- (id)initWithBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep;
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
@end
#endif
|
/*
* Copyright (C) 1996-2015 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
* DEBUG: section 76 Internal Squid Object handling
* AUTHOR: Duane, Alex, Henrik
*/
#ifndef SQUID_INTERNAL_H_
#define SQUID_INTERNAL_H_
#include "comm/forward.h"
class HttpRequest;
class SBuf;
class StoreEntry;
void internalStart(const Comm::ConnectionPointer &clientConn, HttpRequest *, StoreEntry *);
bool internalCheck(const SBuf &urlPath);
bool internalStaticCheck(const SBuf &urlPath);
char *internalLocalUri(const char *dir, const SBuf &name);
char *internalRemoteUri(const char *, unsigned short, const char *, const SBuf &);
const char *internalHostname(void);
int internalHostnameIs(const char *);
#endif /* SQUID_INTERNAL_H_ */
|
// Copyleft 2005 Chris Korda
// 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.
/*
chris korda
revision history:
rev date comments
00 31aug05 initial version
01 03may06 add selection range and export
02 28jan08 support Unicode
snapshot movie player
*/
#if !defined(AFX_MOVIEPLAYERDLG_H__DAD756C5_689F_44EE_82E7_00382AFA01DE__INCLUDED_)
#define AFX_MOVIEPLAYERDLG_H__DAD756C5_689F_44EE_82E7_00382AFA01DE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MoviePlayerDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMoviePlayerDlg dialog
#include "SnapMovie.h"
#include "ClickSliderCtrl.h"
#include "PersistDlg.h"
class CMainFrame;
class CMoviePlayerDlg : public CPersistDlg
{
DECLARE_DYNAMIC(CMoviePlayerDlg);
// Construction
public:
CMoviePlayerDlg(CWnd* pParent = NULL); // standard constructor
// Constants
enum { // transport states
STOP,
PAUSE,
PLAY
};
// Attributes
void SetTransport(int State);
int GetTransport() const;
bool IsOpen() const;
void Hide(bool Enable);
bool IsHidden() const;
void SetLoop(bool Enable);
bool IsLooped() const;
void SetRange(int In, int Out);
void GetRange(int& In, int& Out) const;
bool HasRange() const;
void ClearRange();
// Operations
bool Open(LPCTSTR Path);
void Seek(int Frame);
void FullScreen(bool Enable);
static bool Play(LPCTSTR Path);
static bool Play();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMoviePlayerDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Dialog Data
//{{AFX_DATA(CMoviePlayerDlg)
enum { IDD = IDD_MOVIE_PLAYER };
CButton m_GotoEnd;
CButton m_GotoStart;
CButton m_SetOut;
CButton m_SetIn;
CButton m_TakeSnap;
CButton m_Open;
CButton m_Save;
CStatic m_Time;
CClickSliderCtrl m_Pos;
CButton m_Loop;
CButton m_Stop;
CButton m_Play;
CButton m_Pause;
//}}AFX_DATA
// Generated message map functions
//{{AFX_MSG(CMoviePlayerDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
afx_msg void OnPause();
afx_msg void OnPlay();
afx_msg void OnStop();
afx_msg void OnLoop();
afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnSave();
afx_msg void OnOpen();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg void OnTakeSnap();
afx_msg void OnSetIn();
afx_msg void OnSetOut();
afx_msg void OnGotoStart();
afx_msg void OnGotoEnd();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// Constants
enum {
TIMER_ID = 1
};
// Member data
CSnapMovie m_Movie; // snapshot movie container
CMainFrame *m_Frm; // pointer to main frame window
CString m_Path; // path of currently open movie file
CString m_Caption; // dialog's original caption, from resource
int m_Transport; // transport state: see enum above
int m_Timer; // if non-zero, our timer instance
int m_Period; // timer period, in milliseconds
bool m_IsFullScreen; // true if we're full-screen
bool m_Hidden; // true if dialog has window size of zero
CRect m_InitRect; // initial window rect for restoring size
int m_RangeIn; // selection range first frame, or -1 if no range
int m_RangeOut; // selection range last frame, or -1 if no range
// Helpers
void EnableTimer(int Period);
void SetTitle();
void UpdatePos();
};
inline bool CMoviePlayerDlg::IsOpen() const
{
return(m_Movie.IsOpen());
}
inline bool CMoviePlayerDlg::IsHidden() const
{
return(m_Hidden);
}
inline int CMoviePlayerDlg::GetTransport() const
{
return(m_Transport);
}
inline bool CMoviePlayerDlg::IsLooped() const
{
return(m_Loop.GetCheck() != 0);
}
inline void CMoviePlayerDlg::GetRange(int& In, int& Out) const
{
In = m_RangeIn;
Out = m_RangeOut;
}
inline bool CMoviePlayerDlg::HasRange() const
{
return(m_RangeIn >= 0 && m_RangeOut >= 0);
}
inline void CMoviePlayerDlg::ClearRange()
{
SetRange(-1, -1);
}
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MOVIEPLAYERDLG_H__DAD756C5_689F_44EE_82E7_00382AFA01DE__INCLUDED_)
|
/*
* This file is part of the apvlv package
* Copyright (C) <2010> <Alf>
*
* Contact: Alf <naihe2010@126.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.
*
*/
/* @CPPFILE ApvlvPdf.h
*
* Author: Alf <naihe2010@126.com>
*/
/* @date Created: 2011/09/16 13:50:04 Alf*/
#ifndef _APVLV_PDF_H_
#define _APVLV_PDF_H_
#include "ApvlvFile.h"
namespace apvlv
{
class ApvlvPDF : public ApvlvFile
{
public:
explicit ApvlvPDF (const char *filename, bool check = true);
~ApvlvPDF () override;
bool writefile (const char *filename) override;
bool pagesize (int page, int rot, double *x, double *y) override;
int pagesum () override;
bool pagetext (int pn, gdouble x1, gdouble y1, gdouble x2, gdouble y2,
char **out) override;
bool render (int, int, int, double, int, GdkPixbuf *, char *) override;
bool annot_underline (int, gdouble, gdouble, gdouble, gdouble) override;
bool annot_text (int, gdouble, gdouble, gdouble, gdouble,
const char *text) override;
bool annot_update (int pn, ApvlvAnnotText *text) override;
bool pageselectsearch (int, int, int, double, int, GdkPixbuf *, char *, int,
ApvlvPoses *) override;
ApvlvPoses *pagesearch (int pn, const char *s, bool reverse) override;
ApvlvAnnotTexts getAnnotTexts (int pn) override;
ApvlvLinks *getlinks (int pn) override;
ApvlvFileIndex *new_index () override;
void free_index (ApvlvFileIndex *) override;
bool pageprint (int pn, cairo_t *cr) override;
private:
bool walk_poppler_index_iter (ApvlvFileIndex *root_index,
PopplerIndexIter *iter);
PopplerDocument *mDoc;
};
}
#endif
/* Local Variables: */
/* mode: c++ */
/* End: */
|
/*
* \brief Iguana API functions needed by OKLinux
* \author Norman Feske
* \date 2009-04-12
*
* This file contains function definitions to create/destroy address spaces,
* threads within other address spaces and to populate the address spaces
* with pages.
*/
/*
* Copyright (C) 2009-2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
#include <iguana/types.h>
typedef uintptr_t eas_ref_t; /* Address space id corresponds to OKL4 space id*/
/**
* Create a thread within another address space
*
* \param eas identifier of the target address space
* \param pager thread id of the new thread's pager
* \param scheduler thread id of the new thread's scheduler
* \param utcb address of utcb of the new thread
* \param handle_rv resulting pointer to the id of the new thread
* \return id of the new thread
*/
L4_ThreadId_t eas_create_thread(eas_ref_t eas, L4_ThreadId_t pager,
L4_ThreadId_t scheduler, void *utcb,
L4_ThreadId_t *handle_rv);
/**
* Create a new address space
*
* \param utcb defines utcb region of the address space
* \param l4_id resulting pointer to the id of the new address space
* \return id of the new address space
*/
eas_ref_t eas_create(L4_Fpage_t utcb, L4_SpaceId_t *l4_id);
/**
* Deletes an address space
*
* \param eas identifier of the target address space
*/
void eas_delete(eas_ref_t eas);
/**
* Map a page area to an address space
*
* \param eas identifier of the target address space
* \param src_fpage flexpage describing the area to be mapped
* \param dst_addr destination address where the area will be mapped to
* \param attributes describes the caching policy (OKL4 manual)
*/
int eas_map(eas_ref_t eas, L4_Fpage_t src_fpage,
uintptr_t dst_addr, uintptr_t attributes);
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
|
/* synctex.h
Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE
Acknowledgments:
----------------
The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
and significant help from XeTeX developer Jonathan Kew
Nota Bene:
----------
If you include or use a significant part of the synctex package into a software,
I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
Version 1
Latest Revision: Wed Jul 1 08:17:50 UTC 2009
*/
#ifndef __SYNCTEX_HEADER__
# define __SYNCTEX_HEADER__
# include "synctex-common.h"
/* Free all memory used, close and remove the file if any. */
void synctexabort(boolean log_opened);
/* Send this message when starting a new input. */
extern void synctexstartinput(void);
/* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at
* the very beginning of the ship_out procedure.
*/
extern void synctexsheet(integer mag);
/* Recording the "}..." line. In *tex.web, use synctex_teehs at
* the very end of the ship_out procedure.
*/
extern void synctexteehs(void);
/* This message is sent when a vlist will be shipped out, more precisely at
* the beginning of the vlist_out procedure in *TeX.web. It will be balanced
* by a synctex_tsilv, sent at the end of the vlist_out procedure. p is the
* address of the vlist We assume that p is really a vlist node! */
extern void synctexvlist(halfword this_box);
/* Recording a "}" line ending a vbox: this message is sent whenever a vlist
* has been shipped out. It is used to close the vlist nesting level. It is
* sent at the end of each vlist_out procedure in *TeX.web to balance a former
* synctex_vlist sent at the beginning of that procedure. */
extern void synctextsilv(halfword this_box);
/* This message is sent when a void vlist will be shipped out.
* There is no need to balance a void vlist. */
extern void synctexvoidvlist(halfword p, halfword this_box);
/* Send this message when an hlist will be shipped out, more precisely at
* the beginning of the hlist_out procedure in *TeX.web. It must be balanced
* by a synctex_tsilh, sent at the end of the hlist_out procedure. p is the
* address of the hlist. */
extern void synctexhlist(halfword this_box);
/* Send this message at the end of the various hlist_out procedure in *TeX.web
* to balance a former synctex_hlist. */
extern void synctextsilh(halfword this_box);
/* This message is sent when a void hlist will be shipped out.
* There is no need to balance a void hlist. */
extern void synctexvoidhlist(halfword p, halfword this_box);
/* Send this message whenever an inline math node will ship out. */
extern void synctexmath(halfword p, halfword this_box);
/* Send this message whenever an horizontal rule or glue node will ship out. */
extern void synctexhorizontalruleorglue(halfword p, halfword this_box);
/* Send this message whenever a kern node will ship out. */
extern void synctexkern(halfword p, halfword this_box);
/* this message is sent whenever a char node ships out */
extern void synctexchar(halfword p, halfword this_box);
/* this message should be sent to record information
for a node of an unknown type */
extern void synctexnode(halfword p, halfword this_box);
/* For debugging purpose only */
extern void synctexcurrent(void);
#endif
|
#ifndef __OAPPPLUGIN_H
#define __OAPPPLUGIN_H
#include "oappinterface.h"
#include <qlist.h>
#include <qpe/quuid.h>
class QWidget;
class OAppPlugin : public OAppInterface
{
public:
OAppPlugin(OAppPos pos = midPos);
OAppPlugin(QWidget *widget, OAppPos pos = midPos);
virtual ~OAppPlugin();
QList<QWidget> widgets();
OAppPos position() const;
#ifndef QT_NO_COMPONENT
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface );
Q_REFCOUNT
#endif
private:
QList<QWidget> m_widgets;
OAppPos m_position;
};
#endif // __OAPPPLUGIN_H
|
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Information about DCP/IMF Package List files
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//---------------------------------------------------------------------------
#ifndef MediaInfo_File_DcpPklH
#define MediaInfo_File_DcpPklH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
#include "MediaInfo/File__HasReferences.h"
//---------------------------------------------------------------------------
namespace MediaInfoLib
{
//***************************************************************************
// Class File_DcpPkl
//***************************************************************************
class File_DcpPkl : public File__Analyze, File__HasReferences
{
public :
//Constructor/Destructor
File_DcpPkl();
//Streams
struct stream
{
stream_t StreamKind; // With special cases: Stream_Max+1 means CPL, Stream_Max+2 means PKL
string Id;
string OriginalFileName;
string Type;
string AnnotationText;
struct chunk
{
string Path;
};
typedef std::vector<chunk> chunks;
chunks ChunkList;
stream()
{
StreamKind=Stream_Max;
}
};
typedef std::vector<stream> streams;
streams Streams;
private :
//Streams management
void Streams_Finish ();
//Buffer - Global
#if MEDIAINFO_SEEK
size_t Read_Buffer_Seek (size_t Method, int64u Value, int64u ID);
#endif //MEDIAINFO_SEEK
//Buffer - File header
bool FileHeader_Begin();
//AM
void MergeFromAm (File_DcpPkl::streams &StreamsToMerge);
};
} //NameSpace
#endif
|
#include <stdio.h>
int main(int argc, char *argv[]) {
while (1)
sleep(60);
}
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2006 - 2008 Novell, Inc.
* Copyright (C) 2008 - 2014 Red Hat, Inc.
*
*/
/*
* nm-online.c - Are we online?
*
* Return values:
*
* 0 : already online or connection established within given timeout
* 1 : offline or not online within given timeout
* 2 : unspecified error
*
* Robert Love <rml@novell.com>
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <locale.h>
#include <glib/gi18n.h>
#include "nm-client.h"
#define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup"
typedef struct
{
int value;
double norm;
gboolean quiet;
} Timeout;
static void
client_properties_changed (GObject *object,
GParamSpec *pspec,
gpointer loop)
{
NMClient *client = NM_CLIENT (object);
NMState state;
gboolean wait_startup = GPOINTER_TO_UINT (g_object_get_data (object, WAIT_STARTUP_TAG));
if (!nm_client_get_manager_running (client))
return;
if (wait_startup) {
if (!nm_client_get_startup (client))
g_main_loop_quit (loop);
} else {
state = nm_client_get_state (client);
if ( state == NM_STATE_CONNECTED_LOCAL
|| state == NM_STATE_CONNECTED_SITE
|| state == NM_STATE_CONNECTED_GLOBAL)
g_main_loop_quit (loop);
}
}
static gboolean
handle_timeout (gpointer data)
{
int i = PROGRESS_STEPS;
Timeout *timeout = data;
if (!timeout->quiet) {
g_print (_("\rConnecting"));
for (; i > 0; i--)
putchar ((timeout->value >= (i * timeout->norm)) ? ' ' : '.');
if (timeout->value)
g_print (" %4is", timeout->value);
fflush (stdout);
}
timeout->value--;
if (timeout->value < 0) {
if (!timeout->quiet)
g_print ("\n");
exit (1);
}
return TRUE;
}
int
main (int argc, char *argv[])
{
gint t_secs = -1;
gboolean exit_no_nm = FALSE;
gboolean wait_startup = FALSE;
Timeout timeout;
GOptionContext *opt_ctx = NULL;
gboolean success;
NMClient *client;
NMState state = NM_STATE_UNKNOWN;
GMainLoop *loop;
GOptionEntry options[] = {
{"timeout", 't', 0, G_OPTION_ARG_INT, &t_secs, N_("Time to wait for a connection, in seconds (without the option, default value is 30)"), "<timeout>"},
{"exit", 'x', 0, G_OPTION_ARG_NONE, &exit_no_nm, N_("Exit immediately if NetworkManager is not running or connecting"), NULL},
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &timeout.quiet, N_("Don't print anything"), NULL},
{"wait-for-startup", 's', 0, G_OPTION_ARG_NONE, &wait_startup, N_("Wait for NetworkManager startup instead of a connection"), NULL},
{NULL}
};
timeout.quiet = FALSE;
/* Set locale to be able to use environment variables */
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, NMLOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
opt_ctx = g_option_context_new (NULL);
g_option_context_set_translation_domain (opt_ctx, GETTEXT_PACKAGE);
g_option_context_set_ignore_unknown_options (opt_ctx, FALSE);
g_option_context_set_help_enabled (opt_ctx, TRUE);
g_option_context_add_main_entries (opt_ctx, options, NULL);
g_option_context_set_summary (opt_ctx,
_("Waits for NetworkManager to finish activating startup network connections."));
success = g_option_context_parse (opt_ctx, &argc, &argv, NULL);
g_option_context_free (opt_ctx);
if (!success) {
g_printerr ("%s: %s\n", argv[0],
_("Invalid option. Please use --help to see a list of valid options."));
return 2;
}
if (t_secs > -1)
timeout.value = t_secs;
else
timeout.value = 30;
if (timeout.value < 0 || timeout.value > 3600) {
g_printerr ("%s: %s\n", argv[0],
_("Invalid option. Please use --help to see a list of valid options."));
return 2;
}
g_type_init ();
client = nm_client_new ();
if (!client) {
g_printerr (_("Error: Could not create NMClient object."));
return 2;
}
loop = g_main_loop_new (NULL, FALSE);
g_object_set_data (G_OBJECT (client), WAIT_STARTUP_TAG, GUINT_TO_POINTER (wait_startup));
state = nm_client_get_state (client);
if (!nm_client_get_manager_running (client)) {
if (exit_no_nm) {
g_object_unref (client);
return 1;
}
} else if (wait_startup) {
if (!nm_client_get_startup (client)) {
g_object_unref (client);
return 0;
}
} else {
if ( state == NM_STATE_CONNECTED_LOCAL
|| state == NM_STATE_CONNECTED_SITE
|| state == NM_STATE_CONNECTED_GLOBAL) {
g_object_unref (client);
return 0;
}
}
if (exit_no_nm && (state != NM_STATE_CONNECTING)) {
g_object_unref (client);
return 1;
}
if (!timeout.value) {
g_object_unref (client);
return 1;
}
timeout.norm = (double) timeout.value / (double) PROGRESS_STEPS;
g_timeout_add_seconds (1, handle_timeout, &timeout);
g_signal_connect (client, "notify",
G_CALLBACK (client_properties_changed), loop);
g_main_loop_run (loop);
g_main_loop_unref (loop);
g_object_unref (client);
return 0;
}
|
#ifndef LIBSVM_CLASSIFIER_H
#define LIBSVM_CLASSIFIER_H
#include <liblearning/core/classifier.h>
#include <liblearning/core/maker.h>
#include <liblearning/core/supervised_dataset.h>
#include <liblearning/kernel/kernel.h>
#include <liblearning/classifier/svm.h>
namespace classification
{
using namespace core;
using namespace kernelmethod;
struct LibSVMParam
{
shared_ptr<kernel> kernelfunc;
double C;
};
class LibSVMClassifier : public classifier, public maker<LibSVMParam>
{
private:
shared_ptr<supervised_dataset> train_set;
svm_parameter * libsvm_param;
svm_model * libsvm_machine;
svm_problem * libsvm_problem;
protected:
void clear();
public:
LibSVMClassifier( );
~LibSVMClassifier(void);
virtual void make(const LibSVMParam & param);
virtual void train(const shared_ptr<dataset> &);
virtual NumericType test(const shared_ptr<dataset> &, const shared_ptr<dataset> &);
};
}
#endif
|
/* matrix.h - 6/5/14
* Nicolas Lawler <nlawl001@ucr.edu>:
* Lab Section: 23
* Assignment: Custom Lab
* Exercise Description:
*
* I acknowledge all content contained herein, excluding template/example
* code or unless otherwise notes, is my own original work
*/
/* USAGE DISCLAIMER
* Main driver code adapted from AVR Freaks user user david.prentice
* Post URL: www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=78521
*/
#include <avr/io.h>
#if defined(AVR)
#ifndef DDR_WRITE
#define DDR_WRITE 0xE0 /* bits 0-2 o/p */
#define SDP8_CLOCK (1<<7)
#define SDP8_LOAD (1<<6)
#define SDP8_DATA (1<<5)
#endif
#ifndef sdp8_data
#define sdp8_data PORTD
#define sdp8_ctl DDRD
#define INTENSITY 0x0A
#define SCAN_LIMIT 0x0B
#define DECODE 0x09
#define SHUTDOWN 0x0C
#define DISPLAY_TEST 0x0F
#endif
#endif
void write_column(unsigned char, unsigned char);
void write_frame(unsigned char, unsigned char[], unsigned char current_note);
static void shift_8(unsigned char val)
{
unsigned char cnt;
sdp8_data &= (~SDP8_CLOCK & ~SDP8_LOAD); /* CLOCK = LOAD = 0 */
for (cnt = 8; cnt; --cnt, val <<= 1) {
sdp8_data &= ~SDP8_DATA;
if (val & 0x80) sdp8_data |= SDP8_DATA;
sdp8_data |= SDP8_CLOCK;
sdp8_data &= ~SDP8_CLOCK;
}
sdp8_data |= SDP8_DATA;
}
void send_command(unsigned char posn, unsigned char val)
{
shift_8(posn);
shift_8(val);
sdp8_data |= SDP8_LOAD;
sdp8_data &= ~SDP8_LOAD;
}
void init_matrix(void)
{
sdp8_ctl = DDR_WRITE;
send_command(INTENSITY, 0x01); /* low intensity */
send_command(SCAN_LIMIT, 0x07); /* scan limit */
send_command(DECODE, 0x00); /* no decode */
send_command(SHUTDOWN, 0x01); /* not shutdown */
send_command(DISPLAY_TEST, 0x00); /* display test */
}
unsigned char row_mapping[] = {0x10, 0x80, 0x20, 0x40, 0x01, 0x04, 0x08, 0x02}; // flipped
//unsigned char notes[] = {2, 2, 2, 2, 2, 2, 2, 6, 8, 8, 4, 3, 3, 3, 6};
// writes a single cell specified by value to column specified by column
void write_column(unsigned char column, unsigned char value) {
send_command(column, row_mapping[value]);
}
// writes an 8 element 'frame' of values in array values to display, starting at index start
// WARINING, DOES NOT CHECK IF START IS VALID INDEX, ENSURE START <= 8 - Size of array
void write_frame(unsigned char start, unsigned char values[], unsigned char current_note) {
unsigned char j = 8;
static unsigned char flash = 0;
for (int i = start; (i < start+8); ++i) {
if (i == current_note) { // current note flash
if (flash > 1) { // flash every other tick
send_command(j, 0); // write zero to column
flash = 0;
} else {
write_column(j, values[i]);
flash++;
}
} else {
write_column(j, values[i]); // could be clearer but should work
}
j--;
}
} |
/*
* OpenVPN-GUI -- A Windows GUI for OpenVPN.
*
* Copyright (C) 2010 Heiko Hund <heikoh@users.sf.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 (see the file COPYING included with this
* distribution); if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANAGE_H
#define MANAGE_H
#include <winsock2.h>
#define WM_MANAGEMENT (WM_APP + 2)
typedef enum {
ready,
stop,
bytecount,
echo,
hold,
log,
password,
state,
needok,
needstr,
pkcs11_id_count,
mgmt_rtmsg_type_max
} mgmt_rtmsg_type;
typedef enum {
regular,
combined
} mgmt_cmd_type;
typedef void (*mgmt_msg_func)(connection_t *, char *);
typedef struct {
mgmt_rtmsg_type type;
mgmt_msg_func handler;
} mgmt_rtmsg_handler;
typedef struct mgmt_cmd {
struct mgmt_cmd *prev, *next;
char *command;
int size;
mgmt_msg_func handler;
mgmt_cmd_type type;
} mgmt_cmd_t;
void InitManagement(const mgmt_rtmsg_handler *handler);
BOOL OpenManagement(connection_t *, u_long, u_short);
BOOL ManagementCommand(connection_t *, char *, mgmt_msg_func, mgmt_cmd_type);
void OnManagement(SOCKET, LPARAM);
#endif
|
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef NSC_TCP_L4_PROTOCOL_H
#define NSC_TCP_L4_PROTOCOL_H
#include <stdint.h>
#include "ns3/packet.h"
#include "ns3/ipv4-address.h"
#include "ns3/ptr.h"
#include "ns3/object-factory.h"
#include "ns3/timer.h"
#include "ipv4-l4-protocol.h"
struct INetStack;
namespace ns3 {
class Node;
class Socket;
class Ipv4EndPointDemux;
class Ipv4Interface;
class NscTcpSocketImpl;
class Ipv4EndPoint;
class NscInterfaceImpl;
/**
* \ingroup nsctcp
*
* \brief Nsc wrapper glue, to interface with the Ipv4 protocol underneath.
*/
class NscTcpL4Protocol : public Ipv4L4Protocol {
public:
static const uint8_t PROT_NUMBER;
static TypeId GetTypeId (void);
/**
* \brief Constructor
*/
NscTcpL4Protocol ();
virtual ~NscTcpL4Protocol ();
void SetNode (Ptr<Node> node);
void SetNscLibrary (const std::string &lib);
std::string GetNscLibrary (void) const;
virtual int GetProtocolNumber (void) const;
virtual int GetVersion (void) const;
/**
* \return A smart Socket pointer to a NscTcpSocketImpl, allocated by this instance
* of the TCP protocol
*/
Ptr<Socket> CreateSocket (void);
Ipv4EndPoint *Allocate (void);
Ipv4EndPoint *Allocate (Ipv4Address address);
Ipv4EndPoint *Allocate (uint16_t port);
Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port);
Ipv4EndPoint *Allocate (Ipv4Address localAddress, uint16_t localPort,
Ipv4Address peerAddress, uint16_t peerPort);
void DeAllocate (Ipv4EndPoint *endPoint);
/**
* \brief Receive a packet up the protocol stack
* \param p The Packet to dump the contents into
* \param header IPv4 Header information
* \param incomingInterface The Ipv4Interface it was received on
*/
virtual Ipv4L4Protocol::RxStatus Receive (Ptr<Packet> p,
Ipv4Header const &header,
Ptr<Ipv4Interface> incomingInterface);
// From Ipv4L4Protocol
virtual void SetDownTarget (Ipv4L4Protocol::DownTargetCallback cb);
// From Ipv4L4Protocol
virtual Ipv4L4Protocol::DownTargetCallback GetDownTarget (void) const;
protected:
virtual void DoDispose (void);
virtual void NotifyNewAggregate ();
private:
NscTcpL4Protocol (NscTcpL4Protocol const &);
NscTcpL4Protocol& operator= (NscTcpL4Protocol const &);
// NSC callbacks.
// NSC invokes these hooks to interact with the simulator.
// In any case, these methods are only to be called by NSC.
//
// send_callback is invoked by NSCs 'ethernet driver' to re-inject
// a packet (i.e. an octet soup consisting of an IP Header, TCP Header
// and user payload, if any), into ns-3.
void send_callback (const void *data, int datalen);
// This is called by the NSC stack whenever something of interest
// has happened, e.g. when data arrives on a socket, a listen socket
// has a new connection pending, etc.
void wakeup ();
// This is called by the Linux stack RNG initialization.
// Its also used by the cradle code to add a timestamp to
// printk/printf/debug output.
void gettime (unsigned int *sec, unsigned int *usec);
void AddInterface (void);
void SoftInterrupt (void);
friend class NscInterfaceImpl;
friend class NscTcpSocketImpl;
Ptr<Node> m_node;
Ipv4EndPointDemux *m_endPoints;
INetStack* m_nscStack;
NscInterfaceImpl *m_nscInterface;
void *m_dlopenHandle;
std::string m_nscLibrary;
Timer m_softTimer;
std::vector<Ptr<NscTcpSocketImpl> > m_sockets;
Ipv4L4Protocol::DownTargetCallback m_downTarget;
};
}; // namespace ns3
#endif /* NSC_TCP_L4_PROTOCOL_H */
|
#ifndef __dashercontrol_h__
#define __dashercontrol_h__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "PangoCache.h"
#include "Canvas.h"
#include "../DasherCore/SocketInput.h"
#ifdef JOYSTICK
#include "joystick_input.h"
#endif
#ifdef TILT
#include "tilt_input.h"
#endif
#include "mouse_input.h"
#include "GtkDasherControl.h"
//#include "KeyboardHelper.h"
//#include "../DasherCore/DasherSettingsInterface.h"
#include "../DasherCore/DasherInterfaceBase.h"
#include "../DasherCore/GnomeSettingsStore.h"
#include "../DasherCore/UserLog.h"
///
/// \brief C++ core of the Dasher GTK UI component.
///
/// Class representing the Dasher UI component (ie the canvas and speed slider)
/// \todo It would really be more sensible for CDasherControl to inheret from CDasherInterface rather than contain a pointer to it
///
class CDasherControl : public CDasherInterfaceBase {
public:
///
/// \param pVBox GTK VBox to populate with the DasherControl
/// component widgets. This needs to be created externally by the
/// GObject wrapper and passed to the C++ class rather than being
/// created internally.
/// \param pDasherControl Pointer to the GObject wrapper. This is
/// needed so that we can emit signals from the GObject.
///
CDasherControl(GtkVBox * pVbox, GtkDasherControl * pDasherControl);
~CDasherControl();
// Event handlers
// FIXME - we should probably pass all parameters to these from the "C" callbacks
void SetFocus();
///
/// GTK Signal handler for the canvas getting the focus (which it gives away to the edit box)
///
bool FocusEvent(GtkWidget *pWidget, GdkEventFocus *pEvent);
///
/// Called when the canvas gets realized (ie when internal resources have been allocated), so we can finalise setup.
///
void RealizeCanvas(GtkWidget *pWidget);
///
/// Called periodically by a timer. Used to prompt the interface to perform a redraw
/// \todo There's rather a lot which happens in this
/// function. Ideally it should just be a simple call to the core
/// which then figures out whether we're paused or not etc.
///
int TimerEvent();
int LongTimerEvent();
///
/// Mouse button pressed on the canvas
///
gboolean ButtonPressEvent(GdkEventButton * event);
///
/// Called when the canvas has been resized, prompts the (re)creation of the CCanvas object.
///
int CanvasConfigureEvent();
///
/// Speed slider has been moved.
///
void SliderEvent();
///
/// Called when the canvas GTK widget is destroyed, so we can free any references to it.
///
void CanvasDestroyEvent();
///
/// Key press event on the canvas
///
gint KeyReleaseEvent(GdkEventKey * event);
gint KeyPressEvent(GdkEventKey * event);
///
/// Return an array of allowed values for a string parameter.
/// \param iParameter The parameter to query.
/// \return A GArray of gchar* pointers to strings containing permitted values
///
GArray *GetAllowedValues(int iParameter);
///
/// Called by UI needs to signal a new user trial is starting.
///
void UserLogNewTrial();
void ExternalKeyDown(int iKeyVal);
void ExternalKeyUp(int iKeyVal);
gboolean ExposeEvent();
private:
// virtual void CreateSettingsStore();
virtual void ScanAlphabetFiles(std::vector<std::string> &vFileList);
virtual void ScanColourFiles(std::vector<std::string> &vFileList);
virtual void SetupPaths();
virtual void CreateModules();
virtual void SetupUI();
virtual void CreateSettingsStore();
virtual int GetFileSize(const std::string &strFileName);
virtual void WriteTrainFile(const std::string &strNewText);
virtual void StartTimer();
virtual void ShutdownTimer();
///
/// Pass events coming from the core to the appropriate handler.
///
void ExternalEventHandler(Dasher::CEvent *pEvent);
void GameMessageOut(int message, const void* messagedata);
///
/// Notification from CDasherInterface that a parameter has changed
/// \param iParameter The parameter which has changed
///
void HandleParameterNotification(int iParameter);
GtkWidget *m_pVBox;
GtkWidget *m_pCanvas;
///
/// Abstracted input device object for mouse input.
///
CDasherMouseInput *m_pMouseInput;
CDasher1DMouseInput *m_p1DMouseInput;
///
/// Cache of Pango layouts
///
CPangoCache *m_pPangoCache;
///
/// The CCanvas object
///
CCanvas *m_pScreen;
///
/// The GObject which is wrapping this class
///
GtkDasherControl *m_pDasherControl;
///
/// Keyboard helper class
///
// CKeyboardHelper *m_pKeyboardHelper;
};
#endif
|
/* -*- linux-c -*- ------------------------------------------------------- *
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright 2007 rPath, Inc. - All Rights Reserved
* Copyright 2009 Intel Corporation; author H. Peter Anvin
*
* This file is part of the Linux kernel, and is made available under
* the terms of the GNU General Public License version 2.
*
* ----------------------------------------------------------------------- */
/*
* Get the MCA system description table
*/
#include "boot.h"
/**
@brief MCA: MircoChannel Architecture http://blog.naver.com/PostView.nhn?blogId=jandark25&logNo=60064229440&redirect=Dlog&widgetTypeCall=true\n
MCA: IBM사가 ISA버스의 후속규격으로 정한 버스(컴퓨터 내부의 데이터 전송로)규격.\n
boot_params.sys_desc_table 에 테이블 정보가 복사된다.
@return 성공시:0, 실패시:-1
*/
int query_mca(void)
{
struct biosregs ireg, oreg;
u16 len;
initregs(&ireg);
ireg.ah = 0xc0;
intcall(0x15, &ireg, &oreg);
// INT 15,C0 - Return System Configuration Parameters (PS/2 only)
// AH = C0
// on return:
// CF = 0 if successful
// = 1 if error
// AH = when CF set, 80h for PC & PCjr, 86h for XT
// (BIOS after 11/8/82) and AT (BIOS after 1/10/84)
// ES:BX = pointer to system descriptor table in ROM of the format:
// Offset Size Description
// 00 word length of descriptor (8 minimum)
// 02 byte model byte (same as F000:FFFE, not reliable)
// 03 byte secondary model byte
// 04 byte BIOS revision level (zero based)
// 05 byte feature information, see below
// 06 dword reserved
if (oreg.eflags & X86_EFLAGS_CF)
return -1; /* No MCA present */
set_fs(oreg.es);
len = rdfs16(oreg.bx);
// len = es:bx
if (len > sizeof(boot_params.sys_desc_table))
len = sizeof(boot_params.sys_desc_table);
copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len);
return 0;
}
|
/* This file is part of the KDE project
* Copyright (C) 2006-2007 Thomas Zander <zander@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; 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 KOINLINEOBJECTREGISTRY_H
#define KOINLINEOBJECTREGISTRY_H
#include <KoGenericRegistry.h>
#include <KoInlineObjectFactoryBase.h>
#include <KoXmlReaderForward.h>
#include "kotext_export.h"
#include <QList>
class KoCanvasBase;
class QAction;
class KoShapeLoadingContext;
/**
* This singleton class keeps a register of all available InlineObject factories.
* @see KoInlineObjectFactoryBase
* @see KoInlineTextObjectManager
* @see KoInlineObject
* @see KoVariable
*/
class KOTEXT_EXPORT KoInlineObjectRegistry : public KoGenericRegistry<KoInlineObjectFactoryBase*>
{
public:
~KoInlineObjectRegistry();
/**
* Return an instance of the KoInlineObjectRegistry
* Creates an instance if that has never happened before and returns the singleton instance.
*/
static KoInlineObjectRegistry *instance();
/**
* Create a list of actions that can be used to plug into a menu, for example.
* This method will find all the InlineObjectFactories that are installed in the system and
* find out which object they provide. If a factory provides a variable, then all its
* templates will be added to the response.
* Each of thse actions, when executed, will insert the relevant variable in the current text-position.
* The actions assume that the text tool is selected, if thats not the case then they will silently fail.
* @param host the canvas for which these actions are created. Note that the actions will get these
* actions as a parent (for memory management purposes) as well.
* @see KoInlineTextObjectManager::createInsertVariableActions()
*/
QList<QAction*> createInsertVariableActions(KoCanvasBase *host) const;
/**
* Use the element to find out which variable plugin can load it, and returns the loaded
* variable. The element expected is one of 'text:subject', 'text:date' / etc.
*
* @returns the variable or 0 if no variable could be created
*/
KoInlineObject *createFromOdf(const KoXmlElement &element, KoShapeLoadingContext &context) const;
private:
KoInlineObjectRegistry();
KoInlineObjectRegistry(const KoInlineObjectRegistry&);
KoInlineObjectRegistry operator=(const KoInlineObjectRegistry&);
class Private;
Private * const d;
};
#endif
|
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
NEWLINE = 258,
VERBOSE = 259,
FILENAME = 260,
ADDLIB = 261,
LIST = 262,
ADDMOD = 263,
CLEAR = 264,
CREATE = 265,
DELETE = 266,
DIRECTORY = 267,
END = 268,
EXTRACT = 269,
FULLDIR = 270,
HELP = 271,
QUIT = 272,
REPLACE = 273,
SAVE = 274,
OPEN = 275
};
#endif
/* Tokens. */
#define NEWLINE 258
#define VERBOSE 259
#define FILENAME 260
#define ADDLIB 261
#define LIST 262
#define ADDMOD 263
#define CLEAR 264
#define CREATE 265
#define DELETE 266
#define DIRECTORY 267
#define END 268
#define EXTRACT 269
#define FULLDIR 270
#define HELP 271
#define QUIT 272
#define REPLACE 273
#define SAVE 274
#define OPEN 275
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 38 "arparse.y"
{
char *name;
struct list *list ;
}
/* Line 1489 of yacc.c. */
#line 95 "arparse.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
|
#include <stdint.h>
#include <stdio.h>
typedef struct {
uint64_t high;
uint64_t low;
} __attribute__((aligned(16))) quad_word;
quad_word _op1, _op2, _op3;
void
test(quad_word op1_init, quad_word op2_init, quad_word op3_init)
{
int cc;
_op1 = op1_init;
_op2 = op2_init;
_op3 = op3_init;
__asm__ volatile (
"lmg %%r0,%%r1,%1\n\t"
"lmg %%r2,%%r3,%3\n\t"
"cdsg %%r0,%%r2,%2\n\t"
"stmg %%r0,%%r1,%1\n"
"stmg %%r2,%%r3,%3\n"
: "=d"(cc), "+QS" (_op1), "+QS" (_op2), "+QS" (_op3)
:
: "r0", "r1", "r2", "r3", "cc");
}
void op1_undefined(void)
{
quad_word op1, op2, op3;
op2.high = op2.low = 42;
op3.high = op3.low = 0xdeadbeefdeadbabeull;
test(op1, op2, op3);
}
void op2_undefined(void)
{
quad_word op1, op2, op3;
op1.high = op1.low = 42;
op3.high = op3.low = 0xdeadbeefdeadbabeull;
test(op1, op2, op3);
}
void op3_undefined(void)
{
quad_word op1, op2, op3;
op1.high = op1.low = 42;
op2 = op1;
test(op1, op2, op3);
}
int main ()
{
op1_undefined();
op2_undefined();
op3_undefined();
return 0;
}
|
/* miktex/Core/PathNameParser.h: -*- C++ -*-
Copyright (C) 1996-2016 Christian Schenk
This file is part of the MiKTeX Core Library.
The MiKTeX Core Library is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The MiKTeX Core Library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the MiKTeX Core Library; if not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#if defined(_MSC_VER)
# pragma once
#endif
#if !defined(E46FF47278D7421D9657C798FB641B8C)
#define E46FF47278D7421D9657C798FB641B8C
#include <miktex/Core/config.h>
#include "BufferSizes.h"
MIKTEX_CORE_BEGIN_NAMESPACE;
class PathNameParser
{
public:
MIKTEXCOREEXPORT MIKTEXTHISCALL PathNameParser(const char * lpszPath);
public:
PathNameParser(const PathNameParser & rhs) = delete;
public:
PathNameParser & operator= (const PathNameParser & rhs) = delete;
public:
const char * GetCurrent() const
{
return *lpszCurrent == 0 ? nullptr : lpszCurrent;
}
public:
MIKTEXCORETHISAPI(const char *) operator++ ();
private:
char * lpszCurrent = nullptr;
private:
char * lpszNext = nullptr;
private:
char buffer[BufferSizes::MaxPath];
};
MIKTEX_CORE_END_NAMESPACE;
#endif
|
//
// AppDelegate.h
// TranParamBetwwenUI
//
// Created by CornerZhang on 14-9-30.
// Copyright (c) 2014年 NeXtreme.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
This file is part of BGSLibrary.
BGSLibrary is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BGSLibrary 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 BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include "../IBGS.h"
#include "PratiMediodBGS.h"
using namespace Algorithms::BackgroundSubtraction;
class DPPratiMediodBGS : public IBGS
{
private:
bool firstTime;
long frameNumber;
IplImage* frame;
RgbImage frame_data;
PratiParams params;
PratiMediodBGS bgs;
BwImage lowThresholdMask;
BwImage highThresholdMask;
int threshold;
int samplingRate;
int historySize;
int weight;
bool showOutput;
public:
DPPratiMediodBGS();
~DPPratiMediodBGS();
void process(const cv::Mat &img_input, cv::Mat &img_output, cv::Mat &img_bgmodel);
private:
void saveConfig();
void loadConfig();
};
|
/*
* include/asm-s390/hardirq.h
*
* S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
* Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
*
* Derived from "include/asm-i386/hardirq.h"
*/
#ifndef __ASM_HARDIRQ_H
#define __ASM_HARDIRQ_H
<<<<<<< HEAD
=======
#include <linux/threads.h>
#include <linux/sched.h>
#include <linux/cache.h>
#include <linux/interrupt.h>
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#include <asm/lowcore.h>
#define local_softirq_pending() (S390_lowcore.softirq_pending)
#define __ARCH_IRQ_STAT
#define __ARCH_HAS_DO_SOFTIRQ
#define HARDIRQ_BITS 8
<<<<<<< HEAD
=======
void clock_comparator_work(void);
static inline unsigned long long local_tick_disable(void)
{
unsigned long long old;
old = S390_lowcore.clock_comparator;
S390_lowcore.clock_comparator = -1ULL;
return old;
}
static inline void local_tick_enable(unsigned long long comp)
{
S390_lowcore.clock_comparator = comp;
}
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#endif /* __ASM_HARDIRQ_H */
|
/*
* string.c
*/
#include <types.h>
#include <stdio.h>
#include <string.h>
int strcmp(const char *str1, const char *str2)
{
int res = 0;
while (!(res = *(unsigned char *)str1 - *(unsigned char *)str2) && *str2)
++str1, ++str2;
if (res < 0)
res = -1;
if (res > 0)
res = 1;
return res;
}
int strncmp(const char *str1, const char *str2, size_t num)
{
int res = 0;
while (num-- && !(res = *(unsigned char *)str1 - *(unsigned char *)str2) && *str2)
++str1, ++str2;
if (res < 0)
res = -1;
if (res > 0)
res = 1;
return res;
}
char *strcpy(char *dst, const char *src)
{
char *cp = dst;
while ((*(cp++) = *(src++)));
return (dst);
}
char *strncpy(char *dst, const char *src, size_t num)
{
char *cp = dst;
while (num-- && (*(cp++) = *(src++)));
return dst;
}
char *strcat(char *dst, const char *src)
{
char *cp = dst;
while (*cp) cp++; // Find the end of dst
while ((*(cp++) = *(src++))); // Copy src to end of dst
return dst;
}
char *strncat(char *dst, const char *src, size_t num)
{
char *cp = dst;
while(*cp) cp++; // Find the end of dst
while(num-- && (*(cp++) = *(src++)));
return dst;
}
size_t strlen(const char *str)
{
size_t len = 0;
while (str[len++]);
return len - 1;
}
size_t strnlen(const char *str, size_t num)
{
size_t len = 0;
while (str[len++] && (len <= num));
return len - 1;
}
char *strchr(const char *str, int ch)
{
while (*str && *str != (char)ch) str++;
if (*str == (char)ch)
return ((char*)str);
return NULL;
}
void *memset(void *dst, char val, size_t count)
{
unsigned char *temp = (unsigned char *)dst;
for (; count != 0; count--, temp[count] = val);
return dst;
}
void *memcpy(void *dst, const void *src, size_t count)
{
const char *sp = (const char *)src;
char *dp = (char *)dst;
for (; count != 0; count--)
*dp++ = *sp++;
return dst;
}
int memcmp(const void *s1, const void *s2, size_t count)
{
int res = 0;
uint8_t *ptr1 = (uint8_t *)s1;
uint8_t *ptr2 = (uint8_t *)s2;
while (count-- && !(res = *(unsigned char *)ptr1 - *(unsigned char *)ptr2))
++ptr1, ++ptr2;
if (res < 0)
res = -1;
if (res > 0)
res = 1;
return res;
}
|
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/errno.h>
#include <asm/uaccess.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/delay.h>
static struct task_struct *thread_st;
static int thread_fn(void *unused)
{
int i;
for (i = 0; i < 20; i++) {
printk(KERN_INFO "Thread Running\n");
ssleep(5);
}
printk(KERN_INFO "Thread Stopping\n");
do_exit(0);
}
static int __init init_thread(void)
{
printk(KERN_INFO "Creating Thread\n");
thread_st = kthread_create(thread_fn, NULL, "mythread");
if (thread_st)
printk("Thread Created successfully");
else
printk(KERN_INFO "Thread creation failed\n");
return 0;
}
static void __exit cleanup_thread(void)
{
printk("Cleaning Up\n");
}
module_init(init_thread);
module_exit(cleanup_thread);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("SysPlay Workshops <workshop@sysplay.in>");
MODULE_DESCRIPTION("Thread Creation Demo");
|
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009-2010 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef IM_PLUGIN_H
#define IM_PLUGIN_H
#include <purple.h>
#include <string>
#include "core/exception.h"
namespace im {
using std::string;
class Plugin
{
PurplePlugin* plug;
public:
STREXCEPTION(LoadError);
Plugin();
Plugin(PurplePlugin* plug);
bool isValid() const { return plug != NULL; }
string getID() const;
string getName() const;
string getSummary() const;
string getDescription() const;
bool isLoaded() const;
void load();
void unload();
};
}; /* ns im */
#endif /* IM_PLUGIN_H */
|
/* LD_PRELOAD code.
This file is part of wrap-syscall.
Copyright 2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <dlfcn.h>
#include "ws.h"
static pid_t
hack_vfork (void)
{
// FIXME: temp hack
return ws_real_fork ();
}
#include "ws-preload-gen.c"
|
/*
* Copyright 2008 Cisco Systems, Inc. All rights reserved.
* Copyright 2006 Nuova Systems, Inc. All rights reserved.
*
* This program is free software; you may redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* $Id: fc_virt_fab.h 18557 2008-09-14 22:36:38Z jre $
*/
#ifndef _LIBFC_VIRT_FAB_H_
#define _LIBFC_VIRT_FAB_H_
#include "fc_encaps.h"
/*
* Fibre Channel Virtual Fabric.
* This facility coordinates remote ports and local ports to the same
* virtual fabric.
*
* Struct fc_virt_fab is semi-opaque structure.
*/
struct fc_virt_fab;
struct fc_virt_fab *fc_virt_fab_alloc(u_int tag, enum fc_class,
fc_xid_t min_xid, fc_xid_t max_fid);
void fc_virt_fab_free(struct fc_virt_fab *);
/*
* Default exchange ID limits for user applications.
*/
#define FC_VF_MIN_XID 0x101
#define FC_VF_MAX_XID 0x2ff
#endif /* _LIBFC_VIRT_FAB_H_ */
|
/***************************************************************************
* Copyright (C) 2007 by Christoph Thelen *
* doc_bacardi@users.sourceforge.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. *
***************************************************************************/
#ifndef __MUHKUH_ICONS_H__
#define __MUHKUH_ICONS_H__
//-------------------------------------
// the muhkuh icons
extern const char *muhkuh_016_xpm[91];
extern const char *muhkuh_032_xpm[314];
extern const char *muhkuh_064_xpm[753];
extern const char *muhkuh_128_xpm[1305];
//-------------------------------------
// the famfamfam icons
extern const char *icon_famfamfam_silk_accept[174];
extern const char *icon_famfamfam_silk_application_form_edit[155];
extern const char *icon_famfamfam_silk_arrow_down[82];
extern const char *icon_famfamfam_silk_arrow_up[82];
extern const char *icon_famfamfam_silk_cancel[124];
extern const char *icon_famfamfam_silk_cross[137];
extern const char *icon_famfamfam_silk_database[107];
extern const char *icon_famfamfam_silk_database_add[126];
extern const char *icon_famfamfam_silk_database_delete[136];
extern const char *icon_famfamfam_silk_database_edit[163];
extern const char *icon_famfamfam_silk_database_refresh[169];
extern const char *icon_famfamfam_silk_door_out[197];
extern const char *icon_famfamfam_silk_exclamation[147];
extern const char *icon_famfamfam_silk_folder[143];
extern const char *icon_famfamfam_silk_folder_add[149];
extern const char *icon_famfamfam_silk_folder_database[174];
extern const char *icon_famfamfam_silk_folder_delete[160];
extern const char *icon_famfamfam_silk_folder_edit[170];
extern const char *icon_famfamfam_silk_folder_table[170];
extern const char *icon_famfamfam_silk_help[182];
extern const char *icon_famfamfam_silk_information[180];
extern const char *icon_famfamfam_silk_key[123];
extern const char *icon_famfamfam_silk_lightbulb[180];
extern const char *icon_famfamfam_silk_plugin[144];
extern const char *icon_famfamfam_silk_plugin_add[151];
extern const char *icon_famfamfam_silk_plugin_delete[161];
extern const char *icon_famfamfam_silk_plugin_disabled[78];
extern const char *icon_famfamfam_silk_plugin_go[169];
extern const char *icon_famfamfam_silk_script[181];
extern const char *icon_famfamfam_silk_tag_blue[107];
extern const char *icon_famfamfam_silk_tick[100];
extern const char *icon_famfamfam_silk_wrench[127];
//-------------------------------------
// the lua icon
extern const char *lua_xpm[22];
//-------------------------------------
#endif // __MUHKUH_ICONS_H__
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2013 Werner Schweer and others
//
// 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 and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __AMBITUS_H__
#define __AMBITUS_H__
#include "element.h"
#include "note.h"
#include "accidental.h"
class QPainter;
namespace Ms {
//---------------------------------------------------------
// @@ Ambitus
//---------------------------------------------------------
class Ambitus : public Element {
Q_OBJECT
NoteHead::Group _noteHeadGroup;
NoteHead::Type _noteHeadType;
MScore::DirectionH _dir;
bool _hasLine;
Spatium _lineWidth;
Accidental _topAccid, _bottomAccid;
int _topPitch, _bottomPitch;
int _topTpc, _bottomTpc;
// internally managed, to optimize layout / drawing
QPointF _topPos; // position of top note symbol
QPointF _bottomPos; // position of bottom note symbol
QLineF _line; // the drawn line
void normalize();
public:
Ambitus(Score* s);
virtual Ambitus* clone() const override { return new Ambitus(*this); }
// getters and setters
virtual Element::Type type() const override { return Element::Type::AMBITUS; }
NoteHead::Group noteHeadGroup() const { return _noteHeadGroup;}
NoteHead::Type noteHeadType() const { return _noteHeadType; }
MScore::DirectionH direction() const { return _dir; }
bool hasLine() const { return _hasLine; }
Spatium lineWidth() const { return _lineWidth; }
int topOctave() const { return _topPitch / 12;}
int bottomOctave() const { return _bottomPitch / 12;}
int topPitch() const { return _topPitch; }
int bottomPitch() const { return _bottomPitch; }
int topTpc() const { return _topTpc; }
int bottomTpc() const { return _bottomTpc; }
void setNoteHeadGroup(NoteHead::Group val) { _noteHeadGroup = val; }
void setNoteHeadType (NoteHead::Type val) { _noteHeadType = val; }
void setDirection (MScore::DirectionH val) { _dir = val; }
void setHasLine (bool val) { _hasLine = val; }
void setLineWidth (Spatium val) { _lineWidth = val; }
void setTopPitch (int val);
void setBottomPitch (int val);
void setTopTpc (int val);
void setBottomTpc (int val);
// some utility functions
Segment* segment() const { return (Segment*)parent(); }
SymId noteHead() const;
qreal headWidth() const;
void updateRange(); // scan staff up to next section break and update range pitches
// re-implemented virtual functions
virtual void draw(QPainter*) const override;
virtual void layout() override;
virtual QPointF pagePos() const override; ///< position in page coordinates
virtual void read(XmlReader&) override;
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true) override;
virtual void setTrack(int val) override;
virtual void write(Xml&) const override;
virtual QString accessibleInfo() const override;
virtual QString screenReaderInfo() const override;
// properties
QVariant getProperty(P_ID ) const;
bool setProperty(P_ID propertyId, const QVariant&);
QVariant propertyDefault(P_ID id) const;
virtual Element* nextElement() override;
virtual Element* prevElement() override;
};
} // namespace Ms
#endif
|
#include <scsi/scsi_tgt.h>
#ifdef CONFIG_SCSI_FC_TGT_ATTRS
static inline int fc_tgt_it_nexus_create(struct Scsi_Host *shost, u64 itn_id,
char *initiator)
{
return scsi_tgt_it_nexus_create(shost, itn_id, initiator);
}
static inline int fc_tgt_it_nexus_destroy(struct Scsi_Host *shost, u64 itn_id)
{
return scsi_tgt_it_nexus_destroy(shost, itn_id);
}
#else
static inline int fc_tgt_it_nexus_create(struct Scsi_Host *shost, u64 itn_id,
char *initiator)
{
return 0;
}
static inline int fc_tgt_it_nexus_destroy(struct Scsi_Host *shost, u64 itn_id)
{
return 0;
}
#endif
|
/*
* Virtuality Style for Qt4 and Qt5
* Copyright 2009-2014 by Thomas Lübking <thomas.luebking@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
*
* 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 FOCUS_ANIMATOR_H
#define FOCUS_ANIMATOR_H
#include "basic.h"
namespace Animator {
class Focus : public Basic {
Q_OBJECT
public:
static bool manage(QWidget *w);
static void release(QWidget *w);
static void setDuration(uint ms);
static void setFPS(uint fps);
static int step(const QWidget *widget);
static int maxSteps();
static void Play(QWidget *widget, bool bwd = false);
protected:
Focus();
void _setFPS(uint fps);
virtual int _step(const QWidget *widget, long int index = 0) const;
virtual void play(QWidget *widget, bool bwd = false);
protected slots:
virtual bool eventFilter( QObject *object, QEvent *event );
virtual void timerEvent(QTimerEvent * event);
private:
Q_DISABLE_COPY(Focus)
};
}
#endif //FOCUS_ANIMATOR_H
|
#pragma once
#include <Editor/FontAwesome.h>
namespace Columbus::Editor
{
// Icons for editor
#define TRANSFORM_ICON ICON_FA_ARROWS_ALT
#define MATERIAL_ICON ICON_FA_CIRCLE
#define AUDIO_ICON ICON_FA_VOLUME_UP
#define LIGHT_ICON ICON_FA_LIGHTBULB
#define MESH_ICON ICON_FA_CUBE
#define PARTICLES_ICON ICON_FA_CERTIFICATE
#define RIGIDBODY_ICON ICON_FA_SQUARE
#define ADD_ICON ICON_FA_PLUS
#define DELETE_ICON ICON_FA_TIMES
}
|
/* Board information for the SBCPowerQUICCII, which should be generic for
* all 8260 boards. The IMMR is now given to us so the hard define
* will soon be removed. All of the clock values are computed from
* the configuration SCMR and the Power-On-Reset word.
*/
#ifndef __PPC_SBC82xx_H__
#define __PPC_SBC82xx_H__
#include <asm/ppcboot.h>
#define CPM_MAP_ADDR 0xf0000000
#define SBC82xx_TODC_NVRAM_ADDR 0xd0000000
#define SBC82xx_MACADDR_NVRAM_FCC1 0x220000c9 /* JP6B */
#define SBC82xx_MACADDR_NVRAM_SCC1 0x220000cf /* JP6A */
#define SBC82xx_MACADDR_NVRAM_FCC2 0x220000d5 /* JP7A */
#define SBC82xx_MACADDR_NVRAM_FCC3 0x220000db /* JP7B */
#define BOOTROM_RESTART_ADDR ((uint)0x40000104)
#define SBC82xx_PC_IRQA (NR_SIU_INTS+0)
#define SBC82xx_PC_IRQB (NR_SIU_INTS+1)
#define SBC82xx_MPC185_IRQ (NR_SIU_INTS+2)
#define SBC82xx_ATM_IRQ (NR_SIU_INTS+3)
#define SBC82xx_PIRQA (NR_SIU_INTS+4)
#define SBC82xx_PIRQB (NR_SIU_INTS+5)
#define SBC82xx_PIRQC (NR_SIU_INTS+6)
#define SBC82xx_PIRQD (NR_SIU_INTS+7)
#endif /* __PPC_SBC82xx_H__ */
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "warning.h"
#include "runexpat.h"
/* FIXME: parameterize/compute location of xsltproc at
install time or run time */
const char *xsltproc = "/usr/bin/xsltproc";
extern int options(int, char**,const char*);
extern int optind;
static int cbd_namespaces = 0, html_mode = 0, sig_fixer = 0, unwrap_html = 0, htmlid = 0;
static int cued_printStart = 0, need_gdf_closer = 0;
static const char *project = NULL, *xsl = NULL;
struct frag
{
int nesting;
const char *xid;
FILE *fp;
};
static char *
argv_cmd(void)
{
char *cmd = malloc(strlen(xsl) + strlen("xsltproc - ") + 1);
sprintf(cmd, "%s %s -", xsltproc, xsl);
return cmd;
}
void
printText(const char *s, FILE *frag_fp)
{
while (*s)
{
if (*s == '<')
fputs("<",frag_fp);
else if (*s == '&')
fputs("&",frag_fp);
else if (*s == '"')
fputs(""",frag_fp);
else
fputc(*s,frag_fp);
++s;
}
}
void
printStart(struct frag *frag, const char *name, const char **atts)
{
const char **ap = atts;
printText((const char*)charData_retrieve(), frag->fp);
fprintf(frag->fp, "<%s", name);
if (sig_fixer && !strcmp(name, "a"))
{
for (ap = atts; ap[0]; )
{
fprintf(frag->fp, " %s=\"",*ap++);
if (!strcmp(ap[-1], "href") && !strncmp(ap[0], "javascript:pop1sig", 18))
{
fprintf(frag->fp, "javascript:pop1sig('%s','',", project);
printText(&ap[0][19], frag->fp);
++ap;
}
else
printText(*ap++, frag->fp);
fputc('"', frag->fp);
}
}
else
{
if (atts)
{
for (ap = atts; ap[0]; )
{
fprintf(frag->fp, " %s=\"",*ap++);
printText(*ap++, frag->fp);
fputc('"', frag->fp);
}
}
}
if (cbd_namespaces)
{
fputs(" xmlns:cbd=\"http://oracc.org/ns/cbd/1.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\"",
frag->fp);
cbd_namespaces = 0;
}
fputc('>', frag->fp);
++frag->nesting;
}
void
printEnd(struct frag *frag, const char *name)
{
if (unwrap_html)
{
if (!strcmp(name, "body"))
{
fclose(frag->fp);
exit(0);
}
else
{
printText((const char *)charData_retrieve(), frag->fp);
fprintf(frag->fp, "</%s>", name);
return;
}
}
printText((const char *)charData_retrieve(), frag->fp);
fprintf(frag->fp, "</%s>", name);
if (!--frag->nesting)
{
if (html_mode)
{
if (!strcmp(name, "head"))
fputs("<body>", frag->fp);
else
fputs("</body></html>", frag->fp);
}
else
{
if (need_gdf_closer)
fputs("</o:records>", frag->fp);
else
{
fclose(frag->fp);
exit(0);
}
}
}
}
void
gdf_sH(void *userData, const char *name, const char **atts)
{
const char *xid = (htmlid ? findAttr(atts, "id") : get_xml_id(atts));
if (unwrap_html)
{
if (cued_printStart)
{
cued_printStart = 0;
printStart(userData, name, atts);
}
else if (!strcmp(name, "body"))
{
charData_discard();
cued_printStart = 1;
}
else if (((struct frag*)userData)->nesting)
printStart(userData, name, atts);
else
charData_discard();
}
else if (xid && !strcmp(((struct frag*)userData)->xid, xid))
{
charData_discard();
printStart(userData, name, atts);
}
else if (((struct frag*)userData)->nesting)
printStart(userData, name, atts);
else if (!strcmp(name, "o:records"))
{
printStart(userData, "o:records", atts);
need_gdf_closer = 1;
((struct frag*)userData)->nesting = 0;
}
else if (html_mode && !strcmp(name, "head"))
{
fputs("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
((struct frag*)userData)->fp);
printStart(userData, name, atts);
}
else
charData_discard();
}
void
gdf_eH(void *userData, const char *name)
{
if (((struct frag*)userData)->nesting)
printEnd(userData, name);
else
charData_discard();
}
void
gdf_frag_from_file(const char *fname, const char *xml_id, FILE *outfp)
{
char const *fnlist[2];
static struct frag fragdata;
fragdata.xid = xml_id;
fragdata.nesting = 0;
fragdata.fp = outfp;
fnlist[0] = fname;
fnlist[1] = NULL;
runexpatNSuD(i_list, fnlist, gdf_sH, gdf_eH, NULL, &fragdata);
}
int
main(int argc, char **argv)
{
FILE *outfp = stdout;
options(argc, argv, "chHp:sux:");
if (xsl)
{
char *xsltcommand = argv_cmd();
fprintf(stderr, "xfrag xsltcommand = %s\n", xsltcommand);
outfp = popen(xsltcommand, "w");
}
if (argv[optind] && argv[optind+1])
gdf_frag_from_file(argv[optind], argv[optind+1], outfp);
else if (unwrap_html && argv[optind])
gdf_frag_from_file(argv[optind], NULL, stdout);
if (xsl)
(void)pclose(outfp);
return 0;
}
int verbose = 0;
const char *prog = "xfrag";
int major_version = 1;
int minor_version = 0;
const char *usage_string = " [-c -h -H -s] [-p PROJECT] [XML_FILE] [XML_ID]";
int
opts(int argc, char *arg)
{
switch (argc)
{
case 'c': cbd_namespaces = 1; break;
case 'h': html_mode = 1; break;
case 'H': htmlid = 1; break;
case 'p': project = arg; break;
case 's': sig_fixer = 1; break;
case 'u': unwrap_html = 1; break;
case 'x': xsl = arg; break;
default: return 1;
}
return 0;
}
void help() {}
|
/*************************************************************************
*
* Copyright (c) 2002-2005 by Zhang Huiyong All Rights Reserved
*
* FILENAME: DaytimeSrv.c
*
* PURPOSE : Daytime »ùÓÚ UDP ·þÎñÆ÷³ÌÐò.
*
* AUTHOR : ÕÅ»áÓÂ
*
* BOOK : <<WinSockÍøÂç±à³Ì¾Âç>>
*
**************************************************************************/
#include <stdio.h>
#include <time.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib") /* WinSockʹÓõĿ⺯Êý */
#define DAYTIME_DEF_PORT 13 /* Daytime ȱʡ¶Ë¿Ú */
#define DAYTIME_BUF_SIZE 64 /* »º³åÇøµÄ´óС */
int main(int argc, char **argv)
{
WSADATA wsaData;
SOCKET srv_sock = 0; /* ·þÎñÆ÷µÄsocket¾ä±ú */
struct sockaddr_in srv_addr, /* Daytime ·þÎñÆ÷µØÖ· */
clnt_addr; /* ¿Í»§¶ËµØÖ· */
unsigned short port = DAYTIME_DEF_PORT;
int result, addr_len = sizeof(srv_addr);
char *time_str, recv_buf[DAYTIME_BUF_SIZE];
time_t now_time;
WSAStartup(WINSOCK_VERSION, &wsaData);/* ³õʼ»¯ WinSock ×ÊÔ´ */
if (argc == 2) /* ¶Ë¿Ú */
port = atoi(argv[1]);
/* ´´½¨ Daytime ʹÓõÄsocket */
srv_sock = socket(AF_INET, SOCK_DGRAM, 0);
/* Daytime ·þÎñÆ÷µØÖ· */
srv_addr.sin_family = AF_INET;
srv_addr.sin_port = htons(port);
srv_addr.sin_addr.s_addr = INADDR_ANY;
result = bind(srv_sock, (struct sockaddr *)&srv_addr, addr_len);
if (result == SOCKET_ERROR)
{
printf("[Daytime] bind error : %d", WSAGetLastError());
closesocket(srv_sock);
return -1;
}
printf("[Daytime] The server is running ... ...\r\n");
while (1)
{
result = recvfrom(srv_sock, recv_buf, DAYTIME_BUF_SIZE, 0,
(struct sockaddr *)&clnt_addr, &addr_len);
if (result >= 0)
{
recv_buf[result] = 0;
printf("[Daytime] recv: \"%s\", from %s\r\n",
recv_buf, inet_ntoa(clnt_addr.sin_addr));
now_time = time(0); /* µÃµ½µ±Ç°Ê±¼ä */
time_str = ctime(&now_time);
/* Ïò¿Í»§¶Ë·¢Ë͵±Ç°µÄÈÕÆÚºÍʱ¼ä×Ö·û´® */
sendto(srv_sock, time_str, strlen(time_str), 0,
(struct sockaddr *)&clnt_addr, addr_len);
}
}
closesocket(srv_sock);
WSACleanup();
return 0;
}
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/CoreDAV.framework/CoreDAV
*/
@protocol CoreDAVTaskGroupDelegate <NSObject>
@optional
- (void)taskGroup:(id)group didFinishWithError:(id)error;
@end
|
#ifndef __LCD_GB_H__
#define __LCD_GB_H__
#include "defs.h"
struct vissprite
{
byte *buf;
int x;
byte pal, pri;
};
struct scan
{
int bg[64];
int wnd[64];
#if LCD_DEPTH == 1
byte buf[8][256];
#elif LCD_DEPTH == 2
byte buf[4][256];
#elif LCD_DEPTH > 4
byte buf[256];
#endif
un16 pal[64];
byte pri[256];
struct vissprite vs[16];
int ns, l, x, y, s, t, u, v, wx, wy, wt, wv;
};
struct obj
{
byte y;
byte x;
byte pat;
byte flags;
};
struct lcd
{
byte vbank[2][8192];
union
{
byte mem[256];
struct obj obj[40];
} oam;
byte pal[128];
};
extern struct lcd lcd;
extern struct scan scan;
void lcd_begin(void) ICODE_ATTR;
void lcd_refreshline(void) ICODE_ATTR;
void pal_write(int i, byte b) ICODE_ATTR;
void pal_write_dmg(int i, int mapnum, byte d) ICODE_ATTR;
void vram_write(addr a, byte b) ICODE_ATTR;
void vram_dirty(void) ICODE_ATTR;
void pal_dirty(void) ICODE_ATTR;
void lcd_reset(void);
#endif
|
/*
* uffs/flash/nand.h
*
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Info:
* Contains standard defines and IDs for NAND flash devices
*/
#ifndef __RTT_DFS_NAND_H__
#define __RTT_DFS_NAND_H__
/*
* Standard NAND flash commands
*/
#define NAND_CMD_READ0 0 /* Read0 */
#define NAND_CMD_READ1 1 /* Read1 */
#define NAND_CMD_RNDOUT 5 /* Random data output */
#define NAND_CMD_PAGEPROG 0x10 /* Write phase 2 */
#define NAND_CMD_READOOB 0x50 /* Read oob */
#define NAND_CMD_ERASE1 0x60 /* Erase phase 1 */
#define NAND_CMD_STATUS 0x70 /* Status read */
#define NAND_CMD_STATUS_MULTI 0x71
#define NAND_CMD_SEQIN 0x80 /* Write phase 1 */
#define NAND_CMD_RNDIN 0x85 /* Random data input */
#define NAND_CMD_READID 0x90 /* ReadID,all-purpose command */
#define NAND_CMD_ERASE2 0xd0 /* Erase phase 2 */
#define NAND_CMD_RESET 0xff /* Reset */
/* Extended commands for large page devices */
#define NAND_CMD_READSTART 0x30
#define NAND_CMD_RNDOUTSTART 0xE0
#define NAND_CMD_CACHEDPROG 0x15
#define NAND_CMD_READ_EDC 0x7b
/* define low accessing value */
#define TOTAL_BLOCKS 2048 /* total block of whole chip */
#define PAGE_DATA_SIZE 2048 /* max size of page data */
#define PAGE_SPARE_SIZE 64 /* max size of extended partition */
#define PAGES_PER_BLOCK 64 /* max pages per block' */
#define PAGE_SIZE (PAGE_DATA_SIZE+PAGE_SPARE_SIZE)/* max size per whole page */
#define BLOCK_DATA_SIZE (PAGE_DATA_SIZE*PAGES_PER_BLOCK)/* max size per block' */
/* bad flags offset in the oob area. */
#define NAND_SMALL_BADBLOCK_POS 5 /* small page FLASH */
#define NAND_LARGE_BADBLOCK_POS 0 /* large page FLASH */
/* Option constants for bizarre disfunctionality and real
* features
*/
/* Chip can not auto increment pages */
#define NAND_NO_AUTOINCR 0x00000001
/* Buswitdh is 16 bit */
#define NAND_BUSWIDTH_16 0x00000002
/* Device supports partial programming without padding */
#define NAND_NO_PADDING 0x00000004
/* Chip has cache program function */
#define NAND_CACHEPRG 0x00000008
/* Chip has copy back function */
#define NAND_COPYBACK 0x00000010
/* AND Chip which has 4 banks and a confusing page / block
* assignment. See Renesas datasheet for further information */
#define NAND_IS_AND 0x00000020
/* Chip has a array of 4 pages which can be read without
* additional ready /busy waits */
#define NAND_4PAGE_ARRAY 0x00000040
/* Options valid for Samsung large page devices */
#define NAND_SAMSUNG_LP_OPTIONS \
(NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
struct nand_flash_dev
{
char *name; /* chip name */
int id; /* chip ID */
unsigned long pagesize; /* max pages */
unsigned long chipsize; /* size of whole chip iMB */
unsigned long blocksize;/* size of block */
unsigned long options; /* option */
};
struct nand_manufacturers
{
int id;
char * name;
};
#endif /*__RTT_DFS_NAND_H__*/
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:34 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/modules.h */
|
#ifndef __FRUIT__
#define __FRUIT__
#include "room.h"
void fruit_draw(RoomElement element);
RoomElement fruit_hit(RoomElement element);
#endif __FRUIT__
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/GMM.framework/GMM
*/
#import <GMM/XXUnknownSuperclass.h>
@interface LBSGCell : XXUnknownSuperclass {
int _lac; // 4 = 0x4
int _cellid; // 8 = 0x8
BOOL _hasMnc; // 12 = 0xc
int _mnc; // 16 = 0x10
BOOL _hasMcc; // 20 = 0x14
int _mcc; // 24 = 0x18
BOOL _hasRssi; // 28 = 0x1c
int _rssi; // 32 = 0x20
BOOL _hasAge; // 36 = 0x24
int _age; // 40 = 0x28
BOOL _hasTimingAdvance; // 44 = 0x2c
int _timingAdvance; // 48 = 0x30
BOOL _hasPrimaryScramblingCode; // 52 = 0x34
int _primaryScramblingCode; // 56 = 0x38
}
@property(assign, nonatomic) int primaryScramblingCode; // G=0x33ef5; S=0x33871; @synthesize=_primaryScramblingCode
@property(assign, nonatomic) BOOL hasPrimaryScramblingCode; // G=0x33ed5; S=0x33ee5; @synthesize=_hasPrimaryScramblingCode
@property(assign, nonatomic) int timingAdvance; // G=0x33825; S=0x3384d; @synthesize=_timingAdvance
@property(assign, nonatomic) BOOL hasTimingAdvance; // G=0x33eb5; S=0x33ec5; @synthesize=_hasTimingAdvance
@property(assign, nonatomic) int age; // G=0x337dd; S=0x33801; @synthesize=_age
@property(assign, nonatomic) BOOL hasAge; // G=0x33e95; S=0x33ea5; @synthesize=_hasAge
@property(assign, nonatomic) int rssi; // G=0x3378d; S=0x337b9; @synthesize=_rssi
@property(assign, nonatomic) BOOL hasRssi; // G=0x33e75; S=0x33e85; @synthesize=_hasRssi
@property(assign, nonatomic) int mcc; // G=0x33741; S=0x33769; @synthesize=_mcc
@property(assign, nonatomic) BOOL hasMcc; // G=0x33e55; S=0x33e65; @synthesize=_hasMcc
@property(assign, nonatomic) int mnc; // G=0x336f5; S=0x3371d; @synthesize=_mnc
@property(assign, nonatomic) BOOL hasMnc; // G=0x33e35; S=0x33e45; @synthesize=_hasMnc
@property(assign, nonatomic) int cellid; // G=0x33e15; S=0x33e25; @synthesize=_cellid
@property(assign, nonatomic) int lac; // G=0x33df5; S=0x33e05; @synthesize=_lac
// declared property getter: - (int)primaryScramblingCode; // 0x33ef5
// declared property setter: - (void)setHasPrimaryScramblingCode:(BOOL)code; // 0x33ee5
// declared property getter: - (BOOL)hasPrimaryScramblingCode; // 0x33ed5
// declared property setter: - (void)setHasTimingAdvance:(BOOL)advance; // 0x33ec5
// declared property getter: - (BOOL)hasTimingAdvance; // 0x33eb5
// declared property setter: - (void)setHasAge:(BOOL)age; // 0x33ea5
// declared property getter: - (BOOL)hasAge; // 0x33e95
// declared property setter: - (void)setHasRssi:(BOOL)rssi; // 0x33e85
// declared property getter: - (BOOL)hasRssi; // 0x33e75
// declared property setter: - (void)setHasMcc:(BOOL)mcc; // 0x33e65
// declared property getter: - (BOOL)hasMcc; // 0x33e55
// declared property setter: - (void)setHasMnc:(BOOL)mnc; // 0x33e45
// declared property getter: - (BOOL)hasMnc; // 0x33e35
// declared property setter: - (void)setCellid:(int)cellid; // 0x33e25
// declared property getter: - (int)cellid; // 0x33e15
// declared property setter: - (void)setLac:(int)lac; // 0x33e05
// declared property getter: - (int)lac; // 0x33df5
- (void)writeTo:(id)to; // 0x33cbd
- (BOOL)readFrom:(id)from; // 0x33b25
- (id)dictionaryRepresentation; // 0x33905
- (id)description; // 0x33895
// declared property setter: - (void)setPrimaryScramblingCode:(int)code; // 0x33871
// declared property setter: - (void)setTimingAdvance:(int)advance; // 0x3384d
// declared property getter: - (int)timingAdvance; // 0x33825
// declared property setter: - (void)setAge:(int)age; // 0x33801
// declared property getter: - (int)age; // 0x337dd
// declared property setter: - (void)setRssi:(int)rssi; // 0x337b9
// declared property getter: - (int)rssi; // 0x3378d
// declared property setter: - (void)setMcc:(int)mcc; // 0x33769
// declared property getter: - (int)mcc; // 0x33741
// declared property setter: - (void)setMnc:(int)mnc; // 0x3371d
// declared property getter: - (int)mnc; // 0x336f5
- (void)dealloc; // 0x336c9
@end
|
/*
* ldi AMOLED LCD panel driver.
*
*
* Copyright (c) 2009 Samsung Electronics
* Aakash Manik <aakash.manik@samsung.com>
*
* Derived from drivers/video/samsung/s3cfb_tl2796.c
*
*
* 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/delay.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/lcd.h>
#include <linux/backlight.h>
#include <plat/gpio-cfg.h>
#include "ldi_common.h"
#define PACKET_LEN 8
unsigned char DELAY=1;
static DEFINE_MUTEX(spi_rd);
static inline void lcd_cs_value(int level)
{
gpio_set_value(S5PV210_MP01(1), level);//GPIO_DISPLAY_CS
}
static inline void lcd_clk_value(int level)
{
gpio_set_value(S5PV210_GPC0(1), level);//GPIO_DISPLAY_CLK
}
static inline void lcd_si_value(int level)
{
gpio_set_value(S5PV210_MP01(0), level);//GPIO_DISPLAY_DAT
}
static inline int get_lcd_si_value()
{
return (gpio_get_value(GPIO_DISPLAY_SI)?1:0);
}
int ldi_spi_read(unsigned char reg)
{
return ldi_spi_read_byte(reg);
}
int ldi_spi_read_byte(unsigned char command)
{
int j,ret;
unsigned short data;
mutex_lock(&spi_rd);
data = (0x00 << 8) + command;
lcd_cs_value(1);
lcd_si_value(1);
lcd_clk_value(1);
udelay(DELAY);
lcd_cs_value(0);
udelay(DELAY);
for (j = PACKET_LEN; j >= 0; j--)
{
lcd_clk_value(0);
/* data high or low */
if ((data >> j) & 0x0001)
lcd_si_value(1);
else
lcd_si_value(0);
udelay(DELAY);
lcd_clk_value(1);
udelay(DELAY);
}
s3c_gpio_cfgpin(GPIO_DISPLAY_SI, S3C_GPIO_INPUT);
s3c_gpio_setpull(GPIO_DISPLAY_SI, S3C_GPIO_PULL_NONE);
ret = 0;
for (j = PACKET_LEN ;j >= 0; j--)
{
lcd_clk_value(0);
udelay(2);
lcd_clk_value(1);
ret |= get_lcd_si_value() << j;
udelay(2);
}
ret = 0;
for (j = PACKET_LEN ;j >= 0; j--)
{
lcd_clk_value(0);
udelay(2);
lcd_clk_value(1);
ret |= get_lcd_si_value() << j;
udelay(2);
}
s3c_gpio_cfgpin(GPIO_DISPLAY_SI, GPIO_DISPLAY_SI_AF);
s3c_gpio_setpull(GPIO_DISPLAY_SI, S3C_GPIO_PULL_NONE);
//printk("ldi_spi_read_byte-------------------------: %x\n",ret);
lcd_cs_value(1);
udelay(DELAY);
mutex_unlock(&spi_rd);
return ret;
}
|
#if !defined(__BORLANDC__)
namespace M302de {
void decomp_pp20(Bit8u *dst, Bit8u *src_data, Bit8u *src, Bit32u len);
}
#else
extern "C" {
void decomp_pp20(Bit8u *dst, Bit8u *src_data, Bit16u off, Bit16u seg, Bit32u len);
}
#endif
|
/*
* Copyright (c) 2007 Cyrille Berger (cberger@cberger.net)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _KIS_IMAGE_ALIGNMENT_MODEL_P_H_
#define _KIS_IMAGE_ALIGNMENT_MODEL_P_H_
#include <vector>
#include <gmm/gmm_matrix.h>
#include "kis_image_alignment_model.h"
class KisImageAlignmentModel::OptimizationFunction
{
public:
virtual ~OptimizationFunction();
virtual std::vector<double> values(const std::vector<double>& parameters) = 0;
virtual gmm::row_matrix< gmm::rsvector<double> > jacobian(const std::vector<double>& parameters) = 0;
virtual void removeOutlier(const std::vector<double>& parameters, double threshold) = 0;
};
#endif
|
/*
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2014 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NET_EATHENA_BEINGHANDLER_H
#define NET_EATHENA_BEINGHANDLER_H
#include "net/ea/beinghandler.h"
#include "net/eathena/messagehandler.h"
namespace EAthena
{
class BeingHandler final : public MessageHandler, public Ea::BeingHandler
{
public:
explicit BeingHandler(const bool enableSync);
A_DELETE_COPY(BeingHandler)
void handleMessage(Net::MessageIn &msg) override final;
void requestNameById(const int id) const override final;
void undress(Being *const being) const override final;
void processBeingVisibleOrMove(Net::MessageIn &msg,
const bool visible) override final;
protected:
void processBeingChangeLook(Net::MessageIn &msg,
const bool look2) const;
static void processNameResponse2(Net::MessageIn &msg);
void processPlayerMoveUpdate(Net::MessageIn &msg,
const int type) const;
};
} // namespace EAthena
#endif // NET_EATHENA_BEINGHANDLER_H
|
/*
* Result.h
*
* Author: knightl
*/
#ifndef RESULT_H_
#define RESULT_H_
class Result {
public:
int problems, penalty;
Result(int problems, int penalty);
bool operator<(const Result& b) const;
bool operator==(const Result& b) const;
bool operator>(const Result& b) const;
bool operator!=(const Result& b) const;
Result operator+(const Result& b) const;
Result& operator+=(const Result& b);
};
#endif /* RESULT_H_ */
|
#ifndef dataFormats_PropagationDirection_H
#define dataFormats_PropagationDirection_H
enum PropagationDirection {oppositeToMomentum, alongMomentum, anyDirection};
#endif
|
#ifndef ParameterSet_ParameterSet_h
#define ParameterSet_ParameterSet_h
/* our own simplistic version of ParameterSet. Just enough to get through
* with ConfigurableVertexReco ...
*/
#include "Environment/Configuration/interface/MultiType.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include <string>
#include <vector>
#include <map>
#include <ostream>
#include <sstream>
#include <exception>
// ----------------------------------------------------------------------
// contents
namespace edm {
class ParameterSet {
public:
void augment( ParameterSet const & from );
std::vector<std::string> getParameterNames() const;
template <class T> T getParameter ( const std::string & name ) const
{
if (!(theMap.count(name)))
{
throw edm::Exception(errors::Configuration, "MissingParameter:")
<< "The required parameter '" << name << "' was not specified.\n";
}
return (T) (theMap[name]);
}
/*
template <class T> T getParameter( const std::string & name, const T & defaultValue ) const
{
if (!(theMap.count(name)))
{
return defaultValue;
}
return (T) (theMap[name]);
}
*/
template <class T> void addParameter( const std::string & name, const T & defaultValue ) const
{
theMap[name]=defaultValue;
}
template <class T> T getUntrackedParameter( const std::string & name ) const
{
return getParameter<T> ( name );
}
template <class T> T getUntrackedParameter( const std::string & name, const T & defaultValue ) const
{
try {
return getParameter<T> ( name );
} catch ( edm::Exception & ) {};
return defaultValue;
}
template <class T> void addUntrackedParameter( const std::string & name, const T & defaultValue ) const
{
addParameter<T> ( name, defaultValue );
}
std::string toString() const;
bool isEmpty() const;
private:
mutable std::map < std::string, dataharvester::MultiType > theMap;
mutable std::map < std::string, edm::ParameterSet > theNested;
}; // ParameterSet
/*
template<> inline ParameterSet ParameterSet::getParameter<edm::ParameterSet>
(std::string const& name, edm::ParameterSet const& defaultValue) const
{
if (!theNested.count(name) ) return defaultValue;
return theNested[name];
}
*/
/*
template<> inline ParameterSet ParameterSet::getUntrackedParameter<edm::ParameterSet>
(std::string const& name, edm::ParameterSet const& defaultValue) const
{
return getParameter<edm::ParameterSet>(name,defaultValue);
try {
return getParameter<edm::ParameterSet>(name);
} catch ( edm::Exception & ) {};
return defaultValue;
}
*/
template<> inline ParameterSet ParameterSet::getParameter<edm::ParameterSet>
(std::string const& name) const
{
if (!theNested.count(name) ) throw edm::Exception( errors::Configuration, "MissingParameter:" )
<< "The required parameter '" << name << "' was not specified.\n";
return theNested[name];
}
template<> inline ParameterSet ParameterSet::getUntrackedParameter<edm::ParameterSet>
(std::string const& name) const
{
return getParameter<edm::ParameterSet>(name);
}
template<> inline void ParameterSet::addParameter<edm::ParameterSet>
(std::string const& name, const edm::ParameterSet & defaultValue ) const
{
theNested[name]=defaultValue;
}
template<> inline void ParameterSet::addUntrackedParameter<edm::ParameterSet>
(std::string const& name, const edm::ParameterSet & defaultValue ) const
{
addParameter<edm::ParameterSet>(name,defaultValue);
}
} // namespace edm
std::ostream & operator<< (std::ostream& os, const edm::ParameterSet & );
#endif
|
/*
* Copyright (C) 2000, 2001 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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.
*/
/*
* These are routines to set up and handle interrupts from the
* sb1250 general purpose timer 0. We're using the timer as a
* system clock, so we set it up to run at 100 Hz. On every
* interrupt, we update our idea of what the time of day is,
* then call do_timer() in the architecture-independent kernel
* code to do general bookkeeping (e.g. update jiffies, run
* bottom halves, etc.)
*/
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <asm/irq.h>
#include <asm/ptrace.h>
#include <asm/addrspace.h>
#include <asm/sibyte/sb1250.h>
#include <asm/sibyte/sb1250_regs.h>
#include <asm/sibyte/sb1250_int.h>
#include <asm/sibyte/sb1250_scd.h>
#include <asm/sibyte/64bit.h>
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
#define IMR_IP2_VAL K_INT_MAP_I0
#define IMR_IP3_VAL K_INT_MAP_I1
#define IMR_IP4_VAL K_INT_MAP_I2
void sb1250_time_init(void)
{
int cpu = smp_processor_id();
/* Only have 4 general purpose timers */
if (cpu > 3) {
BUG();
}
sb1250_mask_irq(cpu, K_INT_TIMER_0 + cpu);
/* Map the timer interrupt to ip[4] of this cpu */
out64(IMR_IP4_VAL, KSEG1 + A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE)
+ ((K_INT_TIMER_0 + cpu)<<3));
/* the general purpose timer ticks at 1 Mhz independent if the rest of the system */
/* Disable the timer and set up the count */
out64(0, KSEG1 + A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
out64(
#ifndef CONFIG_SIMULATION
1000000/HZ
#else
50000/HZ
#endif
, KSEG1 + A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
/* Set the timer running */
out64(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
KSEG1 + A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
sb1250_unmask_irq(cpu, K_INT_TIMER_0 + cpu);
/*
* This interrupt is "special" in that it doesn't use the request_irq
* way to hook the irq line. The timer interrupt is initialized early
* enough to make this a major pain, and it's also firing enough to
* warrant a bit of special case code. sb1250_timer_interrupt is called * directly from irq_handler.S when IP[4] is set during an interrupt
*/
}
extern int set_rtc_mmss(unsigned long nowtime);
extern rwlock_t xtime_lock;
static long last_rtc_update = 0;
void sb1250_timer_interrupt(struct pt_regs *regs)
{
int cpu = smp_processor_id();
/* Reset the timer */
out64(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
KSEG1 + A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
/*
* Need to do some stuff here with xtime, too, but that looks like
* it should be architecture independent...does it really belong here?
*/
if (!cpu) {
do_timer(regs);
read_lock(&xtime_lock);
if ((time_status & STA_UNSYNC) == 0
&& xtime.tv_sec > last_rtc_update + 660
&& xtime.tv_usec >= 500000 - (tick >> 1)
&& xtime.tv_usec <= 500000 + (tick >> 1))
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
/* do it again in 60 s */
last_rtc_update = xtime.tv_sec - 600;
read_unlock(&xtime_lock);
}
#ifdef CONFIG_SMP
/*
* We need to make like a normal interrupt -- otherwise timer
* interrupts ignore the global interrupt lock, which would be
* a Bad Thing.
*/
irq_enter(cpu, 0);
update_process_times(user_mode(regs));
irq_exit(cpu, 0);
if (softirq_pending(cpu))
do_softirq();
#endif /* CONFIG_SMP */
}
|
/*
build.c
Build number and version strings
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#include "qwsvdef.h"
/*
=======================
VersionStringFull
======================
*/
char *VersionStringFull (void)
{
static char str[256];
if (!str[0]) {
if (!strlen(GIT_COMMIT)) {
snprintf(str, sizeof(str), SERVER_NAME " " SERVER_VERSION);
} else {
snprintf(str, sizeof(str), SERVER_NAME " " SERVER_VERSION " (build " GIT_COMMIT "-" QW_PLATFORM_SHORT ")");
}
}
return str;
}
|
/****************************************************************
* *
* Copyright 2001 Sanchez Computer Associates, Inc. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
/*
* omi_prc_def.c ---
*
* Process a DEFINE request.
*
*/
#ifndef lint
static char rcsid[] = "$Header: /cvsroot/fis-gtm/gtm/sr_unix_cm/omi_prc_def.c,v 1.2 2002/06/13 14:34:46 miazim Exp $";
#endif
#include "mdef.h"
#include "gtm_string.h"
#include "omi.h"
#include "error.h"
#include "stringpool.h"
#include "op.h"
int
omi_prc_def(omi_conn *cptr, char *xend, char *buff, char *bend)
{
GBLREF bool undef_inhibit;
char *bptr;
omi_li len;
int rv;
mval vo, vd, vg;
bptr = buff;
/* Global Ref */
OMI_LI_READ(&len, cptr->xptr);
/* Set up a condition handler */
ESTABLISH_RET(omi_dbms_ch,0);
rv = omi_gvextnam(cptr, len.value, cptr->xptr);
/* If true, there was an error finding the global reference in the DBMS */
if (rv < 0) {
REVERT;
return rv;
}
cptr->xptr += len.value;
/* Bounds checking */
if (cptr->xptr > xend) {
REVERT;
return -OMI_ER_PR_INVMSGFMT;
}
/* We want to make sure there is plenty of space in the string pool
* for all three operations ($ORDER, $GET, $DATA) */
if (cptr->exts & OMI_XTF_NEWOP)
stp_gcol(0);
/* $DATA */
op_gvdata(&vd);
if (!(vd.mvtype & MV_INT)) {
REVERT;
return -OMI_ER_DB_UNRECOVER;
}
if (cptr->exts & OMI_XTF_NEWOP) {
/* $GET */
undef_inhibit = TRUE;
rv = op_gvget(&vg);
/* $ORDER */
op_gvorder(&vo);
OMI_SI_WRIT(vo.str.len, bptr);
if (vo.str.len) {
memcpy(bptr, vo.str.addr, vo.str.len);
bptr += vo.str.len;
}
}
/* $DATA (buffer write) */
OMI_SI_WRIT(vd.m[1] / MV_BIAS, bptr);
if (cptr->exts & OMI_XTF_NEWOP) {
/* $GET (buffer write) */
OMI_SI_WRIT((rv ? 1 : 0), bptr);
if (!rv || !vg.str.len)
OMI_LI_WRIT(0, bptr);
else {
OMI_LI_WRIT(vg.str.len, bptr);
memcpy(bptr, vg.str.addr, vg.str.len);
bptr += vg.str.len;
}
}
REVERT;
return bptr - buff;
}
|
/****************************************************************************
* Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved.
* Copyright (C) 2011-2013 Sourcefire, Inc.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
****************************************************************************/
#ifndef __SIP_PAF_H__
#define __SIP_PAF_H__
#include "sfPolicy.h"
#include "sfPolicyUserData.h"
#ifdef TARGET_BASED
void register_sip_paf_service(struct _SnortConfig *sc, int16_t app, tSfPolicyId policy);
#endif
void register_sip_paf_port(struct _SnortConfig *sc, unsigned int i, tSfPolicyId policy);
#endif
|
#define INFO_VER 0x10
enum chip_ids {
PMIC_POWER = 0x2000,
PMIC_GPIO,
PMIC_LED_LCD,
PMIC_RTC,
PMIC_BATT,
MSIC_ID,
MSIC_IRQ,
MSIC_GPIO,
MSIC_SVID,
MSIC_VREG,
MSIC_RESET,
MSIC_BURST,
MSIC_RTC,
MSIC_CHARGER,
MSIC_ADC,
MSIC_AUDIO,
MSIC_HDMI,
CHIP_ID_END
};
struct reg_info {
unsigned short version;
unsigned short valid;
unsigned int chip_id;
unsigned int register_id;
unsigned int register_value;
};
|
/*
* CINELERRA
* Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 RESOURCEPIXMAP_H
#define RESOURCEPIXMAP_H
#include "bctimer.inc"
#include "edit.inc"
#include "guicast.h"
#include "mwindow.inc"
#include "trackcanvas.inc"
// Can't use garbage collection for GUI elements because they need to
// lock the window for deletion.
class ResourcePixmap : public BC_Pixmap
{
public:
ResourcePixmap(MWindow *mwindow,
MWindowGUI *gui,
Edit *edit,
int pane_number,
int w,
int h);
~ResourcePixmap();
void resize(int w, int h);
void draw_data(TrackCanvas *canvas,
Edit *edit,
int64_t edit_x,
int64_t edit_w,
int64_t pixmap_x,
int64_t pixmap_w,
int64_t pixmap_h,
int mode,
int indexes_only);
void draw_audio_resource(TrackCanvas *canvas,
Edit *edit,
int x,
int w);
void draw_video_resource(TrackCanvas *canvas,
Edit *edit,
int64_t edit_x,
int64_t edit_w,
int64_t pixmap_x,
int64_t pixmap_w,
int refresh_x,
int refresh_w,
int mode);
void draw_audio_source(TrackCanvas *canvas,
Edit *edit,
int x,
int w);
void draw_subttl_resource(TrackCanvas *canvas,
Edit *edit,
int x,
int w);
// Called by ResourceThread to update pixmap
void draw_wave(TrackCanvas *canvas,
int x,
double high,
double low);
void draw_title(TrackCanvas *canvas,
Edit *edit,
int64_t edit_x,
int64_t edit_w,
int64_t pixmap_x,
int64_t pixmap_w);
void reset();
// Change to hourglass if timer expired
void test_timer();
void dump();
MWindow *mwindow;
MWindowGUI *gui;
// Visible in entire track canvas
int visible;
// Section drawn
int64_t edit_id;
int pane_number;
int64_t edit_x, pixmap_x, pixmap_w, pixmap_h;
int64_t zoom_sample, zoom_track, zoom_y;
int64_t startsource;
double source_framerate, project_framerate;
int64_t source_samplerate, project_samplerate;
int data_type;
// Timer to cause an hourglass to appear
Timer *timer;
};
#endif
|
/***************************************************************************
file : soundconfig.h
created : Thu Dec 12 15:11:55 CET 2004
copyright : (C) 2004 Bernhard Wymann
email : berniw@bluewin.ch
version : $Id: soundconfig.h,v 1.1 2005/02/01 15:58:23 berniw Exp $
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/** @file
@version $Id: soundconfig.h,v 1.1 2005/02/01 15:58:23 berniw Exp $
*/
#ifndef _SOUNDCONFIG_H_
#define _SOUNDCONFIG_H_
extern void *SoundMenuInit(void *prevMenu);
#endif // _SOUNDCONFIG_H_
|
/**
********************************************************************************
\file identu.h
\brief Definitions for identu module
This file contains the definitions for the identu modules.
*******************************************************************************/
/*------------------------------------------------------------------------------
Copyright (c) 2012, SYSTEC electronic GmbH
Copyright (c) 2014, Bernecker+Rainer Industrie-Elektronik Ges.m.b.H. (B&R)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------*/
#ifndef _INC_identu_H_
#define _INC_identu_H_
//------------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------------
#include <common/oplkinc.h>
#include <oplk/frame.h>
//------------------------------------------------------------------------------
// const defines
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// typedef
//------------------------------------------------------------------------------
typedef tOplkError (*tIdentuCbResponse)(UINT nodeId_p, tIdentResponse* pIdentResponse_p);
//------------------------------------------------------------------------------
// function prototypes
//------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C"
{
#endif
tOplkError identu_init(void);
tOplkError identu_addInstance(void);
tOplkError identu_delInstance(void);
tOplkError identu_reset(void);
tOplkError identu_getIdentResponse(UINT nodeId_p, tIdentResponse** ppIdentResponse_p);
tOplkError identu_requestIdentResponse(UINT nodeId_p, tIdentuCbResponse pfnCbResponse_p);
UINT32 identu_getRunningRequests(void);
#ifdef __cplusplus
}
#endif
#endif /* _INC_identu_H_ */
|
/* -*-C++-*-
**********************************************************************
Copyright (C) 2005-2006, eMolecules, Inc. (www.emolecules.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 version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************
+======================================================================
| FILE: canon.h
| AUTHOR: Craig A. James
| DESCRIPTION:
| Declarations for canon.cpp
+======================================================================
*/
// Return vector is indexed from zero, corresponds to "atom->GetIdx()-1"
namespace OpenBabel {
void CanonicalLabels(OBMol *pmol,
OBBitVec &frag_atoms,
std::vector<unsigned int> &symmetry_classes,
std::vector<unsigned int> &canonical_labels);
} // namespace OpenBabel
//! \file canon.h
//! \brief Canonical numbering of SMILES, molecules and fragments
|
/*
* linux/arch/arm/mach-ep93xx/dma.c
*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/init.h>
#include <asm/dma.h>
#include <asm/mach/dma.h>
void __init arch_dma_init(dma_t *dma)
{
}
|
/*
* CRL reading application
*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
*
* This file is part of mbed TLS (https://polarssl.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "polarssl/config.h"
#include "polarssl/x509.h"
#define DFL_FILENAME "crl.pem"
#define DFL_DEBUG_LEVEL 0
/*
* global options
*/
struct options
{
const char *filename; /* filename of the certificate file */
int debug_level; /* level of debugging */
} opt;
void my_debug( void *ctx, int level, const char *str )
{
if( level < opt.debug_level )
{
fprintf( (FILE *) ctx, "%s", str );
fflush( (FILE *) ctx );
}
}
#define USAGE \
"\n usage: crl_app param=<>...\n" \
"\n acceptable parameters:\n" \
" filename=%%s default: crl.pem\n" \
" debug_level=%%d default: 0 (disabled)\n" \
"\n"
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
!defined(POLARSSL_X509_PARSE_C) || !defined(POLARSSL_FS_IO)
int main( int argc, char *argv[] )
{
((void) argc);
((void) argv);
printf("POLARSSL_BIGNUM_C and/or POLARSSL_RSA_C and/or "
"POLARSSL_X509_PARSE_C and/or POLARSSL_FS_IO not defined.\n");
return( 0 );
}
#else
int main( int argc, char *argv[] )
{
int ret = 0;
unsigned char buf[100000];
x509_crl crl;
int i;
char *p, *q;
/*
* Set to sane values
*/
memset( &crl, 0, sizeof( x509_crl ) );
if( argc == 0 )
{
usage:
printf( USAGE );
goto exit;
}
opt.filename = DFL_FILENAME;
opt.debug_level = DFL_DEBUG_LEVEL;
for( i = 1; i < argc; i++ )
{
p = argv[i];
if( ( q = strchr( p, '=' ) ) == NULL )
goto usage;
*q++ = '\0';
if( strcmp( p, "filename" ) == 0 )
opt.filename = q;
else if( strcmp( p, "debug_level" ) == 0 )
{
opt.debug_level = atoi( q );
if( opt.debug_level < 0 || opt.debug_level > 65535 )
goto usage;
}
else
goto usage;
}
/*
* 1.1. Load the CRL
*/
printf( "\n . Loading the CRL ..." );
fflush( stdout );
ret = x509parse_crlfile( &crl, opt.filename );
if( ret != 0 )
{
printf( " failed\n ! x509parse_crl returned %d\n\n", ret );
x509_crl_free( &crl );
goto exit;
}
printf( " ok\n" );
/*
* 1.2 Print the CRL
*/
printf( " . CRL information ...\n" );
ret = x509parse_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
if( ret == -1 )
{
printf( " failed\n ! x509parse_crl_info returned %d\n\n", ret );
x509_crl_free( &crl );
goto exit;
}
printf( "%s\n", buf );
exit:
x509_crl_free( &crl );
#if defined(_WIN32)
printf( " + Press Enter to exit this program.\n" );
fflush( stdout ); getchar();
#endif
return( ret );
}
#endif /* POLARSSL_BIGNUM_C && POLARSSL_RSA_C && POLARSSL_X509_PARSE_C &&
POLARSSL_FS_IO */
|
#ifndef _TEXT_HEADER_
#define _TEXT_HEADER_
#include "common/defs.h"
void init_text(void);
void deinit_text(void);
void print_text_simple(SDL_Surface *s, char *text, Uint16 x, Uint16 y);
#endif /* _TEXT_HEADER_ */
|
/*
Copyright (c) 2005-2009 by Jakob Schroeter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef DATAFORMREPORTED_H__
#define DATAFORMREPORTED_H__
#include "dataformfieldcontainer.h"
namespace gloox
{
class Tag;
/**
* @brief An abstraction of a <reported> element in a @xep{0004} Data Form of type result.
*
* There are some constraints regarding usage of this element you should be aware of. Check @xep{0004}
* section 3.4. This class does not enforce correct usage at this point.
*
* @author Jakob Schroeter <js@camaya.net>
* @since 0.7
*/
class GLOOX_API DataFormReported : public DataFormFieldContainer
{
public:
/**
* Creates an empty 'reported' element you can add fields to.
*/
DataFormReported();
/**
* Creates a 'reported' element and fills it with the 'field' elements contained in the given Tag.
* The Tag's root element must be a 'reported' element. Its child element should be 'field' elements.
* @param tag The tag to read the 'field' elements from.
* @since 0.8.5
*/
DataFormReported( Tag* tag );
/**
* Virtual destructor.
*/
virtual ~DataFormReported();
/**
* Creates and returns a Tag representation of the current object.
* @return A Tag representation of the current object.
*/
virtual Tag* tag() const;
};
}
#endif // DATAFORMREPORTED_H__
|
/*
* Copyright (C) 2002-2022 by the Widelands Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*
*/
#ifndef WL_EDITOR_TOOLS_MULTI_SELECT_H
#define WL_EDITOR_TOOLS_MULTI_SELECT_H
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <vector>
/**
* This class allows for selection of more than just one
* thing. Like more than one texture, more than one map object
*
* This is a helper class, no Editor Tool (might be usable in game too)
*/
struct MultiSelect {
MultiSelect() : nr_enabled_(0) {
}
~MultiSelect() {
}
void enable(int32_t n, bool t) {
if (static_cast<int32_t>(enabled_.size()) < n + 1)
enabled_.resize(n + 1, false);
if (enabled_[n] == t)
return;
enabled_[n] = t;
if (t)
++nr_enabled_;
else
--nr_enabled_;
assert(0 <= nr_enabled_);
}
bool is_enabled(int32_t n) const {
if (static_cast<int32_t>(enabled_.size()) < n + 1)
return false;
return enabled_[n];
}
int32_t get_nr_enabled() const {
return nr_enabled_;
}
int32_t get_random_enabled() const {
const int32_t rand_value =
static_cast<int32_t>(static_cast<double>(get_nr_enabled()) * rand() / (RAND_MAX + 1.0));
int32_t i = 0;
int32_t j = rand_value + 1;
while (j) {
if (is_enabled(i))
--j;
++i;
}
return i - 1;
}
private:
int32_t nr_enabled_;
std::vector<bool> enabled_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_MULTI_SELECT_H
|
/*
* Copyright (C) ST-Ericsson SA 2010
* Author: Rickard Andersson <rickard.andersson@stericsson.com> for
* ST-Ericsson.
* License terms: GNU General Public License (GPL) version 2
*
*/
#include <linux/io.h>
#include <linux/percpu.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/nomadik.h>
#include <asm/hardware/gic.h>
#include <asm/processor.h>
#include <mach/hardware.h>
#include <mach/pm.h>
#define STABILIZATION_TIME 30 /* us */
#define GIC_FREEZE_DELAY 1 /* us */
#define PRCM_ARM_WFI_STANDBY_CPU0_WFI 0x8
#define PRCM_ARM_WFI_STANDBY_CPU1_WFI 0x10
/* Dual A9 core interrupt management unit registers */
#define PRCM_A9_MASK_REQ (_PRCMU_BASE + 0x328)
#define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ 0x1
#define PRCM_A9_MASK_ACK (_PRCMU_BASE + 0x32c)
#define PRCM_ARMITMSK31TO0 (_PRCMU_BASE + 0x11c)
#define PRCM_ARMITMSK63TO32 (_PRCMU_BASE + 0x120)
#define PRCM_ARMITMSK95TO64 (_PRCMU_BASE + 0x124)
#define PRCM_ARMITMSK127TO96 (_PRCMU_BASE + 0x128)
#define PRCM_POWER_STATE_VAL (_PRCMU_BASE + 0x25C)
#define PRCM_ARMITVAL31TO0 (_PRCMU_BASE + 0x260)
#define PRCM_ARMITVAL63TO32 (_PRCMU_BASE + 0x264)
#define PRCM_ARMITVAL95TO64 (_PRCMU_BASE + 0x268)
#define PRCM_ARMITVAL127TO96 (_PRCMU_BASE + 0x26C)
/* ARM WFI Standby signal register */
#define PRCM_ARM_WFI_STANDBY (_PRCMU_BASE + 0x130)
/* IO force */
#define PRCM_IOCR (_PRCMU_BASE + 0x310)
#define PRCM_IOCR_IOFORCE 0x1
static u32 u8500_gpio_banks[] = {U8500_GPIOBANK0_BASE,
U8500_GPIOBANK1_BASE,
U8500_GPIOBANK2_BASE,
U8500_GPIOBANK3_BASE,
U8500_GPIOBANK4_BASE,
U8500_GPIOBANK5_BASE,
U8500_GPIOBANK6_BASE,
U8500_GPIOBANK7_BASE,
U8500_GPIOBANK8_BASE};
static u32 u5500_gpio_banks[] = {U5500_GPIOBANK0_BASE,
U5500_GPIOBANK1_BASE,
U5500_GPIOBANK2_BASE,
U5500_GPIOBANK3_BASE,
U5500_GPIOBANK4_BASE,
U5500_GPIOBANK5_BASE,
U5500_GPIOBANK6_BASE,
U5500_GPIOBANK7_BASE};
static u32 ux500_gpio_wks[ARRAY_SIZE(u8500_gpio_banks)];
inline int ux500_pm_arm_on_ext_clk(bool leave_arm_pll_on)
{
return 0;
}
/* Decouple GIC from the interrupt bus */
void ux500_pm_gic_decouple(void)
{
writel(readl(PRCM_A9_MASK_REQ) | PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ,
PRCM_A9_MASK_REQ);
while (!readl(PRCM_A9_MASK_REQ))
cpu_relax();
/* TODO: Use the ack bit when possible */
udelay(GIC_FREEZE_DELAY); /* Wait for the GIC to freeze */
}
/* Recouple GIC with the interrupt bus */
void ux500_pm_gic_recouple(void)
{
writel((readl(PRCM_A9_MASK_REQ) & ~PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ),
PRCM_A9_MASK_REQ);
/* TODO: Use the ack bit when possible */
}
#define GIC_NUMBER_REGS 5
bool ux500_pm_gic_pending_interrupt(void)
{
u32 pr; /* Pending register */
u32 er; /* Enable register */
int i;
/* 5 registers. STI & PPI not skipped */
for (i = 0; i < GIC_NUMBER_REGS; i++) {
pr = readl_relaxed(__io_address(U8500_GIC_DIST_BASE) +
GIC_DIST_PENDING_SET + i * 4);
er = readl_relaxed(__io_address(U8500_GIC_DIST_BASE) +
GIC_DIST_ENABLE_SET + i * 4);
if (pr & er)
return true; /* There is a pending interrupt */
}
return false;
}
#define GIC_NUMBER_SPI_REGS 4
bool ux500_pm_prcmu_pending_interrupt(void)
{
u32 it;
u32 im;
int i;
for (i = 0; i < GIC_NUMBER_SPI_REGS; i++) { /* There are 4 registers */
it = readl(PRCM_ARMITVAL31TO0 + i * 4);
im = readl(PRCM_ARMITMSK31TO0 + i * 4);
if (it & im)
return true; /* There is a pending interrupt */
}
return false;
}
void ux500_pm_prcmu_set_ioforce(bool enable)
{
if (enable)
writel(readl(PRCM_IOCR) | PRCM_IOCR_IOFORCE, PRCM_IOCR);
else
writel(readl(PRCM_IOCR) & ~PRCM_IOCR_IOFORCE, PRCM_IOCR);
}
void ux500_pm_prcmu_copy_gic_settings(void)
{
u32 er; /* Enable register */
int i;
for (i = 0; i < GIC_NUMBER_SPI_REGS; i++) { /* 4*32 SPI interrupts */
/* +1 due to skip STI and PPI */
er = readl_relaxed(__io_address(U8500_GIC_DIST_BASE) +
GIC_DIST_ENABLE_SET + (i + 1) * 4);
writel(er, PRCM_ARMITMSK31TO0 + i * 4);
}
}
void ux500_pm_gpio_save_wake_up_status(void)
{
int num_banks;
u32 *banks;
int i;
if (cpu_is_u5500()) {
num_banks = ARRAY_SIZE(u5500_gpio_banks);
banks = u5500_gpio_banks;
} else {
num_banks = ARRAY_SIZE(u8500_gpio_banks);
banks = u8500_gpio_banks;
}
nmk_gpio_clocks_enable();
for (i = 0; i < num_banks; i++)
ux500_gpio_wks[i] = readl(__io_address(banks[i]) + NMK_GPIO_WKS);
nmk_gpio_clocks_disable();
}
u32 ux500_pm_gpio_read_wake_up_status(unsigned int bank_num)
{
if (WARN_ON(cpu_is_u5500() && bank_num >=
ARRAY_SIZE(u5500_gpio_banks)))
return 0;
if (WARN_ON(cpu_is_u8500() && bank_num >=
ARRAY_SIZE(u8500_gpio_banks)))
return 0;
return ux500_gpio_wks[bank_num];
}
/* Check if the other CPU is in WFI */
bool ux500_pm_other_cpu_wfi(void)
{
if (smp_processor_id()) {
/* We are CPU 1 => check if CPU0 is in WFI */
if (readl(PRCM_ARM_WFI_STANDBY) &
PRCM_ARM_WFI_STANDBY_CPU0_WFI)
return true;
} else {
/* We are CPU 0 => check if CPU1 is in WFI */
if (readl(PRCM_ARM_WFI_STANDBY) &
PRCM_ARM_WFI_STANDBY_CPU1_WFI)
return true;
}
return false;
}
/* PRCM_ACK_MB0_AP_PWRSTTR_STATUS */
#define DB8500_PRCMU_STATUS_REGISTER 0x801b8e08
#define DB5500_PRCMU_STATUS_REGISTER 0x80168f38
enum prcmu_idle_stat ux500_pm_prcmu_idle_stat(void)
{
u32 val;
void __iomem *prcmu_status_reg;
if (cpu_is_u8500())
prcmu_status_reg = __io_address(DB8500_PRCMU_STATUS_REGISTER);
else if (cpu_is_u5500())
prcmu_status_reg = __io_address(DB5500_PRCMU_STATUS_REGISTER);
else
ux500_unknown_soc();
val = readl(prcmu_status_reg) & 0xff;
return (enum prcmu_idle_stat)val;
}
|
#ifndef HTMLRENDERER_H
#define HTMLRENDERER_H
#include <QtWebKit>
#include <QNetworkReply>
#include <QSslError>
#if QT_VERSION >= 0x050000
#include <QtWebKitWidgets>
#endif
class TemplateRenderer;
class TemplatePage : public QWebPage {
Q_OBJECT
public:
TemplatePage() : QWebPage() {
setAttribute(QWebSettings::AutoLoadImages, true);
setAttribute(QWebSettings::JavascriptEnabled, true);
setAttribute(QWebSettings::LinksIncludedInFocusChain, true);
setAttribute(QWebSettings::PrintElementBackgrounds, true);
// The documentation does not say, but it seems the mainFrame
// will never change, so we can set this here. Otherwise we'd
// have to set this in snapshot and trigger an update, which
// is not currently possible (Qt 4.4.0) as far as I can tell.
mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
}
void setAttribute(QWebSettings::WebAttribute option, bool value);
protected:
QString chooseFile(QWebFrame *frame, const QString& suggestedFile);
void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID);
bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result);
void javaScriptAlert(QWebFrame* frame, const QString& msg);
bool javaScriptConfirm(QWebFrame* frame, const QString& msg);
};
class DicomProcessor;
class TemplateRenderer : public QObject {
Q_OBJECT
public:
TemplateRenderer();
~TemplateRenderer();
void setTemplatePath(QString templateFilePath);
TemplatePage *getPage();
void setDcmProcessor(DicomProcessor *dcmProcessor);
signals:
void pageRendered(QImage *image);
private slots:
void DocumentComplete(bool ok);
void InitialLayoutCompleted();
void JavaScriptWindowObjectCleared();
void handleSslErrors(QNetworkReply* reply, QList<QSslError> errors);
void Timeout();
private:
void finishRender();
void saveSnapshot();
QString processHtmlCode(QString htmlCode);
QString getDicomValue(QString Name);
bool mSawInitialLayout;
bool mSawDocumentComplete;
QImage *renderedImage;
DicomProcessor *dcmProcessor;
protected:
TemplatePage mPage;
};
#endif // HTMLRENDERER_H
|
/*
Copyright (C) 2008-2009 DeSmuME team
This file 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 file 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 the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _READWRITE_H_
#define _READWRITE_H_
#include "emu-types.h"
#include "emufile.h"
#include <iostream>
#include <cstdio>
#include <vector>
//well. just for the sake of consistency
int write8le(u8 b, EMUFILE *fp);
inline int write8le(u8* b, EMUFILE *fp) { return write8le(*b,fp); }
int write16le(u16 b, EMUFILE* os);
int write32le(u32 b, EMUFILE* os);
int write64le(u64 b, EMUFILE* os);
inline int write_double_le(double b, EMUFILE*is) { u64 temp = double_to_u64(b); int ret = write64le(temp,is); return ret; }
int read8le(u8 *Bufo, EMUFILE*is);
int read16le(u16 *Bufo, EMUFILE*is);
inline int read16le(s16 *Bufo, EMUFILE*is) { return read16le((u16*)Bufo,is); }
int read32le(u32 *Bufo, EMUFILE*is);
inline int read32le(s32 *Bufo, EMUFILE*is) { return read32le((u32*)Bufo,is); }
int read64le(u64 *Bufo, EMUFILE*is);
inline int read_double_le(double *Bufo, EMUFILE*is) { u64 temp; int ret = read64le(&temp,is); *Bufo = u64_to_double(temp); return ret; }
int read16le(u16 *Bufo, std::istream *is);
template<typename T>
int readle(T *Bufo, EMUFILE*is)
{
CTASSERT(sizeof(T)==1||sizeof(T)==2||sizeof(T)==4||sizeof(T)==8);
switch(sizeof(T)) {
case 1: return read8le((u8*)Bufo,is);
case 2: return read16le((u16*)Bufo,is);
case 4: return read32le((u32*)Bufo,is);
case 8: return read64le((u64*)Bufo,is);
default:
return 0;
}
}
int readbool(bool *b, EMUFILE* is);
void writebool(bool b, EMUFILE* os);
int readbuffer(std::vector<u8> &vec, EMUFILE* is);
int writebuffer(std::vector<u8>& vec, EMUFILE* os);
#endif
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This file is part of guh. *
* *
* Guh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, version 2 of the License. *
* *
* Guh 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 guh. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef ACTION_H
#define ACTION_H
#include "typeutils.h"
#include "param.h"
#include <QVariantList>
class Action
{
public:
explicit Action(const ActionTypeId &actionTypeId, const DeviceId &deviceId);
ActionId id() const;
bool isValid() const;
ActionTypeId actionTypeId() const;
DeviceId deviceId() const;
ParamList params() const;
void setParams(const ParamList ¶ms);
Param param(const QString ¶mName) const;
private:
ActionId m_id;
ActionTypeId m_actionTypeId;
DeviceId m_deviceId;
ParamList m_params;
};
#endif // ACTION_H
|
#define EXECUTEFN(X) X##_32
#include "core/execute.inc.c"
#undef EXECUTEFN
|
/*
Revision of last commit: $Rev$
Author of last commit: $Author$
Date of last commit: $Date$
*/
#ifndef NEUROFITTER_ROIVDVDTMATRIX_H
#define NEUROFITTER_ROIVDVDTMATRIX_H
using namespace std;
#include "FixedParamObject.h"
#include "ROIStringParser.h"
#include "TracesReader.h"
#include "VdVdtMatrix.h"
#include "DirectVdVdtMatrix.h"
#include "Tools.h"
class ROIVdVdtMatrix : public VdVdtMatrix {
public:
ROIVdVdtMatrix();
ROIVdVdtMatrix(FixedParameters params);
ROIVdVdtMatrix(DataTrace & trace, FixedParameters params);
void makeEmpty();
virtual ~ROIVdVdtMatrix() {};
double compare(const VdVdtMatrix&) const;
void readFrom(const DataTrace& trace);
string toString() const;
string toFileExportString() const;
protected:
///todo Make this more generic (no directvdvdt)
vector< DirectVdVdtMatrix > matrices;
ROIStringParser ROIsParser;
};
#endif
|
/*
* Copyright (c) 2007 Daniel Borca All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 UTIL_H_included
#define UTIL_H_included
char *strupr (char *dst, const char *src);
#endif
|
/*
* linux/arch/arm/mach-sa1100/lart.c
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <asm/hardware.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
static struct map_desc lart_io_desc[] __initdata = {
/* virtual physical length domain r w c b */
{ 0xe8000000, 0x00000000, 0x00400000, DOMAIN_IO, 1, 1, 0, 0 }, /* main flash memory */
{ 0xec000000, 0x08000000, 0x00400000, DOMAIN_IO, 1, 1, 0, 0 }, /* main flash, alternative location */
LAST_DESC
};
static void __init lart_map_io(void)
{
sa1100_map_io();
iotable_init(lart_io_desc);
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
sa1100_register_uart(2, 2);
GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
GPDR |= GPIO_UART_TXD;
GPDR &= ~GPIO_UART_RXD;
PPAR |= PPAR_UPR;
}
MACHINE_START(LART, "LART")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
BOOT_PARAMS(0xc0000100)
MAPIO(lart_map_io)
INITIRQ(sa1100_init_irq)
MACHINE_END
|
/*
matrix multiplication
matrix A
matrix B
matrix C
size : A = B =C
computing : A * B = C
*/
#include "mtime.h"
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#define RANDOM_SEED 2882 //random seed
#define VECTOR_SIZE 4 //sequare matrix width the same to height
#define MATRIX_SIZE (VECTOR_SIZE * VECTOR_SIZE) //total size of MATRIX
int main(int argc, char *argv[]){
int i,j,k;
int node_id;
int *AA; //sequence use & check the d2mce right or fault
int *BB; //sequence use
int *CC; //sequence use
int computing;
int _vector_size = VECTOR_SIZE;
int _matrix_size = MATRIX_SIZE;
double time;
char c[10];
if(argc > 1){
for( i = 1 ; i < argc ;){
if(strcmp(argv[i],"-s") == 0){
_vector_size = atoi(argv[i+1]);
_matrix_size =_vector_size * _vector_size;
i+=2;
}
else{
printf("the argument only have:\n");
printf("-s: the size of vector ex: -s 256\n");
return 0;
}
}
}
AA =(int *)malloc(sizeof(int) * _matrix_size);
BB =(int *)malloc(sizeof(int) * _matrix_size);
CC =(int *)malloc(sizeof(int) * _matrix_size);
srand( RANDOM_SEED );
/*
create matrix A and Matrix B
*/
for( i=0 ; i< _matrix_size ; i++){
AA[i] = rand()%10;
BB[i] = rand()%10;
}
time = -D2MCE_Mtime();
/*
computing C = A * B
*/
#pragma omp parallel for private(computing, j , k)
for( i=0 ; i < _vector_size ; i++){
for( j=0 ; j < _vector_size ; j++){
CC[ i*_vector_size + j ] =0;
for( k=0 ; k < _vector_size ; k++)
CC[ i*_vector_size + j ]+= AA[ i*_vector_size + k ] * BB[ k*_vector_size + j ];
}
}
time += D2MCE_Mtime();
printf("\nVector_size:%d\n", _vector_size);
printf("Matrix_size:%d\n", _matrix_size);
printf("Processing time:%f\n", time);
for( j=0 ; j<_vector_size ; j++){
for( k=0 ; k<_vector_size ; k++)
printf("%d ", CC[j*_vector_size + k]);
printf("\n");
}
return 0;
}
|
/*
UserinfoEx plugin for Miranda IM
Copyright:
© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
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 _MIR_STRING_H_INCLUDED_
#define _MIR_STRING_H_INCLUDED_
#define mir_tcschr mir_wcschr
#define mir_tcsrchr mir_wcsrchr
#define mir_tcsncat_c mir_wcsncat_c
#define mir_IsEmpty mir_IsEmptyW
#define mir_strchr(s,c) (((s)!=0)?strchr((s),(c)):0)
#define mir_strrchr(s,c) (((s)!=0)?strrchr((s),(c)):0)
#define mir_wcschr(s,c) (((s)!=0)?wcschr((s),(c)):0)
#define mir_wcsrchr(s,c) (((s)!=0)?wcsrchr((s),(c)):0)
char* mir_strncat_c(char *pszDest, const char cSrc);
char* mir_wcsncat_c(char *pszDest, const char cSrc);
char* mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo);
int mir_IsEmptyA(char *str);
int mir_IsEmptyW(wchar_t *str);
#endif /* _MIR_STRING_H_INCLUDED_ */ |
/******************************************************************************\
CAMotics is an Open-Source simulation and CAM software.
Copyright (C) 2011-2019 Joseph Coffland <joseph@cauldrondevelopment.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/>.
\******************************************************************************/
#pragma once
#include <QWidget>
namespace CAMotics {
class ClickWidget : public QWidget {
public:
ClickWidget(QWidget *parent = 0) : QWidget(parent) {}
// From QWidget
void mousePressEvent(QMouseEvent *event);
};
}
|
//
// FOMOrderDetailsViewController.h
// Food Ordering Manager
//
// Created by Jakub Turek on 08.12.2013.
// Copyright (c) 2013 Jakub Turek. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FOMCommunicationHandlerDelegate.h"
#import "FOMLoadingDialog.h"
#import "FOMOrder.h"
@interface FOMOrderDetailsViewController : UIViewController<UITableViewDataSource, UITableViewDelegate, FOMCommunicationHandlerDelegate>
@property (nonatomic, strong) IBOutlet UITableView *tableView;
@property (nonatomic, strong) FOMLoadingDialog *loadingDialog;
@property (nonatomic, strong) FOMOrder *order;
@property (nonatomic, strong) NSArray *settlements;
- (IBAction)addOrderItemsButtonPushed:(id)sender;
@end
|
/*
* cuebreakpoints.c -- print track break points
*
* Copyright (C) 2004, 2005, 2006, 2007, 2013 Svend Sorensen
* For license terms, see the file COPYING in this distribution.
*/
#include <getopt.h> /* getopt_long() */
#include <stdio.h> /* fprintf(), printf(), snprintf(), stderr */
#include <stdlib.h> /* exit() */
#include <string.h> /* strcasecmp() */
#include "cuefile.h"
#include "time.h"
#if HAVE_CONFIG_H
#include "config.h"
#else /* not HAVE_CONFIG_H */
#define PACKAGE_STRING "cuebreakpoints"
#endif /* HAVE_CONFIG_H */
char *progname;
/*
* pregap correction modes:
* APPEND - append pregap to previous track (except for first track)
* PREPEND - prefix pregap to current track
* SPLIT - print breakpoints for beginning and end of pregap
*/
enum GapMode {APPEND, PREPEND, SPLIT};
/* Print usage information and exit */
void usage(int status)
{
if (0 == status) {
printf("Usage: %s [option...] [file...]\n", progname);
printf("Report track breakpoints from a CUE or TOC file.\n"
"\n"
"OPTIONS\n"
"-h, --help print usage\n"
"-i, --input-format cue|toc set format of file(s)\n"
"--append-gaps append pregaps to previous track (default)\n"
"--prepend-gaps prefix pregaps to track\n"
"--split-gaps split at beginning and end of pregaps\n"
"-V, --version print version information\n");
} else {
fprintf(stderr, "Try `%s --help' for more information.\n", progname);
}
exit (status);
}
/* Print version information and exit */
void version()
{
printf("%s\n", PACKAGE_STRING);
exit(0);
}
void print_m_ss_ff(long frame)
{
int m, s, f;
time_frame_to_msf(frame, &m, &s, &f);
printf ("%d:%02d.%02d\n", m, s, f);
}
void print_breakpoint(long b)
{
/* Do not print zero breakpoints. */
if (0 != b) {
print_m_ss_ff(b);
}
}
void print_breaks(Cd *cd, int gaps)
{
int i;
long b;
long pg;
Track *track;
for (i = 1; i <= cd_get_ntrack(cd); i++) {
track = cd_get_track(cd, i);
/*
* When breakpoint is at:
* index 0: gap is prepended to track
* index 1: gap is appended to previous track
*/
b = track_get_start(track);
pg = track_get_index(track, 1) - track_get_zero_pre(track);
if (gaps == PREPEND || gaps == SPLIT) {
print_breakpoint(b);
/*
* There is no previous track to append the first track's
* pregap to.
*/
} else if (gaps == APPEND && 1 < i) {
print_breakpoint(b + pg);
}
/* If pregap exists, print breakpoints (in split mode). */
if (gaps == SPLIT && 0 < pg) {
print_breakpoint(b + pg);
}
}
}
int breaks(char *name, int format, int gaps)
{
Cd *cd = NULL;
if (NULL == (cd = cf_parse(name, &format))) {
fprintf(stderr, "%s: error: unable to parse input file"
" `%s'\n", progname, name);
return -1;
}
print_breaks(cd, gaps);
return 0;
}
int main(int argc, char *argv[])
{
int format = UNKNOWN;
int gaps = APPEND;
int ret = 0; /* return value of breaks() */
/* option variables */
int c;
/* getopt_long() variables */
extern char *optarg;
extern int optind;
static struct option longopts[] = {
{"help", no_argument, NULL, 'h'},
{"input-format", required_argument, NULL, 'i'},
{"append-gaps", no_argument, NULL, 'a'},
{"prepend-gaps", no_argument, NULL, 'p'},
{"split-gaps", no_argument, NULL, 's'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};
progname = argv[0];
while (-1 != (c = getopt_long(argc, argv, "hi:V", longopts, NULL))) {
switch (c) {
case 'h':
usage(0);
break;
case 'i':
if (0 == strcmp("cue", optarg)) {
format = CUE;
} else if (0 == strcmp("toc", optarg)) {
format = TOC;
} else {
fprintf(stderr, "%s: error: unknown input file"
" format `%s'\n", progname, optarg);
usage(1);
}
break;
case 'a':
gaps = APPEND;
break;
case 'p':
gaps = PREPEND;
break;
case 's':
gaps = SPLIT;
break;
case 'V':
version();
break;
default:
usage(1);
break;
}
}
/* What we do depends on the number of operands. */
if (optind == argc) {
/* No operands: report breakpoints of stdin. */
ret = breaks("-", format, gaps);
} else {
/* Report track breakpoints for each operand. */
for (; optind < argc; optind++) {
ret = breaks(argv[optind], format, gaps);
/* Exit if breaks() returns nonzero. */
if (!ret) {
break;
}
}
}
return ret;
}
|
#ifndef R4300_DISASM_H
#define R4300_DISASM_H
typedef unsigned char r4300byte;
typedef unsigned short r4300half;
typedef signed short r4300halfsigned;
typedef unsigned long r4300word;
typedef signed long r4300wordsigned;
typedef r4300byte CPUREG;
typedef r4300byte FPUREG;
typedef enum {
INST_UNDEF,
INST_LB, INST_LBU, INST_LD, INST_LDL,
INST_LDR, INST_LH, INST_LHU, INST_LL,
INST_LLD, INST_LW, INST_LWL, INST_LWR,
INST_LWU, INST_SB, INST_SC, INST_SCD,
INST_SD, INST_SDL, INST_SDR, INST_SH,
INST_SW, INST_SWL, INST_SWR, INST_SYNC,
INST_ADD, INST_ADDI, INST_ADDIU, INST_ADDU,
INST_AND, INST_ANDI, INST_DADD, INST_DADDI,
INST_DADDIU, INST_DADDU, INST_DDIV, INST_DDIVU,
INST_DIV, INST_DIVU, INST_DMULT, INST_DMULTU,
INST_DSLL, INST_DSLL32, INST_DSLLV, INST_DSRA,
INST_DSRA32, INST_DSRAV, INST_DSRL, INST_DSRL32,
INST_DSRLV, INST_DSUB, INST_DSUBU, INST_LUI,
INST_MFHI, INST_MFLO, INST_MTHI, INST_MTLO,
INST_MULT, INST_MULTU, INST_NOR, INST_OR,
INST_ORI, INST_SLL, INST_SLLV, INST_SLT,
INST_SLTI, INST_SLTIU, INST_SLTU, INST_SRA,
INST_SRAV, INST_SRL, INST_SRLV, INST_SUB,
INST_SUBU, INST_XOR, INST_XORI,
INST_BEQ, INST_BEQL, INST_BGEZ, INST_BGEZAL,
INST_BGEZALL, INST_BGEZL, INST_BGTZ, INST_BGTZL,
INST_BLEZ, INST_BLEZL, INST_BLTZ, INST_BLTZAL,
INST_BLTZALL, INST_BLTZL, INST_BNE, INST_BNEL,
INST_J, INST_JAL, INST_JALR, INST_JR,
INST_BREAK, INST_SYSCALL,
INST_LWC1, INST_LDC1, INST_SWC1, INST_SDC1,
INST_TEQ, INST_TEQI, INST_TGE, INST_TGEI,
INST_TGEIU, INST_TGEU, INST_TLT, INST_TLTI,
INST_TLTIU, INST_TLTU, INST_TNE, INST_TNEI,
INST_CACHE, INST_ERET,
INST_MFC0, INST_MTC0, INST_TLBP, INST_TLBR,
INST_TLBWI, INST_TLBWR,
INST_MFC1, INST_DMFC1, INST_CFC1, INST_MTC1,
INST_DMTC1, INST_CTC1, INST_BC1F, INST_BC1T,
INST_BC1FL, INST_BC1TL,
INST_ADD_S, INST_SUB_S, INST_MUL_S, INST_DIV_S,
INST_SQRT_S, INST_ABS_S, INST_MOV_S, INST_NEG_S,
INST_ROUND_L_S, INST_TRUNC_L_S, INST_CEIL_L_S, INST_FLOOR_L_S,
INST_ROUND_W_S, INST_TRUNC_W_S, INST_CEIL_W_S, INST_FLOOR_W_S,
INST_CVT_D_S, INST_CVT_W_S, INST_CVT_L_S,
INST_C_F_S, INST_C_UN_S, INST_C_EQ_S, INST_C_UEQ_S,
INST_C_OLT_S, INST_C_ULT_S, INST_C_OLE_S, INST_C_ULE_S,
INST_C_SF_S, INST_C_NGLE_S, INST_C_SEQ_S, INST_C_NGL_S,
INST_C_LT_S, INST_C_NGE_S, INST_C_LE_S, INST_C_NGT_S,
INST_ADD_D, INST_SUB_D, INST_MUL_D, INST_DIV_D,
INST_SQRT_D, INST_ABS_D, INST_MOV_D, INST_NEG_D,
INST_ROUND_L_D, INST_TRUNC_L_D, INST_CEIL_L_D, INST_FLOOR_L_D,
INST_ROUND_W_D, INST_TRUNC_W_D, INST_CEIL_W_D, INST_FLOOR_W_D,
INST_CVT_S_D, INST_CVT_W_D, INST_CVT_L_D,
INST_C_F_D, INST_C_UN_D, INST_C_EQ_D, INST_C_UEQ_D,
INST_C_OLT_D, INST_C_ULT_D, INST_C_OLE_D, INST_C_ULE_D,
INST_C_SF_D, INST_C_NGLE_D, INST_C_SEQ_D, INST_C_NGL_D,
INST_C_LT_D, INST_C_NGE_D, INST_C_LE_D, INST_C_NGT_D,
INST_CVT_S_W, INST_CVT_D_W, INST_CVT_S_L, INST_CVT_D_L,
INST_COUNT
} INST;
//\¦p
typedef enum {
INSTF_NONE,
//---- i type
INSTF_LUI,
INSTF_ISIGN,
INSTF_IUNSIGN,
INSTF_0BRANCH,
INSTF_1BRANCH,
INSTF_2BRANCH,
INSTF_ADDRR,
INSTF_ADDRW,
INSTF_JR,
//---- j type
INSTF_J,
//---- r type
INSTF_MFC0,
INSTF_MTC0,
INSTF_MFC1,
INSTF_MTC1,
INSTF_R1,
INSTF_R2,
INSTF_R3,
INSTF_SA,
//---- lf type
INSTF_LFR,
INSTF_LFW,
//---- cf type (S, D)
INSTF_R2F,
INSTF_C,
INSTF_R3F,
//----
INSTF_COUNT
} INSTFMT;
typedef enum {
INSTFTYPE_NONE,
INSTFTYPE_I,
INSTFTYPE_J,
INSTFTYPE_R,
INSTFTYPE_LF,
INSTFTYPE_CF,
INSTFTYPE_COUNT
} INSTFTYPE;
typedef union {
struct {
CPUREG rs;
CPUREG rt;
r4300half immediate;
} i;
struct {
r4300word inst_index;
} j;
struct {
CPUREG rs;
CPUREG rt;
CPUREG rd;
r4300byte sa;
} r;
struct {
FPUREG base;
FPUREG ft;
r4300half offset;
} lf;
struct {
FPUREG ft;
FPUREG fs;
FPUREG fd;
} cf;
} INSTOPERAND;
typedef struct {
INST inst;
INSTFMT format;
INSTFTYPE type;
INSTOPERAND operand;
} INSTDECODE;
INST GetInstruction(r4300word w);
void DecodeInstruction(r4300word w, INSTDECODE *d);
const char *GetOpecodeString(INSTDECODE *d);
char *GetOperandString(char *buf, INSTDECODE *d, r4300word pc);
char *DisassembleInstruction(char *buf, r4300word w, r4300word pc); //buf size:27
extern const INSTFMT InstFormat[INST_COUNT];
extern const INSTFTYPE InstFormatType[INSTF_COUNT];
extern const char * const OpecodeName[INST_COUNT];
extern void (*InstFormatTypeFunc[INSTFTYPE_COUNT])(r4300word, INSTOPERAND*);
extern const char * const CPURegisterName[32];
extern const char * const COP0RegisterName[32];
#endif
|
/*
* Copyright (C) 2003 Sistina Software
* Copyright (C) 2004 - 2008 Red Hat, Inc. All rights reserved.
*
* Device-Mapper low-level I/O.
*
* This file is released under the GPL.
*/
#ifndef _LINUX_DM_IO_H
#define _LINUX_DM_IO_H
#ifdef __KERNEL__
#include <linux/types.h>
#define DM_IO_MAX_REGIONS BITS_PER_LONG
#define MIN_IOS 16
#define MIN_BIOS 16
typedef void (*io_notify_fn)(unsigned long error, void *context);
struct dm_io_region {
struct block_device *bdev;
sector_t sector;
sector_t count; /* If this is zero the region is ignored. */
unsigned int rvec_count;
struct ram_vec *rvec;
};
struct page_list {
struct page_list *next;
struct page *page;
};
enum dm_io_mem_type {
DM_IO_PAGE_LIST,/* Page list */
DM_IO_BVEC, /* Bio vector */
DM_IO_VMA, /* Virtual memory area */
DM_IO_KMEM, /* Kernel memory */
};
struct dm_io_memory {
enum dm_io_mem_type type;
unsigned offset;
union {
struct page_list *pl;
struct bio_vec *bvec;
void *vma;
void *addr;
} ptr;
};
struct dm_io_notify {
io_notify_fn fn; /* Callback for asynchronous requests */
void *context; /* Passed to callback */
};
/*
* IO request structure
*/
struct dm_io_client;
struct dm_io_request {
int bi_rw; /* READ|WRITE - not READA */
struct dm_io_memory mem; /* Memory to use for io */
struct dm_io_notify notify; /* Synchronous if notify.fn is NULL */
struct dm_io_client *client; /* Client memory handler */
};
/*
* For async io calls, users can alternatively use the dm_io() function below
* and dm_io_client_create() to create private mempools for the client.
*
* Create/destroy may block.
*/
struct dm_io_client *dm_io_client_create(void);
void dm_io_client_destroy(struct dm_io_client *client);
/*
* IO interface using private per-client pools.
* Each bit in the optional 'sync_error_bits' bitset indicates whether an
* error occurred doing io to the corresponding region.
*/
int dm_io(struct dm_io_request *io_req, unsigned num_regions,
struct dm_io_region *region, unsigned long *sync_error_bits);
#endif /* __KERNEL__ */
#endif /* _LINUX_DM_IO_H */
|
/*
* Copyright (C) 2015-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FunctionRareData_h
#define FunctionRareData_h
#include "InternalFunctionAllocationProfile.h"
#include "JSCell.h"
#include "ObjectAllocationProfile.h"
#include "Watchpoint.h"
namespace JSC {
class JSGlobalObject;
class LLIntOffsetsExtractor;
namespace DFG {
class SpeculativeJIT;
class JITCompiler;
}
class FunctionRareData : public JSCell {
friend class JIT;
friend class DFG::SpeculativeJIT;
friend class DFG::JITCompiler;
friend class VM;
public:
typedef JSCell Base;
static const unsigned StructureFlags = StructureIsImmortal | Base::StructureFlags;
static FunctionRareData* create(VM&);
static const bool needsDestruction = true;
static void destroy(JSCell*);
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
static void visitChildren(JSCell*, SlotVisitor&);
DECLARE_INFO;
static inline ptrdiff_t offsetOfObjectAllocationProfile()
{
return OBJECT_OFFSETOF(FunctionRareData, m_objectAllocationProfile);
}
ObjectAllocationProfile* objectAllocationProfile()
{
return &m_objectAllocationProfile;
}
Structure* objectAllocationStructure() { return m_objectAllocationProfile.structure(); }
InlineWatchpointSet& allocationProfileWatchpointSet()
{
return m_objectAllocationProfileWatchpoint;
}
void clear(const char* reason);
void initializeObjectAllocationProfile(VM&, JSObject* prototype, size_t inlineCapacity);
bool isObjectAllocationProfileInitialized() { return !m_objectAllocationProfile.isNull(); }
Structure* internalFunctionAllocationStructure() { return m_internalFunctionAllocationProfile.structure(); }
Structure* createInternalFunctionAllocationStructureFromBase(VM& vm, JSObject* prototype, Structure* baseStructure)
{
return m_internalFunctionAllocationProfile.createAllocationStructureFromBase(vm, this, prototype, baseStructure);
}
Structure* getBoundFunctionStructure() { return m_boundFunctionStructure.get(); }
void setBoundFunctionStructure(VM& vm, Structure* structure) { m_boundFunctionStructure.set(vm, this, structure); }
bool hasReifiedLength() const { return m_hasReifiedLength; }
void setHasReifiedLength() { m_hasReifiedLength = true; }
bool hasReifiedName() const { return m_hasReifiedName; }
void setHasReifiedName() { m_hasReifiedName = true; }
protected:
FunctionRareData(VM&);
~FunctionRareData();
private:
friend class LLIntOffsetsExtractor;
// Ideally, there would only be one allocation profile for subclassing but due to Reflect.construct we
// have two. There are some pros and cons in comparison to our current system to using the same profile
// for both JS constructors and subclasses of builtin constructors:
//
// 1) + Uses less memory.
// 2) + Conceptually simplier as there is only one profile.
// 3) - We would need a check in all JSFunction object creations (both with classes and without) that the
// new.target's profiled structure has a JSFinalObject ClassInfo. This is needed, for example, if we have
// `Reflect.construct(Array, args, myConstructor)` since myConstructor will be the new.target of Array
// the Array constructor will set the allocation profile of myConstructor to hold an Array structure
//
// We don't really care about 1) since this memory is rare and small in total. 2) is unfortunate but is
// probably outweighed by the cost of 3).
ObjectAllocationProfile m_objectAllocationProfile;
InlineWatchpointSet m_objectAllocationProfileWatchpoint;
InternalFunctionAllocationProfile m_internalFunctionAllocationProfile;
WriteBarrier<Structure> m_boundFunctionStructure;
bool m_hasReifiedLength { false };
bool m_hasReifiedName { false };
};
} // namespace JSC
#endif // FunctionRareData_h
|
/*
* time.c -- time functions
*
* Copyright (C) 2004, 2005, 2006, 2007, 2013 Svend Sorensen
* For license terms, see the file COPYING in this distribution.
*/
#include <stdio.h>
#include <stdlib.h>
long time_msf_to_frame(int m, int s, int f)
{
return (m * 60 + s) * 75 + f;
}
void msf_frame_to_msf(long frame, int *m, int *s, int *f)
{
*f = frame % 75; /* 0 <= frames <= 74 */
frame /= 75;
*s = frame % 60; /* 0 <= seconds <= 59 */
frame /= 60;
*m = frame; /* 0 <= minutes */
}
void time_frame_to_msf(long frame, int *m, int *s, int *f)
{
*f = frame % 75; /* 0 <= frames <= 74 */
frame /= 75;
*s = frame % 60; /* 0 <= seconds <= 59 */
frame /= 60;
*m = frame; /* 0 <= minutes */
}
/* print frame in mm:ss:ff format */
char *time_frame_to_mmssff(long f)
{
static char msf[10];
int minutes, seconds, frames;
msf_frame_to_msf(f, &minutes, &seconds, &frames);
sprintf(msf, "%02d:%02d:%02d", minutes, seconds, frames);
return msf;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.