text stringlengths 4 6.14k |
|---|
/*
// C++ Interface:
//
// Description:
//
//
// Author: Analabha Roy <daneel@bose.res.in>, (C) 2010
//
//
*/
//paramspace_pt_serial is a datatype that stores the system parameters, namely the gap 'delta' and the driving frequency 'omega'
typedef struct
{
double gridsize;
double omega;
double mu0;
double muamp;
double delta_real;
double delta_imag;
double veff;
} paramspace_pt_serial;
|
//
// GlobTest.h
//
// $Id: //poco/svn/Foundation/testsuite/src/GlobTest.h#2 $
//
// Definition of the GlobTest class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef GlobTest_INCLUDED
#define GlobTest_INCLUDED
#include "Poco/Foundation.h"
#include "CppUnit/TestCase.h"
#include <set>
class GlobTest: public CppUnit::TestCase
{
public:
GlobTest(const std::string& name);
~GlobTest();
void testMatchChars();
void testMatchQM();
void testMatchAsterisk();
void testMatchRange();
void testMisc();
void testGlob();
void setUp();
void tearDown();
static CppUnit::Test* suite();
private:
void createFile(const std::string& path);
void translatePaths(std::set<std::string>& paths);
};
#endif // GlobTest_INCLUDED
|
//*****************************************************************************
//
// cpu_usage.h - Prototypes for the CPU utilization routines.
//
// Copyright (c) 2007-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 10636 of the Stellaris Firmware Development Package.
//
//*****************************************************************************
#ifndef __CPU_USAGE_H__
#define __CPU_USAGE_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// Prototypes for the CPU utilization routines.
//
//*****************************************************************************
extern unsigned long CPUUsageTick(void);
extern void CPUUsageInit(unsigned long ulClockRate, unsigned long ulRate,
unsigned long ulTimer);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __CPU_USAGE_H__
|
/*
* Opensvs - A lightweight services for Hybrid ircd OFTC branch.
* Copyright (C) 2006 The Openbrasil Opensvs Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
*/
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include "database.h"
sqlite3 *db;
static void database_close() {
sqlite3_close(db);
}
void database_init() {
assert(!sqlite3_open("opensvs.db", &db));
atexit(database_close);
}
int dbexec(char *fmt, sqlite3_callback cb, void *cbarg, char **errmsg, ...) {
va_list ap;
char *sql;
int res;
va_start(ap, errmsg);
sql = sqlite3_vmprintf(fmt, ap);
res = sqlite3_exec(db, sql, cb, cbarg, errmsg);
sqlite3_free(sql);
va_end(ap);
return res;
}
void database_onconnect() {
dbexec("update nicks set identified=0;", 0, 0, 0);
}
|
/**
* Copyright (C) 2017 Cisco 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.
*
* 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/>.
*/
// @author Changxue Deng <chadeng@cisco.com>
#ifndef __MBERROR_H__
#define __MBERROR_H__
#undef TRY_AGAIN
namespace mabain {
// mabain errors
class MBError
{
public:
enum mb_error
{
SUCCESS = 0,
NO_MEMORY = 1,
OUT_OF_BOUND = 2,
INVALID_ARG = 3,
NOT_INITIALIZED = 4,
NOT_EXIST = 5,
IN_DICT = 6,
MMAP_FAILED = 7,
NOT_ALLOWED = 8,
OPEN_FAILURE = 9,
WRITE_ERROR = 10,
READ_ERROR = 11,
INVALID_SIZE = 12,
TRY_AGAIN = 13,
ALLOCATION_ERROR = 14,
MUTEX_ERROR = 15,
UNKNOWN_ERROR = 16,
WRITER_EXIST = 17,
NO_RESOURCE = 18,
DB_CLOSED = 19,
BUFFER_LOST = 20,
THREAD_FAILED = 21,
RC_SKIPPED = 22,
VERSION_MISMATCH = 23,
// NO_DB should be the last enum.
NO_DB
};
static const int MAX_ERROR_CODE;
static const char* error_str[];
static const char* get_error_str(int err);
};
}
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* This file is based on WME Lite.
* http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
#ifndef WINTERMUTE_RENDER_TICKET_H
#define WINTERMUTE_RENDER_TICKET_H
#include "engines/wintermute/graphics/transparent_surface.h"
#include "graphics/surface.h"
#include "common/rect.h"
namespace Wintermute {
class BaseSurfaceOSystem;
/**
* A single RenderTicket.
* A render ticket is a collection of the data and draw specifications made
* for a single draw-call in the OSystem-backend for WME. The ticket additionally
* holds the order in which this call was made, so that it can be detected if
* the same call is done in the following frame. Thus allowing us to potentially
* skip drawing the same region again, unless anything has changed. Since a surface
* can have a potentially large amount of draw-calls made to it, at varying rotation,
* zoom, and crop-levels we also need to hold a copy of the necessary data.
* (Video-surfaces may even change their data). The promise that is made when a ticket
* is created is that what the state was of the surface at THAT point, is what will end
* up on screen at flip() time.
*/
class RenderTicket {
public:
RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRest, TransformStruct transform);
RenderTicket() : _isValid(true), _wantsDraw(false), _drawNum(0), _transform(TransformStruct()) {}
~RenderTicket();
const Graphics::Surface *getSurface() const { return _surface; }
// Non-dirty-rects:
void drawToSurface(Graphics::Surface *_targetSurface) const;
// Dirty-rects:
void drawToSurface(Graphics::Surface *_targetSurface, Common::Rect *dstRect, Common::Rect *clipRect) const;
Common::Rect _dstRect;
uint32 _batchNum;
bool _isValid;
bool _wantsDraw;
uint32 _drawNum;
TransformStruct _transform;
BaseSurfaceOSystem *_owner;
bool operator==(const RenderTicket &a) const;
const Common::Rect *getSrcRect() const { return &_srcRect; }
private:
Graphics::Surface *_surface;
Common::Rect _srcRect;
};
} // End of namespace Wintermute
#endif
|
#ifndef CROTRON_CONFIG_H_
#define CROTRON_CONFIG_H_
#include <cstdio>
#include <cstdlib>
#endif // CROTRON_CONFIG_H_
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2001-2009 The 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 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DLG_CATALOG_H
#define DLG_CATALOG_H
#include <glib.h>
#include <gthumb.h>
void dlg_add_to_catalog (GthBrowser *browser);
void add_to_catalog (GthBrowser *browser,
GFile *catalog,
GList *list /* GFile list */);
#endif /* DLG_CATALOG_H */
|
#pragma once
#include "afxwin.h"
// CInsertSceneNodeDlg dialog
class CInsertSceneNodeDlg : public CDialog
{
DECLARE_DYNAMIC(CInsertSceneNodeDlg)
public:
CInsertSceneNodeDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CInsertSceneNodeDlg();
void AddModelFile(const wchar_t* file);
void InitXmlNode(IBaseRenderer* pRenderer);
xXmlNode* Construct();
public:
xXmlNode* GetXmlNode() { return &m_XmlNode ; }
// Dialog Data
enum { IDD = IDD_INSERT_NODE };
xXmlNode m_XmlNode;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
bool ReadPlacement();
void SetCurrentModelInfo(int curSel , const wchar_t* modelName);
void SetNodeInfo();
DECLARE_MESSAGE_MAP()
public:
CString m_ModelName;
CString m_MatName;
CString m_EffectName;
CString m_NodeType;
float m_PosX;
float m_PosY;
float m_PosZ;
float m_ScaleX;
float m_ScaleY;
float m_ScaleZ;
float m_RotX;
float m_RotY;
float m_RotZ;
float m_RotAngle;
afx_msg void OnBnClickedOk();
virtual BOOL OnInitDialog();
CString m_EnitiyType;
CComboBox m_CbEntityType;
CComboBox m_CbEffectType;
CComboBox m_CbMaterialType;
CComboBox m_CbNodeTypes;
CComboBox m_CbFileName;
CString m_NodeName;
ds_vector(ds_wstring) m_vFileList;
};
|
/*
* Copyright (C) 2020 Jeff Kent <jeff@jkent.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
*/
#pragma once
#include <stdbool.h>
extern void icache_invalidate(void);
extern void icache_enable(void);
extern void icache_disable(void);
extern void dcache_invalidate(void);
extern void dcache_enable(void);
extern void dcache_disable(void);
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (c) 2008 Intel Corp.
*
* Author: Tomas Frydrych <tf@linux.intel.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/>.
*/
#include "config.h"
#include "compositor/meta-module.h"
#include <gmodule.h>
#include "meta/meta-plugin.h"
#include "meta/meta-version.h"
enum
{
PROP_0,
PROP_PATH,
};
struct _MetaModulePrivate
{
GModule *lib;
gchar *path;
GType plugin_type;
};
G_DEFINE_TYPE_WITH_PRIVATE (MetaModule, meta_module, G_TYPE_TYPE_MODULE);
static gboolean
meta_module_load (GTypeModule *gmodule)
{
MetaModulePrivate *priv = META_MODULE (gmodule)->priv;
MetaPluginVersion *info = NULL;
GType (*register_type) (GTypeModule *) = NULL;
if (priv->lib && priv->plugin_type)
return TRUE;
g_assert (priv->path);
if (!priv->lib &&
!(priv->lib = g_module_open (priv->path, 0)))
{
g_warning ("Could not load library [%s (%s)]",
priv->path, g_module_error ());
return FALSE;
}
if (g_module_symbol (priv->lib, "meta_plugin_version",
(gpointer *)(void *)&info) &&
g_module_symbol (priv->lib, "meta_plugin_register_type",
(gpointer *)(void *)®ister_type) &&
info && register_type)
{
if (info->version_api != META_PLUGIN_API_VERSION)
g_warning ("Plugin API mismatch for [%s]", priv->path);
else
{
GType plugin_type;
if (!(plugin_type = register_type (gmodule)))
{
g_warning ("Could not register type for plugin %s",
priv->path);
return FALSE;
}
else
{
priv->plugin_type = plugin_type;
}
return TRUE;
}
}
else
g_warning ("Broken plugin module [%s]", priv->path);
return FALSE;
}
static void
meta_module_unload (GTypeModule *gmodule)
{
MetaModulePrivate *priv = META_MODULE (gmodule)->priv;
g_module_close (priv->lib);
priv->lib = NULL;
priv->plugin_type = 0;
}
static void
meta_module_dispose (GObject *object)
{
G_OBJECT_CLASS (meta_module_parent_class)->dispose (object);
}
static void
meta_module_finalize (GObject *object)
{
MetaModulePrivate *priv = META_MODULE (object)->priv;
g_free (priv->path);
priv->path = NULL;
G_OBJECT_CLASS (meta_module_parent_class)->finalize (object);
}
static void
meta_module_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaModulePrivate *priv = META_MODULE (object)->priv;
switch (prop_id)
{
case PROP_PATH:
g_free (priv->path);
priv->path = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_module_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaModulePrivate *priv = META_MODULE (object)->priv;
switch (prop_id)
{
case PROP_PATH:
g_value_set_string (value, priv->path);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_module_class_init (MetaModuleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GTypeModuleClass *gmodule_class = G_TYPE_MODULE_CLASS (klass);
gobject_class->finalize = meta_module_finalize;
gobject_class->dispose = meta_module_dispose;
gobject_class->set_property = meta_module_set_property;
gobject_class->get_property = meta_module_get_property;
gmodule_class->load = meta_module_load;
gmodule_class->unload = meta_module_unload;
g_object_class_install_property (gobject_class,
PROP_PATH,
g_param_spec_string ("path",
"Path",
"Load path",
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
meta_module_init (MetaModule *self)
{
self->priv = meta_module_get_instance_private (self);
}
GType
meta_module_get_plugin_type (MetaModule *module)
{
MetaModulePrivate *priv = META_MODULE (module)->priv;
return priv->plugin_type;
}
|
//
// TMLayers.h
// Messenger for Telegram
//
// Created by Dmitry Kondratyev on 5/4/14.
// Copyright (c) 2014 keepcoder. All rights reserved.
//
#import "TMTextLayer.h"
#import "TMCircleLayer.h"
|
/* (C) 1999-2001 Paul `Rusty' Russell
* (C) 2002-2006 Netfilter Core Team <coreteam@netfilter.org>
*
* 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/types.h>
#include <linux/init.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink_conntrack.h>
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_nat_rule.h>
#include <net/netfilter/nf_nat_protocol.h>
#include <net/netfilter/nf_nat_core.h>
static u_int16_t tcp_port_rover;
<<<<<<< HEAD
static void
=======
static bool
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
tcp_unique_tuple(struct nf_conntrack_tuple *tuple,
const struct nf_nat_range *range,
enum nf_nat_manip_type maniptype,
const struct nf_conn *ct)
{
<<<<<<< HEAD
nf_nat_proto_unique_tuple(tuple, range, maniptype, ct, &tcp_port_rover);
=======
return nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
&tcp_port_rover);
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
}
static bool
tcp_manip_pkt(struct sk_buff *skb,
unsigned int iphdroff,
const struct nf_conntrack_tuple *tuple,
enum nf_nat_manip_type maniptype)
{
const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff);
struct tcphdr *hdr;
unsigned int hdroff = iphdroff + iph->ihl*4;
__be32 oldip, newip;
__be16 *portptr, newport, oldport;
int hdrsize = 8; /* TCP connection tracking guarantees this much */
/* this could be a inner header returned in icmp packet; in such
cases we cannot update the checksum field since it is outside of
the 8 bytes of transport layer headers we are guaranteed */
if (skb->len >= hdroff + sizeof(struct tcphdr))
hdrsize = sizeof(struct tcphdr);
if (!skb_make_writable(skb, hdroff + hdrsize))
return false;
iph = (struct iphdr *)(skb->data + iphdroff);
hdr = (struct tcphdr *)(skb->data + hdroff);
if (maniptype == IP_NAT_MANIP_SRC) {
/* Get rid of src ip and src pt */
oldip = iph->saddr;
newip = tuple->src.u3.ip;
newport = tuple->src.u.tcp.port;
portptr = &hdr->source;
} else {
/* Get rid of dst ip and dst pt */
oldip = iph->daddr;
newip = tuple->dst.u3.ip;
newport = tuple->dst.u.tcp.port;
portptr = &hdr->dest;
}
oldport = *portptr;
*portptr = newport;
if (hdrsize < sizeof(*hdr))
return true;
inet_proto_csum_replace4(&hdr->check, skb, oldip, newip, 1);
inet_proto_csum_replace2(&hdr->check, skb, oldport, newport, 0);
return true;
}
const struct nf_nat_protocol nf_nat_protocol_tcp = {
.protonum = IPPROTO_TCP,
.me = THIS_MODULE,
.manip_pkt = tcp_manip_pkt,
.in_range = nf_nat_proto_in_range,
.unique_tuple = tcp_unique_tuple,
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
.range_to_nlattr = nf_nat_proto_range_to_nlattr,
.nlattr_to_range = nf_nat_proto_nlattr_to_range,
#endif
};
|
/*
* Copyright (c) 2017 Google, 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, see <http://www.gnu.org/licenses/>.
*/
/*
* Regression test for commit 814fb7bb7db5 ("x86/fpu: Don't let userspace set
* bogus xcomp_bv"), or CVE-2017-15537. This bug allowed ptrace(pid,
* PTRACE_SETREGSET, NT_X86_XSTATE, &iov) to assign a task an invalid FPU state
* --- specifically, by setting reserved bits in xstate_header.xcomp_bv. This
* made restoring the FPU registers fail when switching to the task, causing the
* FPU registers to take on the values from other tasks.
*
* To detect the bug, we have a subprocess run a loop checking its xmm0 register
* for corruption. This detects the case where the FPU state became invalid and
* the kernel is not restoring the process's registers. Note that we have to
* set the expected value of xmm0 to all 0's since it is acceptable behavior for
* the kernel to simply reinitialize the FPU state upon seeing that it is
* invalid. To increase the chance of detecting the problem, we also create
* additional subprocesses that spin with different xmm0 contents.
*
* Thus bug affected the x86 architecture only. Other architectures could have
* similar bugs as well, but this test has to be x86-specific because it has to
* know about the architecture-dependent FPU state.
*/
#include <errno.h>
#include <inttypes.h>
#include <sched.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include "config.h"
#include "ptrace.h"
#include "tst_test.h"
#ifndef PTRACE_GETREGSET
# define PTRACE_GETREGSET 0x4204
#endif
#ifndef PTRACE_SETREGSET
# define PTRACE_SETREGSET 0x4205
#endif
#ifndef NT_X86_XSTATE
# define NT_X86_XSTATE 0x202
#endif
#ifdef __x86_64__
static void check_regs_loop(uint32_t initval)
{
const unsigned long num_iters = 1000000000;
uint32_t xmm0[4] = { initval, initval, initval, initval };
int status = 1;
asm volatile(" movdqu %0, %%xmm0\n"
" mov %0, %%rbx\n"
"1: dec %2\n"
" jz 2f\n"
" movdqu %%xmm0, %0\n"
" mov %0, %%rax\n"
" cmp %%rax, %%rbx\n"
" je 1b\n"
" jmp 3f\n"
"2: mov $0, %1\n"
"3:\n"
: "+m" (xmm0), "+r" (status)
: "r" (num_iters) : "rax", "rbx", "xmm0");
if (status) {
tst_res(TFAIL,
"xmm registers corrupted! initval=%08X, xmm0=%08X%08X%08X%08X\n",
initval, xmm0[0], xmm0[1], xmm0[2], xmm0[3]);
}
exit(status);
}
static void do_test(void)
{
int i;
int num_cpus = tst_ncpus();
pid_t pid;
uint64_t xstate[512];
struct iovec iov = { .iov_base = xstate, .iov_len = sizeof(xstate) };
int status;
bool okay;
pid = SAFE_FORK();
if (pid == 0) {
TST_CHECKPOINT_WAKE(0);
check_regs_loop(0x00000000);
}
for (i = 0; i < num_cpus; i++) {
if (SAFE_FORK() == 0)
check_regs_loop(0xDEADBEEF);
}
TST_CHECKPOINT_WAIT(0);
sched_yield();
TEST(ptrace(PTRACE_ATTACH, pid, 0, 0));
if (TEST_RETURN != 0)
tst_brk(TBROK | TTERRNO, "PTRACE_ATTACH failed");
SAFE_WAITPID(pid, NULL, 0);
TEST(ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov));
if (TEST_RETURN != 0) {
if (TEST_ERRNO == EIO)
tst_brk(TCONF, "GETREGSET/SETREGSET is unsupported");
if (TEST_ERRNO == EINVAL)
tst_brk(TCONF, "NT_X86_XSTATE is unsupported");
if (TEST_ERRNO == ENODEV)
tst_brk(TCONF, "CPU doesn't support XSAVE instruction");
tst_brk(TBROK | TTERRNO,
"PTRACE_GETREGSET failed with unexpected error");
}
xstate[65] = -1; /* sets all bits in xstate_header.xcomp_bv */
/*
* Old kernels simply masked out all the reserved bits in the xstate
* header (causing the PTRACE_SETREGSET command here to succeed), while
* new kernels will reject them (causing the PTRACE_SETREGSET command
* here to fail with EINVAL). We accept either behavior, as neither
* behavior reliably tells us whether the real bug (which we test for
* below in either case) is present.
*/
TEST(ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov));
if (TEST_RETURN == 0) {
tst_res(TINFO, "PTRACE_SETREGSET with reserved bits succeeded");
} else if (TEST_ERRNO == EINVAL) {
tst_res(TINFO,
"PTRACE_SETREGSET with reserved bits failed with EINVAL");
} else {
tst_brk(TBROK | TTERRNO,
"PTRACE_SETREGSET failed with unexpected error");
}
TEST(ptrace(PTRACE_CONT, pid, 0, 0));
if (TEST_RETURN != 0)
tst_brk(TBROK | TTERRNO, "PTRACE_CONT failed");
okay = true;
for (i = 0; i < num_cpus + 1; i++) {
SAFE_WAIT(&status);
okay &= (WIFEXITED(status) && WEXITSTATUS(status) == 0);
}
if (okay)
tst_res(TPASS, "wasn't able to set invalid FPU state");
}
static struct tst_test test = {
.test_all = do_test,
.forks_child = 1,
.needs_checkpoints = 1,
};
#else /* !__x86_64__ */
TST_TEST_TCONF("this test is only supported on x86_64");
#endif /* __x86_64__ */
|
/* $OpenBSD: putc.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <stdio.h>
#include <errno.h>
#include "local.h"
/*
* A subroutine version of the macro putc_unlocked.
*/
#undef putc_unlocked
int
putc_unlocked(int c, FILE *fp)
{
if (cantwrite(fp)) {
errno = EBADF;
return (EOF);
}
return (__sputc(c, fp));
}
/*
* A subroutine version of the macro putc.
*/
#undef putc
int
putc(int c, FILE *fp)
{
int ret;
flockfile(fp);
ret = putc_unlocked(c, fp);
funlockfile(fp);
return (ret);
}
|
// PairPricing.h: interface for the PairPricing class.
//
//////////////////////////////////////////////////////////////////////
#ifndef PairPricing_h
#define PairPricing_h
#ifndef string_h
#include <string>
#define string_h
#endif
#ifndef map_h
#include <map>
#define map_h
#endif
class PairPricing
{
public:
static PairPricing * instance();
virtual ~PairPricing();
void setPairPrice(const std::string & symbol, double price);
double getUSDCost(const std::string & symbol, double price);
double getUSDPipVal(const std::string & symbol, double price);
private:
PairPricing();
static PairPricing * instance_;
typedef std::map<std::string, double, std::less<std::string> > PriceMap;
typedef PriceMap::iterator PriceMapIter;
PriceMap priceMap_;
};
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef BLADERUNNER_BLADERUNNER_H
#define BLADERUNNER_BLADERUNNER_H
#include "bladerunner/archive.h"
#include "common/array.h"
#include "common/random.h"
#include "common/stream.h"
#include "engines/engine.h"
#include "graphics/surface.h"
#include "suspects_database.h"
namespace BladeRunner {
enum AnimationModes {
kAnimationModeIdle = 0,
kAnimationModeWalk = 1,
kAnimationModeRun = 2,
kAnimationModeCombatIdle = 4,
kAnimationModeCombatWalk = 7,
kAnimationModeCombatRun = 8
};
class Actor;
class ADQ;
class AIScripts;
class AmbientSounds;
class AudioPlayer;
class AudioSpeech;
class Chapters;
class CrimesDatabase;
class Combat;
class Font;
class GameFlags;
class GameInfo;
class ItemPickup;
class Items;
class Lights;
class Mouse;
class Obstacles;
class Scene;
class SceneObjects;
class SceneScript;
class Settings;
class Shape;
class SliceAnimations;
class SliceRenderer;
class Spinner;
class TextResource;
class View;
class Waypoints;
class ZBuffer;
#define ACTORS_COUNT 100
#define VOICEOVER_ACTOR (ACTORS_COUNT - 1)
class BladeRunnerEngine : public Engine {
public:
bool _gameIsRunning;
bool _windowIsActive;
int _playerLosesControlCounter;
ADQ *_adq;
AIScripts *_aiScripts;
AmbientSounds *_ambientSounds;
AudioPlayer *_audioPlayer;
AudioSpeech *_audioSpeech;
Chapters *_chapters;
CrimesDatabase *_crimesDatabase;
Combat *_combat;
GameFlags *_gameFlags;
GameInfo *_gameInfo;
ItemPickup *_itemPickup;
Items *_items;
Lights *_lights;
Font *_mainFont;
Mouse *_mouse;
Obstacles *_obstacles;
Scene *_scene;
SceneObjects *_sceneObjects;
SceneScript *_sceneScript;
Settings *_settings;
SliceAnimations *_sliceAnimations;
SliceRenderer *_sliceRenderer;
Spinner *_spinner;
SuspectsDatabase *_suspectsDatabase;
View *_view;
Waypoints *_waypoints;
int *_gameVars;
TextResource *_textActorNames;
TextResource *_textCrimes;
TextResource *_textCluetype;
TextResource *_textKIA;
TextResource *_textSpinnerDestinations;
TextResource *_textVK;
TextResource *_textOptions;
Common::Array<Shape*> _shapes;
Actor *_actors[ACTORS_COUNT];
Actor *_playerActor;
int in_script_counter;
Graphics::Surface _surfaceGame;
Graphics::Surface _surfaceInterface;
Graphics::Surface _surface4;
ZBuffer *_zbuffer;
Common::RandomSource _rnd;
bool _playerActorIdle;
bool _playerDead;
bool _speechSkipped;
bool _gameOver;
int _gameAutoSave;
bool _gameIsLoading;
bool _sceneIsLoading;
int _walkSoundId;
int _walkSoundVolume;
int _walkSoundBalance;
int _walkingActorId;
private:
static const uint kArchiveCount = 10;
MIXArchive _archives[kArchiveCount];
public:
BladeRunnerEngine(OSystem *syst);
~BladeRunnerEngine();
bool hasFeature(EngineFeature f) const;
Common::Error run();
bool startup(bool hasSavegames = false);
void initChapterAndScene();
void shutdown();
bool loadSplash();
bool init2();
Common::Point getMousePos();
void gameLoop();
void gameTick();
void actorsUpdate();
void handleEvents();
void handleMouseAction(int x, int y, bool buttonLeft, bool buttonDown);
void handleMouseClickExit(int x, int y, int exitIndex);
void handleMouseClickRegion(int x, int y, int regionIndex);
void handleMouseClickItem(int x, int y, int itemId);
void handleMouseClickActor(int x, int y, int actorId);
void handleMouseClick3DObject(int x, int y, int objectId, bool isClickable, bool isTarget);
void gameWaitForActive();
void loopActorSpeaking();
void outtakePlay(int id, bool no_localization, int container = -1);
bool openArchive(const Common::String &name);
bool closeArchive(const Common::String &name);
bool isArchiveOpen(const Common::String &name);
Common::SeekableReadStream *getResourceStream(const Common::String &name);
bool playerHasControl();
void playerLosesControl();
void playerGainsControl();
void ISez(const char *str);
void blitToScreen(const Graphics::Surface &src);
};
static inline const Graphics::PixelFormat createRGB555() {
return Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
}
void blit(const Graphics::Surface &src, Graphics::Surface &dst);
} // End of namespace BladeRunner
#endif
|
/********************************************
* *
* Eyüp Can KILINÇDEMİR *
* KARADENİZ TEKNİK UNİVERSİTESİ *
* ceksoft.wordpress.com *
* eyupcankilincdemir@gmail.com *
* *
********************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double tam_sayiya_yuvarla(double);
double tam_sayiya_yuvarla(double girilen_sayi)
{
double yuvarlanan_sayi;
yuvarlanan_sayi = floor(girilen_sayi + .5);
return yuvarlanan_sayi;
}
double onluk_tam_sayiya_yuvarla(double);
double onluk_tam_sayiya_yuvarla(double girilen_sayi)
{
double onluk_yuvarlanan_sayi;
onluk_yuvarlanan_sayi = floor((girilen_sayi * 10) + .5) / 10;
return onluk_yuvarlanan_sayi;
}
double yuzluk_tam_sayiya_yuvarla(double);
double yuzluk_tam_sayiya_yuvarla(double girilen_sayi)
{
double yuvarlanan_sayi;
yuvarlanan_sayi = floor((girilen_sayi * 100) + .5) / 100;
return yuvarlanan_sayi;
}
double binlik_tam_sayiya_yuvarla(double);
double binlik_tam_sayiya_yuvarla(double girilen_sayi)
{
double yuvarlanan_sayi;
yuvarlanan_sayi = floor((girilen_sayi * 1000) + .5) / 1000;
return yuvarlanan_sayi;
}
int main()
{
double sayi_limiti;
printf("Kac sayinin yuvarlanmasini istiyosunuz giriniz: ");
scanf("%lf",&sayi_limiti);
int for_sayici;
for(for_sayici = 1 ;for_sayici <= sayi_limiti ;for_sayici++)
{
double yuvarlanacak_sayi;
printf("Yuvarlanacak sayiyi giriniz: ");
scanf("%lf",&yuvarlanacak_sayi);
double yuvarlanmis_sayi;
yuvarlanmis_sayi = tam_sayiya_yuvarla(yuvarlanacak_sayi);
double onluk_hanede_yuvarlanmis_sayi;
onluk_hanede_yuvarlanmis_sayi = onluk_tam_sayiya_yuvarla(yuvarlanacak_sayi);
double yuzluk_hanede_yuvarlanmis_sayi;
yuzluk_hanede_yuvarlanmis_sayi = yuzluk_tam_sayiya_yuvarla(yuvarlanacak_sayi);
double binlik_hanede_yuvarlanmis_sayi;
binlik_hanede_yuvarlanmis_sayi = binlik_tam_sayiya_yuvarla(yuvarlanacak_sayi);
printf("%12s %15s %6s %7s %7s\n","Orjinal Hali","Yuvarlanmis Hali","Onluga","Yuzluge","Binlige");
printf("%12f %16.2f %4.4f %7.4f %7.4f\n",yuvarlanacak_sayi,yuvarlanmis_sayi,onluk_hanede_yuvarlanmis_sayi,
yuzluk_hanede_yuvarlanmis_sayi,binlik_hanede_yuvarlanmis_sayi);
}
printf("Program Sonlanmistir :)");
return 0;
}
|
/*
MetaContactSelectorWidget
Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
*************************************************************************
*/
#ifndef MetaContactSelectorWidget_H
#define MetaContactSelectorWidget_H
#include <kdemacros.h>
#include <qwidget.h>
#include "kopetelistviewitem.h"
#include "kopete_export.h"
class Kopete::MetaContact;
namespace Kopete
{
namespace UI
{
/**
* @author Duncan Mac-Vicar Prett <duncan@kde.org>
* This class provides a widget which allows easy selection
* of available Kopete metacontacts.
*/
class KOPETE_EXPORT MetaContactSelectorWidget : public QWidget
{
Q_OBJECT
public:
MetaContactSelectorWidget( QWidget *parent = 0, const char *name = 0 );
~MetaContactSelectorWidget();
Kopete::MetaContact* metaContact();
/**
* sets the widget label message
* example: Please select a contact
* or, Choose a contact to delete
*/
void setLabelMessage( const QString &msg );
/**
* pre-selects a contact
*/
void selectMetaContact( Kopete::MetaContact *mc );
/**
* excludes a metacontact from being shown in the list
* if the metacontact is already excluded, do nothing
*/
void excludeMetaContact( Kopete::MetaContact *mc );
/**
* @return true if there is a contact selected
*/
bool metaContactSelected();
protected slots:
/**
* Utility function, populates the metacontact list
*/
void slotLoadMetaContacts();
signals:
void metaContactListClicked( QListViewItem *mc );
private:
class Private;
Private *d;
};
/**
* @author Duncan Mac-Vicar Prett <duncan@kde.org>
*/
class MetaContactSelectorWidgetLVI : public Kopete::UI::ListView::Item
{
Q_OBJECT
public:
MetaContactSelectorWidgetLVI(Kopete::MetaContact *mc, QListView *parent, QObject *owner = 0, const char *name = 0 );
Kopete::MetaContact* metaContact();
virtual QString text ( int column ) const;
protected slots:
void slotPhotoChanged();
void slotDisplayNameChanged();
void buildVisualComponents();
void slotUpdateContactBox();
private:
class Private;
Private *d;
};
} // namespace UI
} // namespace Kopete
#endif
// vim: set noet ts=4 sts=4 sw=4:
|
/*
* Copyright (C) 2002-2019 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA.
*/
/* Local Debug Function */
#if C_DEBUG
#include <curses.h>
#include "mem.h"
#include <string>
#define PAIR_BLACK_BLUE 1
#define PAIR_BYELLOW_BLACK 2
#define PAIR_GREEN_BLACK 3
#define PAIR_BLACK_GREY 4
#define PAIR_GREY_RED 5
#define PAIR_BLACK_GREEN 6
#define PAIR_WHITE_BLUE 7
void DBGUI_StartUp(void);
extern const unsigned int dbg_def_win_height[];
extern const char *dbg_def_win_titles[];
extern const char *dbg_win_names[];
class DBGBlock {
public:
enum {
DATV_SEGMENTED=0,
DATV_VIRTUAL,
DATV_PHYSICAL
};
enum {
/* main not counted */
WINI_REG,
WINI_DATA,
WINI_CODE,
WINI_VAR,
WINI_OUT,
/* inp not counted */
WINI_MAX_INDEX
};
bool win_vis[WINI_MAX_INDEX] = {};
std::string win_title[WINI_MAX_INDEX];
unsigned char win_order[WINI_MAX_INDEX] = {};
unsigned int win_height[WINI_MAX_INDEX] = {};
public:
DBGBlock() : win_main(NULL), win_reg(NULL), win_data(NULL), win_code(NULL),
win_var(NULL), win_out(NULL), win_inp(NULL), active_win(WINI_CODE), input_y(0), global_mask(0), data_view(0xFF) {
for (unsigned int i=0;i < WINI_MAX_INDEX;i++) {
win_height[i] = dbg_def_win_height[i];
win_title[i] = dbg_def_win_titles[i];
win_vis[i] = (i != WINI_VAR);
win_order[i] = i;
}
}
public:
WINDOW * win_main; /* The Main Window (not counted in tab enumeration) */
WINDOW * win_reg; /* Register Window */
WINDOW * win_data; /* Data Output window */
WINDOW * win_code; /* Disassembly/Debug point Window */
WINDOW * win_var; /* Variable Window */
WINDOW * win_out; /* Text Output Window */
WINDOW * win_inp; /* Input window (not counted in tab enumeration) */
Bit32u active_win; /* Current active window */
Bit32u input_y;
Bit32u global_mask; /* Current msgmask */
unsigned char data_view;
void set_data_view(unsigned int view);
WINDOW *get_win(int idx);
WINDOW* &get_win_ref(int idx);
const char *get_winname(int idx);
const char *get_wintitle(int idx);
std::string windowlist_by_name(void);
int name_to_win(const char *name);
WINDOW *get_active_win(void);
int win_find_order(int wnd);
int win_prev_by_order(int order);
int win_next_by_order(int order);
void swap_order(int o1,int o2);
void next_window(void);
};
struct DASMLine {
Bit32u pc;
char dasm[80];
PhysPt ea;
Bit16u easeg;
Bit32u eaoff;
};
extern DBGBlock dbg;
/* Local Debug Stuff */
Bitu DasmI386(char* buffer, PhysPt pc, Bit32u cur_ip, bool bit32);
int DasmLastOperandSize(void);
#endif
|
/*
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//
// vregset.c: video register-setting interpreter
//
#include <dos.h>
#include <conio.h>
#include "quakedef.h"
#include "vregset.h"
#include <sys.h>
//#define outportb loutportb
void
loutportb ( int port, int val )
{
printf ("port, val: %x %x\n", port, val);
getch ();
}
/*
================
VideoRegisterSet
================
*/
void
VideoRegisterSet ( int *pregset )
{
int port, temp0, temp1, temp2;
for ( ;; )
{
switch (*pregset++)
{
case VRS_END:
return;
case VRS_BYTE_OUT:
port = *pregset++;
outportb (port, *pregset++);
break;
case VRS_BYTE_RMW:
port = *pregset++;
temp0 = *pregset++;
temp1 = *pregset++;
temp2 = inportb (port);
temp2 &= temp0;
temp2 |= temp1;
outportb (port, temp2);
break;
case VRS_WORD_OUT:
port = *pregset++;
outportb (port, *pregset & 0xFF);
outportb (port+1, *pregset >> 8);
pregset++;
break;
default:
Sys_Error ("VideoRegisterSet: Invalid command\n");
}
}
}
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
* 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 __LIBSQUEEZE_SUPPORT_H__
#define __LIBSQUEEZE_SUPPORT_H__
#include "internal-types.h"
G_BEGIN_DECLS
#define LSQ_TYPE_SUPPORT_INFO lsq_support_info_get_type()
#define LSQ_SUPPORT_INFO(obj) ( \
G_TYPE_CHECK_INSTANCE_CAST ((obj), \
LSQ_TYPE_SUPPORT_INFO, \
LSQSupportInfo))
#define LSQ_IS_SUPPORT_INFO(obj) ( \
G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
LSQ_TYPE_SUPPORT_INFO))
#define LSQ_SUPPORT_INFO_CLASS(klass) ( \
G_TYPE_CHECK_CLASS_CAST ((klass), \
LSQ_TYPE_SUPPORT_INFO, \
LSQSupportInfoClass))
#define LSQ_IS_SUPPORT_INFO_CLASS(klass) ( \
G_TYPE_CHECK_CLASS_TYPE ((klass), \
LSQ_TYPE_SUPPORT_INFO))
#define LSQ_SUPPORT_INFO_GET_CLASS(obj) ( \
G_TYPE_INSTANCE_GET_CLASS ((obj), \
LSQ_TYPE_SUPPORT_INFO, \
LSQSupportInfoClass))
#define LSQ_TYPE_SUPPORT_APP lsq_support_app_get_type()
#define LSQ_SUPPORT_APP(obj) ( \
G_TYPE_CHECK_INSTANCE_CAST ((obj), \
LSQ_TYPE_SUPPORT_APP, \
LSQSupportApp))
#define LSQ_IS_SUPPORT_APP(obj) ( \
G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
LSQ_TYPE_SUPPORT_APP))
#define LSQ_SUPPORT_APP_CLASS(klass) ( \
G_TYPE_CHECK_CLASS_CAST ((klass), \
LSQ_TYPE_SUPPORT_APP, \
LSQSupportAppClass))
#define LSQ_IS_SUPPORT_APP_CLASS(klass) ( \
G_TYPE_CHECK_CLASS_TYPE ((klass), \
LSQ_TYPE_SUPPORT_APP))
#define LSQ_SUPPORT_APP_GET_CLASS(obj) ( \
G_TYPE_INSTANCE_GET_CLASS ((obj), \
LSQ_TYPE_SUPPORT_APP, \
LSQSupportAppClass))
GType
lsq_support_info_get_type ( void ) G_GNUC_CONST;
GType
lsq_support_app_get_type ( void ) G_GNUC_CONST;
const LSQSupportInfo *
lsq_support_info_get ( const gchar *mime_type );
const gchar *
lsq_support_info_get_contentype ( const LSQSupportInfo *info );
GSList *
lsq_support_info_get_apps ( const LSQSupportInfo *info ) G_GNUC_WARN_UNUSED_RESULT;
GSList *
lsq_support_info_get_apps_by_operation (
const LSQSupportInfo *info,
LSQCommandType cmd
) G_GNUC_WARN_UNUSED_RESULT;
const LSQSupportApp *
lsq_support_info_get_app_by_id (
const LSQSupportInfo *info,
const gchar *id
);
const gchar *
lsq_support_app_get_id ( const LSQSupportApp *app );
gboolean
lsq_support_app_has_operation (
const LSQSupportApp *app,
LSQCommandType cmd
);
GList *
lsq_support_info_get_all ( void ) G_GNUC_WARN_UNUSED_RESULT;
GList *
lsq_support_info_get_all_mime_types ( void ) G_GNUC_WARN_UNUSED_RESULT;
const gchar *
lsq_archive_iter_get_content_type ( const LSQArchiveIter * ) G_GNUC_PURE;
const LSQSupportInfo *
lsq_archive_get_support_info ( const LSQArchive *archive ) G_GNUC_PURE;
void
lsq_archive_set_refresh_app (
LSQArchive *archive,
const LSQSupportApp *app
);
G_END_DECLS
#endif /* __LIBSQUEEZE_SUPPORT_H__ */
|
#pragma once
#include "digital_controller.h"
namespace peripherals {
struct AnalogController : public DigitalController {
protected:
enum class Command {
None,
Read,
EnterConfiguration,
ExitConfiguration,
SetLed,
GetLed,
UnlockRumble,
Unknown_46,
Unknown_47,
Unknown_4c
};
struct Stick {
/**
* 0x00 - left/up
* 0x80 - center
* 0xff - right/down
*/
uint8_t x;
uint8_t y;
Stick() : x(0x80), y(0x80) {}
};
struct Vibration {
// Small vibration motor is on/off
// Big has 256 values of vibration strength
bool small = false;
uint8_t big = 0;
bool operator==(const Vibration& r) { return small == r.small && big == r.big; }
bool operator!=(const Vibration& r) { return !(*this == r); }
bool operator!=(const int r) { return small != r || big != r; }
};
uint8_t _handle(uint8_t byte); // Wrapper for handler for catching return value
uint8_t handleReadAnalog(uint8_t byte);
uint8_t handleEnterConfiguration(uint8_t byte);
uint8_t handleExitConfiguration(uint8_t byte);
uint8_t handleSetLed(uint8_t byte);
uint8_t handleLedStatus(uint8_t byte);
uint8_t handleUnlockRumble(uint8_t byte);
uint8_t handleUnknown46(uint8_t byte);
uint8_t handleUnknown47(uint8_t byte);
uint8_t handleUnknown4c(uint8_t byte);
Stick left, right;
Command command = Command::None;
bool analogEnabled = false;
bool ledEnabled = false;
bool configurationMode = false;
Vibration prevVibration, vibration;
public:
AnalogController(int Port);
uint8_t handle(uint8_t byte) override;
void update() override;
};
}; // namespace peripherals |
#ifndef IP4_H
#define IP4_H
extern unsigned int ip4_fmt(char *, const char *);
extern unsigned int ip4_scan(const char *, char *);
#define IP4_FMT 20
#endif
|
/*
Example for LoRa Click
Date : Feb 2018.
Author : MikroE Team
Test configuration STM32 :
MCU : STM32F107VCT6
Dev. Board : EasyMx PRO v7 for STM32
ARM Compiler ver : v6.0.0.0
---
Description :
The application is composed of three sections :
- System Initialization - Initializes UART module and CS pin, RST pin as output and INT pin as input
- Application Initialization - Initializes driver init and LoRa init
- Application Task - (code snippet) - The transceiver sends one by one byte in UART which is for the work of the lora,
the Receiver mode, receives one byte and logs it on usbuart. Receiver mode is default mode.
*/
#include "Click_LoRa_types.h"
#include "Click_LoRa_config.h"
uint8_t sendMessage[8] = { 'M', 'i', 'k', 'r', 'o', 'E',' ', 0 };
char tmp_txt[ 50 ];
char sendHex[ 50 ];
char rspTxt[ 50 ];
char rsp_data[10];
uint8_t cnt;
uint8_t send_data;
uint8_t _data;
uint8_t rxState;
uint8_t txState;
void systemInit()
{
mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_INT_PIN, _GPIO_INPUT );
mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_RST_PIN, _GPIO_OUTPUT );
mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_CS_PIN, _GPIO_OUTPUT );
mikrobus_uartInit( _MIKROBUS1, &_LORA_UART_CFG[0] );
mikrobus_logInit( _LOG_USBUART_A, 57600 );
mikrobus_logWrite("--- System init ---", _LOG_LINE );
}
void lora_cbk( char* response )
{
}
void applicationInit()
{
lora_uartDriverInit( (T_LORA_P)&_MIKROBUS1_GPIO, (T_LORA_P)&_MIKROBUS1_UART );
lora_init( 0, &lora_cbk );
// start
lora_cmd( &LORA_CMD_SYS_GET_VER[0], &tmp_txt[0] );
lora_cmd( &LORA_CMD_MAC_PAUSE[0], &tmp_txt[0] );
mikrobus_logWrite("mac pause",_LOG_LINE);
mikrobus_logWrite(&tmp_txt[0],_LOG_LINE);
lora_cmd( &LORA_CMD_RADIO_SET_WDT[0], &tmp_txt[0] );
mikrobus_logWrite("radio set wdt 0",_LOG_LINE);
mikrobus_logWrite(&tmp_txt[0],_LOG_LINE);
}
void applicationTask()
{
lora_process();
// RECEIVER
rxState = lora_rx( &LORA_ARG_0[0], &tmp_txt[0]);
if( rxState == 0)
{
_data = xtoi(&tmp_txt[11]);
mikrobus_logWrite( &_data,_LOG_BYTE);
mikrobus_logWrite( " ",_LOG_LINE);
}
// TRANSCEIVER
/*for (cnt = 0; cnt < 7; cnt++ )
{
send_data = sendMessage[cnt];
IntToHex(send_data,sendHex);
txState = lora_tx( &sendHex[0] );
if( txState == 0)
{
mikrobus_logWrite( " Response : ",_LOG_TEXT );
mikrobus_logWrite( &tmp_txt[0],_LOG_LINE );
}
Delay_1sec();
}*/
}
void main()
{
systemInit();
applicationInit();
while (1)
{
applicationTask();
}
} |
/*
* Copyright (C) 2012-2017 Team Kodi
* http://kodi.tv
*
* 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; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "settings/lib/ISettingCallback.h"
#include "utils/Observer.h"
class CSetting;
class CSettings;
namespace KODI
{
namespace GAME
{
class CGameSettings : public ISettingCallback,
public Observable
{
public:
CGameSettings(CSettings &settings);
~CGameSettings() override;
// Inherited from ISettingCallback
virtual void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
private:
// Construction parameters
CSettings &m_settings;
};
} // namespace GAME
}
|
/**************************************************************************/
/* Copyright 2012 Tim Day */
/* */
/* This file is part of Evolvotron */
/* */
/* Evolvotron 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. */
/* */
/* Evolvotron 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 Evolvotron. If not, see <http://www.gnu.org/licenses/>. */
/**************************************************************************/
/*! \file
\brief Interfaces for class FunctionPreTransform
This class would normally live in functions.h (and is included and registered there),
but is split out so it can be efficiently used by MutatableImageDisplay and EvolvotronMain.
NB There is no class heirarchy here as all virtualisation and boilerplate services are supplied when the functions are plugged into the FunctionNode template.
*/
#ifndef _function_pre_transform_h_
#define _function_pre_transform_h_
#include "transform.h"
//! Function class returning leaf node evaluated at position transfomed by a 12-component linear transform.
FUNCTION_BEGIN(FunctionPreTransform,12,1,false,0)
//! Return the evaluation of arg(0) at the transformed position argument.
virtual const XYZ evaluate(const XYZ& p) const
{
const Transform transform(params());
return arg(0)(transform.transformed(p));
}
FUNCTION_END(FunctionPreTransform)
#endif
|
/**************************************************************************
** Part of the MuPAD product code. Protected by law. All rights reserved.**
** MDE_declare.h **
** In diesem File werden die Konstanten von MuPAD deklariert bzw. defi- **
** niert, die nicht mit 3 gro\3en Buchstaben anfangen, sowie Makros zur **
** Anpassung der Sourcen auf C++ bzw. auf bestimmte Compilertypen. **
**************************************************************************/
#ifndef __MDE_declare__
#define __MDE_declare__
#include <stdio.h>
#include "MUP_constants.h"
// Die Funktion 'isSecureFileAccess' muss verwendet werden, wenn auf
// Dateien zugegriffen wird, deren Namen oder Inhalt der Anwender be-
// einflussen kann. Sie liefert entweder 'true' oder löst direkt ein-
// en Fehler aus.
bool MUT_isSecureFileAccess ( const char *filename, const char *type );
#include "MCO_compat.h"
#ifdef C_PLUSPLUS
# ifndef __cplusplus
# define __cplusplus
# endif
# ifndef ANY_ARGS
# define ANY_ARGS ...
# endif
# define MDE_externCstart extern "C" {
# define MDE_externCend }
# else
# ifndef ANY_ARGS
# define ANY_ARGS
# endif
# define MDE_externCstart
# define MDE_externCend
#endif /* C_PLUSPLUS */
#if ( defined SOLARIS || defined SOLARIS_i86 || defined RS6000 || defined SGI || defined __linux__ || defined sequent || defined HP )
# ifndef SYSV
# define SYSV
# endif
#endif
# if ( defined ULTRIX ) /* hack fuer unsere DECstation maspar */
# include "/usr/local/gnu/gcc/lib/gcc-lib/mips-dec-ultrix4.3/2.7.2/include/stdarg.h"
# define NOCONST /* not yet implemented :-) */
# else
# include <stdarg.h> /* auf einigen BSD-Systemen auch varargs.h */
# endif
# define Mva_arglist ,...
# define Mva_decl
typedef va_list Mva_list ;
# define Mva_start(var,lastarg) va_list var ; \
va_start(var, lastarg) ;
# define Mva_arg(var,T) va_arg(var,T)
# define Mva_end(var) va_end(var)
# ifndef CONST
# if ( ! defined NOCONST )
# define CONST const
# else
# define CONST
# endif
# endif
# define REGISTER register
/* Funktionen zum Signal-Handling */
#if defined SGI
# define MUP_setsig(_sig,_fun) sigset( _sig, (void(*)(ANY_ARGS)) _fun )
#elif defined SYSV && !defined __linux__ && !defined HP && !defined __EMX__
# define MUP_setsig(_sig,_fun) sigset( _sig, (void(*)(int)) _fun )
#else
# if defined __GNUC__ && __GLIBC__ && __linux__
# include <signal.h>
# define MUP_setsig(_sig,_fun) __sysv_signal( _sig, (void(*)(int)) _fun )
# elif defined __GNUC__
# define MUP_setsig(_sig,_fun) signal( _sig, (void(*)(int)) _fun )
# elif defined C_PLUSPLUS && !defined HP && !defined WIN32
# define MUP_setsig(_sig,_fun) signal( _sig, (SIG_PF) _fun )
# else
# define MUP_setsig(_sig,_fun) signal( _sig, (void(*)(int)) _fun )
# endif
#endif
/* Verwaltung globaler Variable */
# define GLOBAL_DECL(Typ,Name) extern Typ Name
# define GLOBAL_DEF(Typ,Name) Typ Name
# define GLOBAL_READ(Name) Name
# define GLOBAL_WRITE(Name,value) ( Name = value )
# define VALUE_READ(Name) Name
#endif /* __MDE_declare__ */
|
/* ===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
#include <stdint.h>
#include <sys/mman.h>
/* #include "config.h"
* FIXME: CMake - include when cmake system is ready.
* Remove #define HAVE_SYSCONF 1 line.
*/
#define HAVE_SYSCONF 1
#ifndef __APPLE__
#include <unistd.h>
#endif /* __APPLE__ */
/*
* The compiler generates calls to __enable_execute_stack() when creating
* trampoline functions on the stack for use with nested functions.
* It is expected to mark the page(s) containing the address
* and the next 48 bytes as executable. Since the stack is normally rw-
* that means changing the protection on those page(s) to rwx.
*/
void __enable_execute_stack(void* addr)
{
#if __APPLE__
/* On Darwin, pagesize is always 4096 bytes */
const uintptr_t pageSize = 4096;
#elif !defined(HAVE_SYSCONF)
#error "HAVE_SYSCONF not defined! See enable_execute_stack.c"
#else
const uintptr_t pageSize = sysconf(_SC_PAGESIZE);
#endif /* __APPLE__ */
const uintptr_t pageAlignMask = ~(pageSize-1);
uintptr_t p = (uintptr_t)addr;
unsigned char* startPage = (unsigned char*)(p & pageAlignMask);
unsigned char* endPage = (unsigned char*)((p+48+pageSize) & pageAlignMask);
size_t length = endPage - startPage;
(void) mprotect((void *)startPage, length, PROT_READ | PROT_WRITE | PROT_EXEC);
}
|
/***********************************************************************
Copyright (C) 2007--2016 the X-ray Polarimetry Explorer (XPE) team.
For the license terms see the file LICENSE, distributed along with this
software.
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 PEVENTDISPLAYTAB_H
#define PEVENTDISPLAYTAB_H
#include <iostream>
#include <QString>
#include "pEventDisplay.h"
#include "pHistogramOptions.h"
#include "xpemonPlotOptions.h"
#include "pQtCustomTab.h"
#include "xpolgui.h"
class pEventDisplayTab : public pQtCustomTab
{
Q_OBJECT
public:
pEventDisplayTab();
~pEventDisplayTab() {;}
pEventDisplay *eventDisplay() {return m_eventDisplay;}
public slots:
void update(const pEvent &evt);
void reset();
private:
void setup();
pEventDisplay *m_eventDisplay;
};
#endif //PEVENTDISPLAYTAB_H
|
/****************************************************************************
**
** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the Qt3Support module of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef Q3GRIDLAYOUT_H
#define Q3GRIDLAYOUT_H
#include <QtGui/qboxlayout.h>
QT_BEGIN_HEADER
QT_MODULE(Qt3SupportLight)
class Q3GridLayout : public QGridLayout
{
public:
inline explicit Q3GridLayout(QWidget *parent)
: QGridLayout(parent) { setMargin(0); setSpacing(0); }
inline Q3GridLayout(QWidget *parent, int nRows, int nCols = 1, int margin = 0,
int spacing = -1, const char *name = 0)
: QGridLayout(parent, nRows, nCols, margin, spacing, name) {}
inline Q3GridLayout(int nRows, int nCols = 1, int spacing = -1, const char *name = 0)
: QGridLayout(nRows, nCols, spacing, name) {}
inline Q3GridLayout(QLayout *parentLayout, int nRows =1, int nCols = 1, int spacing = -1,
const char *name = 0)
: QGridLayout(parentLayout, nRows, nCols, spacing, name) {}
private:
Q_DISABLE_COPY(Q3GridLayout)
};
QT_END_HEADER
#endif // Q3GRIDLAYOUT_H
|
/*
* arch/arm/include/asm/processor.h
*
* Copyright (C) 1995-1999 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_ARM_PROCESSOR_H
#define __ASM_ARM_PROCESSOR_H
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
*/
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
#ifdef __KERNEL__
<<<<<<< HEAD
#include <asm/hw_breakpoint.h>
=======
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#include <asm/ptrace.h>
#include <asm/types.h>
#ifdef __KERNEL__
#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
TASK_SIZE : TASK_SIZE_26)
#define STACK_TOP_MAX TASK_SIZE
#endif
extern unsigned int boot_reason;
<<<<<<< HEAD
struct debug_info {
#ifdef CONFIG_HAVE_HW_BREAKPOINT
struct perf_event *hbp[ARM_MAX_HBP_SLOTS];
#endif
=======
union debug_insn {
u32 arm;
u16 thumb;
};
struct debug_entry {
u32 address;
union debug_insn insn;
};
struct debug_info {
int nsaved;
struct debug_entry bp[2];
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
};
struct thread_struct {
/* fault info */
unsigned long address;
unsigned long trap_no;
unsigned long error_code;
/* debugging */
struct debug_info debug;
};
#define INIT_THREAD { }
#ifdef CONFIG_MMU
#define nommu_start_thread(regs) do { } while (0)
#else
#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data
#endif
#define start_thread(regs,pc,sp) \
({ \
unsigned long *stack = (unsigned long *)sp; \
set_fs(USER_DS); \
memset(regs->uregs, 0, sizeof(regs->uregs)); \
if (current->personality & ADDR_LIMIT_32BIT) \
regs->ARM_cpsr = USR_MODE; \
else \
regs->ARM_cpsr = USR26_MODE; \
if (elf_hwcap & HWCAP_THUMB && pc & 1) \
regs->ARM_cpsr |= PSR_T_BIT; \
regs->ARM_cpsr |= PSR_ENDSTATE; \
regs->ARM_pc = pc & ~1; /* pc */ \
regs->ARM_sp = sp; /* sp */ \
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
nommu_start_thread(regs); \
})
/* Forward declaration, a strange C thing */
struct task_struct;
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);
/* Prepare to copy thread state - unlazy all lazy status */
#define prepare_to_copy(tsk) do { } while (0)
unsigned long get_wchan(struct task_struct *p);
<<<<<<< HEAD
#if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
=======
#if __LINUX_ARM_ARCH__ == 6
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
#define cpu_relax() smp_mb()
#else
#define cpu_relax() barrier()
#endif
/*
* Create a new kernel thread
*/
extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
#define task_pt_regs(p) \
((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
#define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc
#define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp
/*
* Prefetching support - only ARMv5.
*/
#if __LINUX_ARM_ARCH__ >= 5
#define ARCH_HAS_PREFETCH
static inline void prefetch(const void *ptr)
{
__asm__ __volatile__(
"pld\t%a0"
:
: "p" (ptr)
: "cc");
}
#define ARCH_HAS_PREFETCHW
#define prefetchw(ptr) prefetch(ptr)
#define ARCH_HAS_SPINLOCK_PREFETCH
#define spin_lock_prefetch(x) do { } while (0)
#endif
#endif
#endif /* __ASM_ARM_PROCESSOR_H */
|
/* views - view images exclusive with SDM
* Copyright (C) cappa <cappa@referee.at>
*
* 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 "include/views.h"
direct *add_name(direct *dir, char *name)
{
if(dir == NULL)
{
dir = (struct _directory *) calloc(1, sizeof(struct _directory));
dir->name = strdup(name);
dir->next = NULL;
} else {
dir->next = add_name(dir->next, name);
}
return dir;
}
void print_names(direct *dir)
{
if(dir != NULL)
{
printf("%s\n", dir->name);
print_names(dir->next);
}
}
char *search(direct *dir, const char *name)
{
while(dir)
{
if(!strcmp(dir->name, name))
{
return dir->name;
}
dir = dir->next;
}
return NULL;
}
direct *read_dir(char *dirname)
{
DIR *cdir;
struct dirent *dir;
dir = (struct dirent *) calloc(1, sizeof(struct dirent));
directory = (struct _directory *) calloc(1, sizeof(struct _directory));
directory = NULL;
if(strlen(dirname) == 0)
{
snprintf(dirname, strlen(get_current_dir_name())+2, "%s/", get_current_dir_name());
}
cdir = opendir(dirname);
if(cdir == NULL)
{
geterror("Can't open directory (%s)", dirname);
die();
}
while(cdir != NULL)
{
dir = readdir(cdir);
if(dir != NULL)
{
directory = add_name(directory, dir->d_name);
} else {
break;
}
}
closedir(cdir);
return directory;
}
char *getdir(char *filename)
{
char *dir;
dir = char_alloc();
dir = substring(filename, 0, strlen(filename)-strlen(basename(filename)));
return dir;
}
|
/* Broadcom NetXtreme-C/E network driver.
*
* Copyright (c) 2014-2016 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.
*/
#ifndef _BNXT_NVM_DEFS_H_
#define _BNXT_NVM_DEFS_H_
enum bnxt_nvm_directory_type {
BNX_DIR_TYPE_UNUSED = 0,
BNX_DIR_TYPE_PKG_LOG = 1,
BNX_DIR_TYPE_CHIMP_PATCH = 3,
BNX_DIR_TYPE_BOOTCODE = 4,
BNX_DIR_TYPE_VPD = 5,
BNX_DIR_TYPE_EXP_ROM_MBA = 6,
BNX_DIR_TYPE_AVS = 7,
BNX_DIR_TYPE_PCIE = 8,
BNX_DIR_TYPE_PORT_MACRO = 9,
BNX_DIR_TYPE_APE_FW = 10,
BNX_DIR_TYPE_APE_PATCH = 11,
BNX_DIR_TYPE_KONG_FW = 12,
BNX_DIR_TYPE_KONG_PATCH = 13,
BNX_DIR_TYPE_BONO_FW = 14,
BNX_DIR_TYPE_BONO_PATCH = 15,
BNX_DIR_TYPE_TANG_FW = 16,
BNX_DIR_TYPE_TANG_PATCH = 17,
BNX_DIR_TYPE_BOOTCODE_2 = 18,
BNX_DIR_TYPE_CCM = 19,
BNX_DIR_TYPE_PCI_CFG = 20,
BNX_DIR_TYPE_TSCF_UCODE = 21,
BNX_DIR_TYPE_ISCSI_BOOT = 22,
BNX_DIR_TYPE_ISCSI_BOOT_IPV6 = 24,
BNX_DIR_TYPE_ISCSI_BOOT_IPV4N6 = 25,
BNX_DIR_TYPE_ISCSI_BOOT_CFG6 = 26,
BNX_DIR_TYPE_EXT_PHY = 27,
BNX_DIR_TYPE_SHARED_CFG = 40,
BNX_DIR_TYPE_PORT_CFG = 41,
BNX_DIR_TYPE_FUNC_CFG = 42,
BNX_DIR_TYPE_MGMT_CFG = 48,
BNX_DIR_TYPE_MGMT_DATA = 49,
BNX_DIR_TYPE_MGMT_WEB_DATA = 50,
BNX_DIR_TYPE_MGMT_WEB_META = 51,
BNX_DIR_TYPE_MGMT_EVENT_LOG = 52,
BNX_DIR_TYPE_MGMT_AUDIT_LOG = 53
};
#define BNX_DIR_ORDINAL_FIRST 0
#define BNX_DIR_EXT_INACTIVE (1 << 0)
#define BNX_DIR_EXT_UPDATE (1 << 1)
#define BNX_DIR_ATTR_NO_CHKSUM (1 << 0)
#define BNX_DIR_ATTR_PROP_STREAM (1 << 1)
#endif /* Don't add anything after this line */
|
/* Linux ISDN subsystem, sync PPP, interface to ipppd
*
* Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
* Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
* Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
* Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#ifndef _UAPI_LINUX_ISDN_PPP_H
#define _UAPI_LINUX_ISDN_PPP_H
#define CALLTYPE_INCOMING 0x1
#define CALLTYPE_OUTGOING 0x2
#define CALLTYPE_CALLBACK 0x4
#define IPPP_VERSION "2.2.0"
struct pppcallinfo
{
int calltype;
unsigned char local_num[64];
unsigned char remote_num[64];
int charge_units;
};
#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
#define PPPIOCBUNDLE _IOW('t',129,int)
#define PPPIOCGMPFLAGS _IOR('t',130,int)
#define PPPIOCSMPFLAGS _IOW('t',131,int)
#define PPPIOCSMPMTU _IOW('t',132,int)
#define PPPIOCSMPMRU _IOW('t',133,int)
#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
#define SC_MP_PROT 0x00000200
#define SC_REJ_MP_PROT 0x00000400
#define SC_OUT_SHORT_SEQ 0x00000800
#define SC_IN_SHORT_SEQ 0x00004000
#define SC_DECOMP_ON 0x01
#define SC_COMP_ON 0x02
#define SC_DECOMP_DISCARD 0x04
#define SC_COMP_DISCARD 0x08
#define SC_LINK_DECOMP_ON 0x10
#define SC_LINK_COMP_ON 0x20
#define SC_LINK_DECOMP_DISCARD 0x40
#define SC_LINK_COMP_DISCARD 0x80
#define ISDN_PPP_COMP_MAX_OPTIONS 16
#define IPPP_COMP_FLAG_XMIT 0x1
#define IPPP_COMP_FLAG_LINK 0x2
struct isdn_ppp_comp_data {
int num;
unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
int optlen;
int flags;
};
#endif /* _UAPI_LINUX_ISDN_PPP_H */
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_ATOMIC_REF_COUNT_H_
#define BASE_ATOMIC_REF_COUNT_H_
#pragma once
#include "base/atomicops.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
namespace base {
typedef subtle::Atomic32 AtomicRefCount;
inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
AtomicRefCount increment) {
subtle::NoBarrier_AtomicIncrement(ptr, increment);
}
// Insert barriers to ensure that state written before the reference count
inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
AtomicRefCount decrement) {
ANNOTATE_HAPPENS_BEFORE(ptr);
bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
if (!res) {
ANNOTATE_HAPPENS_AFTER(ptr);
}
return res;
}
inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) {
base::AtomicRefCountIncN(ptr, 1);
}
// Insert barriers to ensure that state written before the reference count
inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
return base::AtomicRefCountDecN(ptr, 1);
}
inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
bool res = (subtle::Acquire_Load(ptr) == 1);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);
}
return res;
}
inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
bool res = (subtle::Acquire_Load(ptr) == 0);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);
}
return res;
}
}
#endif
|
/*
* CPU detection code, extracted from mmx.h
* (c)1997-99 by H. Dietz and R. Fisher
* Converted to C and improved by Fabrice Bellard.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include "x86_cpu.h"
#include "cputest.h"
/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
#define cpuid(index,eax,ebx,ecx,edx)\
__asm__ volatile\
("mov %%"REG_b", %%"REG_S"\n\t"\
"cpuid\n\t"\
"xchg %%"REG_b", %%"REG_S\
: "=a" (eax), "=S" (ebx),\
"=c" (ecx), "=d" (edx)\
: "0" (index));
#define xgetbv(index,eax,edx) \
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
/* Function to test if multimedia instructions are supported... */
int ff_get_cpu_flags_x86(void)
{
int rval = 0;
int eax, ebx, ecx, edx;
int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
int family=0, model=0;
union { int i[3]; char c[12]; } vendor;
#if ARCH_X86_32
x86_reg a, c;
__asm__ volatile (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushfl\n\t"
"pop %0\n\t"
"mov %0, %1\n\t"
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xor $0x200000, %0\n\t"
"push %0\n\t"
"popfl\n\t"
/* ... Get the (hopefully modified) EFLAGS */
"pushfl\n\t"
"pop %0\n\t"
: "=a" (a), "=c" (c)
:
: "cc"
);
if (a == c)
return 0; /* CPUID not supported */
#endif
cpuid(0, max_std_level, vendor.i[0], vendor.i[2], vendor.i[1]);
if(max_std_level >= 1){
cpuid(1, eax, ebx, ecx, std_caps);
family = ((eax>>8)&0xf) + ((eax>>20)&0xff);
model = ((eax>>4)&0xf) + ((eax>>12)&0xf0);
if (std_caps & (1<<23))
rval |= CPUTEST_FLAG_MMX;
if (std_caps & (1<<25))
rval |= CPUTEST_FLAG_MMX2
//#if HAVE_SSE
| CPUTEST_FLAG_SSE;
if (std_caps & (1<<26))
rval |= CPUTEST_FLAG_SSE2;
if (ecx & 1)
rval |= CPUTEST_FLAG_SSE3;
if (ecx & 0x00000200 )
rval |= CPUTEST_FLAG_SSSE3;
if (ecx & 0x00080000 )
rval |= CPUTEST_FLAG_SSE4;
if (ecx & 0x00100000 )
rval |= CPUTEST_FLAG_SSE42;
//#if HAVE_AVX
/* Check OXSAVE and AVX bits */
if ((ecx & 0x18000000) == 0x18000000) {
/* Check for OS support */
xgetbv(0, eax, edx);
if ((eax & 0x6) == 0x6)
rval |= CPUTEST_FLAG_AVX;
}
//#endif
//#endif
;
}
cpuid(0x80000000, max_ext_level, ebx, ecx, edx);
if(max_ext_level >= 0x80000001){
cpuid(0x80000001, eax, ebx, ecx, ext_caps);
if (ext_caps & (1<<31))
rval |= CPUTEST_FLAG_3DNOW;
if (ext_caps & (1<<30))
rval |= CPUTEST_FLAG_3DNOWEXT;
if (ext_caps & (1<<23))
rval |= CPUTEST_FLAG_MMX;
if (ext_caps & (1<<22))
rval |= CPUTEST_FLAG_MMX2;
/* Allow for selectively disabling SSE2 functions on AMD processors
with SSE2 support but not SSE4a. This includes Athlon64, some
Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster
than SSE2 often enough to utilize this special-case flag.
CPUTEST_FLAG_SSE2 and CPUTEST_FLAG_SSE2SLOW are both set in this case
so that SSE2 is used unless explicitly disabled by checking
CPUTEST_FLAG_SSE2SLOW. */
if (!strncmp(vendor.c, "AuthenticAMD", 12) &&
rval & CPUTEST_FLAG_SSE2 && !(ecx & 0x00000040)) {
rval |= CPUTEST_FLAG_SSE2SLOW;
}
}
if (!strncmp(vendor.c, "GenuineIntel", 12)) {
if (family == 6 && (model == 9 || model == 13 || model == 14)) {
/* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah")
* theoretically support sse2, but it's usually slower than mmx,
* so let's just pretend they don't. CPUTEST_FLAG_SSE2 is disabled and
* CPUTEST_FLAG_SSE2SLOW is enabled so that SSE2 is not used unless
* explicitly enabled by checking CPUTEST_FLAG_SSE2SLOW. The same
* situation applies for CPUTEST_FLAG_SSE3 and CPUTEST_FLAG_SSE3SLOW. */
if (rval & CPUTEST_FLAG_SSE2) rval ^= CPUTEST_FLAG_SSE2SLOW|CPUTEST_FLAG_SSE2;
if (rval & CPUTEST_FLAG_SSE3) rval ^= CPUTEST_FLAG_SSE3SLOW|CPUTEST_FLAG_SSE3;
}
/* The Atom processor has SSSE3 support, which is useful in many cases,
* but sometimes the SSSE3 version is slower than the SSE2 equivalent
* on the Atom, but is generally faster on other processors supporting
* SSSE3. This flag allows for selectively disabling certain SSSE3
* functions on the Atom. */
if (family == 6 && model == 28)
rval |= CPUTEST_FLAG_ATOM;
}
return rval;
}
|
//--------------------------------------------------------------------------
// Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved.
// Copyright (C) 2009-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.
//--------------------------------------------------------------------------
// sd_credit_card.h author Ryan Jordan
#ifndef SD_CREDIT_CARD_H
#define SD_CREDIT_CARD_H
#include <stdint.h>
int SdLuhnAlgorithm(const uint8_t *buf, uint32_t buflen);
#endif
|
//
// WPContentCell.h
//
//
// Created by Tom Witkin on 12/12/13.
//
//
#import <UIKit/UIKit.h>
#import "WPTableViewCell.h"
#import "WPContentViewProvider.h"
@interface WPContentCell : WPTableViewCell
@property (nonatomic, strong) id<WPContentViewProvider> contentProvider;
+ (CGFloat)rowHeightForContentProvider:(id<WPContentViewProvider>)contentProvider andWidth:(CGFloat)width;
+ (BOOL)shortDateString;
+ (BOOL)showGravatarImage;
+ (BOOL)supportsUnreadStatus;
+ (UIFont *)statusFont;
+ (NSDictionary *)statusAttributes;
+ (NSString *)statusTextForContentProvider:(id<WPContentViewProvider>)contentProvider;
+ (UIColor *)statusColorForContentProvider:(id<WPContentViewProvider>)contentProvider;
+ (UIFont *)titleFont;
+ (NSDictionary *)titleAttributes;
+ (NSDictionary *)titleAttributesBold;
+ (NSAttributedString *)titleAttributedTextForContentProvider:(id<WPContentViewProvider>)contentProvider;
+ (UIFont *)dateFont;
+ (NSDictionary *)dateAttributes;
+ (NSString *)dateTextForContentProvider:(id<WPContentViewProvider>)contentProvider;
@end
|
/*
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2019 The ManaPlus Developers
* Copyright (C) 2019-2022 Andrei Karas
*
* This file is part of The ManaPlus Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUI_POPUPMANAGER_H
#define GUI_POPUPMANAGER_H
#include "localconsts.h"
class PopupManager final
{
public:
/**
* Constructor.
*/
PopupManager();
A_DELETE_COPY(PopupManager)
/**
* Destructor.
*/
~PopupManager();
static bool isBeingPopupVisible() A_WARN_UNUSED;
static bool isTextPopupVisible() A_WARN_UNUSED;
/**
* Closes the popup menu. Needed for when the player dies or switching
* maps.
*/
static void closePopupMenu();
/**
* Hides the BeingPopup.
*/
static void hideBeingPopup();
static void hideTextPopup();
static void hideItemPopup();
static bool isPopupMenuVisible() A_WARN_UNUSED;
static void clearPopup();
static void hidePopupMenu();
};
extern PopupManager *popupManager;
#endif // GUI_POPUPMANAGER_H
|
/*
* Copyright (c) 2003, 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 mq_open() does not add messages to the queue or remove
* messages from the queue.
*
* Test using mq_send and mq_receive:
* - Call mq_open() for non-blocking queue
* - Verify mq_receive() fails (because nothing should be in the queue yet)
* - Call mq_send() to put something in the queue
* - Call mq_open() again for non-blocking queue
* - Verify mq_receive() now succeeded (because the sent message should
* still be in the queue).
*
* 3/13/03 - Added fix from Gregoire Pichon for specifying an attr
* with a mq_maxmsg >= BUFFER.
*/
#include <stdio.h>
#include <mqueue.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include "posixtest.h"
#define NAMESIZE 50
#define MSGSTR "0123456789"
#define BUFFER 40
int main()
{
char qname[NAMESIZE], msgrcd[BUFFER];
const char *msgptr = MSGSTR;
mqd_t queue;
struct mq_attr attr;
int failure=0;
unsigned pri;
sprintf(qname, "/mq_open_19-1_%d", getpid());
attr.mq_msgsize = BUFFER;
attr.mq_maxmsg = BUFFER;
queue = mq_open(qname, O_CREAT |O_RDWR|O_NONBLOCK,
S_IRUSR | S_IWUSR, &attr);
if (queue == (mqd_t)-1) {
perror("mq_open() did not return success");
printf("Test UNRESOLVED\n");
return PTS_UNRESOLVED;
}
if (mq_receive(queue, msgrcd, BUFFER, &pri) != -1) {
printf("mq_receive() succeded\n");
printf("mq_open() may have placed a message in the queue\n");
failure=1;
}
if (mq_send(queue, msgptr, strlen(msgptr), 1) == -1) {
perror("mq_send() did not return success");
printf("Test UNRESOLVED\n");
/* close queue and exit */
mq_close(queue);
mq_unlink(qname);
return PTS_UNRESOLVED;
}
queue = mq_open(qname, O_RDWR|O_NONBLOCK, S_IRUSR | S_IWUSR, NULL);
if (queue == (mqd_t)-1) {
perror("mq_open() second time did not return success");
printf("Test UNRESOLVED\n");
/* close queue and exit */
mq_close(queue);
mq_unlink(qname);
return PTS_UNRESOLVED;
}
if (mq_receive(queue, msgrcd, BUFFER, &pri) == -1) {
perror("mq_receive() failed");
printf("mq_open() may have removed a msg from the queue\n");
failure=1;
}
mq_close(queue);
mq_unlink(qname);
if (failure==1) {
printf("Test FAILED\n");
return PTS_FAIL;
}
printf("Test PASSED\n");
return PTS_PASS;
} |
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "../spidy.h"
#include "../link.h"
#include "../test_folders.h"
#define DEV "/dev/ttyUSB0"
int main (int argc, char **argv)
{
FILE *fw = fopen(DEV, "w");
FILE *fr = fopen(DEV, "r");
int out=0;
int h=0,i,f=0;
if (!fw || !fr) {
fprintf(stderr, "/dev/ttyUSB0 is not accessible\n");
exit(1);
}
/* HANDSHAKE */
while (out!=CHAR_MSTART) {
out=fgetc(fr);
printf("%i ",out);
}
printf("Received Start -> ");
/* START SESSION */
fputc(CHAR_SSTART, fw);
fputc(CHAR_ENDLINE, fw);
printf("Sent Start\n");
printf("# Sending Motors\n");
/* wait ready */
while (out!=CHAR_MREADY) {
out=fgetc(fr);
printf("%i ", out);
}
printf("Received Ready\n");
while (h<2) {
/* send buffer */
printf("BUFFER --> ");
fputc(CHAR_SFRAME, fw);
/* building values and send it */
for (i=1+f*9;i<=9+f*9;i++) {
out=DEG_NEG90+i*10;
printf("%i ",out);
fputc(out, fw);
}
printf("\n");
fputc(CHAR_SFRAME, fw);
fputc(CHAR_ENDLINE, fw);
f++; f%=2; /* from 1 to 10 */
h++;
sleep(1);
/* wait ready */
while (out!=CHAR_MREADY) {
out=fgetc(fr);
printf("%i ", out);
}
printf("Received Ready\n");
}
printf("# Testing Frames\n");
for (i=0;i<40;i++) {
while(out != CHAR_TEST_MEND) {
out=fgetc(fr);
printf("%c", out);
}
sleep(1);
printf("\n# Next Frame\n");
fputc(CHAR_TEST_SEND, fw);
fputc(CHAR_ENDLINE, fw);
out=0;
}
printf("# Exiting\n");
fclose(fw);
fclose(fr);
return 0;
}
|
// Copyright 2006 Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef OPEN_VCDIFF_VCDIFFENGINE_H_
#define OPEN_VCDIFF_VCDIFFENGINE_H_
#include <config.h>
#include <stddef.h>
#include <stdint.h>
namespace open_vcdiff {
class BlockHash;
class OutputStringInterface;
class CodeTableWriterInterface;
class VCDiffEngine {
public:
static const size_t kMinimumMatchSize = 32;
VCDiffEngine(const char* dictionary, size_t dictionary_size);
~VCDiffEngine();
bool Init();
size_t dictionary_size() const { return dictionary_size_; }
void Encode(const char* target_data,
size_t target_size,
bool look_for_target_matches,
OutputStringInterface* diff,
CodeTableWriterInterface* coder) const;
private:
static bool ShouldGenerateCopyInstructionForMatchOfSize(size_t size) {
return size >= kMinimumMatchSize;
}
template<bool look_for_target_matches>
void EncodeInternal(const char* target_data,
size_t target_size,
OutputStringInterface* diff,
CodeTableWriterInterface* coder) const;
template<bool look_for_target_matches>
size_t EncodeCopyForBestMatch(uint32_t hash_value,
const char* target_candidate_start,
const char* unencoded_target_start,
size_t unencoded_target_size,
const BlockHash* target_hash,
CodeTableWriterInterface* coder) const;
void AddUnmatchedRemainder(const char* unencoded_target_start,
size_t unencoded_target_size,
CodeTableWriterInterface* coder) const;
void FinishEncoding(size_t target_size,
OutputStringInterface* diff,
CodeTableWriterInterface* coder) const;
const char* dictionary_;
const size_t dictionary_size_;
const BlockHash* hashed_dictionary_;
VCDiffEngine(const VCDiffEngine&);
void operator=(const VCDiffEngine&);
};
}
#endif
|
/* netsc520.c -- MTD map driver for AMD NetSc520 Demonstration Board
*
* Copyright (C) 2001 Mark Langsdorf (mark.langsdorf@amd.com)
* based on sc520cdp.c by Sysgo Real-Time Solutions GmbH
*
* $Id: netsc520.c 2 2007-04-05 08:51:12Z tt $
*
* 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
*
* The NetSc520 is a demonstration board for the Elan Sc520 processor available
* from AMD. It has a single back of 16 megs of 32-bit Flash ROM and another
* 16 megs of SDRAM.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
/*
** The single, 16 megabyte flash bank is divided into four virtual
** partitions. The first partition is 768 KiB and is intended to
** store the kernel image loaded by the bootstrap loader. The second
** partition is 256 KiB and holds the BIOS image. The third
** partition is 14.5 MiB and is intended for the flash file system
** image. The last partition is 512 KiB and contains another copy
** of the BIOS image and the reset vector.
**
** Only the third partition should be mounted. The first partition
** should not be mounted, but it can erased and written to using the
** MTD character routines. The second and fourth partitions should
** not be touched - it is possible to corrupt the BIOS image by
** mounting these partitions, and potentially the board will not be
** recoverable afterwards.
*/
/* partition_info gives details on the logical partitions that the split the
* single flash device into. If the size if zero we use up to the end of the
* device. */
static struct mtd_partition partition_info[]={
{
.name = "NetSc520 boot kernel",
.offset = 0,
.size = 0xc0000
},
{
.name = "NetSc520 Low BIOS",
.offset = 0xc0000,
.size = 0x40000
},
{
.name = "NetSc520 file system",
.offset = 0x100000,
.size = 0xe80000
},
{
.name = "NetSc520 High BIOS",
.offset = 0xf80000,
.size = 0x80000
},
};
#define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0]))
#define WINDOW_SIZE 0x00100000
#define WINDOW_ADDR 0x00200000
static struct map_info netsc520_map = {
.name = "netsc520 Flash Bank",
.size = WINDOW_SIZE,
.bankwidth = 4,
.phys = WINDOW_ADDR,
};
#define NUM_FLASH_BANKS (sizeof(netsc520_map)/sizeof(struct map_info))
static struct mtd_info *mymtd;
static int __init init_netsc520(void)
{
printk(KERN_NOTICE "NetSc520 flash device: 0x%lx at 0x%lx\n", netsc520_map.size, netsc520_map.phys);
netsc520_map.virt = ioremap_nocache(netsc520_map.phys, netsc520_map.size);
if (!netsc520_map.virt) {
printk("Failed to ioremap_nocache\n");
return -EIO;
}
simple_map_init(&netsc520_map);
mymtd = do_map_probe("cfi_probe", &netsc520_map);
if(!mymtd)
mymtd = do_map_probe("map_ram", &netsc520_map);
if(!mymtd)
mymtd = do_map_probe("map_rom", &netsc520_map);
if (!mymtd) {
iounmap(netsc520_map.virt);
return -ENXIO;
}
mymtd->owner = THIS_MODULE;
add_mtd_partitions( mymtd, partition_info, NUM_PARTITIONS );
return 0;
}
static void __exit cleanup_netsc520(void)
{
if (mymtd) {
del_mtd_partitions(mymtd);
map_destroy(mymtd);
}
if (netsc520_map.virt) {
iounmap(netsc520_map.virt);
netsc520_map.virt = NULL;
}
}
module_init(init_netsc520);
module_exit(cleanup_netsc520);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mark Langsdorf <mark.langsdorf@amd.com>");
MODULE_DESCRIPTION("MTD map driver for AMD NetSc520 Demonstration Board");
|
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
//
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <iosfwd>
class Game;
class Serializer;
/// Checksum of the game before the game commands of any player is executed
struct AsyncChecksum
{
unsigned randChecksum;
unsigned objCt, objIdCt;
unsigned eventCt, evInstanceCt;
AsyncChecksum();
AsyncChecksum(unsigned randChecksum, unsigned objCt, unsigned objIdCt, unsigned eventCt, unsigned evInstanceCt);
void Serialize(Serializer& ser) const;
void Deserialize(Serializer& ser);
/// Get a hash for this checksum
unsigned getHash() const;
static AsyncChecksum create(const Game& game);
bool operator==(const AsyncChecksum& rhs) const;
bool operator!=(const AsyncChecksum& rhs) const;
};
inline bool AsyncChecksum::operator==(const AsyncChecksum& rhs) const
{
return randChecksum == rhs.randChecksum && objCt == rhs.objCt && objIdCt == rhs.objIdCt && eventCt == rhs.eventCt
&& evInstanceCt == rhs.evInstanceCt;
}
inline bool AsyncChecksum::operator!=(const AsyncChecksum& rhs) const
{
return !(*this == rhs);
}
std::ostream& operator<<(std::ostream& os, const AsyncChecksum& checksum);
|
/*=============================================================================
Copyright (C) 2000 Kenneth Kocienda and David Hakim.
This file is part of the Moto Programming Language.
Moto Programming Language 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.
Moto Programming Language is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Codex C Library; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
$RCSfile: mxarr.h,v $
$Revision: 1.13 $
$Author: dhakim $
$Date: 2003/03/03 03:40:15 $
==============================================================================*/
#ifndef __MXARR_H
#define __MXARR_H
#ifdef HAVE_RCONFIG_H
#include <rconfig.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "integer.h"
#include "exception.h"
/* moto type variants */
typedef enum {
ARR_BOOLEAN_TYPE = 1,
ARR_BYTE_TYPE = 2,
ARR_CHAR_TYPE = 3,
ARR_INT32_TYPE = 4,
ARR_INT64_TYPE = 5,
ARR_FLOAT_TYPE = 6,
ARR_DOUBLE_TYPE = 7,
ARR_VOID_TYPE = 8,
ARR_REF_TYPE = 9,
} ArrTypeKind;
typedef struct arrMeta {
int length;
int dim;
void* subtype;
} ArrMeta;
typedef struct booleanArr {
struct arrMeta meta;
unsigned char data[1];
} BooleanArray;
typedef struct byteArr {
struct arrMeta meta;
unsigned char data[1];
} ByteArray;
typedef struct charArr {
struct arrMeta meta;
char data[1];
} CharArray;
typedef struct intArr {
struct arrMeta meta;
int32_t data[1];
} IntArray;
typedef struct longArr {
struct arrMeta meta;
int64_t data[1];
} LongArray;
typedef struct floatArr {
struct arrMeta meta;
float data[1];
} FloatArray;
typedef struct doubleArr {
struct arrMeta meta;
double data[1];
} DoubleArray;
typedef struct refArr {
struct arrMeta meta;
void* data[1];
} RefArray;
typedef struct arrArr {
struct arrMeta meta;
union unArr* data[1];
} ArrArray;
typedef union unArr {
struct arrMeta meta;
struct booleanArr ba;
struct byteArr ya;
struct charArr ca;
struct intArr ia;
struct longArr la;
struct floatArr fa;
struct doubleArr da;
struct refArr ra;
struct arrArr aa;
} UnArray;
UnArray* arr_create(int dim,char unspec,int l,int* dimarr,int subtype);
UnArray* arr_create_and_init(
int dim,char unspec,int l,int* dimarr,int subtype,int num_init, ...);
inline int arr_length(UnArray* ua);
inline int32_t* isub(UnArray* ua,int index);
inline int64_t* lsub(UnArray* ua,int index);
inline float* fsub(UnArray* ua,int index);
inline double* dsub(UnArray* ua,int index);
inline unsigned char* bsub(UnArray* ua,int index);
inline char* csub(UnArray* ua,int index);
inline signed char* ysub(UnArray* ua,int index);
inline void** rsub(UnArray* ua,int index);
inline int32_t* inline_isub(UnArray* ua,int index);
inline int64_t* inline_lsub(UnArray* ua,int index);
inline float* inline_fsub(UnArray* ua,int index);
inline double* inline_dsub(UnArray* ua,int index);
inline unsigned char* inline_bsub(UnArray* ua,int index);
inline char* inline_csub(UnArray* ua,int index);
inline signed char* inline_ysub(UnArray* ua,int index);
inline void** inline_rsub(UnArray* ua,int index);
inline int32_t inline_checkForIntZero(int32_t p);
inline int64_t inline_checkForLongZero(int64_t p);
inline float inline_checkForFloatZero(float p);
inline double inline_checkForDoubleZero(double p);
inline char inline_checkForCharZero(char p);
inline signed char inline_checkForByteZero(signed char p);
inline void* inline_checkForNullDereference(void* p);
inline void* inline_checkForNullMethCall(void* p);
inline void* inline_checkForNullCallee(void* p);
#define CHK_NULL_M(SELF_PTR) (excp_file=__FILE__,excp_line=__LINE__,inline_checkForNullMethCall(SELF_PTR))
#define CHK_NULL_D(SELF_PTR) (excp_file=__FILE__,excp_line=__LINE__,inline_checkForNullDereference(SELF_PTR))
#define CHK_NULL_C(CALLEE_PTR) (excp_file=__FILE__,excp_line=__LINE__,inline_checkForNullCallee(CALLEE_PTR))
#endif
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
#import "base/mac/cocoa_protocols.h"
#include "base/memory/scoped_ptr.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h"
class BookmarkBubbleNotificationBridge;
class BookmarkModel;
class BookmarkNode;
@class BookmarkBubbleController;
@class InfoBubbleView;
@interface BookmarkBubbleController : NSWindowController<NSWindowDelegate> {
@private
NSWindow* parentWindow_;
BookmarkModel* model_;
const BookmarkNode* node_;
const BookmarkNode* pulsingBookmarkNode_;
BOOL alreadyBookmarked_;
scoped_ptr<BookmarkModelObserverForCocoa> bookmark_observer_;
scoped_ptr<BookmarkBubbleNotificationBridge> chrome_observer_;
IBOutlet NSTextField* bigTitle_;
IBOutlet NSTextField* nameTextField_;
IBOutlet NSPopUpButton* folderPopUpButton_;
IBOutlet InfoBubbleView* bubble_;
}
@property(readonly, nonatomic) const BookmarkNode* node;
- (id)initWithParentWindow:(NSWindow*)parentWindow
model:(BookmarkModel*)model
node:(const BookmarkNode*)node
alreadyBookmarked:(BOOL)alreadyBookmarked;
- (IBAction)ok:(id)sender;
- (IBAction)remove:(id)sender;
- (IBAction)cancel:(id)sender;
- (IBAction)edit:(id)sender;
- (IBAction)folderChanged:(id)sender;
@end
@interface BookmarkBubbleController(ExposedForUnitTesting)
- (void)addFolderNodes:(const BookmarkNode*)parent
toPopUpButton:(NSPopUpButton*)button
indentation:(int)indentation;
- (void)setTitle:(NSString*)title parentFolder:(const BookmarkNode*)parent;
- (void)setParentFolderSelection:(const BookmarkNode*)parent;
+ (NSString*)chooseAnotherFolderString;
- (NSPopUpButton*)folderPopUpButton;
@end
|
/*
Copyright (C) 2008-2011 Vana 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; version 2
of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
#include "Types.h"
namespace Parties {
const int8_t MaxMembers = 6;
}
namespace Characters {
const int8_t MaxNameSize = 12;
const int8_t MinNameSize = 4;
const int32_t DefaultCharacterSlots = 3;
}
namespace Gender {
enum {
Male = 0,
Female = 1,
Both = 2
};
}
namespace GuildsAndAlliances {
const int32_t RankQuantity = 5;
const int32_t InvitationAliveTime = 300; // Amount of seconds the invitation is 'alive'
const int32_t GuildMaxCapacacity = 100;
// Alliance costs
const int32_t AllianceCreationCost = 5000000;
const int32_t AllianceCapacityIncreasementCost = 1000000;
// Guild costs
const int32_t GuildCreationCost = 1500000;
const int32_t GuildDisbandCost = 200000;
const int32_t GuildChangeEmblemCost = 5000000;
const int32_t GuildRemoveEmblemCost = 1000000;
const int32_t GuildCapacityIncreasementCost = 500000;
namespace GuildIncreaseCapacityCostMultiplier {
enum {
FifteenSlots = 3,
TwentySlots = 5,
TwentyFiveOrMoreSlots = 7
};
}
}
namespace Stats {
const uint8_t PlayerLevels = 200;
const uint8_t CygnusLevels = 120;
const uint8_t PetLevels = 30;
const int16_t MaxMaxHp = 30000;
const int16_t MinMaxHp = 1;
const int16_t MaxMaxMp = 30000;
const int16_t MinMaxMp = 1;
const int16_t MaxFame = 30000;
const int16_t MinFame = -30000;
const int16_t MaxCloseness = 30000;
const int16_t ApPerLevel = 5;
const int16_t ApPerCygnusLevel = 6;
const uint8_t CygnusApCutoff = 70;
const int16_t SpPerLevel = 3;
const int8_t MaxFullness = 100;
const int8_t MinFullness = 0;
const int8_t PetFeedFullness = 30;
const int32_t MaxDamage = 199999;
const int16_t PetExp[PetLevels - 1] = {
1, 3, 6, 14, 31, 60, 108, 181, 287, 434,
632, 891, 1224, 1642, 2161, 2793, 3557, 4467, 5542, 6801,
8263, 9950, 11882, 14084, 16578, 19391, 22548, 26074, 30000
};
namespace BaseHp {
const int16_t Variation = 4; // This is the range of HP that the server will give
const int16_t Beginner = 12; // These are base HP values rewarded on level up
const int16_t Warrior = 24;
const int16_t Magician = 10;
const int16_t Bowman = 20;
const int16_t Thief = 20;
const int16_t Pirate = 22;
const int16_t Gm = 150;
const int16_t BeginnerAp = 8; // These are base HP values rewarded on AP distribution
const int16_t WarriorAp = 20;
const int16_t MagicianAp = 8;
const int16_t BowmanAp = 16;
const int16_t ThiefAp = 16;
const int16_t PirateAp = 18;
const int16_t GmAp = 16;
}
namespace BaseMp {
const int16_t Variation = 2; // This is the range of MP that the server will give
const int16_t Beginner = 10; // These are base MP values rewarded on level up
const int16_t Warrior = 4;
const int16_t Magician = 6;
const int16_t Bowman = 14;
const int16_t Thief = 14;
const int16_t Pirate = 18;
const int16_t Gm = 150;
const int16_t BeginnerAp = 6; // These are base MP values rewarded on AP distribution
const int16_t WarriorAp = 2;
const int16_t MagicianAp = 18;
const int16_t BowmanAp = 10;
const int16_t ThiefAp = 10;
const int16_t PirateAp = 14;
const int16_t GmAp = 10;
}
enum Constants {
Skin = 0x01,
Eyes = 0x02,
Hair = 0x04,
Pet = 0x08,
Level = 0x10,
Job = 0x20,
Str = 0x40,
Dex = 0x80,
Int = 0x100,
Luk = 0x200,
Hp = 0x400,
MaxHp = 0x800,
Mp = 0x1000,
MaxMp = 0x2000,
Ap = 0x4000,
Sp = 0x8000,
Exp = 0x10000,
Fame = 0x20000,
Mesos = 0x40000
};
}
namespace MonsterCards {
const uint8_t MaxCardLevel = 5;
const int32_t MaxPlayerLevel = 8;
const int32_t PlayerLevels[MaxPlayerLevel - 1] = {10, 30, 60, 100, 150, 210, 280};
}
namespace MobElements {
enum Modifiers {
Normal,
Immune,
Strong,
Weak
};
} |
/***************************************************************************
* Project TUPI: Magia 2D *
* Project Contact: info@maefloresta.com *
* Project Website: http://www.maefloresta.com *
* Project Leader: Gustav Gonzalez <info@maefloresta.com> *
* *
* Developers: *
* 2010: *
* Gustavo Gonzalez *
* *
* KTooN's versions: *
* *
* 2006: *
* David Cuadrado *
* Jorge Cuadrado *
* 2003: *
* Fernado Roldan *
* Simena Dinas *
* *
* Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com *
* License: *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef TUPBRUSHMANAGER_H
#define TUPBRUSHMANAGER_H
#include "tglobal.h"
#include <QObject>
#include <QPen>
#include <QBrush>
/**
* @author David Cuadrado
*/
class TUPI_EXPORT TupBrushManager : public QObject
{
Q_OBJECT
public:
TupBrushManager(QObject * parent = 0);
TupBrushManager(const QPen &pen, const QBrush &brush, QObject * parent = 0);
~TupBrushManager();
void setPen(const QPen &pen);
//void setPenBrush(const QBrush &brush);
void setPenColor(const QColor &color);
QPen pen() const;
void setBrush(const QBrush &brush);
QBrush brush() const;
int penWidth() const;
QColor penColor() const;
QBrush penBrush() const;
QBrush brushColor() const;
signals:
void penChanged(const QPen &pen);
void brushChanged(const QBrush &brush);
private:
struct Private;
Private *const k;
};
#endif
|
/*
The mediastreamer library aims at providing modular media processing and I/O
for linphone, but also for any telephony application.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MSRTPSEND_H
#define MSRTPSEND_H
#include "msfilter.h"
#include "mssync.h"
#undef PACKAGE
#undef VERSION
#include <ortp.h>
/*this is the class that implements a sending through rtp filter*/
#define MSRTPSEND_MAX_INPUTS 1 /* max input per filter*/
#define MSRTPSEND_DEF_GRAN 4096/* the default granularity*/
struct _MSRtpSend
{
/* the MSCopy derivates from MSFilter, so the MSFilter object MUST be the first of the MSCopy object
in order to the object mechanism to work*/
MSFilter filter;
MSFifo *f_inputs[MSRTPSEND_MAX_INPUTS];
MSQueue *q_inputs[MSRTPSEND_MAX_INPUTS];
MSSync *sync;
RtpSession *rtpsession;
guint32 ts;
guint32 ts_inc; /* the timestamp increment */
gint packet_size;
guint flags;
guint delay; /* number of _proccess call which must be skipped */
#define RTPSEND_CONFIGURED (1)
};
typedef struct _MSRtpSend MSRtpSend;
struct _MSRtpSendClass
{
/* the MSRtpSend derivates from MSFilter, so the MSFilter class MUST be the first of the MSCopy class
in order to the class mechanism to work*/
MSFilterClass parent_class;
};
typedef struct _MSRtpSendClass MSRtpSendClass;
/* PUBLIC */
#define MS_RTP_SEND(filter) ((MSRtpSend*)(filter))
#define MS_RTP_SEND_CLASS(klass) ((MSRtpSendClass*)(klass))
MSFilter * ms_rtp_send_new(void);
RtpSession * ms_rtp_send_set_session(MSRtpSend *obj,RtpSession *session);
#define ms_rtp_send_unset_session(obj) (ms_rtp_send_set_session((obj),NULL))
#define ms_rtp_send_get_session(obj) ((obj)->rtpsession)
void ms_rtp_send_set_timing(MSRtpSend *r, guint32 ts_inc, gint payload_size);
gint ms_rtp_send_dtmf(MSRtpSend *r, gchar dtmf);
/* FOR INTERNAL USE*/
void ms_rtp_send_init(MSRtpSend *r);
void ms_rtp_send_class_init(MSRtpSendClass *klass);
void ms_rtp_send_destroy( MSRtpSend *obj);
void ms_rtp_send_process(MSRtpSend *r);
void ms_rtp_send_setup(MSRtpSend *r, MSSync *sync);
#endif
|
/*****************************************************************************
* charset.h: Unicode UTF-8 wrappers function
*****************************************************************************
* Copyright (C) 2003-2005 the VideoLAN team
* Copyright © 2005-2006 Rémi Denis-Courmont
* $Id$
*
* Author: Rémi Denis-Courmont <rem # videolan,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 VLC_CHARSET_H
#define VLC_CHARSET_H 1
/**
* \file
* This files handles locale conversions in vlc
*/
#include <stdarg.h>
#include <sys/types.h>
#include <dirent.h>
VLC_EXPORT( void, LocaleFree, ( const char * ) );
VLC_EXPORT( char *, FromLocale, ( const char * ) );
VLC_EXPORT( char *, FromLocaleDup, ( const char * ) );
VLC_EXPORT( char *, ToLocale, ( const char * ) );
VLC_EXPORT( char *, ToLocaleDup, ( const char * ) );
/* TODO: move all of this to "vlc_fs.h" or something like that */
VLC_EXPORT( int, utf8_open, ( const char *filename, int flags, mode_t mode ) );
VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
VLC_EXPORT( DIR *, utf8_opendir, ( const char *dirname ) );
VLC_EXPORT( char *, utf8_readdir, ( DIR *dir ) );
VLC_EXPORT( int, utf8_loaddir, ( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, utf8_mkdir, ( const char *filename, mode_t mode ) );
VLC_EXPORT( int, utf8_unlink, ( const char *filename ) );
#ifdef WIN32
# define stat _stati64
#endif
VLC_EXPORT( int, utf8_stat, ( const char *filename, struct stat *buf ) );
VLC_EXPORT( int, utf8_lstat, ( const char *filename, struct stat *buf ) );
VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) );
VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
VLC_EXPORT( char *, EnsureUTF8, ( char * ) );
VLC_EXPORT( const char *, IsUTF8, ( const char * ) );
#ifdef WIN32
static inline char *FromWide (const wchar_t *wide)
{
size_t len = WideCharToMultiByte (CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
if (len == 0)
return NULL;
char *out = (char *)malloc (len);
if (out)
WideCharToMultiByte (CP_UTF8, 0, wide, -1, out, len, NULL, NULL);
return out;
}
#endif
VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
VLC_EXPORT( double, us_strtod, ( const char *, char ** ) );
VLC_EXPORT( double, us_atof, ( const char * ) );
#endif
|
#include <string.h>
#include "spawn.h"
//#include "mechs.h"
//#include "worldents.h"
#include "player.h"
#include "space.h"
#include "entity.h"
#include "enemy.h"
extern arSurface *screen;
extern arRect Camera;
extern Level level;
extern Entity *ThePlayer;
int MaxSpawns;
Spawn GameSpawns[] =
{
{
{8,12,36,26}, /*bounding box for wall detection*/
"player_start", /*the name of the entity*/
"images/playersprites/playersheet.png", /*the sprite for the main part of the entity*/
54,67, /*width and height of sprite dimensions*/
/*{ /*a list of pointers to the wav files that this entity will produce*/
/*"\0",
"\0",
"\0",
"\0"
},*/
NULL, /*spawn function*/
/* {
0,0 /*offset coordinates to draw the legs at
},*/
NULL
},
{
{8,12,36,26},
"longshot",
"images/enemies/mecha1.png",
48,48,
{
"\0",
"\0",
"\0",
"\0"
},
SpawnenemyM,
NULL,
},
{
{8,12,36,26},
"flyer",
"images/enemies/flyer.png",
38,59,
{
"\0",
"\0",
"\0",
"\0"
},
SpawnFlyer,
NULL,
},
{
{0,0,0,0}, /*bounding box for wall detection*/
"\0", /*the name of the entity*/
"\0", /*the sprite for the main part of the entity*/
0,0, /*width and height of sprite dimensions*/
/*{ /*a list of pointers to the wav files that this entity will produce*/
/*"\0",
"\0",
"\0",
"\0"
}, */
NULL, /*spawn function*/
/*
0,0 /*offset coordinates to draw the legs at
},*/
NULL
}
};
int GetSpawnIndexByName(char EntName[40])
{
int i;
for(i =0;i < MaxSpawns;i++)
{
if(strncmp(EntName,GameSpawns[i].EntName,40)== 0)return i;
}
return -1;/*not found*/
}
/*only after a map's info has been loaded*/
void PrecacheSpawns()
{
int i,j;
i =0;
for(i = 0;i < level.spawncount;i++)
{
for(j = 0;j < SOUNDSPERENT;i++)
{
if(GameSpawns[GetSpawnIndexByName(level.spawnlist[i].name)].sound[j][0] != '\0')
{
LoadSound(GameSpawns[GetSpawnIndexByName(level.spawnlist[i].name)].sound[j],SDL_MIX_MAXVOLUME>>4);
}
}
}
}
void LoadSpawnSprites()
{
int index;
int i = 0;
while(strncmp(GameSpawns[i].EntName,"\0",40 )!=0)
{
i++;
}
MaxSpawns = i;
for(index = 0;index < MaxSpawns;index++)
{
GameSpawns[index].mapsprite = LoadSprite(GameSpawns[index].sprite,GameSpawns[index].sw,GameSpawns[index].sh);
}
}
void DrawSpawnPoints()
{
int i;
for(i = 0;i < level.spawncount;i++)
{
DrawSpawn(GetSpawnIndexByName(level.spawnlist[i].name),level.spawnlist[i].sx - Camera.x,level.spawnlist[i].sy - Camera.y);
}
}
/*draws the desired spawn candidate at the location*/
void DrawSpawn(int index,int sx, int sy)
{
if(GameSpawns[index].mapsprite != NULL)
DrawSprite(GameSpawns[index].mapsprite,screen,sx,sy,0);
/*by not freeing the sprite, I ensure that it only gets loaded from disk once.*/
}
void SpawnAll(int initial) /*after map is loaded, start all entities*/
{
int sindex;
int i = 0;
while(strncmp(GameSpawns[i].EntName,"\0",40 )!=0)
{
i++;
}
MaxSpawns = i;
for(i = 0;i < level.spawncount;i++)
{
sindex = GetSpawnIndexByName(level.spawnlist[i].name);
if(GameSpawns[sindex].spawn != NULL)
GameSpawns[sindex].spawn(NULL,level.spawnlist[i].sx,level.spawnlist[i].sy,level.spawnlist[i].UnitInfo,level.spawnlist[i].UnitType);
else
{
if(strncmp(level.spawnlist[i].name,"player_start",40) == 0)
{
if(initial == 1)
{
SpawnPlayer(level.spawnlist[i].sx,level.spawnlist[i].sy);
}
else
{
ThePlayer->s.x = level.spawnlist[i].sx;
ThePlayer->s.y = level.spawnlist[i].sy;
ThePlayer->v.x = 0;
ThePlayer->v.y = 0;
ThePlayer->a.x = 0;
ThePlayer->a.y = 0;
UpdateEntityPosition(ThePlayer,0);
}
}
/*if(strncmp(level.spawnlist[i].name,"func_door",40) == 0)
{
SetDoor(level.spawnlist[i].sx, level.spawnlist[i].sy, 0,0,0);
}*/
}
}
} |
/* _ __ __ _ ___ __ __
** | '_ \ / _` |_ _| \/ | naim
** | | | | | | || || |\/| | Copyright 1998-2006 Daniel Reed <n@ml.org>
** |_| |_|\__,_|___|_| |_| ncurses-based chat client
*/
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include "moon-int.h"
#if 0
static int _literal_index(lua_State *L, const int index) {
const int top = lua_gettop(L);
assert(top >= 0);
if ((index < 0) && (-index <= top))
return(top + index + 1);
return(index);
}
static void _print_stack(lua_State *L) {
const int top = lua_gettop(L);
int i;
fprintf(stderr, "stack = {");
for (i = 1; i <= top; i++) {
fprintf(stderr, " %i = (%s)", i, lua_typename(L, lua_type(L, i)));
if (lua_isstring(L, i))
fprintf(stderr, "\"%s\"", lua_tostring(L, i));
else if (lua_isnumber(L, i))
fprintf(stderr, "%li", (long)lua_tonumber(L, i));
}
fprintf(stderr, " }\r\n");
}
#endif
static void _replace_entv(lua_State *L, const char *name, va_list msg) {
const int top = lua_gettop(L);
assert(top > 0);
while (name != NULL) {
//const char *dot;
if (!lua_istable(L, top)) { // { t }
luaL_error(L, "trying to look up stack[%d][...] but stack[%d] is not a table (it is a %s)\r\n", top, top, lua_typename(L, lua_type(L, top)));
abort(); /* NOTREACH */
}
//if ((dot = strchr(name, '.')) != NULL) {
// lua_pushlstring(L, name, dot-name); // { NAME, t }
// name = dot+1;
//} else {
lua_pushstring(L, name); // { NAME, t }
name = va_arg(msg, const char *);
//}
lua_gettable(L, top); // { t[NAME], t }
lua_replace(L, top); // { t[NAME] }
assert(lua_gettop(L) == top);
//_print_stack(L);
}
assert(lua_gettop(L) == top);
}
void _get_entv(lua_State *L, int index, const char *name, va_list msg) {
const int top = lua_gettop(L);
if (name == NULL)
return;
if (!lua_istable(L, index)) {
luaL_error(L, "trying to look up %d[..] but %d is not a table (it is a %s)", index, index, lua_typename(L, lua_type(L, index)));
abort(); /* NOTREACH */
}
lua_pushvalue(L, index); // { t }
if (!lua_istable(L, -1)) {
luaL_error(L, "made a copy of %d to -1 but -1 is not a table (it is a %s)", index, lua_typename(L, lua_type(L, -1)));
abort(); /* NOTREACH */
}
_replace_entv(L, name, msg); // { t[NAME] }
assert(lua_gettop(L) == top+1);
}
void _get_ent(lua_State *L, const int index, const char *name, ...) {
va_list msg;
va_start(msg, name);
_get_entv(L, index, name, msg);
va_end(msg);
}
void _get_global_entv(lua_State *L, const char *name, va_list msg) {
_get_entv(L, LUA_GLOBALSINDEX, name, msg);
}
void _get_global_ent(lua_State *L, const char *name, ...) {
const int top = lua_gettop(L);
va_list msg;
if (name == NULL)
return;
va_start(msg, name);
_get_global_entv(L, name, msg);
va_end(msg);
assert(lua_gettop(L) == top+1);
}
|
/*
* Copyright (c) 2006 National Research Council
*
* All rights reserved.
*
* This material is confidential and proprietary information of
* National Research Council Canada ("Confidential Information").
* This Confidential Information may only be used and reproduced
* in accordance with the terms of the license agreement.
*
*/
#ifndef __INCLUDED_SCOPIRA_PVM_UTIL_H__
#define __INCLUDED_SCOPIRA_PVM_UTIL_H__
#include <string>
#include <scopira/basekit/narray.h>
namespace scopira
{
namespace pvm
{
/**
* Spawns the given process as sub tasks.
*
* @return returns the task id, or 0 on error
* @author Aleksander Demko
*/
int spawn_one(const std::string &fullfilename);
/**
* Spawns the given process as sub tasks.
* outids will have the task tids, or be an empty list on error.
*
* @author Aleksander Demko
*/
void spawn_many(const std::string &fullfilename, int numtasks, scopira::basekit::narray<int> &out);
/**
* Finds a given int in the given array. Returns its index.
* Returns -1 if its not found.
* Handy for peer lists, as made from spawn_many().
*
* @author Aleksander Demko
*/
int find_index(const scopira::basekit::narray<int> &peers, int tid);
/**
* Does this task have a parent task?
* ie was it spawned via spawn* or pvm_*
*
* @author Aleksander Demko
*/
bool has_parent_task(void) { return pvm_parent() != PvmNoParent; }
/**
* Returns the recommended number of CPU-bound tasks to launch.
* Usually, this simply reports the number of hosts * their cpus.
* However, this PVM version only counts the number of hosts.
* It cannot factor in the number of CPUs PER host (a shame, yes, I know).
*
* @author Aleksander Demko
*/
int default_group_size(void);
}
}
#endif
|
/*
Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Mark Aylett <mark.aylett@gmail.com>
This file is part of Aug written by Mark Aylett.
Aug is released under the GPL with the additional exemption that compiling,
linking, and/or using OpenSSL is allowed.
Aug 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.
Aug is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "augsys.h"
#include "augctx.h"
#define MSG1_ "first chunk, "
#define MSG2_ "second chunk"
#include <stdio.h>
#include <stdlib.h> /* exit() */
static void
test(aug_muxer_t muxer, int n)
{
aug_sd sv[2];
struct iovec iov[2];
char buf[AUG_MAXLINE];
if (0 == n)
return;
if (aug_socketpair(AF_UNIX, SOCK_STREAM, 0, sv) < 0) {
aug_perrinfo(aug_tlx, "aug_socketpair() failed", NULL);
exit(1);
}
iov[0].iov_base = MSG1_;
iov[0].iov_len = sizeof(MSG1_) - 1;
iov[1].iov_base = MSG2_;
iov[1].iov_len = sizeof(MSG2_);
if (aug_setmdeventmask(muxer, sv[0], AUG_MDEVENTALL) < 0
|| aug_setmdeventmask(muxer, sv[1], AUG_MDEVENTRDEX) < 0) {
aug_perrinfo(aug_tlx, "aug_setmdeventmask() failed", NULL);
exit(1);
}
if (AUG_MDEVENTALL != aug_getmdeventmask(muxer, sv[0])
|| AUG_MDEVENTRDEX != aug_getmdeventmask(muxer, sv[1])) {
aug_perrinfo(aug_tlx, "aug_getmdeventmask() failed", NULL);
exit(1);
}
if (aug_swritev(sv[0], iov, 2) < 0) {
aug_perrinfo(aug_tlx, "aug_writev() failed", NULL);
exit(1);
}
if (aug_waitmdevents(muxer, NULL) < 0) {
aug_perrinfo(aug_tlx, "aug_waitmdevents() failed", NULL);
exit(1);
}
test(muxer, n - 1);
if (aug_sread(sv[1], buf, iov[0].iov_len + iov[1].iov_len) < 0) {
aug_perrinfo(aug_tlx, "aug_sread() failed", NULL);
exit(1);
}
if (0 != strcmp(buf, MSG1_ MSG2_)) {
fprintf(stderr, "unexpected buffer contents: %s\n", buf);
exit(1);
}
if (aug_setmdeventmask(muxer, sv[0], 0) < 0
|| aug_setmdeventmask(muxer, sv[1], 0) < 0) {
aug_perrinfo(aug_tlx, "aug_setmdeventmask() failed", NULL);
exit(1);
}
aug_sclose(sv[0]);
aug_sclose(sv[1]);
}
int
main(int argc, char* argv[])
{
aug_mpool* mpool;
aug_muxer_t muxer;
if (!aug_autotlx())
return 1;
mpool = aug_getmpool(aug_tlx);
muxer = aug_createmuxer(mpool);
aug_release(mpool);
test(muxer, 30);
aug_destroymuxer(muxer);
return 0;
}
|
/*
Copyright (C) 2001 Tensilica, Inc. All Rights Reserved.
Revised to support Tensilica processors and to improve overall performance
*/
/*
Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU General Public License along
with this program; if not, write the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston MA 02111-1307, USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef ipl_main_INCLUDED
#define ipl_main_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
/* General progress trace: */
extern BOOL Trace_IPA;
extern BOOL Trace_Perf;
extern BOOL Debug_On;
extern BOOL Do_Const;
extern BOOL Do_Par;
extern BOOL DoPreopt;
extern BOOL Do_Split_Commons;
extern BOOL Do_Split_Commons_Set;
extern BOOL IPL_Enable_Unknown_Frequency;
extern BOOL IPL_Generate_Elf_Symtab;
extern struct DU_MANAGER *Ipl_Du_Mgr;
extern struct ALIAS_MANAGER *Ipl_Al_Mgr;
#ifdef __cplusplus
}
#endif
extern WN_MAP Summary_Map;
extern WN_MAP Stmt_Map;
#endif // ipl_main_INCLUDED
|
/*
* Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
* Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
* Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
* Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KDMTHEMER_H
#define KDMTHEMER_H
#include <qobject.h>
#include <qdom.h>
class KdmThemer;
class KdmItem;
class KdmPixmap;
class KdmRect;
class KdmBox;
class QRect;
class QWidget;
class QEvent;
/**
* @author Unai Garro
*/
/*
* The themer widget. Whatever drawn here is just themed
* according to a XML file set by the user.
*/
class KdmThemer : public QObject {
Q_OBJECT
public:
/*
* Construct and destruct the interface
*/
KdmThemer( const QString &path, const QString &mode, QWidget *parent );
~KdmThemer();
bool isOK() { return rootItem != 0; }
/*
* Gives a sizeHint to the widget (parent size)
*/
//QSize sizeHint() const{ return parentWidget()->size(); }
/*
* Takes a shot of the current widget
*/
// void pixmap( const QRect &r, QPixmap *px );
virtual // just to put the reference in the vmt
KdmItem *findNode( const QString & ) const;
void updateGeometry( bool force ); // force = true for external calls
// must be called by parent widget
void widgetEvent( QEvent *e );
signals:
void activated( const QString &id );
private:
/*
* Our display mode (e.g. console, remote, ...)
*/
QString m_currentMode;
/*
* The config file being used
*/
QDomDocument domTree;
/*
* Stores the root of the theme
*/
KdmItem *rootItem;
/*
* The backbuffer
*/
QPixmap *backBuffer;
// methods
/*
* Test whether item needs to be displayed
*/
bool willDisplay( const QDomNode &node );
/*
* Parses the XML file looking for the
* item list and adds those to the themer
*/
void generateItems( KdmItem *parent = 0, const QDomNode &node = QDomNode() );
void showStructure( QObject *obj );
QWidget *widget();
};
#endif
|
#include <stdio.h>
int loop_fibonacci(int n)
{
if (n == 1 || n == 2) return 1;
else if (n > 2)
{
int f1 = 1, f2 = 1;
for (int i = 0; i < n - 2; ++i)
{
int tmp = f2;
f2 += f1;
f1 = tmp;
}
return f2;
}
return 0;
}
int recursive_fibonacci(int n)
{
if (n == 1 || n == 2)
return 1;
else
return recursive_fibonacci(n - 1) + recursive_fibonacci(n - 2);
}
int main()
{
printf("%d\n", loop_fibonacci(10));
printf("%d\n", recursive_fibonacci(10));
} |
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include "VideoCommon/TextureCacheBase.h"
namespace Null
{
class TextureCache : public TextureCacheBase
{
public:
TextureCache() {}
~TextureCache() {}
bool CompileShaders() override { return true; }
void DeleteShaders() override {}
void ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette,
TlutFormat format) override
{
}
void CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_row, u32 num_blocks_y,
u32 memory_stride, bool is_depth_copy, const EFBRectangle& src_rect,
bool is_intensity, bool scale_by_half) override
{
}
private:
struct TCacheEntry : TCacheEntryBase
{
TCacheEntry(const TCacheEntryConfig& _config) : TCacheEntryBase(_config) {}
~TCacheEntry() {}
void Load(const u8* buffer, u32 width, u32 height, u32 expanded_width, u32 level) override {}
void FromRenderTarget(bool is_depth_copy, const EFBRectangle& src_rect, bool scale_by_half,
unsigned int cbufid, const float* colmat) override
{
}
void CopyRectangleFromTexture(const TCacheEntryBase* source,
const MathUtil::Rectangle<int>& srcrect,
const MathUtil::Rectangle<int>& dstrect) override
{
}
void Bind(unsigned int stage) override {}
bool Save(const std::string& filename, unsigned int level) override { return false; }
};
TCacheEntryBase* CreateTexture(const TCacheEntryConfig& config) override
{
return new TCacheEntry(config);
}
};
} // Null name space
|
// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// 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 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#pragma once
#include "../MIPS.h"
#include "../MIPSAnalyst.h"
#include "Core/MIPS/ARM/ArmRegCache.h"
#include "Core/MIPS/MIPSVFPUUtils.h"
#include "Common/ArmEmitter.h"
using namespace ArmGen;
enum {
NUM_TEMPS = 16,
TEMP0 = 32 + 128,
TOTAL_MAPPABLE_MIPSFPUREGS = 32 + 128 + NUM_TEMPS,
};
struct FPURegARM {
int mipsReg; // if -1, no mipsreg attached.
bool isDirty; // Should the register be written back?
};
struct FPURegMIPS {
// Where is this MIPS register?
RegMIPSLoc loc;
// Data (only one of these is used, depending on loc. Could make a union).
int reg;
bool spillLock; // if true, this register cannot be spilled.
bool tempLock;
// If loc == ML_MEM, it's back in its location in the CPU context struct.
};
class ArmRegCacheFPU
{
public:
ArmRegCacheFPU(MIPSState *mips);
~ArmRegCacheFPU() {}
void Init(ARMXEmitter *emitter);
void Start(MIPSAnalyst::AnalysisResults &stats);
// Protect the arm register containing a MIPS register from spilling, to ensure that
// it's being kept allocated.
void SpillLock(MIPSReg reg, MIPSReg reg2 = -1, MIPSReg reg3 = -1, MIPSReg reg4 = -1);
void SpillLockV(MIPSReg r) { SpillLock(r + 32); }
void ReleaseSpillLocksAndDiscardTemps();
void ReleaseSpillLock(int mipsreg)
{
mr[mipsreg].spillLock = false;
}
void ReleaseSpillLockV(int mipsreg) {
ReleaseSpillLock(mipsreg + 32);
}
void SetImm(MIPSReg reg, u32 immVal);
bool IsImm(MIPSReg reg) const;
u32 GetImm(MIPSReg reg) const;
// Returns an ARM register containing the requested MIPS register.
ARMReg MapReg(MIPSReg reg, int mapFlags = 0);
void MapInIn(MIPSReg rd, MIPSReg rs);
void MapDirty(MIPSReg rd);
void MapDirtyIn(MIPSReg rd, MIPSReg rs, bool avoidLoad = true);
void MapDirtyInIn(MIPSReg rd, MIPSReg rs, MIPSReg rt, bool avoidLoad = true);
void FlushArmReg(ARMReg r);
void FlushR(MIPSReg r);
void DiscardR(MIPSReg r);
// VFPU register as single ARM VFP registers. Must not be used in the upcoming NEON mode!
void MapRegV(int vreg, int flags = 0);
void LoadToRegV(ARMReg armReg, int vreg);
void MapInInV(int rt, int rs);
void MapDirtyInV(int rd, int rs, bool avoidLoad = true);
void MapDirtyInInV(int rd, int rs, int rt, bool avoidLoad = true);
void FlushV(MIPSReg r) { FlushR(r + 32); }
void DiscardV(MIPSReg r) { DiscardR(r + 32);}
bool IsTempX(ARMReg r) const;
MIPSReg GetTempR();
MIPSReg GetTempV() { return GetTempR() - 32; }
void FlushAll();
ARMReg R(int preg); // Returns a cached register
// VFPU registers as single VFP registers
ARMReg V(int vreg) { return R(vreg + 32); }
// NOTE: These require you to release spill locks manually!
void MapRegsAndSpillLockV(int vec, VectorSize vsz, int flags);
void MapRegsAndSpillLockV(const u8 *v, VectorSize vsz, int flags);
void SpillLockV(const u8 *v, VectorSize vsz);
void SpillLockV(int vec, VectorSize vsz);
void SetEmitter(ARMXEmitter *emitter) { emit_ = emitter; }
// For better log output only.
void SetCompilerPC(u32 compilerPC) { compilerPC_ = compilerPC; }
int GetMipsRegOffset(MIPSReg r);
int GetMipsRegOffsetV(MIPSReg r) {
return GetMipsRegOffset(r + 32);
}
private:
MIPSState *mips_;
ARMXEmitter *emit_;
u32 compilerPC_;
int numARMFpuReg_;
enum {
MAX_ARMFPUREG = 32, // TODO: Support 32, which you have with NEON
NUM_MIPSFPUREG = TOTAL_MAPPABLE_MIPSFPUREGS,
};
FPURegARM ar[MAX_ARMFPUREG];
FPURegMIPS mr[NUM_MIPSFPUREG];
FPURegMIPS *vr;
};
|
/* debyer -- program for calculation of diffration patterns
* Copyright 2006-2007 Marcin Wojdyr
*
* 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.
*
* class LineInput -- see description below
*/
#ifndef DEBYER_LINEIO_H_
#define DEBYER_LINEIO_H_
#include <cassert>
#include <string>
#include <cstdio>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_ZLIB
# include <zlib.h>
#endif
#ifdef HAVE_BZLIB
# include <bzlib.h>
#endif
// Line-oriented (fgets()-based) API for reading files.
// Provides random access to the first 1kb of the file (which is buffered),
// to allow guess file format.
// Can handle normal files, stdin, gzipped and bzip2-ed files.
class LineInput
{
public:
static const int buffer_size = 1024;
LineInput();
~LineInput();
// if filename == "-", stdin is read
// on error returns false and error message is stored in buffer
bool init(const char* filename_);
// after the first get_line() call, get_buffer() can't be called
const char* get_buffer() const { assert(line_number == 0); return buffer; }
const char* get_error() { return buffer; }
// returns pointer to 0-terminated array (without a new line character).
// The string can be changed.
char* get_line();
std::string const& get_filename() const { return filename; }
std::string const& get_orig_filename() const { return orig_filename; }
int get_line_number() const { return line_number; }
private:
std::string filename;
std::string orig_filename;
int line_number;
char *buffer;
char* next_line;
FILE *stream;
#ifdef HAVE_ZLIB
gzFile gz_stream;
#endif
#ifdef HAVE_BZLIB
BZFILE* bz_stream;
#endif
int fill_buffer(size_t offset);
// failure in init, store error message in buffer
void failure(const char *msg, const char* fn=NULL)
{
snprintf(buffer, buffer_size, "%s%s\n", msg, (fn ? fn : ""));
}
};
#endif // DEBYER_LINEIO_H_
|
/**
* Copyright (C) 2007 Stefan Buettcher. All rights reserved.
* This is free software with ABSOLUTELY NO WARRANTY.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA
**/
/**
* author: Stefan Buettcher
* created: 2007-01-15
* changed: 2007-01-15
**/
#ifndef __FILTERS__TROFF_H
#define __FILTERS__TROFF_H
#include "conversion_inputstream.h"
#define TROFF_COMMAND "troff -a"
class TroffInputStream : public ConversionInputStream {
public:
TroffInputStream(const char *fileName);
virtual ~TroffInputStream();
virtual int getDocumentType();
static bool canProcess(const char *fileName, byte *fileStart, int length);
}; // end of class TroffInputStream
#endif
|
/********************
PhyloBayes MPI. Copyright 2010-2013 Nicolas Lartillot, Nicolas Rodrigue, Daniel Stubbs, Jacques Richer.
PhyloBayes 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.
PhyloBayes 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 PhyloBayes. If not, see <http://www.gnu.org/licenses/>.
**********************/
#ifndef MATRIXONEPROFILE_H
#define MATRIXONEPROFILE_H
#include "MatrixProfileProcess.h"
#include "OneProfileProcess.h"
class MatrixOneProfileProcess : public virtual MatrixProfileProcess, public virtual OneProfileProcess {
public:
MatrixOneProfileProcess() : matrix(0) {}
virtual ~MatrixOneProfileProcess() {}
SubMatrix* GetMatrix(int site) {
return matrix;
}
protected:
// called at the beginning and the end of the run
virtual void Create(int innsite, int indim);
virtual void Delete();
double MoveProfile(double tuning = 1, int n = 1, int nrep = 1);
virtual void UpdateProfileSuffStat() = 0;
// should be called each time global parameters are modified
void UpdateProfile() {
UpdateMatrix();
}
virtual void CreateMatrix() = 0;
virtual void DeleteMatrix() {
delete matrix;
matrix = 0;
}
virtual void UpdateMatrix() {
if (matrix) {
matrix->CorruptMatrix();
}
}
SubMatrix* matrix;
};
#endif
|
#ifndef WIDGET_H
#define WIDGET_H
#include <QtWidgets/QtWidgets>
namespace Ui
{
class WidgetClass;
}
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = nullptr);
~Widget();
public slots:
void CreateWRP();
void ReadXYZ();
void ReadObjects();
void SaveWRP();
void TextureBMP();
void ImportObjects();
private:
Ui::WidgetClass *ui;
QVector<QString> RandomObjectList;
};
#endif // WIDGET_H
|
/*
* This file is part of D3DShark - DirectX Component Framework
* Copyright (C) 2012-2013 Michael Bleis
*
* 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 "UI/D3DTexture.h"
#include "UI/ID3DSurface.h"
class IRenderTarget abstract : public virtual Utils::IDynamicObject
{
public:
virtual ~IRenderTarget() {}
virtual void BeginUI() {}
virtual void EndUI() {}
virtual void OnLostDevice() {}
virtual void OnResetDevice() {}
virtual bool GetSurfaceRect(RECT *pRect) const = 0;
virtual bool GetClippingArea(RECT *pRect) const = 0;
virtual void SetClippingArea(const RECT *pRect) const = 0;
static float GetDimensionWidth(const std::array<Utils::Vector2, 4> &dimensions) {
return __max(dimensions[1].x, dimensions[2].x) -
__min(dimensions[0].x, dimensions[3].x);
}
static float GetDimensionHeight(const std::array<Utils::Vector2, 4> &dimensions) {
return __max(dimensions[2].y, dimensions[3].y) -
__min(dimensions[0].y, dimensions[1].y);
}
static std::array<Utils::Vector2, 4> MakeDimension(float width, float height) {
std::array<Utils::Vector2, 4> dimension;
dimension[0].x = 0; dimension[0].y = 0;
dimension[1].x = width; dimension[1].y = 0;
dimension[2].x = width; dimension[2].y = height;
dimension[3].x = 0; dimension[3].y = height;
return dimension;
}
virtual boost::shared_ptr<UI::D3DTexture> CreateRenderTargetTexture(uint32 width, uint32 height) const = 0;
virtual boost::shared_ptr<UI::ID3DSurface> CreateRenderTargetSurface(uint32 width, uint32 height) const = 0;
virtual void SetRenderTargetSurface(const boost::shared_ptr<const UI::ID3DSurface> &pSurface, uint32 index = 0, bool shouldClear = false) = 0;
virtual boost::shared_ptr<UI::ID3DSurface> GetRenderTargetSurface(uint32 index = 0) const = 0;
virtual void DrawRectangle(const Utils::Vector2 &position,
const std::array<Utils::Vector2, 4> &dimensions,
const std::array<D3DXCOLOR, 4> &gradient,
float stroke) const = 0;
virtual void FillRectangle(const Utils::Vector2 &position,
const std::array<Utils::Vector2, 4> &dimensions,
const std::array<D3DXCOLOR, 4> &gradient) const = 0;
virtual void DrawRoundedRectangle(const Utils::Vector2 &position,
const std::array<Utils::Vector2, 4> &dimensions,
const float4 &horizontalRadius,
const float4 &verticalRadius,
const std::array<D3DXCOLOR, 4> &gradient,
float stroke) const = 0;
virtual void FillRoundedRectangle(const Utils::Vector2 &position,
const std::array<Utils::Vector2, 4> &dimensions,
const float4 &horizontalRadius,
const float4 &verticalRadius,
const std::array<D3DXCOLOR, 4> &gradient) const = 0;
virtual void DrawBlurredSprite(const Utils::Vector2 &position,
boost::shared_ptr<const UI::D3DTexture> pTexture,
const std::array<Utils::Vector2, 4> &dimensions,
const std::array<D3DXCOLOR, 4> &gradient) const = 0;
virtual void DrawSprite(const Utils::Vector2 &position,
boost::shared_ptr<const UI::D3DTexture> pTexture,
const std::array<Utils::Vector2, 4> &dimensions,
const std::array<D3DXCOLOR, 4> &gradient) const = 0;
};
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_
#define REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_
#include "base/compiler_specific.h"
#include "remoting/protocol/input_filter.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
namespace remoting {
namespace protocol {
class MouseInputFilter : public InputFilter {
public:
MouseInputFilter();
explicit MouseInputFilter(InputStub* input_stub);
virtual ~MouseInputFilter();
void set_input_size(const webrtc::DesktopSize& size);
void set_output_size(const webrtc::DesktopSize& size);
virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
private:
webrtc::DesktopSize input_max_;
webrtc::DesktopSize output_max_;
DISALLOW_COPY_AND_ASSIGN(MouseInputFilter);
};
}
}
#endif
|
// Copyright 2016 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/cecd/cecd.h"
namespace Service {
namespace CECD {
class CECD_NDM final : public Module::Interface {
public:
explicit CECD_NDM(std::shared_ptr<Module> cecd);
};
} // namespace CECD
} // namespace Service
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_NETWORK_SCREEN_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_NETWORK_SCREEN_H_
#include "chrome/browser/chromeos/login/screens/network_screen.h"
#include "chrome/browser/chromeos/login/screens/network_screen_actor.h"
#include "chrome/browser/chromeos/login/screens/screen_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace chromeos {
class MockNetworkScreen : public NetworkScreen {
public:
MockNetworkScreen(ScreenObserver* observer, NetworkScreenActor* actor);
virtual ~MockNetworkScreen();
};
class MockNetworkScreenActor : public NetworkScreenActor {
public:
MockNetworkScreenActor();
virtual ~MockNetworkScreenActor();
virtual void SetDelegate(Delegate* delegate);
MOCK_METHOD1(MockSetDelegate, void(Delegate* delegate));
MOCK_METHOD0(PrepareToShow, void());
MOCK_METHOD0(Show, void());
MOCK_METHOD0(Hide, void());
MOCK_METHOD1(ShowError, void(const base::string16& message));
MOCK_METHOD0(ClearErrors, void());
MOCK_METHOD2(ShowConnectingStatus,
void(bool connecting, const base::string16& network_id));
MOCK_METHOD1(EnableContinue, void(bool enabled));
MOCK_CONST_METHOD0(IsContinueEnabled, bool());
MOCK_CONST_METHOD0(IsConnecting, bool());
private:
Delegate* delegate_;
};
}
#endif
|
// CHDK palette color settings for the a2200
// Cameras use custom colors (CAM_LOAD_CUSTOM_COLORS) - CHDK colors set in platform_palette.c
#define CHDK_COLOR_BASE 0xA2 // Start color index for CHDK colors loaded into camera palette.
|
#ifndef AT91SAM9260_H
#define AT91SAM9260_H
#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
#define AT91_ID_SYS 1 /* System Peripherals */
#define AT91SAM9260_ID_PIOA 2 /* Parallel IO Controller A */
#define AT91SAM9260_ID_PIOB 3 /* Parallel IO Controller B */
#define AT91SAM9260_ID_PIOC 4 /* Parallel IO Controller C */
#define AT91SAM9260_ID_ADC 5 /* Analog-to-Digital Converter */
#define AT91SAM9260_ID_US0 6 /* USART 0 */
#define AT91SAM9260_ID_US1 7 /* USART 1 */
#define AT91SAM9260_ID_US2 8 /* USART 2 */
#define AT91SAM9260_ID_MCI 9 /* Multimedia Card Interface */
#define AT91SAM9260_ID_UDP 10 /* USB Device Port */
#define AT91SAM9260_ID_TWI 11 /* Two-Wire Interface */
#define AT91SAM9260_ID_SPI0 12 /* Serial Peripheral Interface 0 */
#define AT91SAM9260_ID_SPI1 13 /* Serial Peripheral Interface 1 */
#define AT91SAM9260_ID_SSC 14 /* Serial Synchronous Controller */
#define AT91SAM9260_ID_TC0 17 /* Timer Counter 0 */
#define AT91SAM9260_ID_TC1 18 /* Timer Counter 1 */
#define AT91SAM9260_ID_TC2 19 /* Timer Counter 2 */
#define AT91SAM9260_ID_UHP 20 /* USB Host port */
#define AT91SAM9260_ID_EMAC 21 /* Ethernet */
#define AT91SAM9260_ID_ISI 22 /* Image Sensor Interface */
#define AT91SAM9260_ID_US3 23 /* USART 3 */
#define AT91SAM9260_ID_US4 24 /* USART 4 */
#define AT91SAM9260_ID_US5 25 /* USART 5 */
#define AT91SAM9260_ID_TC3 26 /* Timer Counter 3 */
#define AT91SAM9260_ID_TC4 27 /* Timer Counter 4 */
#define AT91SAM9260_ID_TC5 28 /* Timer Counter 5 */
#define AT91SAM9260_ID_IRQ0 29 /* Advanced Interrupt Controller (IRQ0) */
#define AT91SAM9260_ID_IRQ1 30 /* Advanced Interrupt Controller (IRQ1) */
#define AT91SAM9260_ID_IRQ2 31 /* Advanced Interrupt Controller (IRQ2) */
#define AT91SAM9260_BASE_TCB0 0xfffa0000
#define AT91SAM9260_BASE_TC0 0xfffa0000
#define AT91SAM9260_BASE_TC1 0xfffa0040
#define AT91SAM9260_BASE_TC2 0xfffa0080
#define AT91SAM9260_BASE_UDP 0xfffa4000
#define AT91SAM9260_BASE_MCI 0xfffa8000
#define AT91SAM9260_BASE_TWI 0xfffac000
#define AT91SAM9260_BASE_US0 0xfffb0000
#define AT91SAM9260_BASE_US1 0xfffb4000
#define AT91SAM9260_BASE_US2 0xfffb8000
#define AT91SAM9260_BASE_SSC 0xfffbc000
#define AT91SAM9260_BASE_ISI 0xfffc0000
#define AT91SAM9260_BASE_EMAC 0xfffc4000
#define AT91SAM9260_BASE_SPI0 0xfffc8000
#define AT91SAM9260_BASE_SPI1 0xfffcc000
#define AT91SAM9260_BASE_US3 0xfffd0000
#define AT91SAM9260_BASE_US4 0xfffd4000
#define AT91SAM9260_BASE_US5 0xfffd8000
#define AT91SAM9260_BASE_TCB1 0xfffdc000
#define AT91SAM9260_BASE_TC3 0xfffdc000
#define AT91SAM9260_BASE_TC4 0xfffdc040
#define AT91SAM9260_BASE_TC5 0xfffdc080
#define AT91SAM9260_BASE_ADC 0xfffe0000
#define AT91_BASE_SYS 0xffffe800
#define AT91_ECC (0xffffe800 - AT91_BASE_SYS)
#define AT91_SDRAMC (0xffffea00 - AT91_BASE_SYS)
#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)
#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)
#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS)
#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS)
#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)
#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)
#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)
#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
#define AT91_RTT (0xfffffd20 - AT91_BASE_SYS)
#define AT91_PIT (0xfffffd30 - AT91_BASE_SYS)
#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)
#define AT91_USART0 AT91SAM9260_BASE_US0
#define AT91_USART1 AT91SAM9260_BASE_US1
#define AT91_USART2 AT91SAM9260_BASE_US2
#define AT91_USART3 AT91SAM9260_BASE_US3
#define AT91_USART4 AT91SAM9260_BASE_US4
#define AT91_USART5 AT91SAM9260_BASE_US5
#define AT91SAM9260_ROM_BASE 0x00100000 /* Internal ROM base address */
#define AT91SAM9260_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */
#define AT91SAM9260_SRAM0_BASE 0x00200000 /* Internal SRAM 0 base address */
#define AT91SAM9260_SRAM0_SIZE SZ_4K /* Internal SRAM 0 size (4Kb) */
#define AT91SAM9260_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */
#define AT91SAM9260_SRAM1_SIZE SZ_4K /* Internal SRAM 1 size (4Kb) */
#define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */
#define AT91SAM9XE_FLASH_BASE 0x00200000 /* Internal FLASH base address */
#define AT91SAM9XE_SRAM_BASE 0x00300000 /* Internal SRAM base address */
#define AT91SAM9G20_ROM_BASE 0x00100000 /* Internal ROM base address */
#define AT91SAM9G20_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */
#define AT91SAM9G20_SRAM0_BASE 0x00200000 /* Internal SRAM 0 base address */
#define AT91SAM9G20_SRAM0_SIZE SZ_16K /* Internal SRAM 0 size (16Kb) */
#define AT91SAM9G20_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */
#define AT91SAM9G20_SRAM1_SIZE SZ_16K /* Internal SRAM 1 size (16Kb) */
#define AT91SAM9G20_UHP_BASE 0x00500000 /* USB Host controller */
#endif
|
/*
* Copyright (C) 2001-2013 Jacek Sieka, arnetheduck on gmail point com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DCPLUSPLUS_DCPP_SIMPLEBENCODEREADER_H_
#define DCPLUSPLUS_DCPP_SIMPLEBENCODEREADER_H_
#include <cstdint>
#include <string>
#include <boost/noncopyable.hpp>
namespace dcpp {
using std::string;
class SimpleBencodeReader {
public:
struct Callback : boost::noncopyable {
virtual ~Callback() { }
virtual void intValue(int64_t) { }
virtual void stringValue(const string &) { }
virtual void startList() { }
virtual void endList() { }
virtual void startDictEntry(const string &) { }
virtual void endDictEntry() { }
};
SimpleBencodeReader(Callback &cb) : cb(cb) { }
void parse(const string& data);
private:
static int64_t readInt(const char **data);
static string readString(const char **data, const char *end);
void decode(const char **data, const char *end);
Callback &cb;
};
}
#endif /* DCPLUSPLUS_DCPP_SIMPLEBENCODEREADER_H_ */
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:42 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/fb/sys/fillrect.h */
|
//
// GameScreen.h
// C2DSmasher
//
// Created by Peter Arato on 9/10/13.
// Copyright 2013 Peter Arato. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "FlyingItemDelegate.h"
#import "JPSDK.h"
#import "Player.h"
#import "AimCross.h"
#import "ControllerLayer.h"
#import "ControlTouchDelegate.h"
@interface GameScreen : CCLayer <JPManagerDelegate, FlyingItemDelegate, ControlTouchDelegate> {
CCLabelTTF *scoreLabel;
CCLabelTTF *healthLabel;
CCLabelTTF *livesLabel;
int score;
NSMutableSet *flyingItems;
Player *player;
AimCross *aimCross;
GameControlState controlState;
float prevAccZ;
ControllerLayer *controlPad;
int health;
int lives;
CCNode *controlLayer;
CCNode *gameLayer;
}
- (void)updateScore;
- (void)shoot;
+ (CCScene *)scene;
+ (float)worldSpeedMultiplier;
@end
|
/* This file is part of the KDE project
Copyright (C) 2002 Lars Siebold <khandha5@gmx.net>
Copyright (C) 2002 Werner Trobin <trobin@kde.org>
Copyright (C) 2002 Lennart Kudling <kudling@kde.org>
Copyright (C) 2002-2003,2005 Rob Buis <buis@kde.org>
Copyright (C) 2005 Boudewijn Rempt <boud@valdyas.org>
Copyright (C) 2005 Raphael Langerhorst <raphael.langerhorst@kdemail.net>
Copyright (C) 2005 Thomas Zander <zander@kde.org>
Copyright (C) 2005,2008 Jan Hambrecht <jaham@gmx.net>
Copyright (C) 2006 Inge Wallin <inge@lysator.liu.se>
Copyright (C) 2006 Laurent Montel <montel@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 SVGEXPORT_H
#define SVGEXPORT_H
#include <KoFilter.h>
#include <QVariantList>
class KarbonDocument;
class SvgExport : public KoFilter
{
Q_OBJECT
public:
SvgExport(QObject* parent, const QVariantList&);
virtual ~SvgExport() {}
virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
private:
void saveDocument(KarbonDocument& document);
};
#endif
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: sync_net.h
* Author: programmeur
*
* Created on 16 февраля 2017 г., 23:17
*/
//#ifndef SYNC_NET_H
//#define SYNC_NET_H
struct DCPadKeymap
{
unsigned short int DPad[4]; //крестовина
unsigned short int SPad[4]; //мягкий джой 4-е зарегестрировано для клавиатуры (на всякий)
unsigned short int Buttons[5]; //кнопки
unsigned short int Triggers[2]; //триггеры
bool InvertX, InvertY;
bool plugIn; //подключить устройство?
bool PlugMMU[2]; //подключить карты памяти?
std::string MemoryCardPath[2]; //путь к файлу карты памяти
char DeviceEvNumber; //num of dev
};
typedef struct DCPadKeymap DCPads[4]; //у нас до 4-х джоев
char CreateSock(void);
bool ConfigurePADS(DCPads &CfgPads);
void ProcessMessagesFromServer(void);
void* wrk_sock_thread(void * arg);
bool LoadEmuConfig(void);
void SetupExecIso(void);
//#endif /* SYNC_NET_H */
|
/*
* Problem.h
*
* Created on: 6 Nov 2014
* Author: adasubu
*/
#ifndef PROBLEM_H_
#define PROBLEM_H_
#include <vector>
#include "Toolchain.h"
#include "Workpoint.h"
#include "Random.h"
class Problem {
friend std::ostream &operator<<(std::ostream & str, const Problem &problem);
friend std::istream &operator>>(std::istream & str, Problem &problem);
Toolchain toolchain;
std::vector<Workpoint> workpoints;
public:
Problem();
Problem(Toolchain toolchain);
Problem(int workpointsCount, int maxtools, Toolchain toolchain, double maxX = 1.0, double maxY = 1.0);
void setToolchain(Toolchain toolchain);
Toolchain getToolchain() const;
std::vector<Workpoint> getWorkpoints() const;
};
std::ostream &operator<<(std::ostream & str, const Problem &problem);
std::istream &operator>>(std::istream & str, Problem &problem);
#endif /* PROBLEM_H_ */
|
void init_paging();
void switch_to_paging();
|
/******************************************************************************
* IDL2SCILAB Project
*-----------------------------------------------------------------------------
* ILL (Institut Laue Langevin)
*
* 38000 GRENOBLE Cedex
*-----------------------------------------------------------------------------
* Module : Abstract Tree
* Auteurs : Gardon Lucien
* Sylvestre Nadege
* Bourtembourg Reynald
* Date creation : 11 / 11 / 2001
* Modification : 07 / 07 / 2003
*
*****************************************************************************/
#ifndef TYPE_H
#define TYPE_H
/* Old version - NE PAS MODIFIER LA TAILLE = 10 */
#define I2M_VERSION "Apr03 2003"
/* Current version - NE PAS MODIFIER LA TAILLE = 10 */
#define I2M_VERSION_2 "1.6 130501"
/* OS cible */
#ifdef WIN32
#define PATHSEP '\\'
#else
#define PATHSEP '/'
#endif
#ifndef IDL2MATLAB
#ifdef WIN32
#define IDL2MATLAB "C:\\idl2matlab"
#else /* !WIN32 */
#ifdef MAC
#define IDL2MATLAB ":idl2matlab" /* ToDo: What to put here? */
#else /* !MAC */
#define IDL2MATLAB "/usr/local/lib/idl2matlab"
#endif /* !MAC */
#endif /* !WIN32 */
#endif
/******************************************************/
/* Definition des principaux types de base du systeme */
/******************************************************/
/*+ valeur d'un node +*/
/*+ Un node peut contenir plusieurs types de valeurs +*/
typedef union {
char uString[256]; /*+ si idf +*/
int uInt; /*+ si denotation entiere +*/
char uReal[256]; /*+ si denotation reelle +*/
} leaf ;
/*+ type Node - Brique de base de l'arbre abstrait +*/
typedef struct Node {
int typeNode ; /*+ le type du noeud +*/
int lineInSource; /*+ numero de ligne dans le fichier source +*/
leaf valNode ; /*+ sa valeur +*/
struct Node *fg; /*+ acces fils droit +*/
struct Node *fd; /*+ acces fils gauche +*/
} Node ;
typedef Node *PNode; /*+ Pointeur sur un noeud +*/
typedef struct Comment {
int lineInSource; /*+ numero de ligne dans le fichier source +*/
char *commentString; /*+ commentaire +*/
struct Comment *nextComment; /*+ acces suivant +*/
} Comment ;
/************************************************************/
/* Definition des principales variables globales du systeme */
/************************************************************/
Node *root; /*+ racine de l arbre abstrait +*/
Comment *commentTable; /*+ table contenant les caracteres +*/
Comment *lastComment; /*+ dernierCommentaire de la table +*/
int translationError; /*+ indicateur d erreur pendant la traduction +*/
int fileTranslationError; /*+ indicateur d erreur dans un fichier +*/
int numCurrentLine; /*+ compteur de ligne courante dans le fichier cible +*/
int nbGeneratedFile; /*+ nb de fichiers generes +*/
int nbWarningFile; /*+ nombre de warning pour un fichier +*/
int nbWarning; /*+ nombre total de warning +*/
int nbLinesTotal; /*+ nombre total de lignes +*/
/*+ type de fichier a traduire +*/
/*+ vaut 1 si la source est un script 0 sinon +*/
int scriptFileTranslation;
int displayMessage;/*+ affichage des messages si = 1 sinon 0 +*/
int writeWarning;/*+ ecrit les warning dans le fichier log si = 1 +*/
int writeAbstractTree;/*+ affiche l'arbre abstrait si = 1 +*/
int stringTranslation; /*+ vaut 1 en cas de traduction de chaine de car+*/
int oneFunctionTranslation; /*+ pour traduire 1 seule fonction +*/
int inScilabTranslation; /*+ pour traduire en Scilab (1 -> Scilab, 0 -> Matlab) +*/
int tabVal; /*+ nb d'espace pour l'indentation +*/
char* commentaire; /*+ caractere du commentaire +*/
char i2mDirName[256]; /*+ repertoire d'IDL2MATLAB +*/
#endif
|
/*
* Channel extban type: matches users who are in a certain public channel
* -- jilles
*
* $Id: extb_channel.c 1723 2006-07-06 15:23:58Z jilles $
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "channel.h"
#include "hash.h"
#include "ircd.h"
static int _modinit(void);
static void _moddeinit(void);
static int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
DECLARE_MODULE_AV1(extb_channel, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision: 1723 $");
static int
_modinit(void)
{
extban_table['c'] = eb_channel;
return 0;
}
static void
_moddeinit(void)
{
extban_table['c'] = NULL;
}
static int eb_channel(const char *data, struct Client *client_p,
struct Channel *chptr, long mode_type)
{
struct Channel *chptr2;
(void)chptr;
(void)mode_type;
if (data == NULL)
return EXTBAN_INVALID;
chptr2 = find_channel(data);
if (chptr2 == NULL)
return EXTBAN_INVALID;
/* require consistent target */
if (chptr->chname[0] == '#')
return EXTBAN_INVALID;
/* privacy! don't allow +s/+p channels to influence another channel */
if (!PubChannel(chptr2) && chptr2 != chptr)
return EXTBAN_INVALID;
return IsMember(client_p, chptr2) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
}
|
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/of_device.h>
#include <asm/errno.h>
#include <asm/dcr.h>
static void of_device_make_bus_id(struct of_device *dev)
{
static atomic_t bus_no_reg_magic;
struct device_node *node = dev->dev.of_node;
const u32 *reg;
u64 addr;
int magic;
/*
* If it's a DCR based device, use 'd' for native DCRs
* and 'D' for MMIO DCRs.
*/
#ifdef CONFIG_PPC_DCR
reg = of_get_property(node, "dcr-reg", NULL);
if (reg) {
#ifdef CONFIG_PPC_DCR_NATIVE
dev_set_name(&dev->dev, "d%x.%s", *reg, node->name);
#else /* CONFIG_PPC_DCR_NATIVE */
addr = of_translate_dcr_address(node, *reg, NULL);
if (addr != OF_BAD_ADDR) {
dev_set_name(&dev->dev, "D%llx.%s",
(unsigned long long)addr, node->name);
return;
}
#endif /* !CONFIG_PPC_DCR_NATIVE */
}
#endif /* CONFIG_PPC_DCR */
/*
* For MMIO, get the physical address
*/
reg = of_get_property(node, "reg", NULL);
if (reg) {
addr = of_translate_address(node, reg);
if (addr != OF_BAD_ADDR) {
dev_set_name(&dev->dev, "%llx.%s",
(unsigned long long)addr, node->name);
return;
}
}
/*
* No BusID, use the node name and add a globally incremented
* counter (and pray...)
*/
magic = atomic_add_return(1, &bus_no_reg_magic);
dev_set_name(&dev->dev, "%s.%d", node->name, magic - 1);
}
struct of_device *of_device_alloc(struct device_node *np,
const char *bus_id,
struct device *parent)
{
struct of_device *dev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
dev->dev.of_node = of_node_get(np);
dev->dev.dma_mask = &dev->archdata.dma_mask;
dev->dev.parent = parent;
dev->dev.release = of_release_dev;
if (bus_id)
dev_set_name(&dev->dev, "%s", bus_id);
else
of_device_make_bus_id(dev);
return dev;
}
EXPORT_SYMBOL(of_device_alloc);
int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct of_device *ofdev;
const char *compat;
int seen = 0, cplen, sl;
if (!dev)
return -ENODEV;
ofdev = to_of_device(dev);
if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name))
return -ENOMEM;
if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type))
return -ENOMEM;
/* Since the compatible field can contain pretty much anything
* it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */
compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen);
while (compat && *compat && cplen > 0) {
if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
return -ENOMEM;
sl = strlen (compat) + 1;
compat += sl;
cplen -= sl;
seen++;
}
if (add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen))
return -ENOMEM;
/* modalias is trickier, we add it in 2 steps */
if (add_uevent_var(env, "MODALIAS="))
return -ENOMEM;
sl = of_device_get_modalias(ofdev, &env->buf[env->buflen-1],
sizeof(env->buf) - env->buflen);
if (sl >= (sizeof(env->buf) - env->buflen))
return -ENOMEM;
env->buflen += sl;
return 0;
}
EXPORT_SYMBOL(of_device_uevent);
EXPORT_SYMBOL(of_device_get_modalias);
|
#ifndef JOB_H
#define JOB_H
#include <string>
#include <stdint.h>
namespace org{
namespace esb{
namespace model_old{
class Job{
public:
Job();
~Job();
std::string uuid;
std::string outputfile;
std::string graph;
std::string graphstatus;
std::string status;
time_t created;
time_t begintime;
time_t endtime;
int32_t progress;
std::string infile;
std::string outfile;
std::string graphname;
};
}
}
}
#endif // JOB_H
|
#include <drivers/intel/gma/i915.h>
struct northbridge_intel_i945_config {
u32 gpu_hotplug;
u32 gpu_backlight;
int gpu_lvds_use_spread_spectrum_clock;
struct i915_gpu_controller_info gfx;
};
|
/**
******************************************************************************
* @file stm32f7xx_it.c
* @author Ac6
* @version V1.0
* @date 02-Feb-2015
* @brief Default Interrupt Service Routines.
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f7xx_hal.h"
#include "stm32f7xx.h"
#include "stm32f7xx_it.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles SysTick Handler, but only if no RTOS defines it.
* @param None
* @retval None
*/
#ifndef USE_RTOS_SYSTICK
void SysTick_Handler(void)
{
HAL_IncTick();
HAL_SYSTICK_IRQHandler();
}
#endif
|
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <libnotify/notify.h>
#include "update-notifier.h"
#include "update.h"
static gboolean
check_system_crashes() {
int exitcode;
if(!in_admin_group())
return FALSE;
// check for system crashes
if(!g_spawn_command_line_sync(CRASHREPORT_HELPER " --system", NULL, NULL,
&exitcode, NULL)) {
g_warning("Can not run %s\n", CRASHREPORT_HELPER);
return FALSE;
}
return exitcode == 0;
}
static gboolean
run_apport(TrayApplet *ta)
{
g_debug("fire up the crashreport tool\n");
if (check_system_crashes()) {
invoke_with_gksu(CRASHREPORT_REPORT_APP,
_("<span weight=\"bold\" size=\"larger\">Please enter your password to access problem reports of system programs</span>"),
TRUE);
return TRUE;
} else
return g_spawn_command_line_async(CRASHREPORT_REPORT_APP, NULL);
}
static gboolean
show_notification (TrayApplet *ta)
{
NotifyNotification *n;
// check if the update-icon is still visible (in the delay time a
// update may already have been performed)
if(!gtk_status_icon_get_visible(ta->tray_icon))
return FALSE;
// now show a notification handle
n = notify_notification_new(
_("Crash report detected"),
_("An application has crashed on your "
"system (now or in the past). "
"Click on the notification icon to "
"display details. "
),
GTK_STOCK_DIALOG_INFO);
notify_notification_set_timeout (n, 60000);
notify_notification_show (n, NULL);
return FALSE;
}
static void
hide_crash_applet(TrayApplet *ta)
{
NotifyNotification *n;
gtk_status_icon_set_visible(ta->tray_icon, FALSE);
/* Hide any notification popup */
n = g_object_get_data (G_OBJECT(ta->tray_icon), "notification");
if (n)
notify_notification_close (n, NULL);
g_object_set_data (G_OBJECT(ta->tray_icon), "notification", NULL);
}
gboolean
crashreport_check (TrayApplet *ta)
{
int crashreports_found = 0;
static gboolean first_run = TRUE;
gboolean system_crashes;
// g_debug("crashreport_check\n");
// don't do anything if no apport-gtk is installed
if(!g_file_test(CRASHREPORT_REPORT_APP, G_FILE_TEST_IS_EXECUTABLE))
return FALSE;
// check for (new) reports by calling CRASHREPORT_HELPER
// and checking the return code
int exitcode;
if(!g_spawn_command_line_sync(CRASHREPORT_HELPER, NULL, NULL,
&exitcode, NULL)) {
g_warning("Can not run %s\n", CRASHREPORT_HELPER);
return FALSE;
}
// exitcode == 0: repots found, else no reports
system_crashes = check_system_crashes();
crashreports_found = !exitcode || system_crashes;
// crashreport found and first run: show notification bubble and
// return
gboolean visible = gtk_status_icon_get_visible(ta->tray_icon);
// g_print("reports: %i, visible: %i\n",crashreports_found,visible);
if((crashreports_found > 0) && (system_crashes || first_run)) {
gtk_status_icon_set_tooltip(ta->tray_icon,
_("Crash report detected"));
gtk_status_icon_set_visible(ta->tray_icon, TRUE);
/* Show the notification, after a delay so it doesn't look ugly
* if we've just logged in */
g_timeout_add(5000, (GSourceFunc)(show_notification), ta);
}
// crashreport found and already visible
else if((crashreports_found > 0) && !(system_crashes || first_run)) {
run_apport(ta);
// if apport was run, we don't care anymore and hide the icon
crashreports_found=0;
}
// no crashreports, but visible
if((crashreports_found == 0) && visible) {
hide_crash_applet(ta);
}
first_run = FALSE;
return TRUE;
}
static gboolean
button_release_cb (GtkWidget *widget,
TrayApplet *ta)
{
run_apport(ta);
hide_crash_applet(ta);
return TRUE;
}
void
crashreport_tray_icon_init (TrayApplet *ta)
{
g_signal_connect (G_OBJECT(ta->tray_icon),
"activate",
G_CALLBACK (button_release_cb),
ta);
/* Check for crashes for the first time */
crashreport_check (ta);
}
|
/************************************************************************************************************
Copyright (C) Morozov Vladimir Aleksandrovich
MorozovVladimir@mail.ru
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 MYTEXTEDIT_H
#define MYTEXTEDIT_H
#include <QtCore/QtGlobal>
#if QT_VERSION < 0x050000
#include <QtGui/QTextEdit>
#else
#include <QtWidgets/QTextEdit>
#endif
class MyTextEdit : public QTextEdit
{
Q_OBJECT
public:
MyTextEdit(QWidget *parent = 0 /*nullptr*/);
};
#endif // MYTEXTEDIT_H
|
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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
*/
/* 12/24/2002 Port to LTP robbiew@us.ibm.com */
/* 06/30/2001 Port to Linux nsharoff@us.ibm.com */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/fcntl.h>
#include <sys/wait.h>
#include <sys/poll.h>
/** LTP Port **/
#include "test.h"
#include "usctest.h"
char *TCID="hangup01"; /* Test program identifier. */
int TST_TOTAL=5; /* Total number of test cases. */
/**************/
/*
* pty master clone device
*/
#define MASTERCLONE "/dev/ptmx"
#define MESSAGE1 "I love Linux!"
#define MESSAGE2 "Use the LTP for all your Linux testing needs."
#define MESSAGE3 "For the latest version of the LTP tests, visit http://ltp.sourceforge.net"
#define NUMMESSAGES 3
#define BUFSZ 4096
void cleanup(void);
pid_t childpid;
void
cleanup(void)
{
int status;
if (0 < childpid) {
/* If the PID is still alive... */
if (kill(childpid, 0) == 0 || errno == ESRCH) {
/* KILL IT! */
(void) kill(childpid, 15);
/* And take care of any leftover zombies. */
if (waitpid(childpid, &status, WNOHANG) < 0) {
tst_resm(TWARN|TERRNO,
"waitpid(%d, ...) failed", childpid);
}
}
}
}
/*
* parent process for hangup test
*/
void
parent(int masterfd, int childpid)
{
char buf[BUFSZ];
struct pollfd pollfds[1];
size_t len = strlen(MESSAGE1);
int hangupcount = 0;
int datacount = 0;
int status;
int i;
pollfds[0].fd = masterfd;
pollfds[0].events = POLLIN;
sleep(1);
while ((i = poll(pollfds, 1, -1)) == 1) {
if (read(masterfd, buf, len) == -1) {
++hangupcount;
#ifdef DEBUG
tst_resm(TINFO,"hangup %d", hangupcount);
#endif
if (hangupcount == NUMMESSAGES) {
break;
}
} else {
++datacount;
switch (datacount) {
case 1:
if (strncmp(buf, MESSAGE1,
strlen(MESSAGE1)) != 0) {
tst_brkm(TFAIL, cleanup,
"unexpected message 1");
}
len = strlen(MESSAGE2);
break;
case 2:
if (strncmp(buf, MESSAGE2,
strlen(MESSAGE2)) != 0) {
tst_brkm(TFAIL, cleanup,
"unexpected message 2");
}
len = strlen(MESSAGE3);
break;
case 3:
if (strncmp(buf, MESSAGE3,
strlen(MESSAGE3)) != 0) {
tst_brkm(TFAIL, cleanup,
"unexpected message 3");
}
break;
default:
tst_brkm(TFAIL, cleanup,
"unexpected data message");
}
}
}
if (i != 1) {
tst_brkm(TFAIL, cleanup, "poll");
}
while (waitpid(childpid, &status, WNOHANG) < 0 && errno != ESRCH) ;
tst_resm((status == 0 ? TPASS : TFAIL),
"child process exited with status %d", status);
}
/*
* Child process for hangup test. Write three messages to the slave
* pty, with a hangup after each.
*/
int
child(int masterfd)
{
int slavefd;
char *slavename;
if ((slavename = ptsname(masterfd)) == NULL) {
printf("ptsname[child] failed: %s\n", strerror(errno));
return 1;
}
if ((slavefd = open(slavename, O_RDWR)) < 0) {
printf("open[1] failed: %s\n", strerror(errno));
return 1;
}
if (write(slavefd, MESSAGE1, strlen(MESSAGE1)) != strlen(MESSAGE1)) {
printf("write failed: %s\n", strerror(errno));
return 1;
}
if (close(slavefd) != 0) {
printf("close[1] failed: %s\n", strerror(errno));
return 1;
}
if ((slavefd = open(slavename, O_RDWR)) < 0) {
printf("open[2] failed: %s\n", strerror(errno));
return 1;
}
if (write(slavefd, MESSAGE2, strlen(MESSAGE2)) != strlen(MESSAGE2)) {
printf("write[2] failed: %s\n", strerror(errno));
return 1;
}
if (close(slavefd) != 0) {
printf("close[2] failed: %s\n", strerror(errno));
return 1;
}
if ((slavefd = open(slavename, O_RDWR)) < 0) {
printf("open[3] failed: %s\n", strerror(errno));
return 1;
}
if (write(slavefd, MESSAGE3, strlen(MESSAGE3)) != strlen(MESSAGE3)) {
printf("write[3] failed: %s\n", strerror(errno));
return 1;
}
if (close(slavefd) != 0) {
printf("close[3] failed: %s\n", strerror(errno));
return 1;
}
return 0;
}
/*
* main test driver
*/
int main(int argc, char **argv)
{
int masterfd; /* master pty fd */
char *slavename;
pid_t childpid;
/*--------------------------------------------------------------------*/
masterfd = open(MASTERCLONE, O_RDWR);
if (masterfd < 0)
tst_brkm(TBROK|TERRNO, NULL, "open %s", MASTERCLONE);
slavename = ptsname(masterfd);
if (slavename == NULL)
tst_brkm(TBROK|TERRNO, NULL, "ptsname");
if (grantpt(masterfd) != 0)
tst_brkm(TBROK|TERRNO, NULL, "grantpt");
if (unlockpt(masterfd) != 0)
tst_brkm(TBROK|TERRNO, NULL, "unlockpt");
childpid = fork();
if (childpid == -1)
tst_brkm(TBROK|TERRNO, NULL, "fork");
else if (childpid == 0)
exit(child(masterfd));
else
parent(masterfd, childpid);
/*--------------------------------------------------------------------*/
cleanup();
tst_exit();
} |
/*
* jinclude.h
*
* Copyright (C) 1991-1994, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file exists to provide a single place to fix any problems with
* including the wrong system include files. (Common problems are taken
* care of by the standard jconfig symbols, but on really weird systems
* you may have to edit this file.)
*
* NOTE: this file is NOT intended to be included by applications using the
* JPEG library. Most applications need only include jpeglib.h.
*/
/* Include auto-config file to find out which system include files we need. */
#include "jconfig.h" /* auto configuration options */
#include "jmorecfg.h" /* auto configuration options */
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
/*
* We need the NULL macro and size_t typedef.
* On an ANSI-conforming system it is sufficient to include <stddef.h>.
* Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
* pull in <sys/types.h> as well.
* Note that the core JPEG library does not require <stdio.h>;
* only the default error handler and data source/destination modules do.
* But we must pull it in because of the references to FILE in jpeglib.h.
* You can remove those references if you want to compile without <stdio.h>.
*/
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef NEED_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <stdio.h>
/*
* We need memory copying and zeroing functions, plus strncpy().
* ANSI and System V implementations declare these in <string.h>.
* BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
* Some systems may declare memset and memcpy in <memory.h>.
*
* NOTE: we assume the size parameters to these functions are of type size_t.
* Change the casts in these macros if not!
*/
#ifdef NEED_BSD_STRINGS
#include <strings.h>
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
#else /* not BSD, assume ANSI/SysV string lib */
#include <string.h>
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
#endif
/*
* In ANSI C, and indeed any rational implementation, size_t is also the
* type returned by sizeof(). However, it seems there are some irrational
* implementations out there, in which sizeof() returns an int even though
* size_t is defined as long or unsigned long. To ensure consistent results
* we always use this SIZEOF() macro in place of using sizeof() directly.
*/
#define SIZEOF(object) ((size_t) sizeof(object))
/*
* The modules that use fread() and fwrite() always invoke them through
* these macros. On some systems you may need to twiddle the argument casts.
* CAUTION: argument order is different from underlying functions!
*/
#define JFREAD(file,buf,sizeofbuf) \
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
#define JFWRITE(file,buf,sizeofbuf) \
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
/* linux/arch/arm/plat-s3c/include/plat/uncompress.h
*
* Copyright 2003, 2007 Simtec Electronics
* http://armlinux.simtec.co.uk/
* Ben Dooks <ben@simtec.co.uk>
*
* S3C - uncompress code
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_PLAT_UNCOMPRESS_H
#define __ASM_PLAT_UNCOMPRESS_H
typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
/* uart setup */
static unsigned int fifo_mask;
static unsigned int fifo_max;
/* forward declerations */
static void arch_detect_cpu(void);
/* defines for UART registers */
#include <plat/regs-serial.h>
#include <plat/regs-watchdog.h>
/* working in physical space... */
#undef S3C2410_WDOGREG
#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
/* how many bytes we allow into the FIFO at a time in FIFO mode */
#define FIFO_MAX (14)
#if defined(CONFIG_MACH_VOLANS)
#define uart_base S3C_PA_UART2
#else
#define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT)
#endif /* CONFIG_MACH_VOLANS */
static __inline__ void
uart_wr(unsigned int reg, unsigned int val)
{
volatile unsigned int *ptr;
ptr = (volatile unsigned int *)(reg + uart_base);
*ptr = val;
}
static __inline__ unsigned int
uart_rd(unsigned int reg)
{
volatile unsigned int *ptr;
ptr = (volatile unsigned int *)(reg + uart_base);
return *ptr;
}
/* we can deal with the case the UARTs are being run
* in FIFO mode, so that we don't hold up our execution
* waiting for tx to happen...
*/
static void putc(int ch)
{
if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
int level;
while (1) {
level = uart_rd(S3C2410_UFSTAT);
level &= fifo_mask;
if (level < fifo_max)
break;
}
} else {
/* not using fifos */
while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
barrier();
}
/* write byte to transmission register */
uart_wr(S3C2410_UTXH, ch);
}
static inline void flush(void)
{
}
#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
/* CONFIG_S3C_BOOT_WATCHDOG
*
* Simple boot-time watchdog setup, to reboot the system if there is
* any problem with the boot process
*/
#ifdef CONFIG_S3C_BOOT_WATCHDOG
#define WDOG_COUNT (0xff00)
static inline void arch_decomp_wdog(void)
{
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
}
static void arch_decomp_wdog_start(void)
{
__raw_writel(WDOG_COUNT, S3C2410_WTDAT);
__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
}
#else
#define arch_decomp_wdog_start()
#define arch_decomp_wdog()
#endif
#ifdef CONFIG_S3C_BOOT_ERROR_RESET
static void arch_decomp_error(const char *x)
{
putstr("\n\n");
putstr(x);
putstr("\n\n -- System resetting\n");
__raw_writel(0x4000, S3C2410_WTDAT);
__raw_writel(0x4000, S3C2410_WTCNT);
__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
while(1);
}
#define arch_error arch_decomp_error
#endif
static void error(char *err);
static void
arch_decomp_setup(void)
{
/* we may need to setup the uart(s) here if we are not running
* on an BAST... the BAST will have left the uarts configured
* after calling linux.
*/
arch_detect_cpu();
arch_decomp_wdog_start();
}
#endif /* __ASM_PLAT_UNCOMPRESS_H */
|
/***************************************************************
* L&L - Labyrinths & Legends
* Copyright (c) 1993-2014 YOSHIMURA Tomohiko All rights reserved.
*
* Created by BowKenKen
* URL: https://sourceforge.jp/projects/lnl/
*
* License is GPL
*
* 本プログラムはフリー・ソフトウェアです。
* あなたは、 Free Software Foundation が公表した
* GNU 一般公有使用許諾の「バージョン2」
* 或はそれ以降の各バージョンの中からいずれかを選択し、
* そのバージョンが定める条項に従って本プログラムを
* 再頒布または変更することができます。
*
* 本プログラムは有用とは思いますが、頒布にあたっては、
* 市場性及び特定目的適合性についての暗黙の保証を含めて,
* いかなる保証も行ないません。
* 詳細については GNU 一般公有使用許諾書をお読みください。
*
* あなたは、本プログラムと一緒に GNU 一般公有使用許諾書
* の写しを受け取っているはずです。そうでない場合は、
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
* へ手紙を書いてください。
*
* $Id: IPhoneWSDimage.h,v 1.3 2014/01/07 23:44:46 bowkenken Exp $
***************************************************************/
#ifndef IPHONE_WSD_IMAGE_DEV_H
#define IPHONE_WSD_IMAGE_DEV_H 1
#import <UIKit/UIKit.h>
class WSDimage
{
private:
UIImage *pPixbuf;
public:
WSDimage()
{
pPixbuf = nil;
}
WSDimage( UIImage *buf )
{
pPixbuf = buf;
[pPixbuf retain];
}
void destroyImage()
{
[pPixbuf release];
pPixbuf = nil;
}
UIImage *getPixbuf()
{
return pPixbuf;
}
UIImage *setPixbuf( UIImage *buf )
{
pPixbuf = buf;
[pPixbuf retain];
return pPixbuf;
}
long getImageWidth()
{
if( pPixbuf )
return( pPixbuf.size.width );
else
return 1;
}
long getImageHeight()
{
if( pPixbuf )
return( pPixbuf.size.height );
else
return 1;
}
};
#endif // IPHONE_WSD_IMAGE_DEV_H
|
#include <sys/socket.h>
#include <netdb.h>
const char* diet_gai_strerror(int error) {
switch (error) {
case EAI_FAMILY: return "family not supported";
case EAI_SOCKTYPE: return "socket type not supported";
case EAI_NONAME: return "unknown host";
case EAI_SERVICE: return "unknown service";
case EAI_MEMORY: return "memory allocation failure";
case EAI_AGAIN: return "temporary failure";
}
return "DNS error. Sorry.";
}
|
/*
* Copyright (C) 2009 Ladislav Klenovic <klenovic@nucleonsoft.com>
*
* This file is part of Nucleos kernel.
*
* Nucleos kernel 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.
*/
/* The <nucleos/termios.h> header is used for controlling tty modes. */
#ifndef _SYS_TERMIOS_H
#define _SYS_TERMIOS_H
#include <nucleos/termios.h>
#include <machine/termios.h>
#endif /* _SYS_TERMIOS_H */
|
/*
This file is part of KAddressBook.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DATEPARSER_H
#define DATEPARSER_H
#include <QtCore/QDateTime>
#include <QtCore/QString>
/**
This class parses the datetime out of a given string with the
help of a pattern.
The pattern can contain the following place holders:
y = year (e.g. 82)
Y = year (e.g. 1982)
m = month (e.g. 7, 07 or 12)
M = month (e.g. 07 or 12)
d = day (e.g. 3, 03 or 17)
D = day (e.g. 03 or 17)
H = hour (e.g. 12)
I = minute (e.g. 56)
S = second (e.g. 30)
*/
class DateParser
{
public:
DateParser( const QString &pattern );
~DateParser();
QDateTime parse( const QString &dateStr ) const;
private:
QString mPattern;
};
#endif
|
/**
@file xmlextract.h
@author Tristan Beau, beau@in2p3.fr
@brief Definition of the TXmlExtract class which extract scalar or vector from xml file. It uses currently the tinyxml package but could be written using another xml parser.
*/
#ifndef _XMLEXTRACT_H_
#define _XMLEXTRACT_H_
#include "tinyxml.h"
#include <fstream>
#include "xml_err.h"
#include <stdlib.h>
#include <limits.h>
using namespace std;
enum XmlExtractError {
ERR_LOAD_FILE = 0x21
};
string GetAttribute(const TiXmlElement*, const char*); /// Tests and returns an attribute for a TiXmlElement
/**
@class TXmlExtract
@brief Class containing a pointer to a TiXmlDocument object, and simple functions to check and extract basic elements
The TiXmlExtract is currently a simple interface between CRPropa and tinyxml objects.
*/
class TXmlExtract {
public:
TXmlExtract(const char *) ;
~TXmlExtract() ;
TiXmlElement* GetElement(const char*) const ; /**< Extracts an XML element of a given name from the document */
int GetInt(const char*) const ; /**< Extracts the integer I for the following XML tag : <Arg value = I /> */
unsigned long GetULong(const char*) const ; /** Extracts the unsigned long L for the following XML tag :
<Arg value = L /> */
double GetDouble(const char*) const ; /** Extracts the double D for the following XML tag :
<Arg value = D /> */
string GetString(const char*) const ; /** Extracts the string S for the following XML tag :
<Arg value = S /> */
bool CheckElement(const char*) const ; /** Returns TRUE if the element is present in the XML document */
protected:
TiXmlDocument *_fpXmlDoc;
};
#endif
|
#ifndef POPUPWINDOW_H
#define POPUPWINDOW_H
#include <QQuickWindow>
#include <QQuickItem>
#include <QMouseEvent>
class popupWindow : public QQuickWindow
{
Q_OBJECT
Q_PROPERTY(QQuickItem *parentItem READ parentItem WRITE setParentItem)
Q_PROPERTY(int yOffset READ yOffset WRITE setYOffset NOTIFY yOffsetChanged)
Q_PROPERTY(int xOffset READ xOffset WRITE setXOffset NOTIFY xOffsetChanged)
public:
explicit popupWindow();
QQuickItem *parentItem() const { return m_pParentItem; }
virtual void setParentItem(QQuickItem *item);
void setYOffset(int offset);
void setXOffset(int offset);
int yOffset() const { return m_yOffset; }
int xOffset() const { return m_xOffset; }
private:
QQuickItem *m_pParentItem;
int m_yOffset;
int m_xOffset;
bool m_dismissed;
bool m_mouseMoved;
bool m_needsActivatedEvent;
void forwardEventToTransientParent(QMouseEvent *ev);
protected:
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
protected slots:
void updateSize();
void applicationStateChanged(Qt::ApplicationState state);
public slots:
virtual void show();
void dismissPopup();
signals:
void dismissed();
void geometryChanged();
void yOffsetChanged();
void xOffsetChanged();
void popupDismissed();
};
#endif // POPUPWINDOW_H
|
//====================================================================================
// Name : InterruptMonitor.h
// Author : Jered Tupik
// Version : 1.0 5/17/2015
// Copyright : GNU v3 Public License
//
// Copyright (C) 2015 Tupik, Jered
//
// 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/>.
//
// Description : Definition file of the InterruptMonitor for the Z80.
//====================================================================================
#ifndef Z80_IO_INTERRUPTMONITOR_H_
#define Z80_IO_INTERRUPTMONITOR_H_
#include <thread>
#include <vector>
#include "IInterruptDevice.h"
#include "../Z80Defines.h"
class InterruptMonitor{
private:
//Devices to monitor for interrupts.
std::vector<IInterruptDevice*> ConnectedDevices;
//Last unprocessed Interrupt Code
uint16_t InterruptCode = 0;
//Interrupt Process Status
bool processedInterrupt = false;
//Interrupt Monitoring Thread
std::thread InterruptPoller;
//InterruptPoller method for monitoring devices
void processDevices(uint16_t);
public:
InterruptMonitor();
InterruptMonitor(std::vector<IInterruptDevice*>&);
~InterruptMonitor();
void addDevice(IInterruptDevice*);
uint16_t processInterrupt();
void stopInterruptMonitor();
};
#endif
|
/**************************************************************************
* Otter Browser: Web browser controlled by the user, not vice-versa.
* Copyright (C) 2014 Jan Bajer aka bajasoft <jbajer@gmail.com>
* Copyright (C) 2015 - 2016 Michal Dutkiewicz aka Emdek <michal@emdek.pl>
*
* 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/>.
*
**************************************************************************/
#ifndef OTTER_JAVASCRIPTPREFERENCESDIALOG_H
#define OTTER_JAVASCRIPTPREFERENCESDIALOG_H
#include "../Dialog.h"
namespace Otter
{
namespace Ui
{
class JavaScriptPreferencesDialog;
}
class JavaScriptPreferencesDialog : public Dialog
{
Q_OBJECT
public:
explicit JavaScriptPreferencesDialog(const QVariantMap &options, QWidget *parent = 0);
~JavaScriptPreferencesDialog();
QVariantMap getOptions() const;
protected:
void changeEvent(QEvent *event);
private:
Ui::JavaScriptPreferencesDialog *m_ui;
};
}
#endif
|
static const unsigned char ml_bin[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0B, 0x08, 0x02, 0x00, 0x00, 0x00, 0xF9, 0x80, 0x9A,
0x6E, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xAF, 0xC8, 0x37, 0x05, 0x8A,
0xE9, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72,
0x65, 0x00, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61,
0x64, 0x79, 0x71, 0xC9, 0x65, 0x3C, 0x00, 0x00, 0x01, 0x6C, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA,
0x62, 0x64, 0x98, 0xC8, 0xC0, 0xF0, 0x83, 0x01, 0x04, 0xFE, 0x31, 0x30, 0xFC, 0x61, 0x78, 0x5C,
0xC0, 0x20, 0xC5, 0x05, 0xE6, 0xFD, 0x03, 0xA3, 0x33, 0x0C, 0xFF, 0xAC, 0x41, 0x32, 0x70, 0x04,
0x10, 0x40, 0x2C, 0x0C, 0x5F, 0x18, 0xAA, 0x5D, 0xAB, 0xC1, 0x2A, 0xFE, 0xFD, 0xFB, 0xFF, 0x4F,
0x80, 0xFD, 0x2F, 0x03, 0x03, 0x10, 0xFD, 0x61, 0x64, 0xFC, 0xC3, 0xCC, 0xFC, 0x87, 0x49, 0xFE,
0xF7, 0xFF, 0x98, 0x3F, 0xFF, 0x7F, 0xFF, 0xFE, 0xFF, 0x07, 0x44, 0x7E, 0xD9, 0xB4, 0x09, 0x20,
0x80, 0x58, 0x18, 0x58, 0x80, 0x8A, 0xFF, 0x3F, 0xF9, 0xFA, 0xF4, 0xEF, 0xBF, 0xBF, 0x20, 0xF0,
0xEF, 0x37, 0x03, 0xF3, 0xDF, 0xFF, 0xFF, 0x7F, 0x43, 0xD1, 0xAF, 0xDF, 0xFF, 0x6F, 0xFF, 0xFA,
0xFF, 0xEB, 0x17, 0x50, 0x35, 0xA3, 0xAC, 0x2C, 0xD0, 0x06, 0x80, 0x00, 0x62, 0x61, 0x00, 0x59,
0xFD, 0x1F, 0xA8, 0xFA, 0x0F, 0x10, 0xFD, 0xFD, 0x0D, 0x64, 0xFE, 0xFF, 0xFF, 0xEB, 0xFF, 0xFF,
0x3F, 0x60, 0x0D, 0xBF, 0xFE, 0xFF, 0xFB, 0x05, 0xD2, 0x03, 0xD6, 0xC0, 0xF0, 0xFB, 0x37, 0x50,
0x03, 0x40, 0x00, 0x81, 0xCC, 0xFF, 0xCB, 0xF0, 0xF7, 0x0F, 0xD0, 0xCA, 0x7F, 0x20, 0x84, 0x30,
0x1B, 0x9B, 0x06, 0xA0, 0x62, 0x80, 0x00, 0x62, 0x01, 0x7A, 0x14, 0x68, 0xF6, 0xEF, 0xBF, 0xBF,
0xFF, 0xFC, 0x85, 0x6B, 0xF8, 0x85, 0xD0, 0xF0, 0x1F, 0xAC, 0x1A, 0xA2, 0x01, 0x28, 0xCF, 0xC0,
0x00, 0x10, 0x40, 0x20, 0x0D, 0x7F, 0xC1, 0x66, 0xFF, 0xFA, 0xF7, 0x0B, 0xA8, 0x07, 0x49, 0x03,
0x98, 0x44, 0xB2, 0x81, 0x11, 0xEC, 0x24, 0x80, 0x00, 0x02, 0x69, 0xF8, 0xFD, 0xFF, 0xF7, 0xAF,
0xBF, 0x20, 0xD5, 0xBF, 0xFF, 0xFE, 0xFA, 0x87, 0x66, 0xC3, 0xBF, 0xDF, 0x70, 0xE3, 0x81, 0xAE,
0xFE, 0xC3, 0xC0, 0x00, 0x10, 0x40, 0x60, 0x27, 0x81, 0x94, 0xFE, 0x86, 0x20, 0xB0, 0x6A, 0x64,
0x1B, 0xC0, 0x1A, 0xFE, 0x00, 0x35, 0x00, 0x7D, 0x0A, 0x0C, 0x6E, 0x06, 0x80, 0x00, 0x62, 0x01,
0xC6, 0xDA, 0xEF, 0x7F, 0x7F, 0x24, 0xB9, 0x25, 0x41, 0xDE, 0xF8, 0xF3, 0x97, 0x89, 0x11, 0xE8,
0xB3, 0xDF, 0x8C, 0x20, 0x12, 0x68, 0xDC, 0x6F, 0x06, 0xD6, 0x3F, 0x0C, 0x4A, 0x7F, 0x40, 0x4A,
0xC1, 0x08, 0xE8, 0x24, 0x80, 0x00, 0x62, 0x64, 0x28, 0x65, 0x60, 0xF8, 0x04, 0x96, 0xFD, 0x01,
0x42, 0xA7, 0x7B, 0x18, 0x14, 0x78, 0x60, 0xD1, 0x0C, 0x44, 0xFB, 0x18, 0xFE, 0xC5, 0x42, 0xE3,
0x18, 0x02, 0x00, 0x02, 0x0C, 0x00, 0x63, 0x34, 0x72, 0x32, 0xF8, 0x0C, 0xE9, 0x5A, 0x00, 0x00,
0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
|
/***************************************************************************
* Copyright (C) 2011 Paul-Christian Volkmer
* paul-christian.volkmer@mni.thm.de
*
* This file is part of SpriteGenerator.
*
* SpriteGenerator 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.
*
* SpriteGenerator 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 SpriteGenerator. If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/
#ifndef PREVIEWPAGE_H
#define PREVIEWPAGE_H
#include <QtCore>
#include <memory>
#include "cssspriteelementimage.h"
#include "version.h"
class PreviewPage {
public:
static QByteArray create ( QList<CssSpriteElementImage> images, QString prefix );
static QByteArray createCssOnly ( QList<CssSpriteElementImage> images, QString prefix );
static QString styleName ( QString fileName, QString prefix );
private:
PreviewPage ( QList<CssSpriteElementImage> images, QString prefix );
~PreviewPage();
QByteArray create ();
QByteArray generateCss ();
QString _prefix;
QString * _outPuffer;
QList<CssSpriteElementImage> _images;
};
#endif // PREVIEWPAGE_H
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
#include <gdk/gdk.h>
#include "sysmon.h"
AwnApplet* awn_applet_factory_initp(const gchar * name, gchar* uid, gint panel_id)
{
AwnApplet *applet = AWN_APPLET(awn_sysmon_new(name,uid,panel_id));
return applet;
}
|
/*******************************************************************************
* Copyright (c) 2012 Hoang-Vu Dang <danghvu@gmail.com>
* This file is part of mod_dumpost
*
* mod_dumpost 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.
*
* mod_dumpost 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 mod_dumpost. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef __MOD_DUMPOST__
#define __MOD_DUMPOST__
#define DEFAULT_MAX_SIZE 1024*1024
#define min(a,b) (a)<(b)?(a):(b)
#define CREATEMODE ( APR_UREAD | APR_UWRITE | APR_GREAD )
typedef struct dumpost_cfg_t {
apr_pool_t *pool;
apr_size_t max_size;
apr_array_header_t *headers;
char *file;
} dumpost_cfg_t;
typedef struct {
apr_pool_t *mp;
int log_size;
int log_is_full;
int header_printed;
char *buffer;
apr_file_t *fd;
} request_state;
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.