text
stringlengths 4
6.14k
|
|---|
/*
* Copyright (c) 2017 Chen-Yu Tsai. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/clk-provider.h>
#include <linux/clk/sunxi-ng.h>
#include "ccu_common.h"
/**
* sunxi_ccu_set_mmc_timing_mode: Configure the MMC clock timing mode
* @clk: clock to be configured
* @new_mode: true for new timing mode introduced in A83T and later
*
* Returns 0 on success, -ENOTSUPP if the clock does not support
* switching modes.
*/
int sunxi_ccu_set_mmc_timing_mode(struct clk *clk, bool new_mode)
{
struct clk_hw *hw = __clk_get_hw(clk);
struct ccu_common *cm = hw_to_ccu_common(hw);
unsigned long flags;
u32 val;
if (!(cm->features & CCU_FEATURE_MMC_TIMING_SWITCH))
return -ENOTSUPP;
spin_lock_irqsave(cm->lock, flags);
val = readl(cm->base + cm->reg);
if (new_mode)
val |= CCU_MMC_NEW_TIMING_MODE;
else
val &= ~CCU_MMC_NEW_TIMING_MODE;
writel(val, cm->base + cm->reg);
spin_unlock_irqrestore(cm->lock, flags);
return 0;
}
EXPORT_SYMBOL_GPL(sunxi_ccu_set_mmc_timing_mode);
/**
* sunxi_ccu_set_mmc_timing_mode: Get the current MMC clock timing mode
* @clk: clock to query
*
* Returns 0 if the clock is in old timing mode, > 0 if it is in
* new timing mode, and -ENOTSUPP if the clock does not support
* this function.
*/
int sunxi_ccu_get_mmc_timing_mode(struct clk *clk)
{
struct clk_hw *hw = __clk_get_hw(clk);
struct ccu_common *cm = hw_to_ccu_common(hw);
if (!(cm->features & CCU_FEATURE_MMC_TIMING_SWITCH))
return -ENOTSUPP;
return !!(readl(cm->base + cm->reg) & CCU_MMC_NEW_TIMING_MODE);
}
EXPORT_SYMBOL_GPL(sunxi_ccu_get_mmc_timing_mode);
|
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec -ansi" } */
/* PR 16155
* Compilation of a simple altivec test program fails if the -ansi flag is
* given to gcc, when compiling with -maltivec.
*/
#include <altivec.h>
void foo(void)
{
vector unsigned short a, b;
a = vec_splat(b, 0);
}
/* { dg-bogus "parse error before \"typeof\"" "-maltivec -mansi" { target powerpc*-*-* } 0 } */
|
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
* 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
*/
#ifndef AVUTIL_MD5_H
#define AVUTIL_MD5_H
#include <stdint.h>
extern const int av_md5_size;
struct AVMD5;
void av_md5_init(struct AVMD5 *ctx);
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
#endif /* AVUTIL_MD5_H */
|
int __atomic_readv_replacement(unsigned char iov_len, int count, int i) {
unsigned char bytes = 0;
if ((unsigned char)((char)127 - bytes) < iov_len)
return 22;
return 0;
}
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* v4l2-i2c - I2C helpers for Video4Linux2
*/
#include <linux/i2c.h>
#include <linux/module.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
void v4l2_i2c_subdev_unregister(struct v4l2_subdev *sd)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
/*
* We need to unregister the i2c client
* explicitly. We cannot rely on
* i2c_del_adapter to always unregister
* clients for us, since if the i2c bus is a
* platform bus, then it is never deleted.
*
* Device tree or ACPI based devices must not
* be unregistered as they have not been
* registered by us, and would not be
* re-created by just probing the V4L2 driver.
*/
if (client && !client->dev.of_node && !client->dev.fwnode)
i2c_unregister_device(client);
}
void v4l2_i2c_subdev_set_name(struct v4l2_subdev *sd,
struct i2c_client *client,
const char *devname, const char *postfix)
{
if (!devname)
devname = client->dev.driver->name;
if (!postfix)
postfix = "";
snprintf(sd->name, sizeof(sd->name), "%s%s %d-%04x", devname, postfix,
i2c_adapter_id(client->adapter), client->addr);
}
EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_set_name);
void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
const struct v4l2_subdev_ops *ops)
{
v4l2_subdev_init(sd, ops);
sd->flags |= V4L2_SUBDEV_FL_IS_I2C;
/* the owner is the same as the i2c_client's driver owner */
sd->owner = client->dev.driver->owner;
sd->dev = &client->dev;
/* i2c_client and v4l2_subdev point to one another */
v4l2_set_subdevdata(sd, client);
i2c_set_clientdata(client, sd);
v4l2_i2c_subdev_set_name(sd, client, NULL, NULL);
}
EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
/* Load an i2c sub-device. */
struct v4l2_subdev
*v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
struct i2c_board_info *info,
const unsigned short *probe_addrs)
{
struct v4l2_subdev *sd = NULL;
struct i2c_client *client;
if (!v4l2_dev)
return NULL;
request_module(I2C_MODULE_PREFIX "%s", info->type);
/* Create the i2c client */
if (info->addr == 0 && probe_addrs)
client = i2c_new_scanned_device(adapter, info, probe_addrs,
NULL);
else
client = i2c_new_client_device(adapter, info);
/*
* Note: by loading the module first we are certain that c->driver
* will be set if the driver was found. If the module was not loaded
* first, then the i2c core tries to delay-load the module for us,
* and then c->driver is still NULL until the module is finally
* loaded. This delay-load mechanism doesn't work if other drivers
* want to use the i2c device, so explicitly loading the module
* is the best alternative.
*/
if (!i2c_client_has_driver(client))
goto error;
/* Lock the module so we can safely get the v4l2_subdev pointer */
if (!try_module_get(client->dev.driver->owner))
goto error;
sd = i2c_get_clientdata(client);
/*
* Register with the v4l2_device which increases the module's
* use count as well.
*/
if (v4l2_device_register_subdev(v4l2_dev, sd))
sd = NULL;
/* Decrease the module use count to match the first try_module_get. */
module_put(client->dev.driver->owner);
error:
/*
* If we have a client but no subdev, then something went wrong and
* we must unregister the client.
*/
if (!IS_ERR(client) && !sd)
i2c_unregister_device(client);
return sd;
}
EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);
struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
const char *client_type,
u8 addr,
const unsigned short *probe_addrs)
{
struct i2c_board_info info;
/*
* Setup the i2c board info with the device type and
* the device address.
*/
memset(&info, 0, sizeof(info));
strscpy(info.type, client_type, sizeof(info.type));
info.addr = addr;
return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info,
probe_addrs);
}
EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev);
/* Return i2c client address of v4l2_subdev. */
unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
return client ? client->addr : I2C_CLIENT_END;
}
EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_addr);
/*
* Return a list of I2C tuner addresses to probe. Use only if the tuner
* addresses are unknown.
*/
const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type)
{
static const unsigned short radio_addrs[] = {
#if IS_ENABLED(CONFIG_MEDIA_TUNER_TEA5761)
0x10,
#endif
0x60,
I2C_CLIENT_END
};
static const unsigned short demod_addrs[] = {
0x42, 0x43, 0x4a, 0x4b,
I2C_CLIENT_END
};
static const unsigned short tv_addrs[] = {
0x42, 0x43, 0x4a, 0x4b, /* tda8290 */
0x60, 0x61, 0x62, 0x63, 0x64,
I2C_CLIENT_END
};
switch (type) {
case ADDRS_RADIO:
return radio_addrs;
case ADDRS_DEMOD:
return demod_addrs;
case ADDRS_TV:
return tv_addrs;
case ADDRS_TV_WITH_DEMOD:
return tv_addrs + 4;
}
return NULL;
}
EXPORT_SYMBOL_GPL(v4l2_i2c_tuner_addrs);
|
/* Compiler options:
#notarget: cris*-*-elf
#cc: additional_flags=-pthread
#output: abb ok\n
Testing a pthread corner case. Output will change with glibc
releases. */
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
static void *
process (void *arg)
{
int i;
if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL) != 0)
abort ();
write (2, "a", 1);
for (i = 0; i < 10; i++)
{
sched_yield ();
pthread_testcancel ();
write (2, "b", 1);
}
return NULL;
}
int
main (void)
{
int retcode;
pthread_t th_a;
void *retval;
retcode = pthread_create (&th_a, NULL, process, NULL);
sched_yield ();
sched_yield ();
sched_yield ();
sched_yield ();
retcode = pthread_cancel (th_a);
retcode = pthread_join (th_a, &retval);
if (retcode != 0)
abort ();
fprintf (stderr, " ok\n");
return 0;
}
|
#ifndef _LINUX_KERNEL_STAT_H
#define _LINUX_KERNEL_STAT_H
#include <linux/smp.h>
#include <linux/threads.h>
#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <linux/interrupt.h>
#include <asm/irq.h>
#include <asm/cputime.h>
/*
* 'kernel_stat.h' contains the definitions needed for doing
* some kernel statistics (CPU usage, context switches ...),
* used by rstatd/perfmeter
*/
struct cpu_usage_stat {
cputime64_t user;
cputime64_t nice;
cputime64_t system;
cputime64_t softirq;
cputime64_t irq;
cputime64_t idle;
cputime64_t iowait;
cputime64_t steal;
cputime64_t guest;
};
struct kernel_stat {
struct cpu_usage_stat cpustat;
#ifndef CONFIG_GENERIC_HARDIRQS
unsigned int irqs[NR_IRQS];
#endif
unsigned int softirqs[NR_SOFTIRQS];
};
DECLARE_PER_CPU(struct kernel_stat, kstat);
#define kstat_cpu(cpu) per_cpu(kstat, cpu)
/* Must have preemption disabled for this to be meaningful. */
#define kstat_this_cpu __get_cpu_var(kstat)
extern unsigned long long nr_context_switches(void);
#ifndef CONFIG_GENERIC_HARDIRQS
#define kstat_irqs_this_cpu(irq) \
(kstat_this_cpu.irqs[irq])
struct irq_desc;
static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
struct irq_desc *desc)
{
kstat_this_cpu.irqs[irq]++;
}
static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
{
return kstat_cpu(cpu).irqs[irq];
}
#else
#include <linux/irq.h>
extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
#define kstat_irqs_this_cpu(DESC) \
((DESC)->kstat_irqs[smp_processor_id()])
#define kstat_incr_irqs_this_cpu(irqno, DESC) \
((DESC)->kstat_irqs[smp_processor_id()]++)
#endif
static inline void kstat_incr_softirqs_this_cpu(unsigned int irq)
{
kstat_this_cpu.softirqs[irq]++;
}
static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
{
return kstat_cpu(cpu).softirqs[irq];
}
/*
* Number of interrupts per specific IRQ source, since bootup
*/
static inline unsigned int kstat_irqs(unsigned int irq)
{
unsigned int sum = 0;
int cpu;
for_each_possible_cpu(cpu)
sum += kstat_irqs_cpu(irq, cpu);
return sum;
}
/*
* Lock/unlock the current runqueue - to extract task statistics:
*/
extern unsigned long long task_delta_exec(struct task_struct *);
extern void account_user_time(struct task_struct *, cputime_t, cputime_t);
extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t);
extern void account_steal_time(cputime_t);
extern void account_idle_time(cputime_t);
extern void account_process_tick(struct task_struct *, int user);
extern void account_steal_ticks(unsigned long ticks);
extern void account_idle_ticks(unsigned long ticks);
#endif /* _LINUX_KERNEL_STAT_H */
|
/*
* Copyright (C) ST-Ericsson SA 2011
*
* License Terms: GNU General Public License v2
* Author: Mattias Wallin <mattias.wallin@stericsson.com> for ST-Ericsson
*/
#include <linux/io.h>
#include <linux/errno.h>
#include <linux/clksrc-dbx500-prcmu.h>
#include <asm/localtimer.h>
#include <plat/mtu.h>
#include <mach/setup.h>
#include <mach/hardware.h>
static void __init ux500_timer_init(void)
{
void __iomem *prcmu_timer_base;
if (cpu_is_u5500()) {
#ifdef CONFIG_LOCAL_TIMERS
twd_base = __io_address(U5500_TWD_BASE);
#endif
mtu_base = __io_address(U5500_MTU0_BASE);
prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE);
} else if (cpu_is_u8500()) {
#ifdef CONFIG_LOCAL_TIMERS
twd_base = __io_address(U8500_TWD_BASE);
#endif
mtu_base = __io_address(U8500_MTU0_BASE);
prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
} else {
ux500_unknown_soc();
}
/*
* Here we register the timerblocks active in the system.
* Localtimers (twd) is started when both cpu is up and running.
* MTU register a clocksource, clockevent and sched_clock.
* Since the MTU is located in the VAPE power domain
* it will be cleared in sleep which makes it unsuitable.
* We however need it as a timer tick (clockevent)
* during boot to calibrate delay until twd is started.
* RTC-RTT have problems as timer tick during boot since it is
* depending on delay which is not yet calibrated. RTC-RTT is in the
* always-on powerdomain and is used as clockevent instead of twd when
* sleeping.
* The PRCMU timer 4(3 for DB5500) register a clocksource and
* sched_clock with higher rating then MTU since is always-on.
*
*/
nmdk_timer_init();
clksrc_dbx500_prcmu_init(prcmu_timer_base);
}
static void ux500_timer_reset(void)
{
nmdk_clkevt_reset();
nmdk_clksrc_reset();
}
struct sys_timer ux500_timer = {
.init = ux500_timer_init,
.resume = ux500_timer_reset,
};
|
/*
* Copyright (C) 1999-2013, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: epivers.h.in,v 13.33 2010-09-08 22:08:53 csm Exp $
*
*/
#ifndef _epivers_h_
#define _epivers_h_
#define EPI_MAJOR_VERSION 1
#define EPI_MINOR_VERSION 88
#define EPI_RC_NUMBER 45
#define EPI_INCREMENTAL_NUMBER 0
#define EPI_BUILD_NUMBER 0
#define EPI_VERSION 1, 88, 45, 0
#define EPI_VERSION_NUM 0x01582d00
#define EPI_VERSION_DEV 1.88.45
/* Driver Version String, ASCII, 32 chars max */
#ifdef BCMINTERNAL
#define EPI_VERSION_STR "1.88.45 (r BCMINT)"
#else
#ifdef WLTEST
#define EPI_VERSION_STR "1.88.45 (r WLTEST)"
#else
#define EPI_VERSION_STR "1.88.45 (r)"
#endif
#endif /* BCMINTERNAL */
#endif /* _epivers_h_ */
|
/*
* Device Tree support for Allwinner A1X SoCs
*
* Copyright (C) 2012 Maxime Ripard
*
* Maxime Ripard <maxime.ripard@free-electrons.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/io.h>
#include <linux/reboot.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/system_misc.h>
#include "common.h"
#define SUN4I_WATCHDOG_CTRL_REG 0x00
#define SUN4I_WATCHDOG_CTRL_RESTART BIT(0)
#define SUN4I_WATCHDOG_MODE_REG 0x04
#define SUN4I_WATCHDOG_MODE_ENABLE BIT(0)
#define SUN4I_WATCHDOG_MODE_RESET_ENABLE BIT(1)
#define SUN6I_WATCHDOG1_IRQ_REG 0x00
#define SUN6I_WATCHDOG1_CTRL_REG 0x10
#define SUN6I_WATCHDOG1_CTRL_RESTART BIT(0)
#define SUN6I_WATCHDOG1_CONFIG_REG 0x14
#define SUN6I_WATCHDOG1_CONFIG_RESTART BIT(0)
#define SUN6I_WATCHDOG1_CONFIG_IRQ BIT(1)
#define SUN6I_WATCHDOG1_MODE_REG 0x18
#define SUN6I_WATCHDOG1_MODE_ENABLE BIT(0)
static void __iomem *wdt_base;
static void sun4i_restart(enum reboot_mode mode, const char *cmd)
{
if (!wdt_base)
return;
/* Enable timer and set reset bit in the watchdog */
writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
wdt_base + SUN4I_WATCHDOG_MODE_REG);
/*
* Restart the watchdog. The default (and lowest) interval
* value for the watchdog is 0.5s.
*/
writel(SUN4I_WATCHDOG_CTRL_RESTART, wdt_base + SUN4I_WATCHDOG_CTRL_REG);
while (1) {
mdelay(5);
writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
wdt_base + SUN4I_WATCHDOG_MODE_REG);
}
}
static void sun6i_restart(enum reboot_mode mode, const char *cmd)
{
if (!wdt_base)
return;
/* Disable interrupts */
writel(0, wdt_base + SUN6I_WATCHDOG1_IRQ_REG);
/* We want to disable the IRQ and just reset the whole system */
writel(SUN6I_WATCHDOG1_CONFIG_RESTART,
wdt_base + SUN6I_WATCHDOG1_CONFIG_REG);
/* Enable timer. The default and lowest interval value is 0.5s */
writel(SUN6I_WATCHDOG1_MODE_ENABLE,
wdt_base + SUN6I_WATCHDOG1_MODE_REG);
/* Restart the watchdog. */
writel(SUN6I_WATCHDOG1_CTRL_RESTART,
wdt_base + SUN6I_WATCHDOG1_CTRL_REG);
while (1) {
mdelay(5);
writel(SUN6I_WATCHDOG1_MODE_ENABLE,
wdt_base + SUN6I_WATCHDOG1_MODE_REG);
}
}
static struct of_device_id sunxi_restart_ids[] = {
{ .compatible = "allwinner,sun4i-wdt" },
{ .compatible = "allwinner,sun6i-wdt" },
{ /*sentinel*/ }
};
static void sunxi_setup_restart(void)
{
struct device_node *np;
np = of_find_matching_node(NULL, sunxi_restart_ids);
if (WARN(!np, "unable to setup watchdog restart"))
return;
wdt_base = of_iomap(np, 0);
WARN(!wdt_base, "failed to map watchdog base address");
}
static void __init sunxi_dt_init(void)
{
sunxi_setup_restart();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
static const char * const sunxi_board_dt_compat[] = {
"allwinner,sun4i-a10",
"allwinner,sun5i-a10s",
"allwinner,sun5i-a13",
NULL,
};
DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
.init_machine = sunxi_dt_init,
.dt_compat = sunxi_board_dt_compat,
.restart = sun4i_restart,
MACHINE_END
static const char * const sun6i_board_dt_compat[] = {
"allwinner,sun6i-a31",
NULL,
};
extern void __init sun6i_reset_init(void);
static void __init sun6i_timer_init(void)
{
of_clk_init(NULL);
sun6i_reset_init();
clocksource_of_init();
}
DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
.init_machine = sunxi_dt_init,
.init_time = sun6i_timer_init,
.dt_compat = sun6i_board_dt_compat,
.restart = sun6i_restart,
.smp = smp_ops(sun6i_smp_ops),
MACHINE_END
static const char * const sun7i_board_dt_compat[] = {
"allwinner,sun7i-a20",
NULL,
};
DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
.init_machine = sunxi_dt_init,
.dt_compat = sun7i_board_dt_compat,
.restart = sun4i_restart,
MACHINE_END
|
/* Copyright 2014-2016, Mansour Moufid <mansourmoufid@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#if !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200112L
#endif
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "randombytes.h"
#if !defined(RANDOMBYTES_FILE)
#define RANDOMBYTES_FILE "/dev/urandom"
#endif
/*@ requires \valid((char *) buf);
requires nbyte <= SSIZE_MAX;
behavior success:
assigns *((char *)buf + (0 .. nbyte - 1)) \from fd, nbyte;
ensures 0 <= \result <= nbyte;
behavior failure:
ensures \result < 0;
assigns \nothing;
complete behaviors success, failure;
disjoint behaviors success, failure;
*/
ssize_t read(int fd, void *buf, size_t nbyte);
/*@
assigns \result \from seconds;
*/
unsigned int sleep(unsigned int seconds);
/*@
assigns \result \from fildes, cmd;
*/
int fcntl(int fildes, int cmd, ...);
/*@
requires fd >= 0;
requires \valid(out + (0 .. nbytes - 1));
requires out != \null;
requires nbytes > 0;
assigns out[0 .. nbytes - 1];
assigns errno;
*/
static inline int
read_all(const int fd, unsigned char *out, const size_t nbytes)
{
ssize_t i;
size_t n;
assert(fd >= 0);
assert(out != NULL);
assert(nbytes > 0);
if (nbytes > (size_t) SSIZE_MAX) {
errno = EINVAL;
goto error;
}
n = 0;
/*@
loop invariant nbytes;
loop invariant nbytes >= n;
loop assigns i, n, errno, out[n .. nbytes - 1 - n];
*/
do {
/*@ assert nbytes - n <= SSIZE_MAX; */
errno = 0;
if ((i = read(fd, out + n, nbytes - n)) < 0) {
if (errno == EAGAIN) {
(void) sleep(1);
continue;
}
break;
}
/*@ assert i >= 0; */
/*@ assert n + i <= SIZE_MAX; */
n += (size_t) i;
} while (n < nbytes);
if (errno != 0) {
goto error;
}
return 0;
error:
return 1;
}
static int random_fd = -1;
/*@
assigns \result \from fd;
*/
static inline int
set_nonblock(const int fd)
{
int flags;
if ((flags = fcntl(fd, F_GETFL)) < 0) {
goto error;
}
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
goto error;
}
return 0;
error:
return 1;
}
/*@
assigns random_fd;
ensures \result == 0 && random_fd >= 0 || \result == 1;
*/
static inline int
randombytes_unix_init(void)
{
if (random_fd < 0) {
if ((random_fd = open(RANDOMBYTES_FILE, O_RDONLY)) < 0) {
goto error;
}
if (set_nonblock(random_fd) != 0) {
goto error;
}
}
return 0;
error:
return 1;
}
/*@
assigns random_fd;
ensures \result == 0 && random_fd >= 0 || \result == 1;
*/
int
randombytes_init(void)
{
return randombytes_unix_init();
}
/*@
requires \valid(out + (0 .. nbytes - 1));
requires out != \null;
requires nbytes > 0;
requires random_fd >= 0;
assigns out[0 .. nbytes - 1];
assigns errno;
*/
static int
randombytes_unix(unsigned char *out, const size_t nbytes)
{
assert(out != NULL);
assert(nbytes > 0);
assert(random_fd >= 0);
if (read_all(random_fd, out, nbytes) != 0) {
goto error;
}
return 0;
error:
return 1;
}
/*@
requires \valid(out + (0 .. nbytes - 1));
assigns errno, random_fd;
assigns out[0 .. nbytes - 1];
*/
int
randombytes(unsigned char *out, const size_t nbytes)
{
if (out == NULL || nbytes == 0) {
errno = EINVAL;
goto error;
}
if (randombytes_init() != 0) {
goto error;
}
return randombytes_unix(out, nbytes);
error:
return 1;
}
|
/*
* Copyright (c) 2012-2013 Stanford University
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* RWLock Include
* Copyright (c) 2005 Ali Mashtizadeh
* All rights reserved.
*/
#ifndef __RWLOCK_H__
#define __RWLOCK_H__
#include <stdint.h>
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) \
|| defined(__NetBSD__)
#include <pthread.h>
#elif defined(_WIN32)
#include <windows.h>
#else
#error "UNSUPPORTED OS"
#endif
#include <vector>
#include <map>
#include "thread.h"
#include "mutex.h"
class RWLock;
struct RWKey {
typedef std::shared_ptr<RWKey> sp;
virtual ~RWKey() { };
};
struct ReaderKey : public RWKey {
protected:
ReaderKey(RWLock *l = NULL);
public:
virtual ~ReaderKey();
private:
RWLock *lock;
friend class RWLock;
};
struct WriterKey : public RWKey {
protected:
WriterKey(RWLock *l = NULL);
public:
virtual ~WriterKey();
private:
RWLock *lock;
friend class RWLock;
};
class RWLock
{
public:
RWLock();
~RWLock();
RWKey::sp readLock();
RWKey::sp tryReadLock();
void readUnlock();
RWKey::sp writeLock();
RWKey::sp tryWriteLock();
void writeUnlock();
// bool locked();
typedef std::vector<uint32_t> LockOrderVector;
static void setLockOrder(const LockOrderVector &order);
///^ lock orderings cannot be changed once set
uint32_t lockNum;
private:
static Mutex gOrderMutex;
static uint32_t gLockNum;
static std::map<uint32_t, size_t> gLockNumToOrdering;
static std::vector<LockOrderVector> gLockOrderings;
static std::map<uint32_t, threadid_t> gLockedBy;
void _checkLockOrdering();
void _updateLocked();
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) \
|| defined(__NetBSD__)
pthread_rwlock_t lockHandle;
#elif defined(_WIN32)
SRWLOCK lockHandle;
#else
#error "UNSUPPORTED OS"
#endif
};
#endif /* __RWLOCK_H__ */
|
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
inline const char * bool_to_str (const bool);
inline const char * charptr_to_str (const char * const);
enum Verbosity {
Quiet,
Verbose,
Debug
};
struct pet_opts_t {
char * input_fn; /* input filename */
FILE * input_fd; /* input file desc. */
char * output_fn; /* output filename */
FILE * output_fd; /* output file desc. */
enum Verbosity verbose;
bool show_about;
bool show_help;
};
static char * pet_about =
"PET - Personal Expense Tracker - v0.1\n"
"Licensed under the BSD 3-clause license\n"
"Fred Morcos <fred.morcos@gmail.com>\n"
"https://github.com/fredmorcos/pet.git";
static char * pet_help =
"Usage: pet [arguments]\n"
"\n"
"Arguments:\n"
" -q Do not output extra info [Default]\n"
" -v Verbose output\n"
" -d Output extra and debug info\n"
"\n"
" -V Show info about PET\n"
" -h Show this help\n"
"\n"
" -i <FILE> Use FILE as input [Default: stdin]\n"
" -o <FILE> Use FILE as output [Default: stdout]";
void pet_opts_init_default (struct pet_opts_t * const opts) {
assert(opts != NULL);
opts->input_fn = "<stdin>";
opts->input_fd = stdin;
opts->output_fn = "<stdout>";
opts->output_fd = stdout;
opts->verbose = Quiet;
opts->show_about = false;
opts->show_help = false;
}
const char * verbose_level_str (const enum Verbosity v) {
switch (v) {
case Quiet:
return "Quiet";
break;
case Verbose:
return "Verbose";
break;
case Debug:
return "Debug";
break;
default:
return "<UNKNOWN>";
break;
}
}
const char * bool_to_str (const bool v) {
return v ? "Yes" : "No";
}
const char * charptr_to_str (const char * const v) {
/* should never be called with NULL. but just in case it is and
* debugging is disabled (where also assertions are disabled), do
* not crash but instead return a string indicating a NULL.
*/
assert(v != NULL);
return v == NULL ? "<NULL>" : v;
}
void pet_opts_print (const struct pet_opts_t * const opts) {
assert(opts != NULL);
fprintf(stderr, "Pet Options:\n");
fprintf(stderr, " Input filename : %s\n", charptr_to_str(opts->input_fn));
fprintf(stderr, " Output filename: %s\n", charptr_to_str(opts->output_fn));
fprintf(stderr, " Verbosity : %s\n", verbose_level_str(opts->verbose));
fprintf(stderr, " Show `About` : %s\n", bool_to_str(opts->show_about));
fprintf(stderr, " Show `Help` : %s\n", bool_to_str(opts->show_help));
}
bool pet_opts_parse(int argc, char ** argv, struct pet_opts_t * const opts) {
int arg_inc = 0;
if (argc <= 0) {
return true;
}
assert(argv != NULL);
assert(opts != NULL);
if (strcmp(*argv, "-i") == 0) {
arg_inc++;
if (argc <= 1) {
fprintf(stderr, "Missing argument for `%s`. See help.\n", *argv);
return false;
} else {
argv++;
if (strcmp(*argv, "-") == 0) {
opts->input_fn = "<stdin>";
opts->input_fd = stdin;
} else {
opts->input_fn = *argv;
}
arg_inc++;
}
} else if (strcmp(*argv, "-o") == 0) {
arg_inc++;
if (argc <= 1) {
fprintf(stderr, "Missing argument for `%s`. See help.\n", *argv);
return false;
} else {
argv++;
if (strcmp(*argv, "-") == 0) {
opts->output_fn = "<stdout>";
opts->output_fd = stdout;
} else {
opts->output_fn = *argv;
}
arg_inc++;
}
} else if (strcmp(*argv, "-q") == 0) {
arg_inc++;
opts->verbose = Quiet;
} else if (strcmp(*argv, "-v") == 0) {
arg_inc++;
opts->verbose = Verbose;
} else if (strcmp(*argv, "-d") == 0) {
arg_inc++;
opts->verbose = Debug;
} else if (strcmp(*argv, "-V") == 0) {
arg_inc++;
opts->show_about = true;
} else if (strcmp(*argv, "-h") == 0) {
arg_inc++;
opts->show_help = true;
} else {
fprintf(stderr, "Unknown argument `%s`. See help.\n", *argv);
return false;
}
return pet_opts_parse(argc - arg_inc, argv + arg_inc, opts);
}
int main (int argc, char ** argv) {
struct pet_opts_t opts;
pet_opts_init_default(&opts);
if (!pet_opts_parse(argc - 1, argv + 1, &opts)) {
return EXIT_FAILURE;
}
assert(opts.input_fn != NULL);
assert(opts.input_fd != NULL);
assert(opts.output_fn != NULL);
assert(opts.output_fd != NULL);
if (opts.verbose == Debug) {
pet_opts_print(&opts);
}
if (opts.show_about) {
if (opts.verbose == Debug) {
fprintf(stderr, "\n");
}
puts(pet_about);
}
if (opts.show_help) {
if (opts.show_about) {
puts("");
}
puts(pet_help);
}
return EXIT_SUCCESS;
}
|
/* $OpenBSD: aac_tables.h,v 1.5 2009/03/06 07:28:10 grange Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2000 BSDi
* Copyright (c) 2000 Niklas Hallqvist
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD: /c/ncvs/src/sys/dev/aac/aac_tables.h,v 1.1 2000/09/13 03:20:34 msmith Exp $
*/
/*
* Status codes for block read/write commands, etc.
*
* XXX many of these would not normally be returned, as they are
* relevant only to FSA operations.
*/
const struct aac_code_lookup aac_command_status_table[] = {
{ "OK", 0 },
{ "operation not permitted", 1 },
{ "not found", 2 },
{ "I/O error", 5 },
{ "device not configured", 6 },
{ "too big", 7 },
{ "permission denied", 13 },
{ "file exists", 17 },
{ "cross-device link", 18 },
{ "operation not supported by device", 19 },
{ "not a directory", 20 },
{ "is a directory", 21 },
{ "invalid argument", 22 },
{ "file too large", 27 },
{ "no space on device", 28 },
{ "readonly filesystem", 30 },
{ "too many links", 31 },
{ "operation would block", 35 },
{ "file name too long", 63 },
{ "directory not empty", 66 },
{ "quota exceeded", 69 },
{ "stale file handle", 70 },
{ "too many levels of remote in path", 71 },
{ "bad file handle", 10001 },
{ "not sync", 10002 },
{ "bad cookie", 10003 },
{ "operation not supported", 10004 },
{ "too small", 10005 },
{ "server fault", 10006 },
{ "bad type", 10007 },
{ "jukebox", 10008 },
{ "not mounted", 10009 },
{ "in maintenace mode", 10010 },
{ "stale ACL", 10011 },
{ NULL, 0 },
{ "unknown command status", 0 }
};
#define AAC_COMMAND_STATUS(x) aac_describe_code(aac_command_status_table, x)
static struct aac_code_lookup aac_cpu_variant[] = {
{ "i960JX", CPUI960_JX },
{ "i960CX", CPUI960_CX },
{ "i960HX", CPUI960_HX },
{ "i960RX", CPUI960_RX },
{ "StrongARM SA110", CPUARM_SA110 },
{ "MPC824x", CPUMPC_824x },
{ "Unknown StrongARM", CPUARM_xxx },
{ "Unknown PowerPC", CPUPPC_xxx },
{ "Intel GC80302 IOP", CPUI960_302},
{ "XScale 80321", CPU_XSCALE_80321 },
{ "MIPS 4KC", CPU_MIPS_4KC },
{ "MIPS 5KC", CPU_MIPS_5KC },
{ NULL, 0 },
{ "Unknown processor", 0 }
};
static struct aac_code_lookup aac_battery_platform[] = {
{ "required battery present", PLATFORM_BAT_REQ_PRESENT },
{ "REQUIRED BATTERY NOT PRESENT", PLATFORM_BAT_REQ_NOTPRESENT },
{ "optional battery present", PLATFORM_BAT_OPT_PRESENT },
{ "optional battery not installed", PLATFORM_BAT_OPT_NOTPRESENT },
{ "no battery support", PLATFORM_BAT_NOT_SUPPORTED },
{ NULL, 0 },
{ "unknown battery platform", 0 }
};
#if 0
static struct aac_code_lookup aac_container_types[] = {
{ "Volume", CT_VOLUME },
{ "RAID 1 (Mirror)", CT_MIRROR },
{ "RAID 0 (Stripe)", CT_STRIPE },
{ "RAID 5", CT_RAID5 },
{ "SSRW", CT_SSRW },
{ "SSRO", CT_SSRO },
{ "Morph", CT_MORPH },
{ "Passthrough", CT_PASSTHRU },
{ "RAID 4", CT_RAID4 },
{ "RAID 10", CT_RAID10 },
{ "RAID 00", CT_RAID00 },
{ "Volume of Mirrors", CT_VOLUME_OF_MIRRORS },
{ "Pseudo RAID 3", CT_PSEUDO_RAID3 },
{ NULL, 0 },
{ "unknown", 0 }
};
#endif
|
//
// ViewController.h
// activeSearchDemo
//
// Created by Neil Mansilla on 11/12/12.
// Copyright (c) 2012 Mashery. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#import <CoreData/CoreData.h>
#import "Activity.h"
@class SMClient;
@class SMQuery;
@interface ViewController : UIViewController <UISearchBarDelegate, MKMapViewDelegate, NSFetchedResultsControllerDelegate> {
__weak IBOutlet UISearchBar *searchBarInstance;
__weak IBOutlet MKMapView *mapView;
NSMutableArray *activityArray;
}
@property (strong, nonatomic) SMQuery *query;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@end
|
// global.h
// created by Kuangdai on 27-Mar-2016
// global constants and macros
#pragma once
// tiny number
const float tinySingle = 1e-5f;
const double tinyDouble = 1e-10;
// solver precision
#ifdef _USE_DOUBLE
typedef double Real;
const Real tinyReal = tinyDouble;
#else
typedef float Real;
const Real tinyReal = tinySingle;
#endif
// complex
#include <complex>
typedef std::complex<Real> Complex;
typedef std::complex<double> ComplexD;
// polynomial order
#ifndef _NPOL
#define _NPOL 4
#endif
const int nPol = _NPOL;
const int nPntEdge = nPol + 1;
const int nPntElem = nPntEdge * nPntEdge;
const int nPE = nPntElem;
// constants
const Real zero = (Real)0.0;
const Real one = (Real)1.0;
const Real two = (Real)2.0;
const Real three = (Real)3.0;
const Real half = (Real)0.5;
const Real third = (Real)(1.0 / 3.0);
const Complex ii = Complex(zero, one);
const Complex czero = Complex(zero, zero);
const double pi = 3.141592653589793238463;
const double degree = pi / 180.;
const ComplexD iid = ComplexD(0., 1.);
// shorten cwiseProduct
#define schur cwiseProduct
// top-level source dir
const std::string projectDirectory = _PROJECT_DIR;
const std::string fftwWisdomDirectory = _FFTW_WISDOM_DIR;
|
// Copyright (c) 2011-2013 The Yescoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SENDCOINSENTRY_H
#define SENDCOINSENTRY_H
#include "walletmodel.h"
#include <QStackedWidget>
class WalletModel;
namespace Ui {
class SendCoinsEntry;
}
/**
* A single entry in the dialog for sending yescoins.
* Stacked widget, with different UIs for payment requests
* with a strong payee identity.
*/
class SendCoinsEntry : public QStackedWidget
{
Q_OBJECT
public:
explicit SendCoinsEntry(QWidget *parent = 0);
~SendCoinsEntry();
void setModel(WalletModel *model);
bool validate();
SendCoinsRecipient getValue();
/** Return whether the entry is still empty and unedited */
bool isClear();
void setValue(const SendCoinsRecipient &value);
void setAddress(const QString &address);
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases
* (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
*/
QWidget *setupTabChain(QWidget *prev);
void setFocus();
public slots:
void clear();
signals:
void removeEntry(SendCoinsEntry *entry);
void payAmountChanged();
private slots:
void deleteClicked();
void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
private:
SendCoinsRecipient recipient;
Ui::SendCoinsEntry *ui;
WalletModel *model;
bool updateLabel(const QString &address);
};
#endif // SENDCOINSENTRY_H
|
/*
sentinel.h - lite message bus framework for device to host functions
The MIT License
Copyright (c) 2016 Sky Morey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once
#ifndef _SENTINEL_H
#define _SENTINEL_H
#ifndef HAS_DEVICESENTINEL
#define HAS_DEVICESENTINEL 1
#endif
#ifndef HAS_HOSTSENTINEL
#define HAS_HOSTSENTINEL 1
#endif
#include <crtdefscu.h>
#include <host_defines.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SENTINEL_NAME "Sentinel" //"Global\\Sentinel"
#define SENTINEL_MAGIC (unsigned short)0xC811
#define SENTINEL_DEVICEMAPS 1
#define SENTINEL_MSGSIZE 4096
#define SENTINEL_MSGCOUNT 1
struct sentinelMessage {
bool Wait;
unsigned short OP;
int Size;
char *(*Prepare)(void*,char*,char*,intptr_t);
bool (*Postfix)(void*,intptr_t);
__device__ sentinelMessage(bool wait, unsigned short op, int size = 0, char *(*prepare)(void*,char*,char*,intptr_t) = nullptr, bool (*postfix)(void*,intptr_t) = nullptr)
: Wait(wait), OP(op), Size(size), Prepare(prepare), Postfix(postfix) { }
public:
};
#define SENTINELPREPARE(P) ((char *(*)(void*,char*,char*,intptr_t))&P)
#define SENTINELPOSTFIX(P) ((bool (*)(void*,intptr_t))&P)
typedef struct __align__(8) {
unsigned short Magic;
volatile long Control;
int Length;
#ifndef _WIN64
int Unknown;
#endif
char Data[1];
void Dump();
} sentinelCommand;
typedef struct __align__(8) {
long GetId;
volatile long SetId;
intptr_t Offset;
char Data[SENTINEL_MSGSIZE*SENTINEL_MSGCOUNT];
void Dump();
} sentinelMap;
typedef struct sentinelExecutor {
sentinelExecutor *Next;
const char *Name;
bool (*Executor)(void*,sentinelMessage*,int,char*(**)(void*,char*,char*,intptr_t));
void *Tag;
} sentinelExecutor;
typedef struct sentinelContext {
sentinelMap *DeviceMap[SENTINEL_DEVICEMAPS];
sentinelMap *HostMap;
sentinelExecutor *HostList;
sentinelExecutor *DeviceList;
} sentinelContext;
#if HAS_HOSTSENTINEL
extern sentinelMap *_sentinelHostMap;
extern intptr_t _sentinelHostMapOffset;
#endif
#if HAS_DEVICESENTINEL
extern __constant__ const sentinelMap *_sentinelDeviceMap[SENTINEL_DEVICEMAPS];
#endif
extern bool sentinelDefaultExecutor(void *tag, sentinelMessage *data, int length, char *(**hostPrepare)(void*,char*,char*,intptr_t));
extern void sentinelServerInitialize(sentinelExecutor *executor = nullptr, char *mapHostName = (char *)SENTINEL_NAME, bool hostSentinel = true, bool deviceSentinel = true);
extern void sentinelServerShutdown();
#if HAS_DEVICESENTINEL
extern __device__ void sentinelDeviceSend(sentinelMessage *msg, int msgLength);
#endif
#if HAS_HOSTSENTINEL
extern void sentinelClientInitialize(char *mapHostName = (char *)SENTINEL_NAME);
extern void sentinelClientShutdown();
extern void sentinelClientSend(sentinelMessage *msg, int msgLength);
#endif
extern sentinelExecutor *sentinelFindExecutor(const char *name, bool forDevice = true);
extern void sentinelRegisterExecutor(sentinelExecutor *exec, bool makeDefault = false, bool forDevice = true);
extern void sentinelUnregisterExecutor(sentinelExecutor *exec, bool forDevice = true);
// file-utils
extern void sentinelRegisterFileUtils();
#ifdef __cplusplus
}
#endif
#endif /* _SENTINEL_H */
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class CPushContact, MMUIViewController;
@protocol SayHelloDataLogicDelegate <NSObject>
- (void)OnSayHelloDataChange;
- (MMUIViewController *)getViewController;
@optional
- (void)OnSayHelloDataSendVerifyMsg:(CPushContact *)arg1;
- (void)OnSayHelloDataVerifyContactOK:(CPushContact *)arg1;
- (void)OnSayHelloDataUnReadCountChange;
@end
|
//
// IntroLayer.h
// Eclosion
//
// Created by Tsubasa on 13-9-1.
// Copyright __MyCompanyName__ 2013年. All rights reserved.
//
// When you import this file, you import all the cocos2d classes
#import "cocos2d.h"
// HelloWorldLayer
@interface IntroLayer : CCLayer
{
}
// returns a CCScene that contains the HelloWorldLayer as the only child
+(CCScene *) scene;
@end
|
#ifndef _CO_TYPELOADER_H_
#define _CO_TYPELOADER_H_
#include "csl/Loader.h"
#include <co/RefPtr.h>
namespace co {
class IType;
class INamespace;
class ITypeBuilder;
class ITypeManager;
class TypeManager;
/*!
Locates and loads a co::IType from a CSL file in the filesystem.
The type is identified by the fully-qualified \a typeName passed in the
constructor. The CSL file where the type is specified should reside in one of
the type repositories specified in the 'path' parameter, also in the constructor.
Please notice that a single call to loadType() may cause multiple types to be loaded,
since all dependencies of the loaded type will be automatically loaded in a
depth-first, recursive manner.
All search for dependencies and type creation is done within the context of a given
ITypeManager, which should also be passed in the constructor.
*/
class CORAL_EXPORT TypeLoader : public csl::Loader
{
public:
/*!
Creates a loader for the type with the given \a fullTypeName.
Types are looked up and created within the context of a \a typeManager.
*/
TypeLoader( const std::string& fullTypeName, ITypeManager* typeManager );
//! Destructor.
virtual ~TypeLoader();
/*!
Effectively loads the type (and its dependencies) from the filesystem.
The CSL file is parsed and any type dependencies are loaded recursively. If the
file is found in the filesystem and no error occurs while parsing the CSL files,
the loaded co::IType instance is returned. Otherwise, this method returns NULL, and
the exact error stack can be obtained through the getError() method.
\warning If any error occurs while loading a type, this method returns NULL
and all partially constructed types are rolled back.
*/
IType* loadType();
private:
// Creates a 'non-root' loader for loading typeh dependencies recursively.
TypeLoader( const std::string& fullTypeName, TypeLoader* parent );
// Returns whether this is a root loader.
inline bool isRootLoader() const { return _parentLoader == NULL; }
// Template method implementation: instantiates a ITypeBuilder for use by the Parser.
ITypeBuilder* createTypeBuilder( const std::string& typeName, TypeKind kind );
/*
Template method implementation: finds or loads a type dependency, given the
type's full or relative name. Here's the algorithm:
1) search for an imported type aliased as 'typeName';
2) search for a type named 'typeName' in the current namespace;
3) search for a type named 'typeName' in the root namespace;
4) try to load the type using the current path.
5) return NULL in case of error parsing the CSL file or if the file
is not found. Use getError() to access the error stack.
*/
IType* resolveType( const csl::location& loc, const std::string& typeName, bool isArray = false );
// Template method implementation: creates or gets a cached default annotation instance.
IAnnotation* getDefaultAnnotationInstance( IType* type );
/*
Searches an existing type with the passed \a typeName. The name can be fully qualified
or relative to the current type's location. Returns NULL if the type is not found.
*/
IType* findDependency( const std::string& typeName );
/*
Tries to load the type with the passed \a typeName. The name can be fully qualified
or relative to the current type's location. An exception is thrown if the type's CSL
file is not found. Otherwise, this method may return NULL if there's an error parsing
the CSL file.
*/
IType* loadDependency( const std::string& typeName );
// Searches for a CSL file in the Coral Path. Returns true if the file was found.
bool findCSL( const std::string& typeName, std::string& fullPath, std::string& relativePath );
private:
std::string _fullTypeName;
TypeManager* _typeManager;
TypeLoader* _parentLoader;
INamespace* _namespace;
typedef std::map<IType*, RefPtr<IAnnotation> > DefaultAnnotationMap;
DefaultAnnotationMap _defaultAnnotationInstances;
};
} // namespace co
#endif
|
#pragma once
#include <pebble.h>
//#ifdef PBL_COLOR
char* get_gbitmapformat_text(GBitmapFormat format);
const char* get_gcolor_text(GColor m_color);
void replace_gbitmap_color(GColor color_to_replace, GColor replace_with_color, GBitmap *im, BitmapLayer *bml);
void spit_gbitmap_color_palette(GBitmap *im);
bool gbitmap_color_palette_contains_color(GColor m_color, GBitmap *im);
void gbitmap_fill_all_except(GColor color_to_not_change, GColor fill_color, bool fill_gcolorclear, GBitmap *im, BitmapLayer *bml);
//#endif
|
#include "common.h"
#include "parser.h"
#include "parser_codes.h"
#include "keywords_hash.h"
static struct resword_decl {
const char *keyword;
int token_code;
} reswords_table[32] = {
"auto", lxm_auto,
"break", lxm_break,
"case", lxm_case,
"char", lxm_char,
"const", lxm_const,
"continue", lxm_continue,
"default", lxm_default,
"do", lxm_do,
"double", lxm_double,
"else", lxm_else,
"enum", lxm_enum,
"extern", lxm_extern,
"float", lxm_float,
"for", lxm_for,
"goto", lxm_goto,
"if", lxm_if,
"int", lxm_int,
"long", lxm_long,
"register", lxm_register,
"return", lxm_return,
"short", lxm_short,
"signed", lxm_signed,
"sizeof", lxm_sizeof,
"static", lxm_static,
"struct", lxm_struct,
"switch", lxm_switch,
"typedef", lxm_typedef,
"union", lxm_union,
"unsigned", lxm_unsigned,
"void", lxm_void,
"volatile", lxm_volatile,
"while", lxm_while,
};
static int equal_keywords(const char *keyword, const char *token, int token_len)
{
return (!memcmp(keyword, token, token_len) && !keyword[token_len]);
}
int keyword_lookup(const char *token, int token_len)
{
int hash_code = keywords_hash_function(token, token_len);
if (hash_code == -1 || !equal_keywords(reswords_table[hash_code].keyword, token, token_len)) {
return lxm_identifier;
} else {
return reswords_table[hash_code].token_code;
}
}
|
#version 120
void main() {
}
|
#pragma once
#include <glm/vec2.hpp>
namespace OpenGLGUI
{
struct Drawable
{
virtual void draw(glm::vec2 origin, glm::vec2 canvasSize) = 0;
};
}
|
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_TYPES_TABLET_TOOL_H
#define WLR_TYPES_TABLET_TOOL_H
#include <stdint.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_list.h>
/*
* Copy+Paste from libinput, but this should neither use libinput, nor
* tablet-unstable-v2 headers, so we can't include them
*/
enum wlr_tablet_tool_type {
/** A generic pen */
WLR_TABLET_TOOL_TYPE_PEN = 1,
/** Eraser */
WLR_TABLET_TOOL_TYPE_ERASER,
/** A paintbrush-like tool */
WLR_TABLET_TOOL_TYPE_BRUSH,
/** Physical drawing tool, e.g. Wacom Inking Pen */
WLR_TABLET_TOOL_TYPE_PENCIL,
/** An airbrush-like tool */
WLR_TABLET_TOOL_TYPE_AIRBRUSH,
/** A mouse bound to the tablet */
WLR_TABLET_TOOL_TYPE_MOUSE,
/** A mouse tool with a lens */
WLR_TABLET_TOOL_TYPE_LENS,
/** A rotary device with positional and rotation data */
WLR_TABLET_TOOL_TYPE_TOTEM,
};
struct wlr_tablet_tool {
enum wlr_tablet_tool_type type;
uint64_t hardware_serial;
uint64_t hardware_wacom;
// Capabilities
bool tilt;
bool pressure;
bool distance;
bool rotation;
bool slider;
bool wheel;
struct {
struct wl_signal destroy;
} events;
void *data;
};
struct wlr_tablet_impl;
struct wlr_tablet {
struct wlr_tablet_impl *impl;
struct {
struct wl_signal axis;
struct wl_signal proximity;
struct wl_signal tip;
struct wl_signal button;
} events;
char *name;
struct wlr_list paths; // char *
void *data;
};
enum wlr_tablet_tool_axes {
WLR_TABLET_TOOL_AXIS_X = 1 << 0,
WLR_TABLET_TOOL_AXIS_Y = 1 << 1,
WLR_TABLET_TOOL_AXIS_DISTANCE = 1 << 2,
WLR_TABLET_TOOL_AXIS_PRESSURE = 1 << 3,
WLR_TABLET_TOOL_AXIS_TILT_X = 1 << 4,
WLR_TABLET_TOOL_AXIS_TILT_Y = 1 << 5,
WLR_TABLET_TOOL_AXIS_ROTATION = 1 << 6,
WLR_TABLET_TOOL_AXIS_SLIDER = 1 << 7,
WLR_TABLET_TOOL_AXIS_WHEEL = 1 << 8,
};
struct wlr_event_tablet_tool_axis {
struct wlr_input_device *device;
struct wlr_tablet_tool *tool;
uint32_t time_msec;
uint32_t updated_axes;
// From 0..1
double x, y;
// Relative to last event
double dx, dy;
double pressure;
double distance;
double tilt_x, tilt_y;
double rotation;
double slider;
double wheel_delta;
};
enum wlr_tablet_tool_proximity_state {
WLR_TABLET_TOOL_PROXIMITY_OUT,
WLR_TABLET_TOOL_PROXIMITY_IN,
};
struct wlr_event_tablet_tool_proximity {
struct wlr_input_device *device;
struct wlr_tablet_tool *tool;
uint32_t time_msec;
// From 0..1
double x, y;
enum wlr_tablet_tool_proximity_state state;
};
enum wlr_tablet_tool_tip_state {
WLR_TABLET_TOOL_TIP_UP,
WLR_TABLET_TOOL_TIP_DOWN,
};
struct wlr_event_tablet_tool_tip {
struct wlr_input_device *device;
struct wlr_tablet_tool *tool;
uint32_t time_msec;
// From 0..1
double x, y;
enum wlr_tablet_tool_tip_state state;
};
struct wlr_event_tablet_tool_button {
struct wlr_input_device *device;
struct wlr_tablet_tool *tool;
uint32_t time_msec;
uint32_t button;
enum wlr_button_state state;
};
#endif
|
#ifndef NRG_SC_LOG_ITEM_H
#define NRG_SC_LOG_ITEM_H
#include <log_item.h>
namespace Log_viewer
{
class NRG_legacy_log_item : public Log_item
{
public:
NRG_legacy_log_item(const QString& value,
const QString& separator,
const QString& origin);
protected:
Log_type Log_type_from_string(const QString value);
};
}
#endif // NRG_SC_LOG_ITEM_H
|
//
// KLDraggableTransition.h
// Pods
//
// Created by Dara on 26/08/2016.
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol KLDraggableTransitionDelegate;
@interface KLDraggableTransition : NSObject <UIViewControllerAnimatedTransitioning, UIViewControllerInteractiveTransitioning>
+ (instancetype)transitionForViewController:(UIViewController *)viewController;
- (void)updateWithScrollView:(UIScrollView *)scrollView;
@property (strong, nonatomic, readonly) UIPanGestureRecognizer *panRecognizer;
@property (weak, nonatomic) UIViewController *viewController;
@property (weak, nonatomic) id<KLDraggableTransitionDelegate> delegate;
@property (nonatomic, readonly, getter=isInteracting) BOOL interacting;
@property (weak, nonatomic, nullable) UIScrollView *scrollView;
@property (nonatomic) NSTimeInterval duration;
@property (nonatomic) UIViewAnimationCurve animationCurve;
@end
|
//
// JEToolkit.h
// JEToolkit
//
// Copyright (c) 2013 John Rommel Estropia
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
#pragma mark - Headers
#import "JEAvailability.h"
#import "JECompilerDefines.h"
#import "JESafetyHelpers.h"
#import "JEFormulas.h"
#import "JEUIMetrics.h"
#import "JESynthesize.h"
#import "JEDispatch.h"
#pragma mark - Categories
#import "NSArray+JEToolkit.h"
#import "NSCache+JEToolkit.h"
#import "NSCalendar+JEToolkit.h"
#import "NSDate+JEToolkit.h"
#import "NSDateFormatter+JEToolkit.h"
#import "NSDictionary+JEToolkit.h"
#import "NSError+JEToolkit.h"
#import "NSIndexSet+JEToolkit.h"
#import "NSMutableArray+JEToolkit.h"
#import "NSNumber+JEToolkit.h"
#import "NSObject+JEToolkit.h"
#import "NSString+JEToolkit.h"
#import "NSURL+JEToolkit.h"
#import "NSValue+JEToolkit.h"
#import "UICollectionView+JEToolkit.h"
#import "UIColor+JEToolkit.h"
#import "UIDevice+JEToolkit.h"
#import "UIImage+JEToolkit.h"
#import "UILabel+JEToolkit.h"
#import "UINib+JEToolkit.h"
#import "UIScrollView+JEToolkit.h"
#import "UITableView+JEToolkit.h"
#import "UITextView+JEToolkit.h"
#import "UIView+JEToolkit.h"
#import "UIViewController+JEToolkit.h"
#pragma mark - Submodules
#import "JEDebugging.h"
#import "UIViewController+JEDebugging.h"
#import "JESettings.h"
#import "JEUserDefaults.h"
#import "JEKeychain.h"
#import "JEOrderedDictionary.h"
#import "JEWeakCache.h"
|
/*************************************************************************/
/* LightEngine.h */
/*************************************************************************/
/* This file is part of: */
/* Xenro Engine */
/* https://github.com/Jmiller7023/Xenro-Engine */
/*************************************************************************/
/* Copyright 11-3-2017 Joseph Miller. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef XENRO_LIGHTENGINE_DEFINED
#define XENRO_LIGHTENGINE_DEFINED
#include <glm\glm.hpp>
#include "vertex.h"
#include "SpriteBatch.h"
#include <vector>
namespace Xenro{
struct Light {
Light() {}
Light(ColorRGBA Color, glm::vec2 Pos, glm::vec2 Size);
ColorRGBA color = ColorRGBA(255,255,255,255);
glm::vec2 pos = glm::vec2(0,0);
glm::vec2 size = glm::vec2(5.0f);
};
class LightEngine {
public:
LightEngine();
~LightEngine();
//Renders a given light.
void renderLight(const Light& light);
//Render the lights to the screen.
void renderAllLights();
void addLights(std::vector<Light>& lights);
//Returns the index of the light object.
int addLight(const Light& light);
int addLight(ColorRGBA color, glm::vec2 pos, glm::vec2 size);
//Modify aspects of a particular light index.
void modifyLight(int index, ColorRGBA color, glm::vec2 pos, glm::vec2 size);
void modifyLightColor(int index, ColorRGBA color);
void modifyLightPos(int index, glm::vec2 pos);
void modifyLightSize(int index, glm::vec2 size);
//Clear all lights.
void reset();
private:
//Draws the light to the spritebatch.
void drawLight(Light light);
std::vector<Light> m_lights;
SpriteBatch m_spriteBatch;
};
}
#endif //XENRO_LIGHTENGINE_DEFINED
|
//
// AppDelegate.h
// Sample04_UsingTrackingResultSet
//
// Created by Tae Hyun Na on 2012. 3. 10.
// Copyright (c) 2014, P9 SOFT, Inc. All rights reserved.
//
// Licensed under the MIT license.
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#ifndef RIRC_STATE_H
#define RIRC_STATE_H
#include "src/components/buffer.h"
#include "src/components/channel.h"
#include "src/components/server.h"
#define FROM_INFO "--"
#define FROM_ERROR "-!!-"
#define FROM_UNKNOWN "-\?\?-"
#define FROM_JOIN ">>"
#define FROM_PART "<<"
#define FROM_QUIT "<<"
#define server_info(S, ...) \
do { newlinef((S)->channel, BUFFER_LINE_SERVER_INFO, FROM_INFO, __VA_ARGS__); } while (0)
#define server_error(S, ...) \
do { newlinef((S)->channel, BUFFER_LINE_SERVER_ERROR, FROM_ERROR, __VA_ARGS__); } while (0)
void state_init(void);
void state_term(void);
/* Get tty dimensions */
unsigned state_cols(void);
unsigned state_rows(void);
const char *action_message(void);
struct channel* channel_get_first(void);
struct channel* channel_get_last(void);
struct channel* channel_get_next(struct channel*);
struct channel* channel_get_prev(struct channel*);
struct channel* current_channel(void);
struct server_list* state_server_list(void);
void buffer_scrollback_back(struct channel*);
void buffer_scrollback_forw(struct channel*);
void channel_set_current(struct channel*);
void newlinef(struct channel*, enum buffer_line_type, const char*, const char*, ...);
#endif
|
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the LIBEFFECTS_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// LIBEFFECTS_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef LIBEFFECTS_EXPORTS
#define LIBEFFECTS_API __declspec(dllexport)
#else
#define LIBEFFECTS_API __declspec(dllimport)
#endif
// This class is exported from the libeffects.dll
class LIBEFFECTS_API Clibeffects {
public:
Clibeffects(void);
// TODO: add your methods here.
};
extern LIBEFFECTS_API int nlibeffects;
LIBEFFECTS_API int fnlibeffects(void);
|
// qxTerrainTile.h
//
// Original code: GenScape (c) 1999, Lucas Ackerman
//
// Author: Jeff Thelen
//
// Copyright 2000 Quixotic, Inc. All Rights Reserved.
//////////////////////////////////////////////////////////////////////
#ifndef qxTerrainTile_H
#define qxTerrainTile_H
class qxTerrainPoly;
class qxTerrainVert;
class qxTerrainMapBase;
#include "qxBinTriTree.h"
#include "qxTerrainPoly.h"
// a qxTerrainTile is one tile in the grid of qxBinTriTree's in a qxLandscape
/*
UL UR
*-----------*
| \ |
| \ T_R |
| \ |
| L_B \ |
| \ |
*-----------*
BL BR
*/
class qxTerrainTile //== 2 bintritree's
{
public:
qxTerrainTile(){};
qxTerrainTile(qxTerrainMapBase* Owner, qxTerrainVert* tl, qxTerrainVert* tr, qxTerrainVert* bl, qxTerrainVert* br);
~qxTerrainTile();
// return's the respective vertex
qxTerrainVert* GetTL(void) { return TL; }
qxTerrainVert* GetTR(void) { return TR; }
qxTerrainVert* GetBL(void) { return BL; }
qxTerrainVert* GetBR(void) { return BR; }
// These are only called by the TerrainMap. Here for convenience.
bool IsLBRootOut() { return (m_pBinTreeLB->m_pTerrainPolyRoot->VF_Overall == VF_OUT ); }
bool IsRTRootOut() { return (m_pBinTreeRT->m_pTerrainPolyRoot->VF_Overall == VF_OUT ); }
void LBRender() { m_pBinTreeLB->m_pTerrainPolyRoot->Render(); }
void RTRender() { m_pBinTreeRT->m_pTerrainPolyRoot->Render(); }
void LBRenderWireFrame() { m_pBinTreeLB->m_pTerrainPolyRoot->RenderWireframe(); }
void RTRenderWireFrame() { m_pBinTreeRT->m_pTerrainPolyRoot->RenderWireframe(); }
void UpdateViewFlagsLB() { m_pBinTreeLB->m_pTerrainPolyRoot->UpdateViewFlags(); }
void UpdateViewFlagsRT() { m_pBinTreeRT->m_pTerrainPolyRoot->UpdateViewFlags(); }
qxTerrainPoly* LBGetTerrainPoly() { return m_pBinTreeLB->m_pTerrainPolyRoot; }
qxTerrainPoly* RTGetTerrainPoly() { return m_pBinTreeRT->m_pTerrainPolyRoot; }
void Reset()
{
m_pBinTreeLB->m_pTerrainPolyRoot->ClearChildTree();
m_pBinTreeRT->m_pTerrainPolyRoot->ClearChildTree();
m_pBinTreeLB->m_pTerrainPolyRoot->m_pBottomNeighbor = m_pBinTreeRT->m_pTerrainPolyRoot;
m_pBinTreeRT->m_pTerrainPolyRoot->m_pBottomNeighbor = m_pBinTreeLB->m_pTerrainPolyRoot;
}
void Update()
{
m_pBinTreeRT->Update();
m_pBinTreeLB->Update();
}
/* these are for cross-linking the BinTriTree neighbor tri's
at the highest level
so the entire mesh of tiles will tesselate together.
each Link_ fn links both m_pRootTri's to each other,
so calling _Top and _Bottom
on the same 2 tri's is not necessary.
*/
void LinkTop(qxTerrainTile *tile)
{
m_pBinTreeRT->m_pTerrainPolyRoot->m_pLeftNeighbor = tile->m_pBinTreeLB->m_pTerrainPolyRoot;
tile->m_pBinTreeLB->m_pTerrainPolyRoot->m_pLeftNeighbor = m_pBinTreeRT->m_pTerrainPolyRoot;
}
void LinkBottom(qxTerrainTile *tile)
{
m_pBinTreeLB->m_pTerrainPolyRoot->m_pLeftNeighbor = tile->m_pBinTreeRT->m_pTerrainPolyRoot;
tile->m_pBinTreeRT->m_pTerrainPolyRoot->m_pLeftNeighbor = m_pBinTreeLB->m_pTerrainPolyRoot;
}
void LinkLeft(qxTerrainTile *tile)
{
m_pBinTreeLB->m_pTerrainPolyRoot->m_pRightNeighbor = tile->m_pBinTreeRT->m_pTerrainPolyRoot;
tile->m_pBinTreeRT->m_pTerrainPolyRoot->m_pRightNeighbor = m_pBinTreeLB->m_pTerrainPolyRoot;
}
void LinkRight(qxTerrainTile *tile)
{
m_pBinTreeRT->m_pTerrainPolyRoot->m_pRightNeighbor = tile->m_pBinTreeLB->m_pTerrainPolyRoot;
tile->m_pBinTreeLB->m_pTerrainPolyRoot->m_pRightNeighbor = m_pBinTreeRT->m_pTerrainPolyRoot;
}
private:
qxTerrainMapBase* m_pOwner;
qxBinTriTree* m_pBinTreeRT;
qxBinTriTree* m_pBinTreeLB;
qxTerrainVert *TL, *TR, *BL, *BR; // 4 corner vert ptrs. top/bottom left/right
};
#endif
|
//
// NSObject+Common.h
//
#import <Foundation/Foundation.h>
@interface NSObject (Common)
//成功信息
+ (void)showSuccessMsg:(NSString *)success;
//失败信息
+ (void)showErrorMsg:(NSString *)error;
@end
|
#pragma once
#include <glm\glm.hpp>
namespace vertex
{
class VertexFormat
{
public:
glm::vec3 position;
glm::vec3 normal;
glm::vec2 texture;
public:
//------------------------------ Constructors
VertexFormat();
VertexFormat(glm::vec3 position, glm::vec3 normal, glm::vec2 texture);
//------------------------------ Secondary Functions (Provide Data)
void setPosition(glm::vec3 position);
void setNormal(glm::vec3 normal);
void setTexture(glm::vec2 texture);
//------------------------------ Secondary Functions (Retrieve Data)
glm::vec3 getPosition();
glm::vec3 getNormal();
glm::vec2 getTexture();
};
}
|
/* -*- C++ -*- */
//=============================================================================
/**
* @file Asynch_Connector3.h
*
*
* @author Alexander Libman <libman@terabit.com.au>
*/
//=============================================================================
#ifndef TPROACTOR_BASECONNECTOR_H
#define TPROACTOR_BASECONNECTOR_H
#include "IOTerabit/IOTERABIT_Export.h"
#include "ace/pre.h"
#include "TProactor/Asynch_IO.h"
#include "TProactor/Monitor_T.h"
#include "ace/Synch_T.h"
#include "ace/INET_Addr.h"
namespace Terabit {
/**
* @class BaseConnector
*
* @brief This class is an example of the Connector pattern. This class
* will establish new connections and create new HANDLER objects to handle
* the new connections.
*
* Unlike the ACE_Connector, however, this class is designed to
* be used asynchronously with the ACE Proactor framework.
*/
class IOTERABIT_Export BaseConnector : public TRB_Handler
{
public:
typedef ACE_SYNCH_MUTEX Mutex;
typedef ACE_SYNCH_CONDITION Condition;
typedef Monitor_T<Mutex,Condition> Monitor;
typedef Guard_Monitor_T<Monitor> Guard_Monitor;
typedef Guard_Monitor::Save_Guard Save_Guard;
enum State
{
ST_INIT = 0x0000, // BEFORE OPEN
ST_ACTIVE = 0x0001, // OPERATIONAL
ST_CANCEL = 0x0002, // IN CANCEL
ST_CLOSED = 0x0004 // CLOSED
};
/// A do nothing constructor.
BaseConnector (void);
/// Virtual destruction
virtual ~BaseConnector (void);
/**
* This opens asynch connector
*/
virtual int open (TRB_Proactor *proactor);
/// This initiates a new asynchronous connect
virtual int connect (const ACE_INET_Addr &remote_sap,
const ACE_INET_Addr &local_sap =
ACE_INET_Addr ((u_short)0),
int reuse_addr = 1,
const void *act = 0);
/**
* Cancels all pending connects operations issued by this object.
* and close the listen handle
*
* @note On Windows, the only one way to cancel all pending
* connect operations is to close listen handel. Windows call
* CancelIO cancels only operations initiated by the calling
* thread, which is not helpfull.
* @note On UNIX, it is safe to close listen handle only after
* cancellation. TProcator will take care about all pending
* connects .
* So the portable solution is to do cancel-and-close, which is
* actually done in current implementation.
*/
virtual int cancel (void);
/**
* Waits for cancellations of all pending connects operations
* issued by this object. This method must be called to ensure
* that no more asychronous callbacks is expected and it is
* safe to delete this object.
*/
void wait (void);
int get_pending_count (void) const;
State get_state ();
private:
/// This is called when an outstanding accept completes.
virtual void handle_connect (const TRB_Asynch_Connect::Result &result);
/**
* This is the template method used to create new handler.
* Subclasses must overwrite this method if a new handler creation
* strategy is required.
* @retval -1 BaseConnector will close the connection, and
* the service will not be opened.
* @retval 0 Service opening will proceeed.
*/
virtual int on_connect_completed (const TRB_Asynch_Connect::Result& result) = 0;
private:
/// Monitor to protect state
mutable Monitor monitor_;
/// state
State state_;
/// The number of pending asynchronous accepts
int pending_count_;
/// Asynch_Connect used to make life easier :-)
TRB_Asynch_Connect asynch_connect_;
};
inline BaseConnector::State
BaseConnector::get_state ()
{
Guard_Monitor guard (monitor_);
return this->state_;
}
} //namespace Terabit
#include "ace/post.h"
#endif //TPROACTOR_BASECONNECTOR_H
|
//
// LaunchStateManager.h
// healthcoming
//
// Created by Bennett on 16/5/4.
// Copyright © 2016年 Franky. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LaunchStateManager : NSObject
@property (nonatomic,assign) BOOL firstLaunch;//是否是首次安装
@property (nonatomic,assign) BOOL everLaunch;//是否是曾经登陆过
@property (nonatomic,assign) BOOL authCompletion;//是否是授权完成
+ (instancetype)share;
@end
|
//
// MessageBox.h
// tdgame
//
// Created by Like Zhang on 3/17/13.
//
//
#ifndef __tdgame__MessageBox__
#define __tdgame__MessageBox__
#include <iostream>
#include "cocos2d.h"
#include <string>
#include <queue>
using namespace cocos2d;
using namespace std;
struct MessageIcon
{
string name;
string description;
string imagePath;
};
class MessageBox : public CCNode, public CCTouchDelegate
{
public:
virtual bool init();
CREATE_FUNC(MessageBox);
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
virtual void showMessage(const char* pImagePath, const char* message, bool pauseGame);
virtual void close();
virtual void close(CCObject * /* dummy parameter to get compile macro pass. */);
void showTextMessage(const char* message, bool pauseGame);
void showMessageWithIcons(const char* message, const vector<MessageIcon>& icons, bool pauseGame);
void showMessageIcons();
void showEnemyIntroduction(int id);
void setCallback(CCCallFunc* callback);
void resetPosition();
inline void setMessage(const char* pMessage)
{
m_pMessageToShow = pMessage;
}
inline void addMessageIcon(const MessageIcon& icon)
{
m_MessageIcons.push(icon);
}
protected:
void resetCallback();
void removeAllIcons();
CCSprite* m_pImageIcon;
CCLabelTTF* m_pTextLabel;
CCSprite* m_pBackground;
const char* m_pMessageToShow;
queue<MessageIcon> m_MessageIcons;
CCCallFunc* m_Callback;
};
#endif /* defined(__tdgame__MessageBox__) */
|
#pragma once
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <SFML\System.hpp>
#include "Definitions.h"
class Quadtree
{
int size;
std::vector<std::vector<Index>> quadtree;
// std::vector<std::vector<std::ofstream*>> quadtreeFiles;
// std::vector<std::vector<long>> quadtreeSizes;
// std::queue<sf::Vector2i> openFileQueue;
// void OpenFile(sf::Vector2i index);
// std::string GetQuadtreeFilename(int x, int y);
// std::string quadtreeFolderName;
public:
Quadtree(int size);
void InitializeQuadtree();
void AddToIndex(sf::Vector2i quadtreePos, Index index);
size_t QuadSize(sf::Vector2i quadtreePos) const;
Index GetIndexFromQuad(sf::Vector2i quadtreePos, int offset) const;
// void CreateQuadtreeFiles(std::string quadtreeFolder);
// void CloseFiles();
~Quadtree();
};
|
//
// AFZRequestReviewsRelatedToArticleWithId.h
// Pods
//
// Created by Alexander Fedosov on 27.01.16.
//
//
#import <Foundation/Foundation.h>
#import "AFZRequest.h"
#import "AFZRequestPagination.h"
@interface AFZRequestReviewsRelatedToArticleWithId : AFZRequest<AFZRequestPagination>
@property (nonatomic, strong) NSString * _Nonnull articleIdentifier;
- (instancetype _Nonnull)initWithArticleId:(NSString * _Nonnull)articleIdentifier NS_DESIGNATED_INITIALIZER;
@end
|
//
// NSManagedObject+IVGUtils.h
// IVGCoreDataUtils
//
// Created by Douglas Sjoquist on 3/28/14.
// Copyright (c) 2014 Ivy Gulch, LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
typedef void(^IVGMOObserverBlock)(id managedObject, NSString *keyPath, id oldValue, id newValue);
@interface NSManagedObject (IVGUtils)
- (void) addObserverBlock:(IVGMOObserverBlock) block forKeyPath:(NSString *)keyPath;
- (void) removeObserverBlockForKeyPath:(NSString *)keyPath;
- (void) removeObserverBlocksForAllKeyPaths;
@end
|
/**
* BasicFunc.h
*
* Created on: 2016年4月4日
* Author: fyabc
*/
#ifndef INCLUDE_MPL_BASICFUNC_H_
#define INCLUDE_MPL_BASICFUNC_H_
namespace fylib {
namespace mpl {
/// compose
template <typename f, typename g>
struct compose {
template <typename... args>
using apply = typename g::template apply<
typename f::template apply<args...>::type
>;
};
/// bindl
template <typename f, typename... args>
struct bindl {
template <typename... remainArgs>
using apply = typename f::template apply<args..., remainArgs...>;
};
/// bindr
template <typename f, typename... args>
struct bindr {
template <typename... remainArgs>
using apply = typename f::template apply<remainArgs..., args...>;
};
} // namespace mpl
} // namespace fylib
#endif /* INCLUDE_MPL_BASICFUNC_H_ */
|
/*
** Definitions for a less error-prone memory allocator.
*/
#include <stdlib.h>
#define malloc DON'T CALL malloc DIRECTLY!
#define MALLOC(num,type) (type *)alloc( (num) * sizeof(type) )
extern void *alloc( size_t size );
|
//
// CardGameViewController.h
// Matchismo
//
// Created by Yuhua Mai on 7/2/13.
// Copyright (c) 2013 Yuhua Mai. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CardGameViewController : UIViewController<UIAlertViewDelegate>
@end
|
//---
//
// License: MIT
//
// Author: David Burken
//
// Description:
//
// Motion Imagery File TRE(MTIMFA) class declaration.
//
// See document NGA.STND.0044_1.3_MIE4NITF, table 15 for more info.
//
//---
// $Id
#ifndef ossimNitfMtimfaTag_HEADER
#define ossimNitfMtimfaTag_HEADER 1
#include <ossim/support_data/ossimNitfRegisteredTag.h>
#include <string>
#include <vector>
/**
* @class ossimNitfMtimfaCameraBlock
*
* Camera temporal block only portion of MTIMFA tag.
*/
class ossimNitfMtimfaCameraBlock
{
public:
enum
{
START_TIMESTAMP_SIZE = 24,
END_TIMESTAMP_SIZE = 24,
IMAGE_SEG_INDEX_SIZE = 3
};
void parseStream(std::istream& in);
void writeStream(std::ostream& out) const;
std::ostream& print( std::ostream& out,
const std::string& prefix,
ossim_uint32 index ) const;
private:
void clearFields();
/**
* FIELD: START_TIMESTAMP
*
* Start time of m'th temporal block for n'th camera.
*
* 24 bytes
*
* BCS-A, Spaces or UTC format
*
* Year, month, day, hour, minute, seconds, nanosecs
*/
char m_startTimestamp[START_TIMESTAMP_SIZE+1];
/**
* FIELD: END_TIMESTAMP
*
* End time of m'th temporal block for n'th camera.
*
* 24 bytes
*
* BCS-A, Spaces or UTC format
*
* Year, month, day, hour, minute, seconds, nanosecs
*/
char m_endTimestamp[END_TIMESTAMP_SIZE+1];
/**
* FIELD: IMAGE_SEG_INDEX
*
* Index of the NITF Image Segment in this NITF file that contains the m'th
* temporal block of MI data for the n'th camera.
*
* 3 bytes
*
* BCS-A spaces or BCS-N, positive integer 001 – 999
*/
char m_imageSegIndex[IMAGE_SEG_INDEX_SIZE+1];
}; // End: class ossimNitfMtimfaCameraBlock
/**
* @class ossimNitfMtimfaCamera
*
* Camera ID only portion of MTIMFA tag.
*/
class ossimNitfMtimfaCamera
{
public:
enum
{
CAMERAS_ID_SIZE = 36,
NUM_TEMP_BLOCS_SIZE = 3
};
void parseStream(std::istream& in);
void writeStream(std::ostream& out) const;
std::ostream& print( std::ostream& out,
const std::string& prefix,
ossim_uint32 index ) const;
private:
void clearFields();
/**
* FIELD: CAMERAS_ID
*
* The UUID of the n'th camera in this phenomenological layer in this camera
* set. See NGA.RP.0001_1.0.0 for UUID details.
*
* 36 bytes
*
* BCS-A, A valid UUID in the “8-4-4-4-12” hexadecimal format
* (see ITU-T X.667)
*/
char m_cameraId[CAMERAS_ID_SIZE+1];
/**
* FIELD: NUM_TEMP_BLOCKS
*
* The number of temporal blocks defined for the n'th camera in this time
* interval.
*
* 3 bytes
*
* BCS-N, positive integer 001 – 999
*/
char m_numTempBlocks[NUM_TEMP_BLOCS_SIZE+1];
/**
* Holds an array of camera temporal blocks.
*/
std::vector<ossimNitfMtimfaCameraBlock> m_cameraBlocks;
}; // End: class ossimNitfMtimfaCamera
class OSSIM_DLL ossimNitfMtimfaTag : public ossimNitfRegisteredTag
{
public:
enum
{
LAYER_ID_SIZE = 36,
CAMERA_SET_INDEX_SIZE = 3,
TIME_INTERVAL_INDEX_SIZE = 6,
NUM_CAMERAS_DEFINED_SIZE = 3
};
/** @brief default constructor */
ossimNitfMtimfaTag();
/** @brief Method to parse data from stream. */
virtual void parseStream(std::istream& in);
/** @brief Method to write data to stream. */
virtual void writeStream(std::ostream& out);
/**
* @brief Print method that outputs a key/value type format
* adding prefix to keys.
* @param out Stream to output to.
* @param prefix Prefix added to key like "image0.";
*/
virtual std::ostream& print(std::ostream& out,
const std::string& prefix) const;
protected:
/** @brief Method to clear all fields including null terminating. */
virtual void clearFields();
/**
* FIELD: LAYER_ID
*
* A 36 character string identifying the layer. Field is large enough to
* hold a UUID.
*
* 36 bytes
*
* BCS-A
*/
char m_layerId[LAYER_ID_SIZE+1];
/**
* FIELD: CAMERA_SET_INDEX
*
* The index of the camera set containing the cameras in this NITF file.
*
* 3 bytes
*
* BCS-N, 001 – 999
*/
char m_cameraSetIndex[CAMERA_SET_INDEX_SIZE+1];
/**
* FIELD: TIME_INTERVAL_INDEX
*
* The index of the time interval corresponding to this NITF file.
*
* 6 bytes
*
* BCS-N, 000001 – 999999
*/
char m_timeIntervalIndex[TIME_INTERVAL_INDEX_SIZE+1];
/**
* FIELD: NUM_CAMERAS_DEFINED
*
* The number of cameras in this camera set for this phenomenological layer
* that collected MI data in this time interval.
*
* 3 bytes
*
* BCS-N, positive integer 001 – 999
*/
char m_numCamerasDefined[NUM_CAMERAS_DEFINED_SIZE+1];
/**
* Holds an array of cameras.
*/
std::vector<ossimNitfMtimfaCamera> m_camera;
TYPE_DATA
}; // End: class ossimNitfMtimfaTag
#endif /* matches #ifndef ossimNitfMtimfaTag_HEADER */
|
//
// Created by kevin on 26/07/16.
//
#ifndef CPP_CSP_SUCCESSOR_H
#define CPP_CSP_SUCCESSOR_H
#include "../process.h"
#include "../chan.h"
namespace csp
{
namespace plugnplay
{
/*! \class successor
* \brief A process that increments its input.
*
* \tparam T The type that the process operates on.
*
* \author Kevin Chalmers
*
* \date 26/07/2016
*/
template<typename T>
class successor : public process
{
private:
chan_in<T> _in; //<! The input channel into the process.
chan_out<T> _out; //<! The output channel from the process.
public:
/*!
* \brief Creates a new successor process.
*
* \param[in] in The input channel into the process.
* \param[in] out The output channel from the process.
*/
successor(chan_in<T> in, chan_out<T> out) noexcept
: _in(in), _out(out)
{
}
/*!
* \brief Executes the successor process.
*/
void run() noexcept override final
{
while (true)
{
auto val = _in();
_out(++val);
}
}
};
}
}
#endif //CPP_CSP_SUCCESSOR_H
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 19222 : 8431;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE,
HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
NODE_BLOOM = (1 << 1),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64 nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64 nServices;
// disk and network only
unsigned int nTime;
// memory only
int64 nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
enum
{
MSG_TX = 1,
MSG_BLOCK,
// Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however,
// MSG_FILTERED_BLOCK should not appear in any invs except as a part of getdata.
MSG_FILTERED_BLOCK,
};
#endif // __INCLUDED_PROTOCOL_H__
|
//
// Establishment.h
// Inbtwn
//
// Created by Corey Schaf on 4/23/14.
// Copyright (c) 2014 Rogue Bit Studios. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Establishment : NSObject
@property (nonatomic, strong) NSString *identifier;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *imageUrl;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *phone;
@property (nonatomic, strong) NSString *displayPhone;
@property (nonatomic, strong) NSArray *categories;
@property (nonatomic, strong) NSString *rating;
@property (nonatomic, strong) NSString *ratingImgUrlSmall;
@property (nonatomic, strong) NSString *locationAddress;
@property (nonatomic, strong) NSString *addressOne;
@property (nonatomic, strong) NSString *addressTwo;
@property (nonatomic, strong) NSString *city;
@property (nonatomic, strong) NSString *postalCode;
@property (nonatomic, strong) NSString *stateCode;
@property (nonatomic, strong) NSString *countryCode;
@property (nonatomic, strong) UIImage *thumbnail;
@property (nonatomic, strong) UIImage *ratingImage;
@property (nonatomic, strong) NSString *latitude;
@property (nonatomic, strong) NSString *longitude;
@property (nonatomic, strong) NSDictionary *neighborhoods;
@end
|
// Copyright (C) 2011 Dg Nechtan <dnechtan@gmail.com>, MIT
/* $Id: fnx_session.h 315615 2011-08-27 14:14:48Z nechtan $ */
#ifndef FNX_SESSION_H
#define FNX_SESSION_H
#define FNX_SESSION_PROPERTY_NAME_STATUS "_started"
#define FNX_SESSION_PROPERTY_NAME_SESSION "_session"
#define FNX_SESSION_PROPERTY_NAME_INSTANCE "_instance"
extern zend_class_entry *fnx_session_ce;
PHPAPI void php_session_start(TSRMLS_D);
FNX_STARTUP_FUNCTION(session);
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
|
//
// XHInstagramStoreManager.h
// InstagramThumbnail
//
// Created by 曾 宪华 on 14-2-23.
// Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^DownloadDataSourceCompled)(NSArray *mediaArray, NSError *error);
@interface XHInstagramStoreManager : NSObject
- (void)mediaWithPage:(NSInteger)page localDownloadDataSourceCompled:(DownloadDataSourceCompled)downloadDataSourceCompled;
@end
|
//
// SRHStreamCell.h
// StreamPerfect
//
// Created by Francois Courville on 2014-05-03.
// Copyright (c) 2014 Swift Synergy. All rights reserved.
//
#import <UIKit/UIKit.h>
@class SRHStream;
@interface SRHStreamCell : UICollectionViewCell
@property(nonatomic, weak) SRHStream *stream;
@end
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG42308 : MOBProjection
@end
|
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/GlobalDefines.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
#include "IfcFlowControllerType.h"
class IFCQUERY_EXPORT IfcDamperTypeEnum;
//ENTITY
class IFCQUERY_EXPORT IfcDamperType : public IfcFlowControllerType
{
public:
IfcDamperType() = default;
IfcDamperType( int id );
virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self );
virtual size_t getNumAttributes() { return 10; }
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcDamperType"; }
virtual const std::wstring toString() const;
// IfcRoot -----------------------------------------------------------
// attributes:
// shared_ptr<IfcGloballyUniqueId> m_GlobalId;
// shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional
// shared_ptr<IfcLabel> m_Name; //optional
// shared_ptr<IfcText> m_Description; //optional
// IfcObjectDefinition -----------------------------------------------------------
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssigns> > m_HasAssignments_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_Nests_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_IsNestedBy_inverse;
// std::vector<weak_ptr<IfcRelDeclares> > m_HasContext_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_IsDecomposedBy_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_Decomposes_inverse;
// std::vector<weak_ptr<IfcRelAssociates> > m_HasAssociations_inverse;
// IfcTypeObject -----------------------------------------------------------
// attributes:
// shared_ptr<IfcIdentifier> m_ApplicableOccurrence; //optional
// std::vector<shared_ptr<IfcPropertySetDefinition> > m_HasPropertySets; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelDefinesByType> > m_Types_inverse;
// IfcTypeProduct -----------------------------------------------------------
// attributes:
// std::vector<shared_ptr<IfcRepresentationMap> > m_RepresentationMaps; //optional
// shared_ptr<IfcLabel> m_Tag; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssignsToProduct> > m_ReferencedBy_inverse;
// IfcElementType -----------------------------------------------------------
// attributes:
// shared_ptr<IfcLabel> m_ElementType; //optional
// IfcDistributionElementType -----------------------------------------------------------
// IfcDistributionFlowElementType -----------------------------------------------------------
// IfcFlowControllerType -----------------------------------------------------------
// IfcDamperType -----------------------------------------------------------
// attributes:
shared_ptr<IfcDamperTypeEnum> m_PredefinedType;
};
|
//
// AppDelegate.h
// Week01
//
// Created by Lucas Campos on 5/23/16.
// Copyright © 2016 Lucas Campos. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Copyright (c) 2013 Jens Schmer
* This file is distributed under the MIT License.
* See COPYING within this package for further information.
*/
#pragma once
#include <glm/glm.hpp>
#include <SFMLApp.h>
#include <IRender.h>
#include <CameraInterface.hpp>
class Teapot : public CameraInterface, public IRender {
public:
Teapot(uint width = 600, uint height = 400);
~Teapot();
void render();
void enableLighting();
// keyboard events
sf::String HelpInfo() const;
void OnKeyPressed(sf::Keyboard::Key key, bool ctrl, bool alt, bool shift, bool system);
// other events
void OnResized(uint width, uint height);
private:
void SetProjectionPerspective();
void SetProjectionParallel();
private:
glm::mat4 _rotation_mat_user_input;
uint _width, _height;
bool _perspective;
double _near, _far;
};
|
#include<stdio.h>
int power();
main()
{
int i;
for(i=0;i<10;i++)
printf("%d %d %d \n",i,power(2,i), power(-3,i));
return 0;
}
power(base,n)
int base,n;
{
int i,p;
p = 1;
for(i=1;i<=n;++i)
p = p * base;
return p;
}
|
/*
* NH hash algorithm, specifically the variant used by Adiantum hashing
*
* Copyright (C) 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
#include "nh.h"
#include "testvec.h"
#if 0 /* unoptimized generic version */
static u64 nhpass(const u32 *key, const u32 *message, size_t message_dwords)
{
u64 sum = 0;
int i, j;
for (i = 0; i < message_dwords; i += NH_PAIR_STRIDE * 2) {
for (j = i; j < i + NH_PAIR_STRIDE; j++) {
u32 l = key[j] + message[j];
u32 r = key[j + NH_PAIR_STRIDE] +
message[j + NH_PAIR_STRIDE];
sum += (u64)l * (u64)r;
}
}
return sum;
}
void nh_generic(const u32 *key, const u8 *message, size_t message_len, u8 *hash)
{
u32 message_vec[NH_MESSAGE_DWORDS];
u64 hash_vec[NH_NUM_PASSES];
size_t message_dwords = message_len / sizeof(__le32);
int i;
ASSERT(message_len % NH_MESSAGE_UNIT == 0);
for (i = 0; i < message_dwords; i++)
message_vec[i] =
get_unaligned_le32(&message[i * sizeof(__le32)]);
for (i = 0; i < NH_NUM_PASSES; i++)
hash_vec[i] = nhpass(&key[i * NH_PAIR_STRIDE * 2],
message_vec, message_dwords);
for (i = 0; i < ARRAY_SIZE(hash_vec); i++)
put_unaligned_le64(hash_vec[i], &hash[i * sizeof(__le64)]);
}
#else /* optimized generic version */
void nh_generic(const u32 *key, const u8 *message, size_t message_len, u8 *hash)
{
u64 sums[4] = { 0, 0, 0, 0 };
BUILD_BUG_ON(NH_PAIR_STRIDE != 2);
BUILD_BUG_ON(NH_NUM_PASSES != 4);
while (message_len) {
u32 m0 = get_unaligned_le32(message + 0);
u32 m1 = get_unaligned_le32(message + 4);
u32 m2 = get_unaligned_le32(message + 8);
u32 m3 = get_unaligned_le32(message + 12);
sums[0] += (u64)(u32)(m0 + key[ 0]) * (u32)(m2 + key[ 2]);
sums[1] += (u64)(u32)(m0 + key[ 4]) * (u32)(m2 + key[ 6]);
sums[2] += (u64)(u32)(m0 + key[ 8]) * (u32)(m2 + key[10]);
sums[3] += (u64)(u32)(m0 + key[12]) * (u32)(m2 + key[14]);
sums[0] += (u64)(u32)(m1 + key[ 1]) * (u32)(m3 + key[ 3]);
sums[1] += (u64)(u32)(m1 + key[ 5]) * (u32)(m3 + key[ 7]);
sums[2] += (u64)(u32)(m1 + key[ 9]) * (u32)(m3 + key[11]);
sums[3] += (u64)(u32)(m1 + key[13]) * (u32)(m3 + key[15]);
key += NH_MESSAGE_UNIT / sizeof(key[0]);
message += NH_MESSAGE_UNIT;
message_len -= NH_MESSAGE_UNIT;
}
put_unaligned_le64(sums[0], hash + 0);
put_unaligned_le64(sums[1], hash + 8);
put_unaligned_le64(sums[2], hash + 16);
put_unaligned_le64(sums[3], hash + 24);
}
#endif /* optimized generic version */
void nh_setkey(struct nh_ctx *ctx, const u8 *key)
{
int i;
for (i = 0; i < NH_KEY_DWORDS; i++)
ctx->key[i] = get_unaligned_le32(key + i * sizeof(u32));
}
static __always_inline void
__nh_bulk(const struct nh_ctx *ctx, const void *data, unsigned int nbytes,
u8 *digest, bool simd)
{
u8 tmp_hash[NH_HASH_BYTES];
memset(digest, 0, NH_HASH_BYTES);
while (nbytes >= NH_MESSAGE_BYTES) {
nh(ctx->key, data, NH_MESSAGE_BYTES, tmp_hash, simd);
/* bogus combining method, just for testing... */
xor(digest, digest, tmp_hash, NH_HASH_BYTES);
data += NH_MESSAGE_BYTES;
nbytes -= NH_MESSAGE_BYTES;
}
if (nbytes > 0) {
nh(ctx->key, data, nbytes, tmp_hash, simd);
/* bogus combining method, just for testing... */
xor(digest, digest, tmp_hash, NH_HASH_BYTES);
}
}
static void nh_bulk_generic(const struct nh_ctx *ctx, const void *data,
unsigned int nbytes, u8 *digest)
{
__nh_bulk(ctx, data, nbytes, digest, false);
}
#ifdef HAVE_NH_SIMD
static void nh_bulk_simd(const struct nh_ctx *ctx, const void *data,
unsigned int nbytes, u8 *digest)
{
__nh_bulk(ctx, data, nbytes, digest, true);
}
#endif
struct nh_testvec {
struct testvec_buffer key;
struct testvec_buffer message;
struct testvec_buffer hash;
};
static void test_nh_testvec(const struct nh_testvec *v, bool simd)
{
u8 res[NH_HASH_BYTES];
u32 key[NH_KEY_DWORDS];
int i;
ASSERT(v->key.len == NH_KEY_BYTES);
ASSERT(v->message.len > 0);
ASSERT(v->message.len % NH_MESSAGE_UNIT == 0);
ASSERT(v->message.len <= NH_MESSAGE_BYTES);
ASSERT(v->hash.len == NH_HASH_BYTES);
for (i = 0; i < NH_KEY_DWORDS; i++)
key[i] = get_unaligned_le32(&v->key.data[i * 4]);
nh(key, v->message.data, v->message.len, res, simd);
ASSERT(!memcmp(res, v->hash.data, sizeof(res)));
}
#include "nh_testvecs.h"
static void fuzz_nh(void)
{
#ifdef HAVE_NH_SIMD
u32 key[NH_KEY_DWORDS];
u8 message[NH_MESSAGE_BYTES];
u8 hash_generic[NH_HASH_BYTES];
u8 hash_simd[NH_HASH_BYTES];
unsigned int len;
for (len = 0; len <= NH_MESSAGE_BYTES; len += NH_MESSAGE_UNIT) {
rand_bytes(key, NH_KEY_BYTES);
rand_bytes(message, len);
memset(hash_generic, 0, NH_HASH_BYTES);
nh_generic(key, message, len, hash_generic);
memset(hash_simd, 0, NH_HASH_BYTES);
nh_simd(key, message, len, hash_simd);
ASSERT(!memcmp(hash_generic, hash_simd, NH_HASH_BYTES));
}
#endif
}
static void test_nh_testvecs(void)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(nh_tv); i++) {
test_nh_testvec(&nh_tv[i], false);
#ifdef HAVE_NH_SIMD
test_nh_testvec(&nh_tv[i], true);
#endif
}
fuzz_nh();
}
void test_nh(void)
{
test_nh_testvecs();
#define ALGNAME "NH"
#define HASH nh_bulk_generic
#ifdef HAVE_NH_SIMD
# define HASH_SIMD nh_bulk_simd
#endif
#define KEY struct nh_ctx
#define SETKEY nh_setkey
#define KEY_BYTES NH_KEY_BYTES
#define DIGEST_SIZE NH_HASH_BYTES
#include "hash_benchmark_template.h"
}
|
/*
* libpal - Automated Placement of Labels Library http://pal.heig-vd.ch
*
*
* Copyright (C) 2007, 2008 MIS-TIC, HEIG-VD (University of Applied Sciences Western Switzerland)
* Copyright (C) 2008, 2009 IICT-SYSIN, HEIG-VD (University of Applied Sciences Western Switzerland)
*
*
* This file is part of libpal.
*
* libpal 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 3 of the License, or
* (at your option) any later version.
*
* libpal is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libpal. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _GEOM_H
#define _GEOM_H
#include <geos_c.h>
#include "palgeometry.h"
class Geom : public pal::PalGeometry {
private:
GEOSGeometry *the_geom;
int nb;
public:
GEOSGeometry* getGeosGeometry();
void releaseGeosGeometry (GEOSGeometry *the_geom);
Geom (const char *wkb);
virtual ~Geom();
};
#endif
|
#include "../include/apue.h"
#include <dirent.h>
#include <limits.h>
#include <string.h>
typedef int Myfunc(const char *, const struct stat *, int);
static int myftw(char *, Myfunc *);
static int dopath(Myfunc *);
static int myfunc(const char *pathname, const struct stat *statptr, int type);
static long nreg, ndir, nblk, nchr, nfifo, nslink, nsock, ntot;
void printPercentage(const char * name, int c){
int size = strlen(name);
int size1 = strlen(" = %7ld, %5.2f %%\n");
char new[size + size1 + 1];
strncpy(new,name,size);
strncpy(&new[size]," = %7ld, %5.2f %%\n",size1);
new[size + size1] = 0;
printf(new, c, c * 100.0/ntot);
}
int main(int argc, char * argv[]){
int ret;
if(argc != 2){
err_quit("usage: ftw <starting-pathname>");
}
ret = myftw(argv[1], myfunc);
ntot = nreg + ndir + nblk + nchr + nfifo + nslink + nsock;
if(ntot == 0){
ntot = 1;
};
printPercentage("regular files ", nreg);
printPercentage("directoryies ", ndir);
printPercentage("block special ", nblk);
printPercentage("char special ", nchr);
printPercentage("FIFOs ", nfifo);
printPercentage("symbolic links ", nslink);
printPercentage("sockets ", nsock);
exit(ret);
};
#define FTW_F 1
#define FTW_D 2
#define FTW_DNR 3
#define FTW_NS 4
static char *fullpath;
static size_t pathlen;
static int myftw(char *pathname, Myfunc *func){
fullpath = path_alloc(&pathlen);
if(pathlen <= strlen(pathname)){
pathlen = strlen(pathname) * 2;
if((fullpath = realloc(fullpath,pathlen)) == NULL){
err_sys("realloc failed");
};
}
strcpy(fullpath, pathname);
return(dopath(func));
}
static int dopath(Myfunc *func){
struct stat statbuf;
struct dirent *dirp;
DIR *dp;
int ret, n;
if(lstat(fullpath, &statbuf) < 0){
return (func(fullpath,&statbuf,FTW_NS));
}
if(S_ISDIR(statbuf.st_mode) == 0){
return (func(fullpath, &statbuf, FTW_F));
}
if((ret = func(fullpath, &statbuf, FTW_D)) != 0){
return (ret);
}
n = strlen(fullpath);
if(n + NAME_MAX + 2 > pathlen){
pathlen *= 2;
if((fullpath = realloc(fullpath, pathlen)) == NULL){
err_sys("realloc failed");
}
}
fullpath[n++] = '/';
fullpath[n] = 0;
if((dp = opendir(fullpath)) == NULL){
return (func(fullpath, &statbuf, FTW_DNR));
}
while((dirp = readdir(dp)) != NULL){
if(strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0 ){
continue;
}
strcpy(&fullpath[n], dirp->d_name);
if((ret = dopath(func)) != 0){
break;
}
}
fullpath[n-1] = 0;
if(closedir(dp) < 0){
err_ret("can't close directory %s", fullpath);
}
return (ret);
}
static int myfunc(const char *pathname, const struct stat *statptr, int type){
switch(type){
case FTW_F:
switch(statptr->st_mode & S_IFMT){
case S_IFREG:
nreg++;
break;
case S_IFBLK:
nblk++;
break;
case S_IFCHR:
nchr++;
break;
case S_IFIFO:
nfifo++;
break;
case S_IFLNK:
nslink++;
break;
case S_IFSOCK:
nsock++;
break;
case S_IFDIR:
err_dump("for S_IFDIR for %s", pathname);
}
break;
case FTW_D:
ndir++;
break;
case FTW_DNR:
err_ret("can't read directory %s", pathname);
break;
case FTW_NS:
err_ret("stat error for %s", pathname);
break;
default:
err_dump("unknow type %d dor pathname %s", type, pathname);
}
return (0);
}
|
//
// NSManagedObjectContext+ContextSave.h
// MADDisc
//
// Created by LEE CHIEN-MING on 2/19/15.
// Copyright (c) 2015 Furnace . All rights reserved.
//
#import <CoreData/CoreData.h>
#import "NSManagedObjectContextTypeDefine.h"
@interface NSManagedObjectContext (ContextSave)
- (void)contextSaveAsync:(DDContextSaveCompletion)completion;
@end
@interface NSManagedObject (ObjectSave)
- (void)objectSaveAsync:(DDContextSaveCompletion)completion;
@end
|
//
// NineStyleDelegate.h
// MobileFramework
//
// Created by Think on 14-5-22.
// Copyright (c) 2014年 wt. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol NineStyleDelegate <NSObject>
@end
|
#pragma once
class Game;
class FrameObject
{
public:
virtual void frameUpdate(const Game& game) = 0;
virtual ~FrameObject() {}
};
|
//
// NBViewController.h
// demo
//
// Created by Josh Justice on 3/9/14.
// Copyright (c) 2014 NeedBee. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NBViewController : UIViewController <UITableViewDataSource>
@end
|
#ifndef _IGNORE_WARNINGS_H__
#define _IGNORE_WARNINGS_H__
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#ifndef BOOST_DISABLE_ABI_HEADERS
#define BOOST_DISABLE_ABI_HEADERS
#endif
#if defined (BOOST_WINDOWS) && BOOST_WINDOWS
#ifndef NOMINMAX
# define NOMINMAX // ignore min, max defined in windows.h
#endif
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
#endif
#endif
#endif
|
#ifndef ORG_WALRUS_ALARMFSCK_ALARMFSCK_H
#define ORG_WALRUS_ALARMFSCK_ALARMFSCK_H
#include "common.h"
#include <gtkmm/button.h>
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/entry.h>
#include <glibmm/dispatcher.h>
#include <canberra-gtk.h>
#include <cryptopp/osrng.h>
class AlarmFsck : public Gtk::Window
{
public:
AlarmFsck();
private:
//Signal handlers:
void on_button_clicked();
bool on_window_delete(GdkEventAny*);
//Member widgets:
Gtk::Box vBox;
Gtk::Button m_button;
Gtk::Label questionField, commentField;
Gtk::Entry answerField;
// canberra-related
ca_context* canberraContext;
ca_proplist* canberraProps;
// thread flags - see comment in alarmfsck.cc on why they're not atomic
static bool loopFinished;
static bool stopPlayback;
// thread tasks
static void playback_looper(ca_context* canCon, ca_proplist* canProp);
static void canberra_callback(ca_context *, uint32_t, int, void *);
// encryption
CryptoPP::SecByteBlock key, iv;
CryptoPP::AutoSeededRandomPool rng;
bool hasHostages;
bool solvedIt;
// file-tree
std::string prefixDir;
std::string compressedPath;
std::string encryptedPath;
std::string archivePath;
void encrypt_hostage_archive();
void decrypt_decompress_hostage_archive();
void free_hostages(const std::string&);
void error_to_user(const std::string&, const std::string&);
void error_to_user(const AfSystemException& error);
void error_to_user(const std::string&);
bool erase_file(std::string);
// rands
int randFactor1, randFactor2;
};
#endif // ORG_WALRUS_ALARMFSCK_ALARMFSCK_H
|
#pragma once
#include <FalconEngine/Graphics/Renderer/Resource/BufferAdaptor.h>
namespace FalconEngine
{
FALCON_ENGINE_CLASS_BEGIN BufferCircular :
public BufferAdaptor
{
public:
explicit BufferCircular(const std::shared_ptr<Buffer>& buffer, size_t bufferZoneSize);
protected:
/************************************************************************/
/* Protected Members */
/************************************************************************/
virtual void
FillBegin() override;
virtual void
FillEnd() override;
private:
// Where the data offset should be when the next fill phrase begins.
size_t mBufferDataOffsetNext;
// How much data should be keep safely at once without wrapping the data offset.
size_t mBufferZoneSize;
};
FALCON_ENGINE_CLASS_END
}
|
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬
// »òÊǾ³£Ê¹Óõ«²»³£¸ü¸ÄµÄ
// ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ
//
#pragma once
#include "YTSvrLib.h"
#include <unordered_map>
#include <unordered_set>
#define USE_CHATSVR
#define USE_ADMINSVR
#include "../Common/GlobalDefine.h"
#include "../Common/MsgRetDef.h"
#include "../Common/ClientDef.h"
#include "Global.h"
#include "Config/Config.h"
#include "timer/TimerMgr.h"
#include "ServerParser/ServerParser.h"
#include "ClientParser/PkgParser.h"
|
//
// BK4Model.h
// LTKit
//
// Created by bmob-LT on 2016/10/11.
// Copyright © 2016年 bmob-LT. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BK4Model : NSObject
@property (copy) NSMutableArray *array;
@end
|
#include "../../math/reinterpret.h"
#include <stdint.h>
long double __floatunditf(uint64_t a)
{
if (!a)
return 0;
int space = __builtin_clzll(a);
unsigned __int128 significand = (unsigned __int128)(a << space & INT64_MAX) << 49;
unsigned __int128 exp = 0x3FFF + 63 - space;
return reinterpret(long double, significand | exp << 112);
}
|
//
// OrgnizedViewUpdator.h
// StockListener
//
// Created by Guozhen Li on 6/16/16.
// Copyright © 2016 Guangzhen Li. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface OrgnizedViewUpdator : NSObject
-(void) updateOrgnizedStocks;
@end
|
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬
// »òÊǾ³£Ê¹Óõ«²»³£¸ü¸ÄµÄ
// ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // ´Ó Windows Í·ÖÐÅųý¼«ÉÙʹÓõÄ×ÊÁÏ
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString ¹¹Ô캯Êý½«ÊÇÏÔʽµÄ
// ¹Ø±Õ MFC ¶ÔijЩ³£¼ûµ«¾³£¿É·ÅÐĺöÂԵľ¯¸æÏûÏ¢µÄÒþ²Ø
#define _AFX_ALL_WARNINGS
#include <afxwin.h> // MFC ºËÐÄ×é¼þºÍ±ê×¼×é¼þ
#include <afxext.h> // MFC À©Õ¹
#include <afxdisp.h> // MFC ×Ô¶¯»¯Àà
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC ¶Ô Internet Explorer 4 ¹«¹²¿Ø¼þµÄÖ§³Ö
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC ¶Ô Windows ¹«¹²¿Ø¼þµÄÖ§³Ö
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcontrolbars.h> // ¹¦ÄÜÇøºÍ¿Ø¼þÌõµÄ MFC Ö§³Ö
#undef WINVER
#define WINVER _WIN32_WINNT_WINXP
#undef _WIN32_WINNT
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
|
//
// HTTP.h
// snowcrash
//
// Created by Zdenek Nemec on 7/11/13.
// Copyright (c) 2013 Apiary Inc. All rights reserved.
//
#ifndef SNOWCRASH_HTTP_H
#define SNOWCRASH_HTTP_H
#include <string>
#include "Blueprint.h"
/**
* \brief HTTP Methods
*
* Technical note: Using preprocessor macro instead of strict
* defined type due to C++98 string concatenation limitations.
* FIXME: To be improved with migration to C++11.
*/
#define HTTP_REQUEST_METHOD \
"(GET|POST|PUT|DELETE|OPTIONS|PATCH|PROPPATCH|LOCK|UNLOCK|COPY|MOVE|MKCOL|HEAD|LINK|UNLINK|CONNECT)"
/**
* \brief URI Template.
*
* See previous technical note (using macro).
*/
#define URI_TEMPLATE "(/.*)"
namespace snowcrash
{
/**
* Selected HTTP Header names.
*/
struct HTTPHeaderName {
static const std::string Accept;
static const std::string ContentLength;
static const std::string ContentType;
static const std::string TransferEncoding;
static const std::string SetCookie;
static const std::string Link;
};
/**
* Selected HTTP Method names.
*/
struct HTTPMethodName {
static const std::string Head;
static const std::string Connect;
};
/**
* A HTTP Status code.
*/
typedef unsigned int HTTPStatusCode;
/**
* Traits of a HTTP response.
*/
struct HTTPResponseTraits {
bool allowBody; /// < Response body is allowed.
HTTPResponseTraits() : allowBody(true)
{
}
};
/**
* Response traits for a HTTP method.
*
* HTTP request method related response prescription
* Ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
*/
struct HTTPMethodTraits : HTTPResponseTraits {
HTTPMethod method;
HTTPMethodTraits() : method("")
{
}
};
/**
* Response traits for a HTTP status code.
*
* Status-related response prescription.
* Ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
*/
struct StatusCodeTraits : HTTPResponseTraits {
HTTPStatusCode code;
StatusCodeTraits() : code(0)
{
}
};
/**
* \brief Retrieve response traits for given HTTP method.
* \param method HTTP method to retrieve traits for.
* \return A %HTTPMethodTraits for given method.
*/
extern HTTPMethodTraits GetMethodTrait(HTTPMethod method);
/**
* \brief Retrieve response traits for given status code.
* \param code A HTTP status code to retrieve traits for.
* \return A %StatusCodeTraits for given code.
*/
extern StatusCodeTraits GetStatusCodeTrait(HTTPStatusCode code);
}
#endif
|
// The MIT License (MIT)
//
// Copyright (c) 2014 Joakim Gyllström
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#import "BSCollectionController.h"
@interface BSCollectionController (UICollectionView) <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
@end
|
#include <string.h>
#include "video/stats.h"
VIDEO_STATS video_stats;
void videostats_reset(void) {
memset(&video_stats, 0, sizeof(video_stats));
}
|
#ifdef __LP64__
#define DTABLE_OFFSET 64
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#elif defined(_WIN64)
// long is 32 bits on Win64, so struct objc_class is smaller. All other offsets are the same.
#define DTABLE_OFFSET 56
#define SMALLOBJ_BITS 3
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#else
#define DTABLE_OFFSET 32
#define SMALLOBJ_BITS 1
#define SHIFT_OFFSET 0
#define DATA_OFFSET 8
#define SLOT_OFFSET 0
#endif
#define SMALLOBJ_MASK ((1<<SMALLOBJ_BITS) - 1)
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "PLLogger.h"
@interface PLApplicationLogger : PLLogger
{
}
- (void)appStateChanged:(id)arg1;
- (void)logStateForDisplayID:(id)arg1 pidString:(id)arg2 andState:(id)arg3 withReasons:(id)arg4;
- (void)log;
- (void)dealloc;
- (id)init;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSData.h"
// Not exported
@interface _NSDispatchData : NSData
{
}
+ (_Bool)supportsSecureCoding;
- (Class)classForCoder;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (_Bool)_allowsDirectEncoding;
- (_Bool)_isDispatchData;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)mutableCopyWithZone:(struct _NSZone *)arg1;
- (struct _NSRange)rangeOfData:(id)arg1 options:(unsigned long long)arg2 range:(struct _NSRange)arg3;
- (id)subdataWithRange:(struct _NSRange)arg1;
- (unsigned long long)hash;
- (_Bool)isEqualToData:(id)arg1;
- (void)getBytes:(void *)arg1 range:(struct _NSRange)arg2;
- (void)enumerateByteRangesUsingBlock:(id)arg1;
- (void)getBytes:(void *)arg1 length:(unsigned long long)arg2;
- (void)getBytes:(void *)arg1;
- (const void *)bytes;
- (const void *)_bytesIfCompact;
- (unsigned long long)length;
@end
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class DVTSystemActivityToken, IDEPlaygroundDocument, IDEPlaygroundExecutionParameters;
@interface _IDEPlaygroundCompletionInfo : NSObject
{
CDUnknownBlockType _completionBlock;
IDEPlaygroundExecutionParameters *_executionParameters;
IDEPlaygroundDocument *_playground;
id <IDEClientTrackingToken> _clientTrackingToken;
DVTSystemActivityToken *_systemActivityToken;
}
@property(retain) DVTSystemActivityToken *systemActivityToken; // @synthesize systemActivityToken=_systemActivityToken;
@property(retain) id <IDEClientTrackingToken> clientTrackingToken; // @synthesize clientTrackingToken=_clientTrackingToken;
@property(retain) IDEPlaygroundDocument *playground; // @synthesize playground=_playground;
@property(retain) IDEPlaygroundExecutionParameters *executionParameters; // @synthesize executionParameters=_executionParameters;
@property(copy) CDUnknownBlockType completionBlock; // @synthesize completionBlock=_completionBlock;
- (void).cxx_destruct;
@end
|
#ifndef __URL_VERSION_H__
#define __URL_VERSION_H__ 1
#include "url.h"
#define URL_VERSION_MAJOR 0
#define URL_VERSION_MINOR 0
#define URL_VERSION_PATCH 1
#define URL_VERSION ( \
(URL_VERSION_MAJOR << 16) | \
(URL_VERSION_MINOR << 8) | \
(URL_VERSION_PATCH) \
)
#define URL_VERSION_STRING ( \
URL_STRINGIFY(URL_VERSION_MAJOR) "." \
URL_STRINGIFY(URL_VERSION_MINOR) "." \
URL_STRINGIFY(URL_VERSION_PATCH) \
)
#if URL_IS_RELEASE
#define URL_VERSION_RELEASE URL_VERSION_STRING
#else
#define URL_VERSION_RELEASE URL_VERSION_STRING "-pre"
#endif
#endif
|
//
// HotTakeRealm.h
// HotTakeRealm
//
// Created by Ian Dundas on 30/11/2016.
// Copyright © 2016 Ian Dundas. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for HotTakeRealm.
FOUNDATION_EXPORT double HotTakeRealmVersionNumber;
//! Project version string for HotTakeRealm.
FOUNDATION_EXPORT const unsigned char HotTakeRealmVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <HotTakeRealm/PublicHeader.h>
|
#ifndef DETECTION_TRANSLATIONS_H
#define DETECTION_TRANSLATIONS_H
#include <QFileInfo>
#include "idetection.h"
class DetectionTranslations : public IDetection {
public:
virtual void types(QStringList &list);
virtual bool isType(const QFileInfo &fi, QString &type, QString &subtype);
};
#endif // DETECTION_TRANSLATIONS_H
|
//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// This is a part of the BCGControlBar Library
// Copyright (C) 1998-2000 BCGSoft Ltd.
// All rights reserved.
//
// This source code can be used, distributed or modified
// only under terms and conditions
// of the accompanying license agreement.
//*******************************************************************************
#if !defined(AFX_BCGTOOLSPAGE_H__80D80813_B943_11D3_A713_009027900694__INCLUDED_)
#define AFX_BCGTOOLSPAGE_H__80D80813_B943_11D3_A713_009027900694__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BCGToolsPage.h : header file
//
#ifndef BCG_NO_CUSTOMIZATION
#include "BCGEditListBox.h"
#include "BCGMenuButton.h"
class CBCGToolbarCustomize;
class CBCGToolsPage;
class CBCGUserTool;
class CToolsList : public CBCGEditListBox
{
public:
CToolsList(CBCGToolsPage* pParent) :
m_pParent (pParent) {}
virtual void OnSelectionChanged ();
virtual BOOL OnBeforeRemoveItem (int iItem);
virtual void OnAfterAddItem (int iItem);
virtual void OnAfterRenameItem (int iItem);
virtual void OnAfterMoveItemUp (int iItem);
virtual void OnAfterMoveItemDown (int iItem);
CBCGToolsPage* m_pParent;
};
/////////////////////////////////////////////////////////////////////////////
// CBCGToolsPage dialog
class CBCGToolsPage : public CPropertyPage
{
friend class CToolsList;
// Construction
public:
CBCGToolsPage();
~CBCGToolsPage();
// Dialog Data
//{{AFX_DATA(CBCGToolsPage)
enum { IDD = IDD_BCGBARRES_PROPPAGE7 };
CBCGMenuButton m_wndInitialDirBtn;
CBCGMenuButton m_wndArgumentsBtn;
CEdit m_wndArgumentsEdit;
CEdit m_wndInitialDirEdit;
CEdit m_wndCommandEdit;
CButton m_wndBrowseBtn;
CToolsList m_wndToolsList;
CString m_strCommand;
CString m_strArguments;
CString m_strInitialDirectory;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CBCGToolsPage)
public:
virtual void OnOK();
virtual BOOL OnKillActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CBCGToolsPage)
virtual BOOL OnInitDialog();
afx_msg void OnBcgbarresBrowseCommand();
afx_msg void OnUpdateTool();
afx_msg void OnArgumentsOptions();
afx_msg void OnInitialDirectoryOptions();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
CBCGUserTool* CreateNewTool ();
void EnableControls ();
CBCGUserTool* m_pSelTool;
CBCGToolbarCustomize* m_pParentSheet;
//UPDATE
CMenu m_menuArguments;
CMenu m_menuInitialDir;
};
#endif // BCG_NO_CUSTOMIZATION
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BCGTOOLSPAGE_H__80D80813_B943_11D3_A713_009027900694__INCLUDED_)
|
/*
* http://github.com/dusty-nv/jetson-inference
*/
#ifndef __CUDA_YUV_CONVERT_H
#define __CUDA_YUV_CONVERT_H
#include "cudaUtility.h"
#include <stdint.h>
//////////////////////////////////////////////////////////////////////////////////
/// @name RGBA to YUV 4:2:0 planar (I420 & YV12)
/// @ingroup util
//////////////////////////////////////////////////////////////////////////////////
///@{
/**
* Convert an RGBA uchar4 buffer into YUV I420 planar.
*/
cudaError_t cudaRGBAToI420( uchar4* input, uint8_t* output, size_t width, size_t height );
/**
* Convert an RGBA uchar4 texture into YUV I420 planar.
*/
cudaError_t cudaRGBAToI420( uchar4* input, size_t inputPitch, uint8_t* output, size_t outputPitch, size_t width, size_t height );
/**
* Convert an RGBA uchar4 buffer into YUV YV12 planar.
*/
cudaError_t cudaRGBAToYV12( uchar4* input, uint8_t* output, size_t width, size_t height );
/**
* Convert an RGBA uchar4 texture into YUV YV12 planar.
*/
cudaError_t cudaRGBAToYV12( uchar4* input, size_t inputPitch, uint8_t* output, size_t outputPitch, size_t width, size_t height );
///@}
//////////////////////////////////////////////////////////////////////////////////
/// @name YUV 4:2:2 packed (UYVY & YUYV) to RGBA
/// @ingroup util
//////////////////////////////////////////////////////////////////////////////////
///@{
/**
* Convert a UYVY 422 packed image into RGBA uchar4.
*/
cudaError_t cudaUYVYToRGBA( uchar2* input, uchar4* output, size_t width, size_t height );
/**
* Convert a UYVY 422 packed image into RGBA uchar4.
*/
cudaError_t cudaUYVYToRGBA( uchar2* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
/**
* Convert a YUYV 422 packed image into RGBA uchar4.
*/
cudaError_t cudaYUYVToRGBA( uchar2* input, uchar4* output, size_t width, size_t height );
/**
* Convert a YUYV 422 packed image into RGBA uchar4.
*/
cudaError_t cudaYUYVToRGBA( uchar2* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
///@}
//////////////////////////////////////////////////////////////////////////////////
/// @name UYUV 4:2:2 packed (UYVY & YUYV) to grayscale
/// @ingroup util
//////////////////////////////////////////////////////////////////////////////////
///@{
/**
* Convert a UYVY 422 packed image into a uint8 grayscale.
*/
cudaError_t cudaUYVYToGray( uchar2* input, float* output, size_t width, size_t height );
/**
* Convert a UYVY 422 packed image into a uint8 grayscale.
*/
cudaError_t cudaUYVYToGray( uchar2* input, size_t inputPitch, float* output, size_t outputPitch, size_t width, size_t height );
/**
* Convert a YUYV 422 packed image into a uint8 grayscale.
*/
cudaError_t cudaYUYVToGray( uchar2* input, float* output, size_t width, size_t height );
/**
* Convert a YUYV 422 packed image into a uint8 grayscale.
*/
cudaError_t cudaYUYVToGray( uchar2* input, size_t inputPitch, float* output, size_t outputPitch, size_t width, size_t height );
///@}
//////////////////////////////////////////////////////////////////////////////////
/// @name YUV NV12 to RGBA
/// @ingroup util
//////////////////////////////////////////////////////////////////////////////////
///@{
/**
* Convert an NV12 texture (semi-planar 4:2:0) to ARGB uchar4 format.
* NV12 = 8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling.
*/
cudaError_t cudaNV12ToRGBA( uint8_t* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
cudaError_t cudaNV12ToRGBA( uint8_t* input, uchar4* output, size_t width, size_t height );
cudaError_t cudaNV12ToRGBAf( uint8_t* input, size_t inputPitch, float4* output, size_t outputPitch, size_t width, size_t height );
cudaError_t cudaNV12ToRGBAf( uint8_t* input, float4* output, size_t width, size_t height );
/**
* Setup NV12 color conversion constants.
* cudaNV12SetupColorspace() isn't necessary for the user to call, it will be
* called automatically by cudaNV12ToRGBA() with a hue of 0.0.
* However if you want to setup custom constants (ie with a hue different than 0),
* then you can call cudaNV12SetupColorspace() at any time, overriding the default.
*/
cudaError_t cudaNV12SetupColorspace( float hue = 0.0f );
///@}
#endif
|
/**
* Copyright (c) 2006-2015 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_IMAGE_MAGPIE_COMPRESSED_DATA_H
#define LOVE_IMAGE_MAGPIE_COMPRESSED_DATA_H
// LOVE
#include "filesystem/FileData.h"
#include "image/CompressedData.h"
namespace love
{
namespace image
{
namespace magpie
{
class CompressedData : public love::image::CompressedData
{
public:
CompressedData(love::filesystem::FileData *filedata);
virtual ~CompressedData();
static bool isCompressed(love::filesystem::FileData *filedata);
private:
void load(love::filesystem::FileData *filedata);
}; // CompressedData
} // magpie
} // image
} // love
#endif // LOVE_IMAGE_MAGPIE_COMPRESSED_DATA_H
|
#pragma once
extern "C"
{
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/timestamp.h"
}
template<class T>
class SeqList;
struct SeqStreamContext;
struct SDL_mutex;
enum class SeqDecoderStatus
{
Inactive,
Opening,
Loading,
Seeking,
Ready,
Stopping,
Disposing
};
struct SeqFrameBuffer
{
int size;
AVFrame **buffer;
int inUseCursor = 0;
int insertCursor = 0;
SeqStreamContext *usedBy = nullptr;
};
struct SeqStreamContext
{
AVCodecContext *codecContext = nullptr;
SeqFrameBuffer *frameBuffer = nullptr;
int frameCount = 0;
double timeBase = 1;
};
class SeqDecoder
{
public:
SeqDecoder();
~SeqDecoder();
SeqDecoderStatus GetStatus();
int64_t GetDuration();
int64_t GetPlaybackTime();
int64_t GetBufferLeft();
int64_t GetBufferRight();
int64_t GetSeqTimeForStreamTime(int64_t streamTime, int streamIndex);
void Dispose();
SeqFrameBuffer* CreateFrameBuffer(int size);
void DisposeFrameBuffer(SeqFrameBuffer *buffer);
void DisposeStreamContext(SeqStreamContext *context);
static int OpenFormatContext(const char *fullPath, AVFormatContext **formatContext);
static void CloseFormatContext(AVFormatContext **formatContext);
static int OpenCodecContext(int streamIndex, AVFormatContext *format, AVCodec **codec, AVCodecContext **context, double* timeBase);
static void CloseCodecContext(AVCodecContext **codecContext);
static int GetBestStream(AVFormatContext *format, enum AVMediaType type, int *streamIndex);
int Preload();
int Loop();
void Stop();
void Seek(int64_t time);
AVFrame* NextFrame(int streamIndex, int64_t time);
AVFrame* NextFrame(int streamIndex);
bool IsAtEndOfStream(int streamIndex);
void StartDecodingStream(int streamIndex);
void StopDecodingStream(int streamIndex);
static bool IsValidFrame(AVFrame *frame);
private:
void SetStatusInactive();
void SetStatusOpening();
void SetStatusLoading();
void SetStatusSeeking();
void SetStatusReady();
void SetStatusStopping();
void SetStatusDisposing();
int FillPacketBuffer();
bool IsSlowAndShouldSkip();
bool NextKeyFrameDts(int64_t *result);
int DecodePacket(AVPacket packet, AVFrame *target, int *frameIndex, int cached);
void RefreshStreamContexts();
void RefreshPrimaryStreamContext();
int NextFrameBuffer();
void ResetFrameBuffer(SeqFrameBuffer *buffer);
void PrintAVError(const char *message, int error);
public:
AVFormatContext *formatContext = nullptr;
private:
static const int defaultFrameBufferSize = 60;
static const int defaultPacketBufferSize = 500;
SeqDecoderStatus status = SeqDecoderStatus::Inactive;
SDL_mutex *statusMutex;
SeqStreamContext *streamContexts;
int primaryStreamIndex = -1;
bool finishedDecoding = false;
bool skipFramesIfSlow = false;
int64_t lastRequestedFrameTime;
int64_t lastReturnedFrameTime;
int64_t bufferPunctuality = 0;
int64_t lowestKeyFrameDecodeTime = 0;
bool shouldRefreshStreamContexts = false;
SeqList<int> *startStreams;
SeqList<int> *stopStreams;
SDL_mutex *refreshStreamContextsMutex;
bool shouldSeek = false;
int64_t seekTime = 0;
SDL_mutex *seekMutex;
SeqList<SeqFrameBuffer*> *frameBuffers;
int packetBufferSize = defaultPacketBufferSize;
AVPacket *packetBuffer;
int decodedPacketCursor = 0;
int insertPacketCursor = 0;
};
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <iWorkImport/TSCH3DShaderEffect.h>
// Not exported
@interface TSCH3DLightingPackageShaderEffect : TSCH3DShaderEffect
{
}
+ (void)setLightingPackageEffectState:(const struct LightingPackageShaderEffectState *)arg1 effectsStates:(id)arg2;
- (void)inject:(id)arg1;
@end
|
#ifndef TEXT_WRAPPER_H
#define TEXT_WRAPPER_H
#include <interface/View.h>
#include <support/String.h>
#include <support/List.h>
#include <vector>
#include "TagQueue.h"
class Tag;
class TaggedText;
class LineBuffer;
#define K_LINE_SPACER 4.0f
class TextWrapper
{
public:
enum WrappingMode
{
K_WIDTH_FIXED = 0,
K_HEIGHT_FIXED,
K_WIDTH_AND_HEIGHT_FIXED
};
public:
TextWrapper(BView *enclosingView, WrappingMode wrappingMode = K_WIDTH_AND_HEIGHT_FIXED);
virtual ~TextWrapper();
LineBuffer* CalculateTextWrapping(BRect enclosingRect, TaggedText* text);
void DrawLineBuffer(BRect enclosingRect, LineBuffer* lineBuffer);
private:
void PropagateTags(LineBuffer *buffer, int32 lineIndex, Tag* addTag);
TaggedText* SplitText(TaggedText* text);
void CalculateStringWidths(TaggedText* textBuffer);
private:
BView* m_enclosingView;
WrappingMode m_wrappingMode;
};
//=Queue
class Line : public TagQueue
{
public:
Line(BView *enclosingView, float spacing = 0.0f);
virtual ~Line();
float Height();
float Width();
virtual Tag* Next();
virtual void Add(Tag* tag);
void SetSpacing(float spacing);
float Spacing();
private:
float m_maxHeight,
m_lineWidth,
m_spacing;
BView *m_enclosingView;
};
class LineBuffer
{
public:
LineBuffer();
virtual ~LineBuffer();
float Height();
float Width();
bool IsEmpty();
int32 CountLines();
void AddLine(Line *line);
Line* LineAt(int32 index);
private:
BList* m_lineList;
float m_bufferHeight,
m_bufferWidth;
};
#endif
|
#pragma once
#include "defs.h"
#include "io.h"
struct particle_data
{
float Pos[3];
float Vel[3];
float Mass;
int32_t Type;
};
struct particle_data * loadsnapshot(const char *fname,struct io_header *header);
void reordering(struct particle_data *P,id64 *Id,int64 N);
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
/* somma e prodotto con sottoprogrammi
Autore: Davide Vallati - Classe: 3° INA - Data: 03/01/2017 - Versione: 1.0 */
int main(){
int a;//n1
int b;//n2
int somma;//somma
int prodotto;//prodotto
printf("Inserire il primo numero:");
scanf("%d",&a);
printf("Inserire il secondo numero:");
scanf("%d",&b);
somma=S(a,b);
prodotto=P(a,b);
printf("La somma e':%d",somma);
printf("\n");
printf("Il prodotto e':%d",prodotto);
}
int S(int n1,int n2){
int somma;
somma=n1+n2;
return somma;
}
int P(int n1,int n2){
int prodotto;
prodotto=n1*n2;
return prodotto;
}
|
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "panic.h"
#include "alloc.h"
#include "log.h"
char *
slurp(char const *path, size_t *n)
{
int fd = open(path, O_RDONLY);
if (fd == -1)
epanic("open(%s)", path);
off_t size = lseek(fd, 0, SEEK_END);
if (size == -1)
epanic("lseek()");
lseek(fd, 0, SEEK_SET);
char *data = alloc(size + 1);
if (read(fd, data, size) != size)
epanic("read()");
data[size] = '\0';
close(fd);
if (n != NULL)
*n = size;
return data;
}
char *
sclone(char const *s)
{
char *new = alloc(strlen(s) + 1);
return strcpy(new, s);
}
|
#pragma once
#include "Properties.h"
#include "Object.h"
#include <vector>
namespace tmx {
class ObjectGroup {
public:
Properties properties;
vector<Object> objects;
const char* name;
const char* color;
int x = 0;
int y = 0;
int width = 0;
int height = 0;
const char* opacity;
const char* visible;
const char* offsetx;
const char* offsety;
const char* draworder;
};
}
|
#ifndef SHADERTOBODY_H
#define SHADERTOBODY_H
#include <stdio.h>
#include <IESoR/Construction/Bodies/outputsToBodies.h>
class ShaderToBody
{
public:
ShaderToBody();
private:
~ShaderToBody();
};
#endif //SHADERTOBODY_H
|
//
// Created by Yanke Guo on 16/3/7.
//
#import <Foundation/Foundation.h>
#import "YMLogItem.h"
@class YMLogger;
@protocol YMLoggerOutput<NSObject>
/**
* Output a line of log
*/
- (void)logger:(YMLogger *__nonnull)logger didOutputItem:(YMLogItem *__nonnull)item;
@optional
- (void)didAddToLogger:(YMLogger *__nonnull)logger;
- (void)didRemoveFromLogger:(YMLogger *__nonnull)logger;
@end
|
/******************************************************************************
* Copyright (C) 2012-2016 A. C. Open Hardware Ideas Lab
*
* Authors:
* Marco Giammarini <m.giammarini@warcomeb.it>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
/**
* @file libohiboard/source/rtc_KL15Z4.c
* @author Marco Giammarini <m.giammarini@warcomeb.it>
* @brief RTC implementations for KL15Z4.
*/
#ifdef LIBOHIBOARD_RTC
#include "platforms.h"
#include "rtc.h"
#include "clock.h"
#if defined (LIBOHIBOARD_KL15Z4) || \
defined (LIBOHIBOARD_KL25Z4) || \
defined (LIBOHIBOARD_FRDMKL25Z)
typedef struct Rtc_Device {
RTC_MemMapPtr regMap;
volatile uint32_t* simScgcPtr; /**< SIM_SCGCx register for the device. */
uint32_t simScgcBitEnable; /**< SIM_SCGC enable bit for the device. */
void (*isrAlarm)(void); /**< The function pointer for Alarm ISR. */
void (*callbackAlarm)(void); /**< The pointer for user alarm callback. */
Interrupt_Vector isrAlarmNumber; /**< ISR Alarm vector number. */
void (*isrSecond)(void); /**< The function pointer for Second ISR. */
void (*callbackSecond)(void); /**< The pointer for user second callback. */
Interrupt_Vector isrSecondNumber; /**< ISR Second vector number. */
uint8_t devInitialized; /**< Indicate that device was been initialized. */
} Rtc_Device;
static Rtc_Device rtc0 = {
.regMap = RTC_BASE_PTR,
.simScgcPtr = &SIM_SCGC6,
.simScgcBitEnable = SIM_SCGC6_RTC_MASK,
.isrAlarm = RTC_IRQHandler,
.callbackAlarm = 0,
.isrAlarmNumber = INTERRUPT_RTC_ALARM,
.isrSecond = RTC_Seconds_IRQHandler,
.callbackSecond = 0,
.isrSecondNumber = INTERRUPT_RTC_SECOND,
};
Rtc_DeviceHandle OB_RTC0 = &rtc0;
void RTC_IRQHandler (void)
{
OB_RTC0->callbackAlarm();
/* Clear alarm flag */
RTC_TAR_REG(OB_RTC0->regMap) = 0;
}
void RTC_Seconds_IRQHandler (void)
{
OB_RTC0->callbackSecond();
}
System_Errors Rtc_init (Rtc_DeviceHandle dev, Rtc_Config *config)
{
RTC_MemMapPtr regmap = dev->regMap;
/* Turn on clock */
*dev->simScgcPtr |= dev->simScgcBitEnable;
switch(config->clockSource)
{
case RTC_CLOCK_CLKIN:
/* Activate mux for this pin */
PORTC_PCR1 &= ~PORT_PCR_MUX_MASK;
PORTC_PCR1 = PORT_PCR_MUX(1);
/* Select this clock source */
SIM_SOPT1 &= ~SIM_SOPT1_OSC32KSEL_MASK;
SIM_SOPT1 |= SIM_SOPT1_OSC32KSEL(2);
break;
case RTC_CLOCK_SYSTEM:
/* Select this clock source */
SIM_SOPT1 &= ~SIM_SOPT1_OSC32KSEL_MASK;
SIM_SOPT1 |= SIM_SOPT1_OSC32KSEL(0);
break;
case RTC_CLOCK_LPO:
SIM_SOPT1 &= ~SIM_SOPT1_OSC32KSEL_MASK;
SIM_SOPT1 |= SIM_SOPT1_OSC32KSEL(3);
break;
}
/* Configure TSR value to default */
/* From RM: "TSR with zero is supported, but not recommended" */
RTC_TSR_REG(regmap) = 1;
if (config->callbackAlarm)
{
Rtc_enableAlarm(dev,config->callbackAlarm,config->alarm);
}
if (config->callbackSecond)
{
Rtc_enableSecond(dev,config->callbackSecond);
}
/* Enable counter */
RTC_SR_REG(regmap) |= RTC_SR_TCE_MASK;
return ERRORS_NO_ERROR;
}
/**
* Set current time with Unix system format.
* Unix format is the number of seconds since the start of the Unix epoch:
* midnight UTC of January 1, 1970 (not counting leap seconds).
*/
void Rtc_setTime (Rtc_DeviceHandle dev, Rtc_Time time)
{
/* Disable counter */
RTC_SR_REG(dev->regMap) &= ~RTC_SR_TCE_MASK;
if (time == 0)
RTC_TSR_REG(dev->regMap) = 1;
else
RTC_TSR_REG(dev->regMap) = time;
/* Enable counter */
RTC_SR_REG(dev->regMap) |= RTC_SR_TCE_MASK;
}
Rtc_Time Rtc_getTime (Rtc_DeviceHandle dev)
{
return RTC_TSR_REG(dev->regMap);
}
void Rtc_enableAlarm (Rtc_DeviceHandle dev, void *callback, Rtc_Time alarm)
{
/* save callback */
dev->callbackAlarm = callback;
/* Set alarm value */
RTC_TAR_REG(dev->regMap) = alarm;
RTC_IER_REG(dev->regMap) |= RTC_IER_TAIE_MASK;
Interrupt_enable(dev->isrAlarmNumber);
}
void Rtc_disableAlarm (Rtc_DeviceHandle dev)
{
/* Set alarm value */
RTC_TAR_REG(dev->regMap) = 0;
RTC_IER_REG(dev->regMap) &= ~RTC_IER_TAIE_MASK;
Interrupt_disable(dev->isrAlarmNumber);
}
void Rtc_enableSecond (Rtc_DeviceHandle dev, void *callback)
{
/* save callback */
dev->callbackSecond = callback;
RTC_IER_REG(dev->regMap) |= RTC_IER_TSIE_MASK;
Interrupt_enable(dev->isrSecondNumber);
}
void Rtc_disableSecond (Rtc_DeviceHandle dev)
{
RTC_IER_REG(dev->regMap) &= ~RTC_IER_TSIE_MASK;
Interrupt_disable(dev->isrSecondNumber);
}
#endif /* LIBOHIBOARD_KL15Z4 */
#endif /* LIBOHIBOARD_RTC */
|
#pragma once
#include <glbinding/nogl.h>
#include <glbinding/gl/types.h>
namespace gl43ext
{
using gl::GLextension;
using gl::GLenum;
using gl::GLboolean;
using gl::GLbitfield;
using gl::GLvoid;
using gl::GLbyte;
using gl::GLshort;
using gl::GLint;
using gl::GLclampx;
using gl::GLubyte;
using gl::GLushort;
using gl::GLuint;
using gl::GLsizei;
using gl::GLfloat;
using gl::GLclampf;
using gl::GLdouble;
using gl::GLclampd;
using gl::GLeglClientBufferEXT;
using gl::GLeglImageOES;
using gl::GLchar;
using gl::GLcharARB;
using gl::GLhandleARB;
using gl::GLhalfARB;
using gl::GLhalf;
using gl::GLfixed;
using gl::GLintptr;
using gl::GLsizeiptr;
using gl::GLint64;
using gl::GLuint64;
using gl::GLintptrARB;
using gl::GLsizeiptrARB;
using gl::GLint64EXT;
using gl::GLuint64EXT;
using gl::GLsync;
using gl::_cl_context;
using gl::_cl_event;
using gl::GLDEBUGPROC;
using gl::GLDEBUGPROCARB;
using gl::GLDEBUGPROCKHR;
using gl::GLDEBUGPROCAMD;
using gl::GLhalfNV;
using gl::GLvdpauSurfaceNV;
using gl::GLVULKANPROCNV;
using gl::GLuint_array_2;
using gl::AttribMask;
using gl::ClearBufferMask;
using gl::ClientAttribMask;
using gl::ContextFlagMask;
using gl::ContextProfileMask;
using gl::FfdMaskSGIX;
using gl::FragmentShaderColorModMaskATI;
using gl::FragmentShaderDestMaskATI;
using gl::FragmentShaderDestModMaskATI;
using gl::MapBufferUsageMask;
using gl::MemoryBarrierMask;
using gl::PathFontStyle;
using gl::PathMetricMask;
using gl::PathRenderingMaskNV;
using gl::PerformanceQueryCapsMaskINTEL;
using gl::SyncObjectMask;
using gl::TextureStorageMaskAMD;
using gl::UseProgramStageMask;
using gl::VertexHintsMaskPGI;
using gl::UnusedMask;
using gl::BufferAccessMask;
using gl::BufferStorageMask;
} // namespace gl43ext
|
//
// DHMenuVC.h
// GoBangGraduationProject
//
// Created by 刘人华 on 16/5/30.
// Copyright © 2016年 dahua. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DHMenuVC : UIViewController
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSString;
// Not exported
@interface _VKPOIIconKey : NSObject
{
CDStruct_cf20f7af _style;
NSString *_name;
}
- (id).cxx_construct;
- (_Bool)isEqual:(id)arg1;
- (unsigned long long)hash;
- (void)dealloc;
- (id)initWithName:(id)arg1 style:(CDStruct_cf20f7af *)arg2;
@end
|
#pragma once
#include <coffee/comp_app/services.h>
#include <coffee/core/types/display/event.h>
struct SDL_Window;
struct SDL_Surface;
using SDL_GLContext = void*;
namespace sdl2 {
using comp_app::position_t;
using comp_app::size_2d_t;
struct Context : comp_app::AppService<
Context,
comp_app::detail::TypeList<
comp_app::EventBus<Coffee::Input::CIEvent>,
comp_app::EventBus<Coffee::Display::Event>>>,
comp_app::AppLoadableService
{
using type = Context;
virtual void load(entity_container& c, comp_app::app_error&) final;
virtual void unload(entity_container& c, comp_app::app_error&) final;
virtual void end_restricted(Proxy& p, time_point const&) final;
bool m_shouldClose = false;
};
struct Windowing : comp_app::Windowing, comp_app::AppLoadableService
{
using type = Windowing;
virtual ~Windowing();
virtual void load(entity_container& c, comp_app::app_error& ec) final;
virtual void unload(entity_container& c, comp_app::app_error& ec) final;
virtual void start_restricted(Proxy& p, time_point const&) final;
virtual void show() final;
virtual void close() final;
virtual size_2d_t size() const final;
virtual void resize(const size_2d_t& newSize) final;
virtual position_t position() const final;
virtual void move(const position_t& newPos) final;
virtual comp_app::detail::WindowState state() const final;
virtual void setState(comp_app::detail::WindowState state) final;
virtual bool notifiedClose() const final;
SDL_Window* m_window = nullptr;
entity_container* m_container = nullptr;
};
struct WindowInfo : comp_app::WindowInfo, comp_app::AppLoadableService
{
virtual void load(entity_container& e, comp_app::app_error&) final;
virtual comp_app::text_type_t name() const final;
virtual void setName(comp_app::text_type newName) final;
entity_container* m_container = nullptr;
};
struct DisplayInfo : comp_app::DisplayInfo
{
virtual comp_app::size_2d_t virtualSize() const final;
virtual libc_types::u32 count() const final;
virtual libc_types::u32 currentDisplay() const final;
virtual comp_app::size_2d_t size(libc_types::u32 idx) const final;
virtual comp_app::size_2d_t physicalSize(libc_types::u32) const final;
};
struct GLContext : comp_app::GraphicsContext, comp_app::AppLoadableService
{
using type = GLContext;
void setupAttributes(entity_container& c);
virtual void load(entity_container& c, comp_app::app_error& ec) final;
virtual void unload(entity_container& c, comp_app::app_error& ec) final;
SDL_GLContext m_context = nullptr;
entity_container* m_container = nullptr;
};
struct GLSwapControl : comp_app::GraphicsSwapControl
{
virtual libc_types::i32 swapInterval() const final;
virtual void setSwapInterval(libc_types::i32 interval) final;
};
struct GLFramebuffer : comp_app::GraphicsFramebuffer,
comp_app::AppLoadableService
{
using type = GLFramebuffer;
virtual void load(entity_container& c, comp_app::app_error&) final;
virtual void swapBuffers(comp_app::app_error& ec) final;
virtual comp_app::size_2d_t size() const final;
entity_container* m_container;
};
struct ControllerInput : comp_app::ControllerInput, comp_app::AppLoadableService
{
virtual void load(entity_container&, comp_app::app_error& ec) final;
virtual void unload(entity_container&, comp_app::app_error& ec) final;
virtual void start_restricted(Proxy& p, time_point const&) final;
virtual libc_types::u32 count() const final;
virtual controller_map state(libc_types::u32 idx) const final;
virtual comp_app::text_type_t name(libc_types::u32 idx) const final;
libc_types::i16 rescale(libc_types::i16 value) const;
int controllerDisconnect(int device);
libc_types::scalar m_axisScale;
libc_types::i16 m_axisDeadzone;
stl_types::Map<int, void*> m_controllers;
stl_types::Map<int, void*> m_playerIndex;
};
struct KeyboardInput : comp_app::BasicKeyboardInput
{
virtual void start_restricted(Proxy& p, time_point const&) final;
virtual void openVirtual() const final;
virtual void closeVirtual() const final;
};
struct MouseInput : comp_app::MouseInput, comp_app::AppLoadableService
{
MouseInput()
{
priority = default_prio + 100;
}
virtual void load(entity_container& e, comp_app::app_error&) override;
virtual void start_restricted(Proxy&, time_point const&) final;
virtual bool mouseGrabbed() const final;
virtual void setMouseGrab(bool enabled) final;
virtual comp_app::position_t position() const final;
virtual void warp(const comp_app::position_t& newPos) final;
virtual MouseButton buttons() const final;
MouseButton m_buttons = MouseButton::NoneBtn;
entity_container* m_container;
};
using Services = comp_app::detail::TypeList<
Context,
Windowing,
WindowInfo,
DisplayInfo,
comp_app::PtrNativeWindowInfo,
ControllerInput,
KeyboardInput,
MouseInput>;
using GLServices =
comp_app::detail::TypeList<GLSwapControl, GLContext, GLFramebuffer>;
} // namespace sdl2
|
#ifndef __Mt_Parser_H__
#define __Mt_Parser_H__
#include <string>
#include "symbol.h"
#include <deque>
class Parser
{
std::string parsed_string;
std::deque<Symbol> elements;
std::deque<Symbol> symbols;
const Symbol *findSymbol(const std::string &value) const;
Symbol stringToSymbol(const std::string &value) const;
public:
Parser &parse(const std::string &parsed_string, const std::string &separators);
Parser();
Parser &addSymbol(const Symbol &symbol);
std::deque<Symbol> &getExpression() { return elements; }
};
Parser getDefaultParser();
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.