text stringlengths 4 6.14k |
|---|
/* PR tree-optimization/36504 */
/* { dg-do compile } */
/* { dg-options "-O3 -fprefetch-loop-arrays -w" } */
struct A { struct { int a; } b[8]; };
struct B { int c; int d; };
struct C { struct B d; };
void bar (struct C *, int);
struct B
foo (struct C *p, struct A *e, int b)
{
struct B q;
bar (p, e->b[b].a);
return q;
}
void
baz (int b, struct A *e)
{
struct C p;
for (; b; ++b)
p.d = foo (&p, e, b);
}
|
/*
* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/err.h>
#include <linux/spinlock.h>
#include <linux/clk.h>
#include "clock.h"
#include "clock-voter.h"
static DEFINE_SPINLOCK(voter_clk_lock);
/* Aggregate the rate of clocks that are currently on. */
static unsigned long voter_clk_aggregate_rate(const struct clk *parent)
{
struct clk *clk;
unsigned long rate = 0;
list_for_each_entry(clk, &parent->children, siblings) {
struct clk_voter *v = to_clk_voter(clk);
if (v->enabled)
rate = max(clk->rate, rate);
}
return rate;
}
static int voter_clk_set_rate(struct clk *clk, unsigned long rate)
{
int ret = 0;
unsigned long flags;
struct clk *clkp;
struct clk_voter *clkh, *v = to_clk_voter(clk);
unsigned long cur_rate, new_rate, other_rate = 0;
spin_lock_irqsave(&voter_clk_lock, flags);
if (v->enabled) {
struct clk *parent = v->parent;
/*
* Get the aggregate rate without this clock's vote and update
* if the new rate is different than the current rate
*/
list_for_each_entry(clkp, &parent->children, siblings) {
clkh = to_clk_voter(clkp);
if (clkh->enabled && clkh != v)
other_rate = max(clkp->rate, other_rate);
}
cur_rate = max(other_rate, clk->rate);
new_rate = max(other_rate, rate);
if (new_rate != cur_rate) {
ret = clk_set_rate(parent, new_rate);
if (ret)
goto unlock;
}
}
clk->rate = rate;
unlock:
spin_unlock_irqrestore(&voter_clk_lock, flags);
return ret;
}
static int voter_clk_enable(struct clk *clk)
{
int ret = 0;
unsigned long flags;
unsigned long cur_rate;
struct clk *parent;
struct clk_voter *v = to_clk_voter(clk);
spin_lock_irqsave(&voter_clk_lock, flags);
parent = v->parent;
/*
* Increase the rate if this clock is voting for a higher rate
* than the current rate.
*/
cur_rate = voter_clk_aggregate_rate(parent);
if (clk->rate > cur_rate) {
ret = clk_set_rate(parent, clk->rate);
if (ret)
goto out;
}
v->enabled = true;
out:
spin_unlock_irqrestore(&voter_clk_lock, flags);
return ret;
}
static void voter_clk_disable(struct clk *clk)
{
unsigned long flags, cur_rate, new_rate;
struct clk *parent;
struct clk_voter *v = to_clk_voter(clk);
spin_lock_irqsave(&voter_clk_lock, flags);
parent = v->parent;
/*
* Decrease the rate if this clock was the only one voting for
* the highest rate.
*/
v->enabled = false;
new_rate = voter_clk_aggregate_rate(parent);
cur_rate = max(new_rate, clk->rate);
if (new_rate < cur_rate)
clk_set_rate(parent, new_rate);
spin_unlock_irqrestore(&voter_clk_lock, flags);
}
static int voter_clk_is_enabled(struct clk *clk)
{
struct clk_voter *v = to_clk_voter(clk);
return v->enabled;
}
static long voter_clk_round_rate(struct clk *clk, unsigned long rate)
{
struct clk_voter *v = to_clk_voter(clk);
return clk_round_rate(v->parent, rate);
}
static struct clk *voter_clk_get_parent(struct clk *clk)
{
struct clk_voter *v = to_clk_voter(clk);
return v->parent;
}
static bool voter_clk_is_local(struct clk *clk)
{
return true;
}
static enum handoff voter_clk_handoff(struct clk *clk)
{
/* Apply default rate vote */
if (clk->rate)
return HANDOFF_ENABLED_CLK;
return HANDOFF_DISABLED_CLK;
}
struct clk_ops clk_ops_voter = {
.enable = voter_clk_enable,
.disable = voter_clk_disable,
.set_rate = voter_clk_set_rate,
.is_enabled = voter_clk_is_enabled,
.round_rate = voter_clk_round_rate,
.get_parent = voter_clk_get_parent,
.is_local = voter_clk_is_local,
.handoff = voter_clk_handoff,
};
|
/* Determine protocol families for which interfaces exist. Linux version.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <stdint.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/socket.h>
#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <stdbool.h>
#include <sys/uio.h>
#include "config.h"
#include "local.h"
#define __ASSUME_NETLINK_SUPPORT 1
static int
make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6)
{
struct
{
struct nlmsghdr nlh;
struct rtgenmsg g;
} req;
struct sockaddr_nl nladdr;
req.nlh.nlmsg_len = sizeof (req);
req.nlh.nlmsg_type = RTM_GETADDR;
req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = time (NULL);
req.g.rtgen_family = AF_UNSPEC;
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
if (TEMP_FAILURE_RETRY (sendto (fd, (void *) &req, sizeof (req), 0,
(struct sockaddr *) &nladdr,
sizeof (nladdr))) < 0)
return -1;
*seen_ipv4 = false;
*seen_ipv6 = false;
bool done = false;
char buf[4096];
struct iovec iov = { buf, sizeof (buf) };
do
{
struct msghdr msg =
{
(void *) &nladdr, sizeof (nladdr),
&iov, 1,
NULL, 0,
0
};
ssize_t read_len = TEMP_FAILURE_RETRY (recvmsg (fd, &msg, 0));
if (read_len < 0)
return -1;
if (msg.msg_flags & MSG_TRUNC)
return -1;
struct nlmsghdr *nlmh;
for (nlmh = (struct nlmsghdr *) buf;
NLMSG_OK (nlmh, (size_t) read_len);
nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
{
if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
|| nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
continue;
if (nlmh->nlmsg_type == RTM_NEWADDR)
{
struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
switch (ifam->ifa_family)
{
case AF_INET:
*seen_ipv4 = true;
break;
case AF_INET6:
*seen_ipv6 = true;
break;
default:
/* Ignore. */
break;
}
}
else if (nlmh->nlmsg_type == NLMSG_DONE)
/* We found the end, leave the loop. */
done = true;
else ;
}
}
while (! done);
close (fd);
return 0;
}
/* We don't know if we have NETLINK support compiled in in our
Kernel. */
#if __ASSUME_NETLINK_SUPPORT == 0
/* Define in ifaddrs.h. */
extern int __no_netlink_support attribute_hidden;
#else
# define __no_netlink_support 0
#endif
void
attribute_hidden
__check_pf (bool *seen_ipv4, bool *seen_ipv6)
{
if (! __no_netlink_support)
{
int fd = socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
struct sockaddr_nl nladdr;
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
socklen_t addr_len = sizeof (nladdr);
if (fd >= 0
&& bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
&& getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
&& make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6) == 0)
/* It worked. */
return;
if (fd >= 0)
close (fd);
#if __ASSUME_NETLINK_SUPPORT == 0
/* Remember that there is no netlink support. */
__no_netlink_support = 1;
#else
/* We cannot determine what interfaces are available. Be
pessimistic. */
*seen_ipv4 = true;
*seen_ipv6 = true;
#endif
}
#if __ASSUME_NETLINK_SUPPORT == 0
/* No netlink. Get the interface list via getifaddrs. */
struct ifaddrs *ifa = NULL;
if (getifaddrs (&ifa) != 0)
{
/* We cannot determine what interfaces are available. Be
pessimistic. */
*seen_ipv4 = true;
*seen_ipv6 = true;
return;
}
*seen_ipv4 = false;
*seen_ipv6 = false;
struct ifaddrs *runp;
for (runp = ifa; runp != NULL; runp = runp->ifa_next)
if (runp->ifa_addr->sa_family == PF_INET)
*seen_ipv4 = true;
else if (runp->ifa_addr->sa_family == PF_INET6)
*seen_ipv6 = true;
(void) freeifaddrs (ifa);
#endif
}
|
#ifndef ZBOOT_H
#define ZBOOT_H
#include <mach/zboot_macros.h>
/**************************************************
*
* board specific settings
*
**************************************************/
#ifdef CONFIG_MACH_KZM9G
#define MEMORY_START 0x43000000
#include "mach/head-kzm9g.txt"
#else
#error "unsupported board."
#endif
#endif /* ZBOOT_H */
|
/**
* Copyright (C) ARM Limited 2010-2014. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
static void gator_buffer_write_packed_int(int cpu, int buftype, int x)
{
uint32_t write = per_cpu(gator_buffer_write, cpu)[buftype];
uint32_t mask = gator_buffer_mask[buftype];
char *buffer = per_cpu(gator_buffer, cpu)[buftype];
int packedBytes = 0;
int more = true;
while (more) {
/* low order 7 bits of x */
char b = x & 0x7f;
x >>= 7;
if ((x == 0 && (b & 0x40) == 0) || (x == -1 && (b & 0x40) != 0))
more = false;
else
b |= 0x80;
buffer[(write + packedBytes) & mask] = b;
packedBytes++;
}
per_cpu(gator_buffer_write, cpu)[buftype] = (write + packedBytes) & mask;
}
static void gator_buffer_write_packed_int64(int cpu, int buftype, long long x)
{
uint32_t write = per_cpu(gator_buffer_write, cpu)[buftype];
uint32_t mask = gator_buffer_mask[buftype];
char *buffer = per_cpu(gator_buffer, cpu)[buftype];
int packedBytes = 0;
int more = true;
while (more) {
/* low order 7 bits of x */
char b = x & 0x7f;
x >>= 7;
if ((x == 0 && (b & 0x40) == 0) || (x == -1 && (b & 0x40) != 0))
more = false;
else
b |= 0x80;
buffer[(write + packedBytes) & mask] = b;
packedBytes++;
}
per_cpu(gator_buffer_write, cpu)[buftype] = (write + packedBytes) & mask;
}
static void gator_buffer_write_bytes(int cpu, int buftype, const char *x, int len)
{
int i;
u32 write = per_cpu(gator_buffer_write, cpu)[buftype];
u32 mask = gator_buffer_mask[buftype];
char *buffer = per_cpu(gator_buffer, cpu)[buftype];
for (i = 0; i < len; i++) {
buffer[write] = x[i];
write = (write + 1) & mask;
}
per_cpu(gator_buffer_write, cpu)[buftype] = write;
}
static void gator_buffer_write_string(int cpu, int buftype, const char *x)
{
int len = strlen(x);
gator_buffer_write_packed_int(cpu, buftype, len);
gator_buffer_write_bytes(cpu, buftype, x, len);
}
|
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_CAMERA_SPI_H
#define __MSM_CAMERA_SPI_H
#include <linux/spi/spi.h>
#include <media/msm_cam_sensor.h>
#include "msm_camera_i2c.h"
/**
* Common SPI communication scheme
* tx: <opcode>[addr][wait][write buffer]
* rx: [read buffer]
* Some inst require polling busy reg until it's done
*/
struct msm_camera_spi_inst {
uint8_t opcode; /* one-byte opcode */
uint8_t addr_len; /* addr len in bytes */
uint8_t dummy_len; /* setup cycles */
uint8_t delay_intv; /* delay intv for this inst (ms) */
uint8_t delay_count; /* total delay count for this inst */
};
struct msm_camera_spi_inst_tbl {
struct msm_camera_spi_inst read;
struct msm_camera_spi_inst read_seq;
struct msm_camera_spi_inst query_id;
struct msm_camera_spi_inst page_program;
struct msm_camera_spi_inst write_enable;
struct msm_camera_spi_inst read_status;
struct msm_camera_spi_inst erase;
};
struct msm_camera_spi_client {
struct spi_device *spi_master;
struct msm_camera_spi_inst_tbl cmd_tbl;
uint8_t device_id;
uint8_t mfr_id;
uint8_t retry_delay; /* ms */
uint8_t retries; /* retry times upon failure */
uint8_t busy_mask; /* busy bit in status reg */
uint16_t page_size; /* page size for page program */
uint32_t erase_size; /* minimal erase size */
};
static __always_inline
uint16_t msm_camera_spi_get_hlen(struct msm_camera_spi_inst *inst)
{
return sizeof(inst->opcode) + inst->addr_len + inst->dummy_len;
}
int32_t msm_camera_spi_read(struct msm_camera_i2c_client *client,
uint32_t addr, uint16_t *data,
enum msm_camera_i2c_data_type data_type);
int32_t msm_camera_spi_read_seq(struct msm_camera_i2c_client *client,
uint32_t addr, uint8_t *data, uint32_t num_byte);
int32_t msm_camera_spi_read_seq_l(struct msm_camera_i2c_client *client,
uint32_t addr, uint32_t num_byte, char *tx, char *rx);
int32_t msm_camera_spi_query_id(struct msm_camera_i2c_client *client,
uint32_t addr, uint8_t *data, uint32_t num_byte);
int32_t msm_camera_spi_write_seq(struct msm_camera_i2c_client *client,
uint32_t addr, uint8_t *data, uint32_t num_byte);
int32_t msm_camera_spi_erase(struct msm_camera_i2c_client *client,
uint32_t addr, uint32_t size);
#endif
|
/* Copyright (c) 2012 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _MACH_QDSP5_V2_AUDIO_ACDBI_H
#define _MACH_QDSP5_V2_AUDIO_ACDBI_H
#define DBOR_SIGNATURE 0x524F4244
void acdb_rtc_set_err(u32 err_code);
struct header {
u32 dbor_signature;
u32 abid;
u32 iid;
u32 data_len;
};
enum {
ACDB_AGC_BLOCK = 197,
ACDB_IIR_BLOCK = 245,
ACDB_MBADRC_BLOCK = 343
};
/* Structure to query for acdb parameter */
struct acdb_get_block {
u32 acdb_id;
u32 sample_rate_id; /* Actual sample rate value */
u32 interface_id; /* Interface id's */
u32 algorithm_block_id; /* Algorithm block id */
u32 total_bytes; /* Length in bytes used by buffer for
configuration */
u32 *buf_ptr; /* Address for storing configuration
data */
};
struct acdb_agc_block {
u16 enable_status;
u16 comp_rlink_static_gain;
u16 comp_rlink_aig_flag;
u16 exp_rlink_threshold;
u16 exp_rlink_slope;
u16 comp_rlink_threshold;
u16 comp_rlink_slope;
u16 comp_rlink_aig_attack_k;
u16 comp_rlink_aig_leak_down;
u16 comp_rlink_aig_leak_up;
u16 comp_rlink_aig_max;
u16 comp_rlink_aig_min;
u16 comp_rlink_aig_release_k;
u16 comp_rlink_aig_sm_leak_rate_fast;
u16 comp_rlink_aig_sm_leak_rate_slow;
u16 comp_rlink_attack_k_msw;
u16 comp_rlink_attack_k_lsw;
u16 comp_rlink_delay;
u16 comp_rlink_release_k_msw;
u16 comp_rlink_release_k_lsw;
u16 comp_rlink_rms_trav;
};
struct iir_coeff_type {
u16 b0_lo;
u16 b0_hi;
u16 b1_lo;
u16 b1_hi;
u16 b2_lo;
u16 b2_hi;
};
struct iir_coeff_stage_a {
u16 a1_lo;
u16 a1_hi;
u16 a2_lo;
u16 a2_hi;
};
struct acdb_iir_block {
u16 enable_flag;
u16 stage_count;
struct iir_coeff_type stages[4];
struct iir_coeff_stage_a stages_a[4];
u16 shift_factor[4];
u16 pan[4];
};
struct mbadrc_band_config_type {
u16 mbadrc_sub_band_enable;
u16 mbadrc_sub_mute;
u16 mbadrc_comp_rms_tav;
u16 mbadrc_comp_threshold;
u16 mbadrc_comp_slop;
u16 mbadrc_comp_attack_msw;
u16 mbadrc_comp_attack_lsw;
u16 mbadrc_comp_release_msw;
u16 mbadrc_comp_release_lsw;
u16 mbadrc_make_up_gain;
};
struct mbadrc_parameter {
u16 mbadrc_enable;
u16 mbadrc_num_bands;
u16 mbadrc_down_sample_level;
u16 mbadrc_delay;
};
struct acdb_mbadrc_block {
u16 ext_buf[196];
struct mbadrc_band_config_type band_config[5];
struct mbadrc_parameter parameters;
};
struct acdb_ns_tx_block {
unsigned short ec_mode_new;
unsigned short dens_gamma_n;
unsigned short dens_nfe_block_size;
unsigned short dens_limit_ns;
unsigned short dens_limit_ns_d;
unsigned short wb_gamma_e;
unsigned short wb_gamma_n;
};
#endif
|
/* linux/arch/arm/mach-s3c2412/dma.c
*
* Copyright (c) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* S3C2412 DMA selection
*
* http://armlinux.simtec.co.uk/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sysdev.h>
#include <linux/serial_core.h>
#include <linux/io.h>
#include <mach/dma.h>
#include <plat/dma-s3c24xx.h>
#include <plat/cpu.h>
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
#include <plat/regs-ac97.h>
#include <plat/regs-dma.h>
#include <mach/regs-mem.h>
#include <mach/regs-lcd.h>
#include <mach/regs-sdi.h>
#include <plat/regs-iis.h>
#include <plat/regs-spi.h>
#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID }
static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
[DMACH_XD0] = {
.name = "xdreq0",
.channels = MAP(S3C2412_DMAREQSEL_XDREQ0),
.channels_rx = MAP(S3C2412_DMAREQSEL_XDREQ0),
},
[DMACH_XD1] = {
.name = "xdreq1",
.channels = MAP(S3C2412_DMAREQSEL_XDREQ1),
.channels_rx = MAP(S3C2412_DMAREQSEL_XDREQ1),
},
[DMACH_SDI] = {
.name = "sdi",
.channels = MAP(S3C2412_DMAREQSEL_SDI),
.channels_rx = MAP(S3C2412_DMAREQSEL_SDI),
},
[DMACH_SPI0] = {
.name = "spi0",
.channels = MAP(S3C2412_DMAREQSEL_SPI0TX),
.channels_rx = MAP(S3C2412_DMAREQSEL_SPI0RX),
},
[DMACH_SPI1] = {
.name = "spi1",
.channels = MAP(S3C2412_DMAREQSEL_SPI1TX),
.channels_rx = MAP(S3C2412_DMAREQSEL_SPI1RX),
},
[DMACH_UART0] = {
.name = "uart0",
.channels = MAP(S3C2412_DMAREQSEL_UART0_0),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART0_0),
},
[DMACH_UART1] = {
.name = "uart1",
.channels = MAP(S3C2412_DMAREQSEL_UART1_0),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART1_0),
},
[DMACH_UART2] = {
.name = "uart2",
.channels = MAP(S3C2412_DMAREQSEL_UART2_0),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART2_0),
},
[DMACH_UART0_SRC2] = {
.name = "uart0",
.channels = MAP(S3C2412_DMAREQSEL_UART0_1),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART0_1),
},
[DMACH_UART1_SRC2] = {
.name = "uart1",
.channels = MAP(S3C2412_DMAREQSEL_UART1_1),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART1_1),
},
[DMACH_UART2_SRC2] = {
.name = "uart2",
.channels = MAP(S3C2412_DMAREQSEL_UART2_1),
.channels_rx = MAP(S3C2412_DMAREQSEL_UART2_1),
},
[DMACH_TIMER] = {
.name = "timer",
.channels = MAP(S3C2412_DMAREQSEL_TIMER),
.channels_rx = MAP(S3C2412_DMAREQSEL_TIMER),
},
[DMACH_I2S_IN] = {
.name = "i2s-sdi",
.channels = MAP(S3C2412_DMAREQSEL_I2SRX),
.channels_rx = MAP(S3C2412_DMAREQSEL_I2SRX),
},
[DMACH_I2S_OUT] = {
.name = "i2s-sdo",
.channels = MAP(S3C2412_DMAREQSEL_I2STX),
.channels_rx = MAP(S3C2412_DMAREQSEL_I2STX),
},
[DMACH_USB_EP1] = {
.name = "usb-ep1",
.channels = MAP(S3C2412_DMAREQSEL_USBEP1),
.channels_rx = MAP(S3C2412_DMAREQSEL_USBEP1),
},
[DMACH_USB_EP2] = {
.name = "usb-ep2",
.channels = MAP(S3C2412_DMAREQSEL_USBEP2),
.channels_rx = MAP(S3C2412_DMAREQSEL_USBEP2),
},
[DMACH_USB_EP3] = {
.name = "usb-ep3",
.channels = MAP(S3C2412_DMAREQSEL_USBEP3),
.channels_rx = MAP(S3C2412_DMAREQSEL_USBEP3),
},
[DMACH_USB_EP4] = {
.name = "usb-ep4",
.channels = MAP(S3C2412_DMAREQSEL_USBEP4),
.channels_rx = MAP(S3C2412_DMAREQSEL_USBEP4),
},
};
static void s3c2412_dma_direction(struct s3c2410_dma_chan *chan,
struct s3c24xx_dma_map *map,
enum dma_data_direction dir)
{
unsigned long chsel;
if (dir == DMA_FROM_DEVICE)
chsel = map->channels_rx[0];
else
chsel = map->channels[0];
chsel &= ~DMA_CH_VALID;
chsel |= S3C2412_DMAREQSEL_HW;
writel(chsel, chan->regs + S3C2412_DMA_DMAREQSEL);
}
static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
struct s3c24xx_dma_map *map)
{
s3c2412_dma_direction(chan, map, chan->source);
}
static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
.select = s3c2412_dma_select,
.direction = s3c2412_dma_direction,
.dcon_mask = 0,
.map = s3c2412_dma_mappings,
.map_size = ARRAY_SIZE(s3c2412_dma_mappings),
};
static int __init s3c2412_dma_add(struct sys_device *sysdev)
{
s3c2410_dma_init();
return s3c24xx_dma_init_map(&s3c2412_dma_sel);
}
static struct sysdev_driver s3c2412_dma_driver = {
.add = s3c2412_dma_add,
};
static int __init s3c2412_dma_init(void)
{
return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver);
}
arch_initcall(s3c2412_dma_init);
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __org_omg_IOP_TaggedComponentHolder__
#define __org_omg_IOP_TaggedComponentHolder__
#pragma interface
#include <java/lang/Object.h>
extern "Java"
{
namespace org
{
namespace omg
{
namespace CORBA
{
class TypeCode;
namespace portable
{
class InputStream;
class OutputStream;
}
}
namespace IOP
{
class TaggedComponent;
class TaggedComponentHolder;
}
}
}
}
class org::omg::IOP::TaggedComponentHolder : public ::java::lang::Object
{
public:
TaggedComponentHolder();
TaggedComponentHolder(::org::omg::IOP::TaggedComponent *);
void _read(::org::omg::CORBA::portable::InputStream *);
void _write(::org::omg::CORBA::portable::OutputStream *);
::org::omg::CORBA::TypeCode * _type();
::org::omg::IOP::TaggedComponent * __attribute__((aligned(__alignof__( ::java::lang::Object)))) value;
static ::java::lang::Class class$;
};
#endif // __org_omg_IOP_TaggedComponentHolder__
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_java_rmi_dgc_LeaseRenewingTask__
#define __gnu_java_rmi_dgc_LeaseRenewingTask__
#pragma interface
#include <java/lang/Object.h>
extern "Java"
{
namespace gnu
{
namespace java
{
namespace rmi
{
namespace dgc
{
class LeaseRenewingTask;
}
namespace server
{
class UnicastRef;
}
}
}
}
namespace java
{
namespace rmi
{
namespace dgc
{
class Lease;
}
}
}
}
class gnu::java::rmi::dgc::LeaseRenewingTask : public ::java::lang::Object
{
public:
LeaseRenewingTask(::gnu::java::rmi::server::UnicastRef *);
static void scheduleLeases(::gnu::java::rmi::server::UnicastRef *);
virtual void schedule(::java::rmi::dgc::Lease *);
virtual void renew();
virtual ::java::rmi::dgc::Lease * notifyDGC(::gnu::java::rmi::server::UnicastRef *);
static jlong REQUEST_LEASE_DURATION;
public: // actually package-private
::java::util::LinkedList * __attribute__((aligned(__alignof__( ::java::lang::Object)))) ref;
::java::rmi::dgc::Lease * lease;
static ::java::util::Timer * timer;
static ::java::util::WeakHashMap * existingTasks;
public:
static ::java::lang::Class class$;
};
#endif // __gnu_java_rmi_dgc_LeaseRenewingTask__
|
#ifndef __SOCK_DIAG_H__
#define __SOCK_DIAG_H__
#include <linux/user_namespace.h>
#include <uapi/linux/sock_diag.h>
struct sk_buff;
struct nlmsghdr;
struct sock;
struct sock_diag_handler {
__u8 family;
int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
int (*destroy)(struct sk_buff *skb, struct nlmsghdr *nlh);
};
int sock_diag_register(const struct sock_diag_handler *h);
void sock_diag_unregister(const struct sock_diag_handler *h);
void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
int sock_diag_check_cookie(void *sk, __u32 *cookie);
void sock_diag_save_cookie(void *sk, __u32 *cookie);
int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
struct sk_buff *skb, int attrtype);
int sock_diag_destroy(struct sock *sk, int err);
#endif
|
/*
$License:
Copyright (C) 2010 InvenSense Corporation, All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
$
*/
#include <string.h>
#ifdef __KERNEL__
#include <linux/module.h>
#endif
#include "mpu.h"
#include "mlsl.h"
#include "mlos.h"
#include <log.h>
#undef MPL_LOG_TAG
#define MPL_LOG_TAG "MPL-compass"
#define AK8963_REG_ST1 (0x02)
#define AK8963_REG_HXL (0x03)
#define AK8963_REG_ST2 (0x09)
#define AK8963_REG_CNTL (0x0A)
#define AK8963_CNTL_MODE_POWER_DOWN (0x00)
#define AK8963_CNTL_MODE_SINGLE_MEASUREMENT (0x01)
int ak8963_suspend(void *mlsl_handle,
struct ext_slave_descr *slave,
struct ext_slave_platform_data *pdata)
{
int result = ML_SUCCESS;
result =
MLSLSerialWriteSingle(mlsl_handle, pdata->address,
AK8963_REG_CNTL,
AK8963_CNTL_MODE_POWER_DOWN);
MLOSSleep(1);
ERROR_CHECK(result);
return result;
}
int ak8963_resume(void *mlsl_handle,
struct ext_slave_descr *slave,
struct ext_slave_platform_data *pdata)
{
int result = ML_SUCCESS;
result =
MLSLSerialWriteSingle(mlsl_handle, pdata->address,
AK8963_REG_CNTL,
AK8963_CNTL_MODE_SINGLE_MEASUREMENT);
ERROR_CHECK(result);
return result;
}
int ak8963_read(void *mlsl_handle,
struct ext_slave_descr *slave,
struct ext_slave_platform_data *pdata, unsigned char *data)
{
unsigned char regs[8];
unsigned char *stat = ®s[0];
unsigned char *stat2 = ®s[7];
int result = ML_SUCCESS;
int status = ML_SUCCESS;
result =
MLSLSerialRead(mlsl_handle, pdata->address, AK8963_REG_ST1,
8, regs);
ERROR_CHECK(result);
if (*stat & 0x01) {
memcpy(data, ®s[1], 6);
status = ML_SUCCESS;
}
if (*stat2 & 0x04)
status = ML_ERROR_COMPASS_DATA_ERROR;
if (*stat2 & 0x08)
status = ML_ERROR_COMPASS_DATA_OVERFLOW;
if (*stat & 0x02) {
status = ML_SUCCESS;
}
if (*stat != 0x00 || *stat2 != 0x00) {
result =
MLSLSerialWriteSingle(mlsl_handle, pdata->address,
AK8963_REG_CNTL,
AK8963_CNTL_MODE_SINGLE_MEASUREMENT);
ERROR_CHECK(result);
}
return status;
}
static int ak8963_config(void *mlsl_handle,
struct ext_slave_descr *slave,
struct ext_slave_platform_data *pdata,
struct ext_slave_config *data)
{
int result;
if (!data->data)
return ML_ERROR_INVALID_PARAMETER;
switch (data->key) {
case MPU_SLAVE_WRITE_REGISTERS:
result = MLSLSerialWrite(mlsl_handle, pdata->address,
data->len,
(unsigned char *)data->data);
ERROR_CHECK(result);
break;
case MPU_SLAVE_CONFIG_ODR_SUSPEND:
case MPU_SLAVE_CONFIG_ODR_RESUME:
case MPU_SLAVE_CONFIG_FSR_SUSPEND:
case MPU_SLAVE_CONFIG_FSR_RESUME:
case MPU_SLAVE_CONFIG_MOT_THS:
case MPU_SLAVE_CONFIG_NMOT_THS:
case MPU_SLAVE_CONFIG_MOT_DUR:
case MPU_SLAVE_CONFIG_NMOT_DUR:
case MPU_SLAVE_CONFIG_IRQ_SUSPEND:
case MPU_SLAVE_CONFIG_IRQ_RESUME:
default:
return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
};
return ML_SUCCESS;
}
static int ak8963_get_config(void *mlsl_handle,
struct ext_slave_descr *slave,
struct ext_slave_platform_data *pdata,
struct ext_slave_config *data)
{
int result;
if (!data->data)
return ML_ERROR_INVALID_PARAMETER;
switch (data->key) {
case MPU_SLAVE_READ_REGISTERS:
{
unsigned char *serial_data = (unsigned char *)data->data;
result = MLSLSerialRead(mlsl_handle, pdata->address,
serial_data[0],
data->len - 1,
&serial_data[1]);
ERROR_CHECK(result);
break;
}
case MPU_SLAVE_CONFIG_ODR_SUSPEND:
case MPU_SLAVE_CONFIG_ODR_RESUME:
case MPU_SLAVE_CONFIG_FSR_SUSPEND:
case MPU_SLAVE_CONFIG_FSR_RESUME:
case MPU_SLAVE_CONFIG_MOT_THS:
case MPU_SLAVE_CONFIG_NMOT_THS:
case MPU_SLAVE_CONFIG_MOT_DUR:
case MPU_SLAVE_CONFIG_NMOT_DUR:
case MPU_SLAVE_CONFIG_IRQ_SUSPEND:
case MPU_SLAVE_CONFIG_IRQ_RESUME:
default:
return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
};
return ML_SUCCESS;
}
struct ext_slave_descr ak8963_descr = {
NULL,
NULL,
ak8963_suspend,
ak8963_resume,
ak8963_read,
ak8963_config,
ak8963_get_config,
"ak8963",
EXT_SLAVE_TYPE_COMPASS,
COMPASS_ID_AKM8963,
0x01,
9,
EXT_SLAVE_LITTLE_ENDIAN,
{9830, 4000}
};
struct ext_slave_descr *ak8963_get_slave_descr(void)
{
return &ak8963_descr;
}
EXPORT_SYMBOL(ak8963_get_slave_descr);
|
/*
* Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <xfs.h>
#include "debug.h"
/* xfs_mount.h drags a lot of crap in, sorry.. */
#include "xfs_sb.h"
#include "xfs_inum.h"
#include "xfs_ag.h"
#include "xfs_mount.h"
#include "xfs_error.h"
static char message[1024]; /* keep it off the stack */
static DEFINE_SPINLOCK(xfs_err_lock);
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
#define XFS_MAX_ERR_LEVEL 7
#define XFS_ERR_MASK ((1 << 3) - 1)
static const char * const err_level[XFS_MAX_ERR_LEVEL+1] =
{KERN_EMERG, KERN_ALERT, KERN_CRIT,
KERN_ERR, KERN_WARNING, KERN_NOTICE,
KERN_INFO, KERN_DEBUG};
void
cmn_err(register int level, char *fmt, ...)
{
char *fp = fmt;
int len;
ulong flags;
va_list ap;
level &= XFS_ERR_MASK;
if (level > XFS_MAX_ERR_LEVEL)
level = XFS_MAX_ERR_LEVEL;
spin_lock_irqsave(&xfs_err_lock,flags);
va_start(ap, fmt);
if (*fmt == '!') fp++;
len = vsnprintf(message, sizeof(message), fp, ap);
if (len >= sizeof(message))
len = sizeof(message) - 1;
if (message[len-1] == '\n')
message[len-1] = 0;
printk("%s%s\n", err_level[level], message);
va_end(ap);
spin_unlock_irqrestore(&xfs_err_lock,flags);
BUG_ON(level == CE_PANIC);
}
void
xfs_fs_vcmn_err(
int level,
struct xfs_mount *mp,
char *fmt,
va_list ap)
{
unsigned long flags;
int len = 0;
level &= XFS_ERR_MASK;
if (level > XFS_MAX_ERR_LEVEL)
level = XFS_MAX_ERR_LEVEL;
spin_lock_irqsave(&xfs_err_lock,flags);
if (mp) {
len = sprintf(message, "Filesystem \"%s\": ", mp->m_fsname);
/*
* Skip the printk if we can't print anything useful
* due to an over-long device name.
*/
if (len >= sizeof(message))
goto out;
}
len = vsnprintf(message + len, sizeof(message) - len, fmt, ap);
if (len >= sizeof(message))
len = sizeof(message) - 1;
if (message[len-1] == '\n')
message[len-1] = 0;
printk("%s%s\n", err_level[level], message);
out:
spin_unlock_irqrestore(&xfs_err_lock,flags);
BUG_ON(level == CE_PANIC);
}
void
assfail(char *expr, char *file, int line)
{
printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line);
BUG();
}
void
xfs_hex_dump(void *p, int length)
{
print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_ADDRESS, 16, 1, p, length, 1);
}
|
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MSM_GEMINI_HW_H
#define MSM_GEMINI_HW_H
#include <media/msm_gemini.h>
#include "msm_gemini_hw_reg.h"
#include <linux/msm_ion.h>
#include <mach/iommu_domains.h>
struct msm_gemini_hw_buf {
struct msm_gemini_buf vbuf;
struct file *file;
uint32_t framedone_len;
uint32_t y_buffer_addr;
uint32_t y_len;
uint32_t cbcr_buffer_addr;
uint32_t cbcr_len;
uint32_t num_of_mcu_rows;
struct ion_handle *handle;
};
struct msm_gemini_hw_pingpong {
uint8_t is_fe; /* 1: fe; 0: we */
struct msm_gemini_hw_buf buf[2];
int buf_status[2];
int buf_active_index;
};
int msm_gemini_hw_pingpong_update(struct msm_gemini_hw_pingpong *pingpong_hw,
struct msm_gemini_hw_buf *buf);
void *msm_gemini_hw_pingpong_irq(struct msm_gemini_hw_pingpong *pingpong_hw);
void *msm_gemini_hw_pingpong_active_buffer(struct msm_gemini_hw_pingpong
*pingpong_hw);
void msm_gemini_hw_irq_clear(uint32_t, uint32_t);
int msm_gemini_hw_irq_get_status(void);
long msm_gemini_hw_encode_output_size(void);
#define MSM_GEMINI_HW_MASK_COMP_FRAMEDONE \
MSM_GEMINI_HW_IRQ_STATUS_FRAMEDONE_MASK
#define MSM_GEMINI_HW_MASK_COMP_FE \
MSM_GEMINI_HW_IRQ_STATUS_FE_RD_DONE_MASK
#define MSM_GEMINI_HW_MASK_COMP_WE \
(MSM_GEMINI_HW_IRQ_STATUS_WE_Y_PINGPONG_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_WE_CBCR_PINGPONG_MASK)
#define MSM_GEMINI_HW_MASK_COMP_RESET_ACK \
MSM_GEMINI_HW_IRQ_STATUS_RESET_ACK_MASK
#define MSM_GEMINI_HW_MASK_COMP_ERR \
(MSM_GEMINI_HW_IRQ_STATUS_FE_RTOVF_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_FE_VFE_OVERFLOW_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_WE_Y_BUFFER_OVERFLOW_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_WE_CBCR_BUFFER_OVERFLOW_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_WE_CH0_DATAFIFO_OVERFLOW_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_WE_CH1_DATAFIFO_OVERFLOW_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_BUS_ERROR_MASK | \
MSM_GEMINI_HW_IRQ_STATUS_VIOLATION_MASK)
#define msm_gemini_hw_irq_is_frame_done(gemini_irq_status) \
(gemini_irq_status & MSM_GEMINI_HW_MASK_COMP_FRAMEDONE)
#define msm_gemini_hw_irq_is_fe_pingpong(gemini_irq_status) \
(gemini_irq_status & MSM_GEMINI_HW_MASK_COMP_FE)
#define msm_gemini_hw_irq_is_we_pingpong(gemini_irq_status) \
(gemini_irq_status & MSM_GEMINI_HW_MASK_COMP_WE)
#define msm_gemini_hw_irq_is_reset_ack(gemini_irq_status) \
(gemini_irq_status & MSM_GEMINI_HW_MASK_COMP_RESET_ACK)
#define msm_gemini_hw_irq_is_err(gemini_irq_status) \
(gemini_irq_status & MSM_GEMINI_HW_MASK_COMP_ERR)
void msm_gemini_hw_fe_buffer_update(struct msm_gemini_hw_buf *p_input,
uint8_t pingpong_index);
void msm_gemini_hw_we_buffer_update(struct msm_gemini_hw_buf *p_input,
uint8_t pingpong_index);
void msm_gemini_hw_we_buffer_cfg(uint8_t is_realtime);
void msm_gemini_hw_fe_start(void);
void msm_gemini_hw_clk_cfg(void);
void msm_gemini_hw_reset(void *base, int size);
void msm_gemini_hw_irq_cfg(void);
void msm_gemini_hw_init(void *base, int size);
uint32_t msm_gemini_hw_read(struct msm_gemini_hw_cmd *hw_cmd_p);
void msm_gemini_hw_write(struct msm_gemini_hw_cmd *hw_cmd_p);
int msm_gemini_hw_wait(struct msm_gemini_hw_cmd *hw_cmd_p, int m_us);
void msm_gemini_hw_delay(struct msm_gemini_hw_cmd *hw_cmd_p, int m_us);
int msm_gemini_hw_exec_cmds(struct msm_gemini_hw_cmd *hw_cmd_p, uint32_t m_cmds);
void msm_gemini_io_dump(int size);
void msm_gemini_io_w(uint32_t offset, uint32_t val);
uint32_t msm_gemini_io_r(uint32_t offset);
#define MSM_GEMINI_PIPELINE_CLK_128MHZ 128 /* 8MP 128MHz */
#define MSM_GEMINI_PIPELINE_CLK_140MHZ 140 /* 9MP 140MHz */
#define MSM_GEMINI_PIPELINE_CLK_200MHZ 153 /* 12MP 153MHz */
#endif /* MSM_GEMINI_HW_H */
|
/*
* Copyright(c) 2009 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* Maintained at www.Open-FCoE.org
*/
#ifndef _FCOE_H_
#define _FCOE_H_
#include <linux/skbuff.h>
#include <linux/kthread.h>
#define FCOE_MAX_QUEUE_DEPTH 256
#define FCOE_MIN_QUEUE_DEPTH 32
#define FCOE_WORD_TO_BYTE 4
#define FCOE_VERSION "0.1"
#define FCOE_NAME "fcoe"
#define FCOE_VENDOR "Open-FCoE.org"
#define FCOE_MAX_LUN 0xFFFF
#define FCOE_MAX_FCP_TARGET 256
#define FCOE_MAX_OUTSTANDING_COMMANDS 1024
#define FCOE_MIN_XID 0x0000 /* the min xid supported by fcoe_sw */
#define FCOE_MAX_XID 0x0FFF /* the max xid supported by fcoe_sw */
extern unsigned int fcoe_debug_logging;
#define FCOE_LOGGING 0x01 /* General logging, not categorized */
#define FCOE_NETDEV_LOGGING 0x02 /* Netdevice logging */
#define FCOE_CHECK_LOGGING(LEVEL, CMD) \
do { \
if (unlikely(fcoe_debug_logging & LEVEL)) \
do { \
CMD; \
} while (0); \
} while (0)
#define FCOE_DBG(fmt, args...) \
FCOE_CHECK_LOGGING(FCOE_LOGGING, \
pr_info("fcoe: " fmt, ##args);)
#define FCOE_NETDEV_DBG(netdev, fmt, args...) \
FCOE_CHECK_LOGGING(FCOE_NETDEV_LOGGING, \
pr_info("fcoe: %s: " fmt, \
netdev->name, ##args);)
/**
* struct fcoe_interface - A FCoE interface
* @list: Handle for a list of FCoE interfaces
* @netdev: The associated net device
* @fcoe_packet_type: FCoE packet type
* @fip_packet_type: FIP packet type
* @oem: The offload exchange manager for all local port
* instances associated with this port
* @removed: Indicates fcoe interface removed from net device
* @priority: Priority for the FCoE packet (DCB)
* This structure is 1:1 with a net device.
*/
struct fcoe_interface {
struct list_head list;
struct net_device *netdev;
struct net_device *realdev;
struct packet_type fcoe_packet_type;
struct packet_type fip_packet_type;
struct fc_exch_mgr *oem;
u8 removed;
u8 priority;
};
#define fcoe_to_ctlr(x) \
(struct fcoe_ctlr *)(((struct fcoe_ctlr *)(x)) - 1)
#define fcoe_from_ctlr(x) \
((struct fcoe_interface *)((x) + 1))
/**
* fcoe_netdev() - Return the net device associated with a local port
* @lport: The local port to get the net device from
*/
static inline struct net_device *fcoe_netdev(const struct fc_lport *lport)
{
return ((struct fcoe_interface *)
((struct fcoe_port *)lport_priv(lport))->priv)->netdev;
}
#endif /* _FCOE_H_ */
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c.
*
* Copyright (C) 2004 Paul Mackerras, IBM Corp.
*/
#include <linux/bsearch.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sort.h>
#include <linux/uaccess.h>
#include <linux/extable.h>
#ifndef ARCH_HAS_RELATIVE_EXTABLE
#define ex_to_insn(x) ((x)->insn)
#else
static inline unsigned long ex_to_insn(const struct exception_table_entry *x)
{
return (unsigned long)&x->insn + x->insn;
}
#endif
#ifndef ARCH_HAS_SORT_EXTABLE
#ifndef ARCH_HAS_RELATIVE_EXTABLE
#define swap_ex NULL
#else
static void swap_ex(void *a, void *b, int size)
{
struct exception_table_entry *x = a, *y = b, tmp;
int delta = b - a;
tmp = *x;
x->insn = y->insn + delta;
y->insn = tmp.insn - delta;
#ifdef swap_ex_entry_fixup
swap_ex_entry_fixup(x, y, tmp, delta);
#else
x->fixup = y->fixup + delta;
y->fixup = tmp.fixup - delta;
#endif
}
#endif /* ARCH_HAS_RELATIVE_EXTABLE */
/*
* The exception table needs to be sorted so that the binary
* search that we use to find entries in it works properly.
* This is used both for the kernel exception table and for
* the exception tables of modules that get loaded.
*/
static int cmp_ex_sort(const void *a, const void *b)
{
const struct exception_table_entry *x = a, *y = b;
/* avoid overflow */
if (ex_to_insn(x) > ex_to_insn(y))
return 1;
if (ex_to_insn(x) < ex_to_insn(y))
return -1;
return 0;
}
void sort_extable(struct exception_table_entry *start,
struct exception_table_entry *finish)
{
sort(start, finish - start, sizeof(struct exception_table_entry),
cmp_ex_sort, swap_ex);
}
#ifdef CONFIG_MODULES
/*
* If the exception table is sorted, any referring to the module init
* will be at the beginning or the end.
*/
void trim_init_extable(struct module *m)
{
/*trim the beginning*/
while (m->num_exentries &&
within_module_init(ex_to_insn(&m->extable[0]), m)) {
m->extable++;
m->num_exentries--;
}
/*trim the end*/
while (m->num_exentries &&
within_module_init(ex_to_insn(&m->extable[m->num_exentries - 1]),
m))
m->num_exentries--;
}
#endif /* CONFIG_MODULES */
#endif /* !ARCH_HAS_SORT_EXTABLE */
#ifndef ARCH_HAS_SEARCH_EXTABLE
static int cmp_ex_search(const void *key, const void *elt)
{
const struct exception_table_entry *_elt = elt;
unsigned long _key = *(unsigned long *)key;
/* avoid overflow */
if (_key > ex_to_insn(_elt))
return 1;
if (_key < ex_to_insn(_elt))
return -1;
return 0;
}
/*
* Search one exception table for an entry corresponding to the
* given instruction address, and return the address of the entry,
* or NULL if none is found.
* We use a binary search, and thus we assume that the table is
* already sorted.
*/
const struct exception_table_entry *
search_extable(const struct exception_table_entry *base,
const size_t num,
unsigned long value)
{
return bsearch(&value, base, num,
sizeof(struct exception_table_entry), cmp_ex_search);
}
#endif
|
/*
* Copyright 2010-2011 Freescale Semiconductor, Inc.
*
* Author: Roy Zang <tie-fei.zang@freescale.com>
*
* Description:
* P1023 RDS Board Setup
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/fsl_devices.h>
#include <linux/of_platform.h>
#include <linux/of_device.h>
#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <mm/mmu_decl.h>
#include <asm/prom.h>
#include <asm/udbg.h>
#include <asm/mpic.h>
#include "smp.h"
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc85xx.h"
/* ************************************************************************
*
* Setup the architecture
*
*/
static void __init mpc85xx_rds_setup_arch(void)
{
struct device_node *np;
if (ppc_md.progress)
ppc_md.progress("p1023_rds_setup_arch()", 0);
/* Map BCSR area */
np = of_find_node_by_name(NULL, "bcsr");
if (np != NULL) {
static u8 __iomem *bcsr_regs;
bcsr_regs = of_iomap(np, 0);
of_node_put(np);
if (!bcsr_regs) {
printk(KERN_ERR
"BCSR: Failed to map bcsr register space\n");
return;
} else {
#define BCSR15_I2C_BUS0_SEG_CLR 0x07
#define BCSR15_I2C_BUS0_SEG2 0x02
/*
* Note: Accessing exclusively i2c devices.
*
* The i2c controller selects initially ID EEPROM in the u-boot;
* but if menu configuration selects RTC support in the kernel,
* the i2c controller switches to select RTC chip in the kernel.
*/
#ifdef CONFIG_RTC_CLASS
/* Enable RTC chip on the segment #2 of i2c */
clrbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG_CLR);
setbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG2);
#endif
iounmap(bcsr_regs);
}
}
#ifdef CONFIG_PCI
for_each_compatible_node(np, "pci", "fsl,p1023-pcie")
fsl_add_bridge(np, 0);
#endif
mpc85xx_smp_init();
}
machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
static void __init mpc85xx_rds_pic_init(void)
{
struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
MPIC_SINGLE_DEST_CPU,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
mpic_init(mpic);
}
static int __init p1023_rds_probe(void)
{
unsigned long root = of_get_flat_dt_root();
return of_flat_dt_is_compatible(root, "fsl,P1023RDS");
}
define_machine(p1023_rds) {
.name = "P1023 RDS",
.probe = p1023_rds_probe,
.setup_arch = mpc85xx_rds_setup_arch,
.init_IRQ = mpc85xx_rds_pic_init,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
#endif
};
|
/* { dg-do run } */
/* { dg-require-weak "" } */
int g_6[1][2] = {{1,1}};
int g_34 = 0;
int *const g_82 = &g_6[0][1];
int *g_85[2][1] __attribute__((weak));
void __attribute__((noinline))
func_4 (int x)
{
int i;
for (i = 0; i <= x; i++) {
if (g_6[0][1]) {
*g_82 = 1;
} else {
int **l_109 = &g_85[1][0];
if (&g_82 != l_109) {
} else {
*l_109 = &g_6[0][1];
}
*g_82 = 1;
}
}
}
int main (void)
{
g_85[0][0] = &g_34;
g_85[1][0] = &g_34;
func_4(1);
return 0;
}
|
#ifndef _NET_DN_FIB_H
#define _NET_DN_FIB_H
/* WARNING: The ordering of these elements must match ordering
* of RTA_* rtnetlink attribute numbers.
*/
struct dn_kern_rta
{
void *rta_dst;
void *rta_src;
int *rta_iif;
int *rta_oif;
void *rta_gw;
u32 *rta_priority;
void *rta_prefsrc;
struct rtattr *rta_mx;
struct rtattr *rta_mp;
unsigned char *rta_protoinfo;
u32 *rta_flow;
struct rta_cacheinfo *rta_ci;
struct rta_session *rta_sess;
};
struct dn_fib_res {
struct fib_rule *r;
struct dn_fib_info *fi;
unsigned char prefixlen;
unsigned char nh_sel;
unsigned char type;
unsigned char scope;
};
struct dn_fib_nh {
struct net_device *nh_dev;
unsigned nh_flags;
unsigned char nh_scope;
int nh_weight;
int nh_power;
int nh_oif;
__le16 nh_gw;
};
struct dn_fib_info {
struct dn_fib_info *fib_next;
struct dn_fib_info *fib_prev;
int fib_treeref;
atomic_t fib_clntref;
int fib_dead;
unsigned fib_flags;
int fib_protocol;
__le16 fib_prefsrc;
__u32 fib_priority;
__u32 fib_metrics[RTAX_MAX];
#define dn_fib_mtu fib_metrics[RTAX_MTU-1]
#define dn_fib_window fib_metrics[RTAX_WINDOW-1]
#define dn_fib_rtt fib_metrics[RTAX_RTT-1]
#define dn_fib_advmss fib_metrics[RTAX_ADVMSS-1]
int fib_nhs;
int fib_power;
struct dn_fib_nh fib_nh[0];
#define dn_fib_dev fib_nh[0].nh_dev
};
#define DN_FIB_RES_RESET(res) ((res).nh_sel = 0)
#define DN_FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel])
#define DN_FIB_RES_PREFSRC(res) ((res).fi->fib_prefsrc ? : __dn_fib_res_prefsrc(&res))
#define DN_FIB_RES_GW(res) (DN_FIB_RES_NH(res).nh_gw)
#define DN_FIB_RES_DEV(res) (DN_FIB_RES_NH(res).nh_dev)
#define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif)
typedef struct {
__le16 datum;
} dn_fib_key_t;
typedef struct {
__le16 datum;
} dn_fib_hash_t;
typedef struct {
__u16 datum;
} dn_fib_idx_t;
struct dn_fib_node {
struct dn_fib_node *fn_next;
struct dn_fib_info *fn_info;
#define DN_FIB_INFO(f) ((f)->fn_info)
dn_fib_key_t fn_key;
u8 fn_type;
u8 fn_scope;
u8 fn_state;
};
struct dn_fib_table {
struct hlist_node hlist;
u32 n;
int (*insert)(struct dn_fib_table *t, struct rtmsg *r,
struct dn_kern_rta *rta, struct nlmsghdr *n,
struct netlink_skb_parms *req);
int (*delete)(struct dn_fib_table *t, struct rtmsg *r,
struct dn_kern_rta *rta, struct nlmsghdr *n,
struct netlink_skb_parms *req);
int (*lookup)(struct dn_fib_table *t, const struct flowi *fl,
struct dn_fib_res *res);
int (*flush)(struct dn_fib_table *t);
int (*dump)(struct dn_fib_table *t, struct sk_buff *skb, struct netlink_callback *cb);
unsigned char data[0];
};
#ifdef CONFIG_DECNET_ROUTER
/*
* dn_fib.c
*/
extern void dn_fib_init(void);
extern void dn_fib_cleanup(void);
extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg);
extern struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r,
struct dn_kern_rta *rta,
const struct nlmsghdr *nlh, int *errp);
extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi,
const struct flowi *fl,
struct dn_fib_res *res);
extern void dn_fib_release_info(struct dn_fib_info *fi);
extern __le16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type);
extern void dn_fib_flush(void);
extern void dn_fib_select_multipath(const struct flowi *fl,
struct dn_fib_res *res);
/*
* dn_tables.c
*/
extern struct dn_fib_table *dn_fib_get_table(u32 n, int creat);
extern struct dn_fib_table *dn_fib_empty_table(void);
extern void dn_fib_table_init(void);
extern void dn_fib_table_cleanup(void);
/*
* dn_rules.c
*/
extern void dn_fib_rules_init(void);
extern void dn_fib_rules_cleanup(void);
extern unsigned dnet_addr_type(__le16 addr);
extern int dn_fib_lookup(struct flowi *fl, struct dn_fib_res *res);
extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb);
extern void dn_fib_free_info(struct dn_fib_info *fi);
static inline void dn_fib_info_put(struct dn_fib_info *fi)
{
if (atomic_dec_and_test(&fi->fib_clntref))
dn_fib_free_info(fi);
}
static inline void dn_fib_res_put(struct dn_fib_res *res)
{
if (res->fi)
dn_fib_info_put(res->fi);
if (res->r)
fib_rule_put(res->r);
}
#else /* Endnode */
#define dn_fib_init() do { } while(0)
#define dn_fib_cleanup() do { } while(0)
#define dn_fib_lookup(fl, res) (-ESRCH)
#define dn_fib_info_put(fi) do { } while(0)
#define dn_fib_select_multipath(fl, res) do { } while(0)
#define dn_fib_rules_policy(saddr,res,flags) (0)
#define dn_fib_res_put(res) do { } while(0)
#endif /* CONFIG_DECNET_ROUTER */
static inline __le16 dnet_make_mask(int n)
{
if (n)
return cpu_to_le16(~((1 << (16 - n)) - 1));
return cpu_to_le16(0);
}
#endif /* _NET_DN_FIB_H */
|
#ifndef _ASM_ALPHA_FUTEX_H
#define _ASM_ALPHA_FUTEX_H
#ifdef __KERNEL__
#include <linux/futex.h>
#include <linux/uaccess.h>
#include <asm/errno.h>
#include <asm/barrier.h>
#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
__asm__ __volatile__( \
__ASM_SMP_MB \
"1: ldl_l %0,0(%2)\n" \
insn \
"2: stl_c %1,0(%2)\n" \
" beq %1,4f\n" \
" mov $31,%1\n" \
"3: .subsection 2\n" \
"4: br 1b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .long 1b-.\n" \
" lda $31,3b-1b(%1)\n" \
" .long 2b-.\n" \
" lda $31,3b-2b(%1)\n" \
" .previous\n" \
: "=&r" (oldval), "=&r"(ret) \
: "r" (uaddr), "r"(oparg) \
: "memory")
static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
{
int op = (encoded_op >> 28) & 7;
int cmp = (encoded_op >> 24) & 15;
int oparg = (encoded_op << 8) >> 20;
int cmparg = (encoded_op << 20) >> 20;
int oldval = 0, ret;
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
oparg = 1 << oparg;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
pagefault_disable();
switch (op) {
case FUTEX_OP_SET:
__futex_atomic_op("mov %3,%1\n", ret, oldval, uaddr, oparg);
break;
case FUTEX_OP_ADD:
__futex_atomic_op("addl %0,%3,%1\n", ret, oldval, uaddr, oparg);
break;
case FUTEX_OP_OR:
__futex_atomic_op("or %0,%3,%1\n", ret, oldval, uaddr, oparg);
break;
case FUTEX_OP_ANDN:
__futex_atomic_op("andnot %0,%3,%1\n", ret, oldval, uaddr, oparg);
break;
case FUTEX_OP_XOR:
__futex_atomic_op("xor %0,%3,%1\n", ret, oldval, uaddr, oparg);
break;
default:
ret = -ENOSYS;
}
pagefault_enable();
if (!ret) {
switch (cmp) {
case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
default: ret = -ENOSYS;
}
}
return ret;
}
static inline int
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
int ret = 0, cmp;
u32 prev;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
__asm__ __volatile__ (
__ASM_SMP_MB
"1: ldl_l %1,0(%3)\n"
" cmpeq %1,%4,%2\n"
" beq %2,3f\n"
" mov %5,%2\n"
"2: stl_c %2,0(%3)\n"
" beq %2,4f\n"
"3: .subsection 2\n"
"4: br 1b\n"
" .previous\n"
" .section __ex_table,\"a\"\n"
" .long 1b-.\n"
" lda $31,3b-1b(%0)\n"
" .long 2b-.\n"
" lda $31,3b-2b(%0)\n"
" .previous\n"
: "+r"(ret), "=&r"(prev), "=&r"(cmp)
: "r"(uaddr), "r"((long)(int)oldval), "r"(newval)
: "memory");
*uval = prev;
return ret;
}
#endif /* __KERNEL__ */
#endif /* _ASM_ALPHA_FUTEX_H */
|
/*
* arch/sh/mm/tlb-sh4.c
*
* SH-4 specific TLB operations
*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2002 - 2007 Paul Mundt
*
* Released under the terms of the GNU GPL v2.0.
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/io.h>
#include <asm/system.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
{
unsigned long flags, pteval, vpn;
/*
* Handle debugger faulting in for debugee.
*/
if (vma && current->active_mm != vma->vm_mm)
return;
local_irq_save(flags);
/* Set PTEH register */
vpn = (address & MMU_VPN_MASK) | get_asid();
__raw_writel(vpn, MMU_PTEH);
pteval = pte.pte_low;
/* Set PTEA register */
#ifdef CONFIG_X2TLB
/*
* For the extended mode TLB this is trivial, only the ESZ and
* EPR bits need to be written out to PTEA, with the remainder of
* the protection bits (with the exception of the compat-mode SZ
* and PR bits, which are cleared) being written out in PTEL.
*/
__raw_writel(pte.pte_high, MMU_PTEA);
#else
if (cpu_data->flags & CPU_HAS_PTEA) {
/* The last 3 bits and the first one of pteval contains
* the PTEA timing control and space attribute bits
*/
__raw_writel(copy_ptea_attributes(pteval), MMU_PTEA);
}
#endif
/* Set PTEL register */
pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
#ifdef CONFIG_CACHE_WRITETHROUGH
pteval |= _PAGE_WT;
#endif
/* conveniently, we want all the software flags to be 0 anyway */
__raw_writel(pteval, MMU_PTEL);
/* Load the TLB */
asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
local_irq_restore(flags);
}
void local_flush_tlb_one(unsigned long asid, unsigned long page)
{
unsigned long addr, data;
/*
* NOTE: PTEH.ASID should be set to this MM
* _AND_ we need to write ASID to the array.
*
* It would be simple if we didn't need to set PTEH.ASID...
*/
addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT;
data = page | asid; /* VALID bit is off */
jump_to_uncached();
__raw_writel(data, addr);
back_to_cached();
}
void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;
/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();
status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);
if (status == 0)
status = MMUCR_URB_NENTRIES;
for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));
for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));
back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
*/
#ifndef __ASM_MIPS_MACH_BCM3384_WAR_H
#define __ASM_MIPS_MACH_BCM3384_WAR_H
#define R4600_V1_INDEX_ICACHEOP_WAR 0
#define R4600_V1_HIT_CACHEOP_WAR 0
#define R4600_V2_HIT_CACHEOP_WAR 0
#define R5432_CP0_INTERRUPT_WAR 0
#define BCM1250_M3_WAR 0
#define SIBYTE_1956_WAR 0
#define MIPS4K_ICACHE_REFILL_WAR 0
#define MIPS_CACHE_SYNC_WAR 0
#define TX49XX_ICACHE_INDEX_INV_WAR 0
#define ICACHE_REFILLS_WORKAROUND_WAR 0
#define R10000_LLSC_WAR 0
#define MIPS34K_MISSED_ITLB_WAR 0
#endif /* __ASM_MIPS_MACH_BCM3384_WAR_H */
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_SCHED_RT_H
#define _LINUX_SCHED_RT_H
#include <linux/sched.h>
struct task_struct;
static inline int rt_prio(int prio)
{
if (unlikely(prio < MAX_RT_PRIO))
return 1;
return 0;
}
static inline int rt_task(struct task_struct *p)
{
return rt_prio(p->prio);
}
static inline bool task_is_realtime(struct task_struct *tsk)
{
int policy = tsk->policy;
if (policy == SCHED_FIFO || policy == SCHED_RR)
return true;
if (policy == SCHED_DEADLINE)
return true;
return false;
}
#ifdef CONFIG_RT_MUTEXES
/*
* Must hold either p->pi_lock or task_rq(p)->lock.
*/
static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *p)
{
return p->pi_top_task;
}
extern void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task);
extern void rt_mutex_adjust_pi(struct task_struct *p);
static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
{
return tsk->pi_blocked_on != NULL;
}
#else
static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
{
return NULL;
}
# define rt_mutex_adjust_pi(p) do { } while (0)
static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
{
return false;
}
#endif
extern void normalize_rt_tasks(void);
/*
* default timeslice is 100 msecs (used only for SCHED_RR tasks).
* Timeslices get refilled after they expire.
*/
#define RR_TIMESLICE (100 * HZ / 1000)
#endif /* _LINUX_SCHED_RT_H */
|
#undef TRACE_SYSTEM
#define TRACE_SYSTEM cpufreq_interactive
#if !defined(_TRACE_CPUFREQ_INTERACTIVE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_CPUFREQ_INTERACTIVE_H
#include <linux/tracepoint.h>
DECLARE_EVENT_CLASS(set,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq),
TP_STRUCT__entry(
__field( u32, cpu_id )
__field(unsigned long, targfreq )
__field(unsigned long, actualfreq )
),
TP_fast_assign(
__entry->cpu_id = (u32) cpu_id;
__entry->targfreq = targfreq;
__entry->actualfreq = actualfreq;
),
TP_printk("cpu=%u targ=%lu actual=%lu",
__entry->cpu_id, __entry->targfreq,
__entry->actualfreq)
);
DEFINE_EVENT(set, cpufreq_interactive_setspeed,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq)
);
#ifdef CONFIG_ARCH_EXYNOS
DEFINE_EVENT(set, cpufreq_interactive_cpu_min_qos,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq)
);
DEFINE_EVENT(set, cpufreq_interactive_cpu_max_qos,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq)
);
#ifdef CONFIG_ARM_EXYNOS_MP_CPUFREQ
DEFINE_EVENT(set, cpufreq_interactive_kfc_min_qos,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq)
);
DEFINE_EVENT(set, cpufreq_interactive_kfc_max_qos,
TP_PROTO(u32 cpu_id, unsigned long targfreq,
unsigned long actualfreq),
TP_ARGS(cpu_id, targfreq, actualfreq)
);
#endif /* CONFIG_ARM_EXYNOS_MP_CPUFREQ */
#endif /* CONFIG_ARCH_EXYNOS */
DECLARE_EVENT_CLASS(loadeval,
TP_PROTO(unsigned long cpu_id, unsigned long load,
unsigned long curtarg, unsigned long curactual,
unsigned long newtarg),
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg),
TP_STRUCT__entry(
__field(unsigned long, cpu_id )
__field(unsigned long, load )
__field(unsigned long, curtarg )
__field(unsigned long, curactual )
__field(unsigned long, newtarg )
),
TP_fast_assign(
__entry->cpu_id = cpu_id;
__entry->load = load;
__entry->curtarg = curtarg;
__entry->curactual = curactual;
__entry->newtarg = newtarg;
),
TP_printk("cpu=%lu load=%lu cur=%lu actual=%lu targ=%lu",
__entry->cpu_id, __entry->load, __entry->curtarg,
__entry->curactual, __entry->newtarg)
);
DEFINE_EVENT(loadeval, cpufreq_interactive_target,
TP_PROTO(unsigned long cpu_id, unsigned long load,
unsigned long curtarg, unsigned long curactual,
unsigned long newtarg),
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
);
DEFINE_EVENT(loadeval, cpufreq_interactive_already,
TP_PROTO(unsigned long cpu_id, unsigned long load,
unsigned long curtarg, unsigned long curactual,
unsigned long newtarg),
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
);
DEFINE_EVENT(loadeval, cpufreq_interactive_notyet,
TP_PROTO(unsigned long cpu_id, unsigned long load,
unsigned long curtarg, unsigned long curactual,
unsigned long newtarg),
TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
);
#ifdef CONFIG_MODE_AUTO_CHANGE
DECLARE_EVENT_CLASS(modeeval,
TP_PROTO(unsigned long cpu_id, unsigned long total_load,
unsigned long single_enter, unsigned long multi_enter,
unsigned long single_exit, unsigned long multi_exit, unsigned long mode),
TP_ARGS(cpu_id, total_load, single_enter, multi_enter, single_exit, multi_exit, mode),
TP_STRUCT__entry(
__field(unsigned long, cpu_id )
__field(unsigned long, total_load )
__field(unsigned long, single_enter)
__field(unsigned long, multi_enter )
__field(unsigned long, single_exit )
__field(unsigned long, multi_exit )
__field(unsigned long, mode)
),
TP_fast_assign(
__entry->cpu_id = cpu_id;
__entry->total_load = total_load;
__entry->single_enter = single_enter;
__entry->multi_enter = multi_enter;
__entry->single_exit = single_exit;
__entry->multi_exit = multi_exit;
__entry->mode = mode ;
),
TP_printk("cpu=%lu load=%3lu s_en=%6lu m_en=%6lu s_ex=%6lu m_ex=%6lu ret=%lu",
__entry->cpu_id, __entry->total_load, __entry->single_enter,
__entry->multi_enter, __entry->single_exit, __entry->multi_exit, __entry->mode)
);
DEFINE_EVENT(modeeval, cpufreq_interactive_mode,
TP_PROTO(unsigned long cpu_id, unsigned long total_load,
unsigned long single_enter, unsigned long multi_enter,
unsigned long single_exit, unsigned long multi_exit, unsigned long mode),
TP_ARGS(cpu_id, total_load, single_enter, multi_enter, single_exit, multi_exit, mode)
);
#endif
TRACE_EVENT(cpufreq_interactive_boost,
TP_PROTO(const char *s),
TP_ARGS(s),
TP_STRUCT__entry(
__string(s, s)
),
TP_fast_assign(
__assign_str(s, s);
),
TP_printk("%s", __get_str(s))
);
TRACE_EVENT(cpufreq_interactive_unboost,
TP_PROTO(const char *s),
TP_ARGS(s),
TP_STRUCT__entry(
__string(s, s)
),
TP_fast_assign(
__assign_str(s, s);
),
TP_printk("%s", __get_str(s))
);
#endif /* _TRACE_CPUFREQ_INTERACTIVE_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
|
static int ap(int i);
static void testit(void){
int ir[4] = {0,1,2,3};
int ix,n,m;
n=1; m=3;
for (ix=1;ix<=4;ix++) {
if (n == 1) m = 4;
else m = n-1;
ap(ir[n-1]);
n = m;
}
}
static int t = 0;
static int a[4];
static int ap(int i){
if (t > 3)
abort();
a[t++] = i;
return 1;
}
int main(void)
{
testit();
if (a[0] != 0)
abort();
if (a[1] != 3)
abort();
if (a[2] != 2)
abort();
if (a[3] != 1)
abort();
exit(0);
}
|
/*
* Core functions for Marvell System On Chip
*
* Copyright (C) 2012 Marvell
*
* Lior Amsalem <alior@marvell.com>
* Gregory CLEMENT <gregory.clement@free-electrons.com>
* Thomas Petazzoni <thomas.petazzoni@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.
*/
#ifndef __ARCH_MVEBU_COMMON_H
#define __ARCH_MVEBU_COMMON_H
#define ARMADA_XP_MAX_CPUS 4
#include <linux/reboot.h>
void mvebu_restart(enum reboot_mode mode, const char *cmd);
void armada_370_xp_init_irq(void);
void armada_370_xp_handle_irq(struct pt_regs *regs);
void armada_xp_cpu_die(unsigned int cpu);
int armada_370_xp_coherency_init(void);
int armada_370_xp_pmsu_init(void);
void armada_xp_secondary_startup(void);
extern struct smp_operations armada_xp_smp_ops;
#endif
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <UIKit/UIKit.h>
#import "RCTBridge.h"
#import "RCTURLRequestHandler.h"
@class ALAssetsLibrary;
typedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total);
typedef void (^RCTImageLoaderCompletionBlock)(NSError *error, UIImage *image);
typedef void (^RCTImageLoaderCancellationBlock)(void);
@interface UIImage (React)
@property (nonatomic, copy) CAKeyframeAnimation *reactKeyframeAnimation;
@end
@interface RCTImageLoader : NSObject <RCTBridgeModule, RCTURLRequestHandler>
/**
* Loads the specified image at the highest available resolution.
* Can be called from any thread, will always call callback on main thread.
*/
- (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
callback:(RCTImageLoaderCompletionBlock)callback;
/**
* As above, but includes target size, scale and resizeMode, which are used to
* select the optimal dimensions for the loaded image.
*/
- (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(UIViewContentMode)resizeMode
progressBlock:(RCTImageLoaderProgressBlock)progressBlock
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;
/**
* Finds an appropriate image decoder and passes the target size, scale and
* resizeMode for optimal image decoding.
*/
- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(UIViewContentMode)resizeMode
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;
@end
@interface RCTBridge (RCTImageLoader)
/**
* The shared image loader instance
*/
@property (nonatomic, readonly) RCTImageLoader *imageLoader;
@end
/**
* Provides the interface needed to register an image data loader. Image data
* loaders are also bridge modules, so should be registered using
* RCT_EXPORT_MODULE().
*/
@protocol RCTImageURLLoader <RCTBridgeModule>
/**
* Indicates whether this data loader is capable of processing the specified
* request URL. Typically the handler would examine the scheme/protocol of the
* URL to determine this.
*/
- (BOOL)canLoadImageURL:(NSURL *)requestURL;
/**
* Send a network request to load the request URL. The method should call the
* progressHandler (if applicable) and the completionHandler when the request
* has finished. The method should also return a cancellation block, if
* applicable.
*/
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL size:(CGSize)size scale:(CGFloat)scale resizeMode:(UIViewContentMode)resizeMode progressHandler:(RCTImageLoaderProgressBlock)progressHandler completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;
@optional
/**
* If more than one RCTImageURLLoader responds YES to `-canLoadImageURL:`
* then `imageLoaderPriority` is used to determine which one to use. The handler
* with the highest priority will be selected. Default priority is zero. If
* two or more valid handlers have the same priority, the selection order is
* undefined.
*/
- (float)imageLoaderPriority;
@end
/**
* Provides the interface needed to register an image decoder. Image decoders
* are also bridge modules, so should be registered using RCT_EXPORT_MODULE().
*/
@protocol RCTImageDecoder <RCTBridgeModule>
/**
* Indicates whether this handler is capable of decoding the specified data.
* Typically the handler would examine some sort of header data to determine
* this.
*/
- (BOOL)canDecodeImageData:(NSData *)imageData;
/**
* Decode an image from the data object. The method should call the
* completionHandler when the decoding operation has finished. The method
* should also return a cancellation block, if applicable.
*/
- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData size:(CGSize)size scale:(CGFloat)scale resizeMode:(UIViewContentMode)resizeMode completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;
@optional
/**
* If more than one RCTImageDecoder responds YES to `-canDecodeImageData:`
* then `imageDecoderPriority` is used to determine which one to use. The
* handler with the highest priority will be selected. Default priority is zero.
* If two or more valid handlers have the same priority, the selection order is
* undefined.
*/
- (float)imageDecoderPriority;
@end
|
/*
* page.h - buffer/page management specific to NILFS
*
* Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Written by Ryusuke Konishi <ryusuke@osrg.net>,
* Seiji Kihara <kihara@osrg.net>.
*/
#ifndef _NILFS_PAGE_H
#define _NILFS_PAGE_H
#include <linux/buffer_head.h>
#include "nilfs.h"
/*
* Extended buffer state bits
*/
enum {
BH_NILFS_Allocated = BH_PrivateStart,
BH_NILFS_Node,
BH_NILFS_Volatile,
BH_NILFS_Checked,
BH_NILFS_Redirected,
};
BUFFER_FNS(NILFS_Node, nilfs_node) /* nilfs node buffers */
BUFFER_FNS(NILFS_Volatile, nilfs_volatile)
BUFFER_FNS(NILFS_Checked, nilfs_checked) /* buffer is verified */
BUFFER_FNS(NILFS_Redirected, nilfs_redirected) /* redirected to a copy */
int __nilfs_clear_page_dirty(struct page *);
struct buffer_head *nilfs_grab_buffer(struct inode *, struct address_space *,
unsigned long, unsigned long);
void nilfs_forget_buffer(struct buffer_head *);
void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *);
int nilfs_page_buffers_clean(struct page *);
void nilfs_page_bug(struct page *);
int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
void nilfs_copy_back_pages(struct address_space *, struct address_space *);
void nilfs_clear_dirty_pages(struct address_space *);
void nilfs_mapping_init(struct address_space *mapping, struct inode *inode,
struct backing_dev_info *bdi);
unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned);
unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
sector_t start_blk,
sector_t *blkoff);
#define NILFS_PAGE_BUG(page, m, a...) \
do { nilfs_page_bug(page); BUG(); } while (0)
static inline struct buffer_head *
nilfs_page_get_nth_block(struct page *page, unsigned int count)
{
struct buffer_head *bh = page_buffers(page);
while (count-- > 0)
bh = bh->b_this_page;
get_bh(bh);
return bh;
}
#endif /* _NILFS_PAGE_H */
|
/*
* Macros for manipulating and testing flags related to a
* pageblock_nr_pages number of pages.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 2 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) IBM Corporation, 2006
*
* Original author, Mel Gorman
* Major cleanups and reduction of bit operations, Andy Whitcroft
*/
#ifndef PAGEBLOCK_FLAGS_H
#define PAGEBLOCK_FLAGS_H
#include <linux/types.h>
/* Bit indices that affect a whole block of pages */
enum pageblock_bits {
PB_migrate,
PB_migrate_end = PB_migrate + 3 - 1,
/* 3 bits required for migrate types */
PB_migrate_skip,/* If set the block is skipped by compaction */
/*
* Assume the bits will always align on a word. If this assumption
* changes then get/set pageblock needs updating.
*/
NR_PAGEBLOCK_BITS
};
#ifdef CONFIG_HUGETLB_PAGE
#ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
/* Huge page sizes are variable */
extern int pageblock_order;
#else /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
/* Huge pages are a constant size */
#define pageblock_order HUGETLB_PAGE_ORDER
#endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
#else /* CONFIG_HUGETLB_PAGE */
/* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
#define pageblock_order (MAX_ORDER-1)
#endif /* CONFIG_HUGETLB_PAGE */
#define pageblock_nr_pages (1UL << pageblock_order)
/* Forward declaration */
struct page;
unsigned long get_pfnblock_flags_mask(struct page *page,
unsigned long pfn,
unsigned long end_bitidx,
unsigned long mask);
void set_pfnblock_flags_mask(struct page *page,
unsigned long flags,
unsigned long pfn,
unsigned long end_bitidx,
unsigned long mask);
/* Declarations for getting and setting flags. See mm/page_alloc.c */
#define get_pageblock_flags_group(page, start_bitidx, end_bitidx) \
get_pfnblock_flags_mask(page, page_to_pfn(page), \
end_bitidx, \
(1 << (end_bitidx - start_bitidx + 1)) - 1)
#define set_pageblock_flags_group(page, flags, start_bitidx, end_bitidx) \
set_pfnblock_flags_mask(page, flags, page_to_pfn(page), \
end_bitidx, \
(1 << (end_bitidx - start_bitidx + 1)) - 1)
#ifdef CONFIG_COMPACTION
#define get_pageblock_skip(page) \
get_pageblock_flags_group(page, PB_migrate_skip, \
PB_migrate_skip)
#define clear_pageblock_skip(page) \
set_pageblock_flags_group(page, 0, PB_migrate_skip, \
PB_migrate_skip)
#define set_pageblock_skip(page) \
set_pageblock_flags_group(page, 1, PB_migrate_skip, \
PB_migrate_skip)
#endif /* CONFIG_COMPACTION */
#endif /* PAGEBLOCK_FLAGS_H */
|
/*
* stmp37xx: USBCTRL register definitions
*
* Copyright (c) 2008 Freescale Semiconductor
* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define REGS_USBCTRL_BASE (STMP3XXX_REGS_BASE + 0x80000)
#define REGS_USBCTRL_PHYS 0x80080000
|
#ifndef _ASM_X86_CRASH_H
#define _ASM_X86_CRASH_H
int crash_load_segments(struct kimage *image);
int crash_copy_backup_region(struct kimage *image);
int crash_setup_memmap_entries(struct kimage *image,
struct boot_params *params);
#endif /* _ASM_X86_CRASH_H */
|
//
// Monitoring.h
// ConexionAcademica
//
// Created by Cristian Palomino Rivera on 24/02/15.
// Copyright (c) 2015 Cristian Palomino Rivera. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Monitoring : NSObject <NSCoding>
@property (nonatomic,strong) NSString *MONITORING_ID;
@property (nonatomic,strong) NSString *MONITORING_EVALUATION;
@property (nonatomic,strong) NSString *MONITORING_MATERIAL;
@property (nonatomic,strong) NSString *MONITORING_WORK;
@property (nonatomic,strong) NSString *MONITORING_PROJECT;
@property (nonatomic,strong) NSString *MONITORING_APPROACH;
@property (nonatomic,strong) NSString *MONITORING_INDISCIPLINE;
@property (nonatomic,strong) NSString *MONITORING_OBSERVATIONS;
@property (nonatomic,strong) NSString *STUDENT_ID;
@property (nonatomic,strong) NSString *MONITORING_CREATED;
@property (nonatomic,strong) NSString *MONITORING_UPDATED;
@property (nonatomic,strong) NSString *MONITORING_DATE;
@property (nonatomic,strong) NSString *MONITORING_HOUR;
- (void) encodeWithCoder:(NSCoder*)encoder;
- (id) initWithCoder:(NSCoder*)decoder;
@end
|
/* $OpenBSD: scfio.h,v 1.3 2009/11/02 22:31:50 sobrado Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
* All rights reserved.
*
* This software was developed by Jason L. Wright under contract with
* RTMX Incorporated (http://www.rtmx.com).
*
* 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 ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* ioctls and flags for sysconfig registers on Force CPU-5V boards.
*/
/* led1/led2 */
#define SCF_LED_COLOR_MASK 0x03 /* color bits */
#define SCF_LED_COLOR_OFF 0x00 /* led off */
#define SCF_LED_COLOR_GREEN 0x01 /* green led */
#define SCF_LED_COLOR_RED 0x02 /* red led */
#define SCF_LED_COLOR_YELLOW 0x03 /* yellow led */
#define SCF_LED_BLINK_MASK 0x0c /* blink bits */
#define SCF_LED_BLINK_NONE 0x00 /* steady led */
#define SCF_LED_BLINK_HALF 0x04 /* blink 1/2 Hz */
#define SCF_LED_BLINK_ONE 0x08 /* blink 1 Hz */
#define SCF_LED_BLINK_TWO 0x0c /* blink 2 Hz */
/* 7 segment led */
#define SCF_7LED_A 0x01 /* Layout: */
#define SCF_7LED_B 0x02 /* AAA */
#define SCF_7LED_C 0x04 /* FF BB */
#define SCF_7LED_D 0x08 /* GGG */
#define SCF_7LED_E 0x10 /* EE CC */
#define SCF_7LED_F 0x20 /* DDD P */
#define SCF_7LED_G 0x40
#define SCF_7LED_P 0x80
/* flash memory control */
#define SCF_FMCTRL_SELROM 0x01 /* select boot/user flash */
#define SCF_FMCTRL_SELBOOT 0x02 /* select 1st/2nd flash */
#define SCF_FMCTRL_WRITEV 0x04 /* turn on write voltage */
#define SCF_FMCTRL_SELADDR 0x38 /* address 21:19 bits */
#define SCFIOCSLED1 _IOW('S', 0x01, u_int8_t) /* set led1 */
#define SCFIOCGLED1 _IOR('S', 0x02, u_int8_t) /* get led1 */
#define SCFIOCSLED2 _IOW('S', 0x03, u_int8_t) /* set led2 */
#define SCFIOCGLED2 _IOR('S', 0x04, u_int8_t) /* get led2 */
#define SCFIOCSLED7 _IOW('S', 0x05, u_int8_t) /* set 7-segment led */
#define SCFIOCGLED7 _IOW('S', 0x06, u_int8_t) /* get 7-segment led */
#define SCFIOCGROT _IOR('S', 0x07, u_int8_t) /* get rotary sw */
#define SCFIOCSFMCTRL _IOW('S', 0x08, u_int8_t) /* set flash ctrl */
#define SCFIOCGFMCTRL _IOR('S', 0x09, u_int8_t) /* get flash ctrl */
|
/*
* Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin
*
* 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 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.
*/
#ifndef KERNEL_PROCESSOR_STACKFRAME_H
#define KERNEL_PROCESSOR_STACKFRAME_H
#include <processor/StackFrameBase.h>
#if defined(X86)
#include <processor/x86/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) X86##x
#elif defined(X64)
#include <processor/x64/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) X64##x
#elif defined(MIPS32)
#include <processor/mips32/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) MIPS32##x
#elif defined(MIPS64)
#include <processor/mips64/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) MIPS64##x
#elif defined(ARM926E)
#include <processor/arm_926e/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) ARM926E##x
#elif defined(PPC32)
#include <processor/ppc32/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) PPC32##x
#elif defined(ARMV7)
#include <processor/armv7/StackFrame.h>
#define PROCESSOR_SPECIFIC_NAME(x) ARMV7##x
#endif
// NOTE: This throws a compile-time error if this header is not adapted for
// the selected processor architecture
#if !defined(PROCESSOR_SPECIFIC_NAME)
#error Unknown processor architecture
#endif
/** @addtogroup kernelprocessor
* @{ */
// NOTE: If a newly added processor architecture does not supply all the
// needed types, you will get an error here
/** Lift the processor-specifc StackFrame class into the global namespace */
typedef PROCESSOR_SPECIFIC_NAME(StackFrame) StackFrame;
/** @} */
#undef PROCESSOR_SPECIFIC_NAME
#endif
|
/* $OpenBSD: reg.h,v 1.7 2014/09/08 01:47:05 guenther Exp $ */
/* $NetBSD: reg.h,v 1.2 1995/03/28 18:14:07 jtc Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#ifndef _MACHINE_REG_H_
#define _MACHINE_REG_H_
/*
* XXX where did this info come from?
*/
/*
* Struct reg, used for ptrace and in signal contexts
* Note that in signal contexts, it's represented as an array.
* That array has to look exactly like 'struct reg' though.
*/
#define R_V0 0
#define R_T0 1
#define R_T1 2
#define R_T2 3
#define R_T3 4
#define R_T4 5
#define R_T5 6
#define R_T6 7
#define R_T7 8
#define R_S0 9
#define R_S1 10
#define R_S2 11
#define R_S3 12
#define R_S4 13
#define R_S5 14
#define R_S6 15
#define R_A0 16
#define R_A1 17
#define R_A2 18
#define R_A3 19
#define R_A4 20
#define R_A5 21
#define R_T8 22
#define R_T9 23
#define R_T10 24
#define R_T11 25
#define R_RA 26
#define R_T12 27
#define R_AT 28
#define R_GP 29
#define R_SP 30
#define R_ZERO 31
struct reg {
u_long r_regs[32];
};
/*
* Floating point unit state. (also, register set used for ptrace.)
*
* The floating point registers for a process, saved only when
* necessary.
*
* Note that in signal contexts, it's represented as an array.
* That array has to look exactly like 'struct reg' though.
*/
struct fpreg {
u_long fpr_regs[32];
u_long fpr_cr;
};
#ifdef _KERNEL
void restorefpstate(struct fpreg *);
void savefpstate(struct fpreg *);
void frametoreg(struct trapframe *, struct reg *);
void regtoframe(struct reg *, struct trapframe *);
#endif
#endif /* _MACHINE_REG_H_ */
|
/****************************************************************************
*
* Copyright (c) 2014 Wi-Fi Alliance
*
* 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.
*
* THE 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.
*
*****************************************************************************/
#ifndef _WFA_SOCK_H
#define _WFA_SOCK_H
#define MAX_UDP_LEN 16384
#define MAX_RCV_BUF_LEN 32*1024
#define MAX_ETH_PAYLOAD_LEN 1450
#define MAX_LEGACY_PAYLOAD_LEN 1000
#define MAX_SOCKOPT_RECVBUF_LEN 128*1024
#define MAX_SOCKOPT_SNDBUF_LEN 128*1024
#define SOCK_TYPE_UDP 0
#define SOCK_TYPE_TCP 1
struct sockfds
{
int *agtfd; /* dut agent main socket fd */
int *cafd; /* sock fd to control agent */
int *tgfd; /* traffic agent fd */
int *wmmfds; /* wmm stream ids */
int *psfd; /* wmm-ps socket id */
};
extern int wfaCreateTCPServSockImpl(char *serverIpAddr, unsigned short port);
extern int wfaCreateTCPServSock(unsigned short sport);
extern int wfaCreateUDPSock(char *sipaddr, unsigned short sport);
extern int wfaCreateSock(int sockType, char *ipaddr, unsigned short port);
extern int wfaAcceptTCPConn(int servSock);
extern int wfaConnectToPeer(int sockType, int mysock, char *daddr, int dport);
extern int wfaConnectUDPPeer(int sock, char *dipaddr, int dport);
extern void wfaSetSockFiDesc(fd_set *sockset, int *, struct sockfds *);
extern int wfaCtrlSend(SOCKET sock, unsigned char *buf, int bufLen);
extern int wfaCtrlRecv(int sock, unsigned char *buf, int bufLen);
extern int wfaTrafficSendTo(int sock, char *buf, int bufLen, struct sockaddr *to);
extern int wfaTrafficRecv(int sock, char *buf, struct sockaddr *from, int bufLen);
extern int wfaSetSockMcastRecvOpt(int, char*);
extern int wfaSetSockMcastSendOpt(int);
extern int wfaSetProcPriority(int);
int wfaCreateTCPCliSock();
int wfaConnectTCPPeer(int mysock, char *daddr, int dport);
#endif /* _WFA_SOCK_H */
|
/*
* %ISC_START_LICENSE%
* ---------------------------------------------------------------------
* Copyright 2014-2018, Pittsburgh Supercomputing Center
* All rights reserved.
*
* 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 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.
* --------------------------------------------------------------------
* %END_LICENSE%
*/
#ifndef _PFL_ACL_H_
#define _PFL_ACL_H_
#ifdef HAVE_SYS_ACL_H
#include <sys/types.h>
#include <sys/acl.h>
acl_t pfl_acl_from_xattr(const void *, size_t);
#endif
#endif /* _PFL_ACL_H_ */
|
//
// WYSettingViewController.h
// StealTrunk
//
// Created by wangyong on 13-7-19.
//
//
#import "JMStaticContentTableViewController.h"
@interface WYSettingViewController : JMStaticContentTableViewController
@end
|
#ifndef ARTISTBROWSECALLBACKS_H
#define ARTISTBROWSECALLBACKS_H
#include <QtCore/QCoreApplication>
#include <QtCore/QHash>
#include <QtSpotify/spotifyartistbrowse.h>
#include <libspotify/api.h>
static void SP_CALLCONV artistBrowseCompleteCallback(sp_artistbrowse* result, void* userData)
{
Q_UNUSED(userData)
QCoreApplication::postEvent(SpotifyArtistBrowse::artistBrowseObjects.value(result), new QEvent(QEvent::Type(QEvent::User)));
}
#endif // ARTISTBROWSECALLBACKS_H
|
// Copyright (c) 2011-2016 The Flericoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <exception>
#include <iomanip>
#include <iostream>
#include "IWalletLegacy.h"
#include "Wallet/WalletErrors.h"
namespace CryptoNote {
inline void throwIf(bool expr, CryptoNote::error::WalletErrorCodes ec)
{
if (expr)
throw std::system_error(make_error_code(ec));
}
inline std::ostream& operator <<(std::ostream& ostr, const Crypto::Hash& hash) {
std::ios_base::fmtflags flags = ostr.setf(std::ios_base::hex, std::ios_base::basefield);
char fill = ostr.fill('0');
for (auto b : hash.data) {
ostr << std::setw(2) << static_cast<unsigned int>(b);
}
ostr.fill(fill);
ostr.setf(flags);
return ostr;
}
} //namespace CryptoNote
|
//
// SpotLightGroup.h
// vrphysics
//
// Created by Robin Wu on 1/7/15.
// Copyright (c) 2015 WSH. All rights reserved.
//
#ifndef __vrphysics__SpotLightGroup__
#define __vrphysics__SpotLightGroup__
#include <stdio.h>
#include <stdio.h>
#include <vector>
#include <osg/Group>
#include "SpotLight.h"
class SpotLightGroup
{
public:
SpotLightGroup();
~SpotLightGroup();
void addLight(const osg::Vec3 &pos, const osg::Vec3 &lookAt, const osg::Vec3 &color);
std::vector<SpotLight *> &getDirectionalLightsReference();
void addMultipleLights(const std::vector<SpotLight *> &lights);
private:
osg::ref_ptr<osg::Group> _spotLightGroup;
std::vector<SpotLight *> _spotLights;
int _lightnum;
};
#endif /* defined(__vrphysics__SpotLightGroup__) */
|
void reverse(char *str, int len)
{
int i=0, j=len-1, temp;
while (i<j)
{
temp = str[i];
str[i] = str[j];
str[j] = temp;
i++; j--;
}
}
// Converts a given integer x to string str[]. d is the number
// of digits required in output. If d is more than the number
// of digits in x, then 0s are added at the beginning.
int intToStr(int x, char str[], int d)
{
int i = 0;
while (x)
{
str[i++] = (x%10) + '0';
x = x/10;
}
// If number of digits required is more, then
// add 0s at the beginning
while (i < d)
str[i++] = '0';
reverse(str, i);
str[i] = '\0';
return i;
}
// Converts a floating point number to string.
void ftoa(float n, char *res, int afterpoint)
{
// Extract integer part
int ipart = (int)n;
// Extract floating part
float fpart = n - (float)ipart;
// convert integer part to string
int i = intToStr(ipart, res, 0);
// check for display option after point
if (afterpoint != 0)
{
res[i] = '.'; // add dot
// Get the value of fraction part upto given no.
// of points after dot. The third parameter is needed
// to handle cases like 233.007
fpart = fpart * pow(10, afterpoint);
intToStr((int)fpart, res + i + 1, afterpoint);
}
}
void specialKeys(int key, int x, int y)
{
if(key == GLUT_KEY_RIGHT)
world_y += r_step;
if(key == GLUT_KEY_LEFT)
world_y -= r_step;
if(key == GLUT_KEY_UP)
{
if(progstep < 0.3)
progstep += progstep_acc;
}
if(key == GLUT_KEY_DOWN)
if(progstep > -0.3)
progstep -= progstep_acc;
if(key == GLUT_KEY_PAGE_DOWN)
{
if(world_y_trans < scale - 1)
world_y_trans += 0.05;
}
if(key == GLUT_KEY_PAGE_UP)
{
if(world_y_trans > -scale + 1)
world_y_trans -= 0.05;
}
glutPostRedisplay();
}
void rotate()
{
double acc = progstep*cos(wind_y/180*PI)*wind_acc_factor - wing_speed*turbine_factor;
wing_speed += acc;
wing_z += wing_speed;
progoffset += progstep;
if(-0.78 + progoffset > 0.99)
progoffset = 0.0;
else if(-.98 + progoffset < -0.99)
progoffset = 1.76;
glutPostRedisplay();
}
void rotateWind(unsigned char key, int x, int y)
{
if(key == 'a')
wind_y -= r_step;
else if(key == 'd')
wind_y += r_step;
}
void mouseWheel(int button, int dir, int x, int y)
{
if (button == 3)
{
// Zoom in
if(scale <= 3.0)
scale += 0.03;
}
else if(button == 4)
{
// Zoom out
if(scale >= 0.5)
scale -= 0.03;
}
}
|
#ifndef _ROS_SERVICE_SearchParam_h
#define _ROS_SERVICE_SearchParam_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace rosapi
{
static const char SEARCHPARAM[] = "rosapi/SearchParam";
class SearchParamRequest : public ros::Msg
{
public:
const char* name;
SearchParamRequest():
name("")
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
uint32_t length_name = strlen(this->name);
memcpy(outbuffer + offset, &length_name, sizeof(uint32_t));
offset += 4;
memcpy(outbuffer + offset, this->name, length_name);
offset += length_name;
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t length_name;
memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t));
offset += 4;
for(unsigned int k= offset; k< offset+length_name; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_name-1]=0;
this->name = (char *)(inbuffer + offset-1);
offset += length_name;
return offset;
}
const char * getType(){ return SEARCHPARAM; };
const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; };
};
class SearchParamResponse : public ros::Msg
{
public:
const char* global_name;
SearchParamResponse():
global_name("")
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
uint32_t length_global_name = strlen(this->global_name);
memcpy(outbuffer + offset, &length_global_name, sizeof(uint32_t));
offset += 4;
memcpy(outbuffer + offset, this->global_name, length_global_name);
offset += length_global_name;
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t length_global_name;
memcpy(&length_global_name, (inbuffer + offset), sizeof(uint32_t));
offset += 4;
for(unsigned int k= offset; k< offset+length_global_name; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_global_name-1]=0;
this->global_name = (char *)(inbuffer + offset-1);
offset += length_global_name;
return offset;
}
const char * getType(){ return SEARCHPARAM; };
const char * getMD5(){ return "87c264f142c2aeca13349d90aeec0386"; };
};
class SearchParam {
public:
typedef SearchParamRequest Request;
typedef SearchParamResponse Response;
};
}
#endif
|
/****************************************************************************
* Atom implements a mechanism whereby each user action is atomic in terms of
* display update and undo/redo
* Author: Bill Forster
* License: MIT license. Full text of license is in associated file LICENSE
* Copyright 2010-2014, Bill Forster <billforsternz at gmail dot com>
****************************************************************************/
#ifndef ATOM_H
#define ATOM_H
class GameLogic;
class Atomic
{
public:
Atomic( bool set_focus=true );
~Atomic();
static GameLogic *gl;
static int stack_count;
};
class Atom
{
public:
Atom( GameLogic *gl );
// Do one undo save, redisplay or status update at end of a command
void Begin( bool set_focus=true );
void SetInsertionPoint( long pos );
unsigned long GetInsertionPoint();
void Display( long pos );
void Redisplay( long pos);
void Undo()
{
undo=true;
}
void Focus()
{
set_focus=true;
}
void StatusUpdate();
void End();
void NotUndoAble()
{
undo=false;
}
private:
long undo_previous_posn;
long pos;
bool running;
bool set_focus;
bool insertion_point;
bool display;
bool redisplay;
bool undo;
bool status_update;
GameLogic *gl;
};
#endif // ATOM_H
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 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 BITCOIN_INIT_H
#define BITCOIN_INIT_H
#include <string>
#include "script.h"
class CWallet;
namespace boost {
class thread_group;
};
extern std::string strWalletFile;
extern CWallet* pwalletMain;
extern std::map<CScript, std::pair<int64_t,int> > PubkeyMap;
void StartShutdown();
bool ShutdownRequested();
void Shutdown();
bool AppInit2(boost::thread_group& threadGroup);
/* The help message mode determines what help message to show */
enum HelpMessageMode
{
HMM_BITCOIND,
HMM_BITCOIN_QT
};
std::string HelpMessage(HelpMessageMode mode);
#endif
|
//
// SizePickerViewController.h
// RoundabuyUI
//
// Created by JunhaoWang on 8/27/15.
// Copyright (c) 2015 JunhaoWang. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol SizePickerDelegate <NSObject>
- (void)sizePickerSelectedSize:(NSString *)size;
@end
@interface SizePickerViewController : UIViewController
@property (weak, nonatomic) id <SizePickerDelegate>delegate;
@end
|
%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%
$project=Qt5xHb
$module=QtDeclarative
$header
$includes
$beginSlotsClass
$signal=|valueChanged()
$endSlotsClass
|
#include "sys/types.h"
#include "sys/socket.h"
#include "netdb.h"
int getaddrinfo(
const char *node,
const char *service,
const struct addrinfo *hints,
struct addrinfo **res
); |
//
// ReactController.h
// ProDevForIOS
//
// Created by 曹亚民 on 16/3/16.
// Copyright © 2016年 曹亚民. All rights reserved.
//
#import "BaseViewController.h"
@interface ReactController : BaseViewController
@end
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_One00DaysVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_One00DaysVersionString[];
|
//
// OneViewController.h
// Demo
//
// Created by liuxing8807@126.com on 8/29/16.
// Copyright © 2016 liuweizhen. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OneViewController : UIViewController
@end
|
// Copyright 2016 Jonathan Buchanan.
// This file is part of Sunglasses, which is licensed under the MIT License.
// See LICENSE.md for details.
#ifndef CLOPTIONPARSING_H
#define CLOPTIONPARSING_H
#include <string>
#include <functional>
#include <vector>
#include <tclap/CmdLine.h>
namespace sunglasses {
/// An abstract struct that represents a command line option
/**
* This abstract struct represents an option/argument on the command line. Subclasses
* must implement the add and
*/
struct CLOption {
/// Adds the option to a command line object.
/**
* This member function adds the option to the command line object. This
* has to be implemented for each subclass because it is a pure virtual
* function. This is called automatically by the parseOptions function.
* @param commandLine A reference to the command line object
*/
virtual void add(TCLAP::CmdLine &commandLine) = 0;
/// Processes the value of the option after parsing.
/**
* This member function processes the option after parsing is done. This is
* pure virtual, so it must be implemented in each subclass. This is called
* automatically on every option after parsing in the parseOptions function.
*/
virtual void process() = 0;
};
/// A subclass of CLOption that represents a switch option
/**
* This subclass of CLOption represents a switch option. It adds itself
* using the TCLAP::SwitchArg, and has a reference to a boolean where it
* will store its value.
*/
struct CLSwitchOption : public CLOption {
public:
/// Constructs the switch option.
/**
* @param shortOption The short name for the switch
* @param longOption The long name for the switch
* @param description The description for the switch (used in help)
* @param defaultValue The default value of the switch (normally false)
* @param _value A pointer to the boolean that should be assigned with the value of the option
*/
CLSwitchOption(std::string shortOption, std::string longOption, std::string description, bool defaultValue, bool *_value);
/// Adds the switch option to the command line object.
/**
* @param commandLine A reference to the command line object
*/
virtual void add(TCLAP::CmdLine &commandLine);
/// Assigns the value of the option to the boolean.
virtual void process();
private:
/// The TCLAP argument attached to the command line
TCLAP::SwitchArg arg;
/// The reference to the boolean that it should be stored in
bool *value;
};
/// A subclass of CLOption that represents a value option
/**
* This subclass of CLOption represents a value option. It adds itself
* using the TCLAP::ValueArg, and has a reference to an object of its type
* where it will store its value.
*/
template<typename T>
struct CLValueOption : public CLOption {
public:
/// Constructs the value option.
/**
* @param shortOption The short name for the option
* @param longOption The long name for the option
* @param description The description for the option (used in help)
* @param typeDescription The description for the type of the option (used in help)
* @param defaultValue The default value of the option
* @param required Whether the option is required
* @param _value A pointer to the object that should b assigned with the value of the option
*/
CLValueOption(std::string shortOption, std::string longOption, std::string description, std::string typeDescription, T defaultValue, bool required, T *_value) : arg(shortOption, longOption, description, required, defaultValue, typeDescription), value(_value) { }
/// Adds the value option to the command line object.
/**
* @param commandLine A reference to the command line object
*/
virtual void add(TCLAP::CmdLine &commandLine) {
commandLine.add(arg);
}
/// Assigns the value of the option to the associated object.
virtual void process() {
(*value) = arg.getValue();
}
private:
/// The TCLAP argument attached to the command line
TCLAP::ValueArg<T> arg;
/// The reference to the object that it should be stored in
T *value;
};
/// Parses command line options.
/**
* This function takes in argc and argv from main and parses the given options
* using the TCLAP library.
* @param options The vector of options to be parsed
* @param help The help message
* @param version The version string
* @param argc The argument count (given in main)
* @param argv The argument vector (given in main)
*/
extern void parseOptions(const std::vector<CLOption *> &options, std::string help, std::string version, int argc, char **argv);
} // namespace
#endif
|
//
// CRFadedView.h
// CRNumberFaded
//
// Created by Bear on 17/3/22.
// Copyright © 2017年 Bear. All rights reserved.
//
#import <UIKit/UIKit.h>
@class CRFadedView;
typedef NS_ENUM(NSUInteger, CRFadedViewAnimationType) {
CRFadedViewAnimationType_NormalToBig,
CRFadedViewAnimationType_BigToNormal,
CRFadedViewAnimationType_SmallToNormal,
CRFadedViewAnimationType_NormalToSmall,
};
@protocol CRFadedViewDelegate <NSObject>
- (void)animationDidFinishedInFadedView:(CRFadedView *)fadedView;
@end
@interface CRFadedView : UIView
@property (strong, nonatomic) UILabel *label;
@property (strong, nonatomic) NSNumber *needLabel; //Default @YES
@property (strong, nonatomic) NSNumber *fadeInRatio; //淡入缩小比例
@property (strong, nonatomic) NSNumber *fadeOutRatio; //淡出放大比例
@property (strong, nonatomic) NSNumber *animationDuration; //动画时间
@property (strong, nonatomic) NSValue *fadeOutOffSetPointValue; //淡出Point偏移
@property (strong, nonatomic) NSValue *fadeInOffSetPointValue; //淡入Point偏移
@property (weak, nonatomic) id <CRFadedViewDelegate> delegate;
- (void)loadParameterAndCreateUI;
- (void)fadedViewAnimationWithType:(CRFadedViewAnimationType)animationType;
- (void)testFadeLinear;
- (void)relayUI;
@end
|
#ifndef __LOCK_H_
#define __LOCK_H_
#include "../common.h"
void Pthread_mutexattr_init(pthread_mutexattr_t *);
void Pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
void Pthread_mutex_init(pthread_mutex_t *, pthread_mutexattr_t *);
void Pthread_mutex_lock(pthread_mutex_t *);
void Pthread_mutex_unlock(pthread_mutex_t *);
void *Mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
int Open(const char *pathname, int oflag, mode_t mode);
void lock_init(char *);
void lock_wait();
void lock_release();
#endif
|
#import <UIKit/UIKit.h>
#import "ASTAutoLoggerVC.h"
FOUNDATION_EXPORT double autoLogVersionNumber;
FOUNDATION_EXPORT const unsigned char autoLogVersionString[];
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <PhotosUI/PULayoutSectionSampler.h>
@interface PULayoutSectionSimpleSampler : PULayoutSectionSampler
{
long long _numberOfVisibleItems;
long long _numberOfRealItems;
}
- (void)dumpInternalMemory;
- (void)enumerateUnsampledIndexesForSampledIndexInRange:(struct _NSRange)arg1 usingBlock:(id)arg2;
- (long long)unsampledIndexForIndex:(long long)arg1;
- (long long)indexForUnsampledIndex:(long long)arg1 isMainItem:(_Bool *)arg2;
- (id)initWithNumberOfVisibleItems:(long long)arg1 numberOfRealItems:(long long)arg2;
@end
|
//
// CCPClassDumpDefaultResultFormatter.h
// CCPClassDump
//
// Created by cocopon on 2014/10/07.
// Copyright (c) 2014 cocopon. All rights reserved.
//
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
#import "CCPClassDumpResultFormatter.h"
@interface CCPClassDumpDefaultResultFormatter : CCPClassDumpResultFormatter
@end
|
//
// RCSTableViewController.h
// Created by Jim Roepcke.
// See license below.
//
#import <UIKit/UIKit.h>
@class RCSTableDefinition;
@class RCSTable;
@interface RCSTableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSObject *rootObject;
@property (nonatomic, strong) RCSTableDefinition *tableDefinition;
@property (nonatomic, readonly, strong) RCSTable *table;
@property (nonatomic, strong) IBOutlet UITableView *tableView;
- (void) reloadData;
@end
/*
* Copyright 2009-2013 Jim Roepcke <jim@roepcke.com>. All rights reserved.
* 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.
*/
|
//
// MPCharacteristic.h
// MPBluetoothKit
//
// Created by MacPu on 15/10/29.
// Copyright © 2015年 www.imxingzhe.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "MPBluetoothKitBlocks.h"
@class MPPeripheral;
@class MPService;
@class MPDescriptor;
@interface MPCharacteristic : NSObject
/*!
* @property UUID
*
* @discussion
* The Bluetooth UUID of the characteristic.
*
*/
@property(readonly, nonatomic, nullable) CBUUID *UUID;
/*!
* @property service
*
* @discussion
* A back-pointer to the service this characteristic belongs to.
*
*/
@property(assign, readonly, nonatomic, nullable) MPService *service;
/*!
* @property properties
*
* @discussion
* The properties of the characteristic.
*
*/
@property(readonly, nonatomic) CBCharacteristicProperties properties;
/*!
* @property value
*
* @discussion
* The value of the characteristic.
*
*/
@property(retain, readonly, nullable) NSData *value;
/*!
* @property descriptors
*
* @discussion
* A list of the CBDescriptors that have so far been discovered in this characteristic.
*
*/
@property(retain, readonly, nullable) NSArray<MPDescriptor *> *descriptors;
/*!
* @property isBroadcasted
*
* @discussion
* Whether the characteristic is currently broadcasted or not.
*
*/
@property(readonly) BOOL isBroadcasted NS_DEPRECATED(NA, NA, 5_0, 8_0);
/*!
* @property isNotifying
*
* @discussion
* Whether the characteristic is currently notifying or not.
*
*/
@property(readonly) BOOL isNotifying;
/*!
* @property ownPeripheral
*
* @discussion
* the peripheral that this characteristic belong to
*
*/
@property (nonatomic, weak, readonly, nullable) MPPeripheral *ownPeripheral;
- (nullable instancetype)init NS_UNAVAILABLE;
- (nullable instancetype)initWithCharacteristic:(nullable CBCharacteristic *)characteristic
andOwnPeripheral:(nullable MPPeripheral *)peripheral;
/*!
* @method readValueWithBlock:
*
* @param block callback with this block,(MPPeripheral *peripheral,MPharacteristic *characteristic,NSError *error)
*
* @discussion Reads the characteristic value for <i>self</i>.
*
* @see MPPeripheralReadValueForCharacteristicBlock
*/
- (void)readValueWithBlock:(nullable MPPeripheralReadValueForCharacteristicBlock)block;
/*!
* @method writeValue:type:withBlock:
*
* @param data The value to write.
* @param type The type of write to be executed.
* @param block callback with this block;
*
* @discussion Writes <i>value</i> to <i>self</i>'s characteristic value.
* If the <code>CBCharacteristicWriteWithResponse</code> type is specified, {@link MPPeripheralWriteValueForCharacteristicsBlock}
* is called with the result of the write request.
* If the <code>CBCharacteristicWriteWithoutResponse</code> type is specified, the delivery of the data is best-effort and not
* guaranteed.
*
* @see CBCharacteristicWriteType
* @seealso MPPeripheralWriteValueForCharacteristicsBlock
*/
- (void)writeValue:(nullable NSData *)data
type:(CBCharacteristicWriteType)type
withBlock:(nullable MPPeripheralWriteValueForCharacteristicsBlock)block;
/*!
* @method setNotifyValue:withBlock:
*
* @param enabled Whether or not notifications/indications should be enabled.
* @param block callback with this block
*
* @discussion Enables or disables notifications/indications for the characteristic value of <i>characteristic</i>. If <i>characteristic</i>
* allows both, notifications will be used.
* When notifications/indications are enabled, updates to the characteristic value will be received via block.
* Since it is the peripheral that chooses when to send an update,
* the application should be prepared to handle them as long as notifications/indications remain enabled.
*
* @see MPPeripheralNotifyValueForCharacteristicsBlock
*/
- (void)setNotifyValue:(BOOL)enabled
withBlock:(nullable MPPeripheralNotifyValueForCharacteristicsBlock)block;
/*!
* @method discoverDescriptorsFWithBlcok:
*
* @param block callback with this block;
*
* @discussion Discovers the characteristic descriptor(s) of <i>self</i>.
*
* @see MPPeripheralDiscoverDescriptorsForCharacteristicBlock
*/
- (void)discoverDescriptorsWithBlock:(nullable MPPeripheralDiscoverDescriptorsForCharacteristicBlock)block;
@end
|
/*
MIT License
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 "Structure.h"
@interface InfixExpression : Structure
{
}
- printValue: goal output: (NSOutputStream *) stream;
@end |
//
// CalendarDayCollectionViewCell.h
// WillowTree
//
// Created by Steven Bishop on 5/26/16.
// Copyright © 2016 WillowTree. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CalendarDayCollectionViewCell : UICollectionViewCell
- (void)configureWithDayOfWeek:(NSString *)dayOfWeek accessibilityString:(NSString *)accessibilityString;
- (void)applyInbetweenDateBackground:(BOOL)dateRangeShouldCoverEmptySpace;
- (void)applySelectedDateBackground;
- (void)applyCurrentDateBackground;
- (void)applyPastDateState;
@property (nonatomic) BOOL hasCheckInDateSelected;
@property (nonatomic) BOOL hasCheckOutDateSelected;
@property (strong, nonatomic) UIFont *dateNumberFont UI_APPEARANCE_SELECTOR;
@property (strong, nonatomic) UIColor *dateNumberTextColor UI_APPEARANCE_SELECTOR;
@property (strong, nonatomic) UIColor *selectedDateTextColor UI_APPEARANCE_SELECTOR;
@property (strong, nonatomic) UIColor *selectedDateBackgroundColor UI_APPEARANCE_SELECTOR;
@property (strong, nonatomic) UIColor *currentDateBackgroundColor UI_APPEARANCE_SELECTOR;
@end |
// Copyright (c) 2013 NSCookbook. All rights reserved.
//
// 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 Weather_WeatherAPIKey_h
#define Weather_WeatherAPIKey_h
//Sign up at http://www.wunderground.com/weather/api to get a free developer key
static NSString * const kWeatherUndergroundAPIKey = @"your_api_key_goes_here";
#endif
|
#ifndef _RocketUIPlugin_H_
#define _RocketUIPlugin_H_
/*
-----------------------------------------------------------------------------
This file is a part of Gsage engine
Copyright (c) 2014-2016 Artem Chernyshev
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.
-----------------------------------------------------------------------------
*/
#include "IPlugin.h"
#include "RocketUIManager.h"
namespace Gsage {
class RocketUIPlugin : public IPlugin
{
public:
RocketUIPlugin();
virtual ~RocketUIPlugin();
/**
* Get rocket UI plugin name
*
* @returns RocketUI string
*/
virtual const std::string& getName() const;
/**
* Install rocker ui manager
*
* @returns true if succesful
*/
virtual bool installImpl();
/**
* Uninstall rocket ui manager
*/
virtual void uninstallImpl();
/**
* Set up lua bindings
*/
void setupLuaBindings();
private:
int mUIManagerHandle;
RocketUIManager mUIManager;
};
}
#endif
|
//
// TWCommonLib
//
@import UIKit;
@interface UIView (TWFadeAnimations)
- (void)tw_fadeInAnimationWithDuration:(NSTimeInterval)duration;
- (void)tw_fadeInAnimationWithDuration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion;
- (void)tw_fadeOutAnimationWithDuration:(NSTimeInterval)duration;
- (void)tw_fadeOutAnimationWithDuration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion;
@end
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
FOUNDATION_EXPORT double Pods_URIDrumKit_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_URIDrumKit_TestsVersionString[];
|
// Copyright (c) 2018 Doyub Kim
//
// I am making my contributions/submissions to this project solely in my
// personal capacity and am not conveying any rights to any intellectual
// property of any third parties.
#ifndef INCLUDE_JET_FDM_LINEAR_SYSTEM3_H_
#define INCLUDE_JET_FDM_LINEAR_SYSTEM3_H_
#include <jet/array1.h>
#include <jet/array3.h>
#include <jet/matrix_csr.h>
#include <jet/vector_n.h>
namespace jet {
//! The row of FdmMatrix3 where row corresponds to (i, j, k) grid point.
struct FdmMatrixRow3 {
//! Diagonal component of the matrix (row, row).
double center = 0.0;
//! Off-diagonal element where colum refers to (i+1, j, k) grid point.
double right = 0.0;
//! Off-diagonal element where column refers to (i, j+1, k) grid point.
double up = 0.0;
//! OFf-diagonal element where column refers to (i, j, k+1) grid point.
double front = 0.0;
};
//! Vector type for 3-D finite differencing.
typedef Array3<double> FdmVector3;
//! Matrix type for 3-D finite differencing.
typedef Array3<FdmMatrixRow3> FdmMatrix3;
//! Linear system (Ax=b) for 3-D finite differencing.
struct FdmLinearSystem3 {
//! System matrix.
FdmMatrix3 A;
//! Solution vector.
FdmVector3 x;
//! RHS vector.
FdmVector3 b;
//! Clears all the data.
void clear();
//! Resizes the arrays with given grid size.
void resize(const Size3& size);
};
//! Compressed linear system (Ax=b) for 3-D finite differencing.
struct FdmCompressedLinearSystem3 {
//! System matrix.
MatrixCsrD A;
//! Solution vector.
VectorND x;
//! RHS vector.
VectorND b;
//! Clears all the data.
void clear();
};
//! BLAS operator wrapper for 3-D finite differencing.
struct FdmBlas3 {
typedef double ScalarType;
typedef FdmVector3 VectorType;
typedef FdmMatrix3 MatrixType;
//! Sets entire element of given vector \p result with scalar \p s.
static void set(ScalarType s, VectorType* result);
//! Copies entire element of given vector \p result with other vector \p v.
static void set(const VectorType& v, VectorType* result);
//! Sets entire element of given matrix \p result with scalar \p s.
static void set(ScalarType s, MatrixType* result);
//! Copies entire element of given matrix \p result with other matrix \p v.
static void set(const MatrixType& m, MatrixType* result);
//! Performs dot product with vector \p a and \p b.
static double dot(const VectorType& a, const VectorType& b);
//! Performs ax + y operation where \p a is a matrix and \p x and \p y are
//! vectors.
static void axpy(double a, const VectorType& x, const VectorType& y,
VectorType* result);
//! Performs matrix-vector multiplication.
static void mvm(const MatrixType& m, const VectorType& v,
VectorType* result);
//! Computes residual vector (b - ax).
static void residual(const MatrixType& a, const VectorType& x,
const VectorType& b, VectorType* result);
//! Returns L2-norm of the given vector \p v.
static ScalarType l2Norm(const VectorType& v);
//! Returns Linf-norm of the given vector \p v.
static ScalarType lInfNorm(const VectorType& v);
};
//! BLAS operator wrapper for compressed 3-D finite differencing.
struct FdmCompressedBlas3 {
typedef double ScalarType;
typedef VectorND VectorType;
typedef MatrixCsrD MatrixType;
//! Sets entire element of given vector \p result with scalar \p s.
static void set(ScalarType s, VectorType* result);
//! Copies entire element of given vector \p result with other vector \p v.
static void set(const VectorType& v, VectorType* result);
//! Sets entire element of given matrix \p result with scalar \p s.
static void set(ScalarType s, MatrixType* result);
//! Copies entire element of given matrix \p result with other matrix \p v.
static void set(const MatrixType& m, MatrixType* result);
//! Performs dot product with vector \p a and \p b.
static double dot(const VectorType& a, const VectorType& b);
//! Performs ax + y operation where \p a is a matrix and \p x and \p y are
//! vectors.
static void axpy(double a, const VectorType& x, const VectorType& y,
VectorType* result);
//! Performs matrix-vector multiplication.
static void mvm(const MatrixType& m, const VectorType& v,
VectorType* result);
//! Computes residual vector (b - ax).
static void residual(const MatrixType& a, const VectorType& x,
const VectorType& b, VectorType* result);
//! Returns L2-norm of the given vector \p v.
static ScalarType l2Norm(const VectorType& v);
//! Returns Linf-norm of the given vector \p v.
static ScalarType lInfNorm(const VectorType& v);
};
} // namespace jet
#endif // INCLUDE_JET_FDM_LINEAR_SYSTEM3_H_
|
#ifndef DADO_H
#define DADO_H
void inicializarSemilla ();
int tirar (int caras);
int tirarVarios (int cantidad, int caras);
int aleatorio (int numeroMax);
int aleatorioInter (int numeroMin, int numeroMax);
int d20 ();
int d10 ();
int d100 ();
int d12 ();
int d6 ();
int d4 ();
int d2 ();
int dPorcentaje ();
#endif |
//
// CropType.h
// FarmKrappApp
//
// Created by Nicholas Outram on 16/12/2013.
// Copyright (c) 2013 Plymouth University. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Field;
@interface CropType : NSManagedObject
@property (nonatomic, retain) NSString * displayName;
@property (nonatomic, retain) NSNumber * seqID;
@property (nonatomic, retain) NSSet *fields;
@end
@interface CropType (CoreDataGeneratedAccessors)
- (void)addFieldsObject:(Field *)value;
- (void)removeFieldsObject:(Field *)value;
- (void)addFields:(NSSet *)values;
- (void)removeFields:(NSSet *)values;
@end
|
#pragma once
namespace scratch {
template<typename...> inline constexpr bool false_v = false;
} // namespace scratch
|
#ifndef GUI_COLORS_H__
#define GUI_COLORS_H__
/**
* Get the RGB values for hsv.
*/
void hsvToRgb(double h, double s, double v, unsigned char& r, unsigned char& g, unsigned char& b);
/**
* Get a (more or less random) color for an id.
*/
void idToRgb(unsigned int id, unsigned char& r, unsigned char& g, unsigned char& b);
#endif // GUI_COLORS_H__
|
// Copyright (c) 2011-2014 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 RPCCONSOLE_H
#define RPCCONSOLE_H
#include <QDialog>
class ClientModel;
namespace Ui {
class RPCConsole;
}
/** Local Krugercoin RPC console. */
class RPCConsole: public QDialog
{
Q_OBJECT
public:
explicit RPCConsole(QWidget *parent);
~RPCConsole();
void setClientModel(ClientModel *model);
enum MessageClass {
MC_ERROR,
MC_DEBUG,
CMD_REQUEST,
CMD_REPLY,
CMD_ERROR
};
protected:
virtual bool eventFilter(QObject* obj, QEvent *event);
private slots:
void on_lineEdit_returnPressed();
void on_tabWidget_currentChanged(int index);
/** open the debug.log from the current datadir */
void on_openDebugLogfileButton_clicked();
/** change the time range of the network traffic graph */
void on_sldGraphRange_valueChanged(int value);
/** update traffic statistics */
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut);
public slots:
void clear();
void reject();
void message(int category, const QString &message, bool html = false);
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
void setNumBlocks(int count);
/** Go forward or back in history */
void browseHistory(int offset);
/** Scroll console view to end */
void scrollToEnd();
signals:
// For RPC command executor
void stopExecutor();
void cmdRequest(const QString &command);
private:
static QString FormatBytes(quint64 bytes);
void setTrafficGraphRange(int mins);
Ui::RPCConsole *ui;
ClientModel *clientModel;
QStringList history;
int historyPtr;
void startExecutor();
};
#endif // RPCCONSOLE_H
|
#ifndef FILEOPERATOR_H
#define FILEOPERATOR_H
#include <QObject>
#include <QtCore>
class fileOperator : public QObject
{
Q_OBJECT
public:
explicit fileOperator(QObject *parent = 0);
signals:
void statusChanged(QString);
public slots:
void set_dir(QString newDir);
QStringList get_files_info();
void rename_files();
bool make_backup();
int get_new_filenames(QString newFileNames);
void set_status(QString newStatus);
private:
QDir dir;
QFileInfoList fileInfoList;
QStringList oldNameList;
QStringList newNameList;
unsigned int numberOfFiles;
QString status;
};
#endif // FILEOPERATOR_H
|
#ifndef ALINOUS_REMOTE_DB_CLIENT_COMMAND_REMOTESTORAGECONNECTCOMMAND_H_
#define ALINOUS_REMOTE_DB_CLIENT_COMMAND_REMOTESTORAGECONNECTCOMMAND_H_
namespace java {namespace io {
class OutputStream;}}
namespace alinous {namespace remote {namespace socket {
class NetworkBinaryBuffer;}}}
namespace java {namespace io {
class InputStream;}}
namespace alinous {namespace remote {namespace db {namespace server {
class RemoteTableStorageServer;}}}}
namespace java {namespace io {
class BufferedOutputStream;}}
namespace alinous {namespace remote {namespace db {namespace client {namespace command {
class AbstractRemoteStorageCommand;}}}}}
namespace java {namespace io {
class IOException;}}
namespace alinous {
class ThreadContext;
}
namespace alinous {namespace remote {namespace db {namespace client {namespace command {
using namespace ::alinous;
using namespace ::java::lang;
using ::java::util::Iterator;
using ::java::io::BufferedOutputStream;
using ::java::io::IOException;
using ::java::io::InputStream;
using ::java::io::OutputStream;
using ::alinous::remote::db::server::RemoteTableStorageServer;
using ::alinous::remote::socket::NetworkBinaryBuffer;
class RemoteStorageConnectCommand final : public AbstractRemoteStorageCommand {
public:
RemoteStorageConnectCommand(const RemoteStorageConnectCommand& base) = default;
public:
RemoteStorageConnectCommand(ThreadContext* ctx) throw() ;
void __construct_impl(ThreadContext* ctx) throw() ;
virtual ~RemoteStorageConnectCommand() throw();
virtual void __releaseRegerences(bool prepare, ThreadContext* ctx) throw();
private:
bool connected;
public:
void readFromStream(InputStream* stream, int remain, ThreadContext* ctx) final;
bool isConnected(ThreadContext* ctx) throw() ;
void executeOnServer(RemoteTableStorageServer* tableStorageServer, BufferedOutputStream* outStream, ThreadContext* ctx) final;
void writeByteStream(OutputStream* out, ThreadContext* ctx) final;
public:
static bool __init_done;
static bool __init_static_variables();
public:
static void __cleanUp(ThreadContext* ctx);
};
}}}}}
#endif /* end of ALINOUS_REMOTE_DB_CLIENT_COMMAND_REMOTESTORAGECONNECTCOMMAND_H_ */
|
/*
-----------------------------------------------------------------------------------------------
Copyright (C) 2013 Henry van Merode. All rights reserved.
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 __PU_CONFIG_FILE_H__
#define __PU_CONFIG_FILE_H__
#include "OgreConfigFile.h"
namespace ParticleUniverse
{
// If the Ogre renderer is replaced by another renderer, the type below must be re-implemented.
typedef Ogre::ConfigFile ConfigFile;
}
#endif
|
#include <unordered_map>
#include <queue>
namespace problema_busqueda
{
template <typename T>
bool Problema_busqueda<T>::voraz()
{
struct Nodo_prioridad
{
size_t indice_en_lista;
decltype(nodo_inicial.tipo_dato_coste()) coste_estimado;
bool operator <(const Nodo_prioridad &nodo) const
{
return nodo.coste_estimado < coste_estimado;
}
};
struct Nodo
{
T nodo;
size_t padre;
decltype(nodo_inicial.tipo_dato_coste()) coste_actual;
bool visitado = false; // extra var
};
solucion.clear();
// Contenedores
std::priority_queue<Nodo_prioridad> lista_prioridad;
std::vector<Nodo> lista; //{nodo,padre,coste_actual}
//std::unordered_map<decltype(nodo_inicial.get_clave()),decltype(nodo_inicial.tipo_dato_coste())>claves; // Si guardáramos el coste del nodo en vez de su posición en la lista
std::unordered_map<decltype(nodo_inicial.get_clave()), size_t> claves; //{clave, puesto}
lista.push_back({ nodo_inicial,0,0 });
claves[nodo_inicial.get_clave()] = 0;
lista_prioridad.push({ 0,heuristica(nodo_inicial,nodo_objetivo) });
bool exito = false;
nodos_expandidos = 0;
size_t iter_lista = 0;
while (exito == false && !lista_prioridad.empty())
{
iter_lista = lista_prioridad.top().indice_en_lista;
lista_prioridad.pop();
exito = lista[iter_lista].nodo == nodo_objetivo;
if (exito == false)
{
if (lista[iter_lista].visitado == false)
{ // No contamos las re-expansiones
lista[iter_lista].visitado = true;
++nodos_expandidos;
}
auto v_hijos = lista[iter_lista].nodo.expandir();
for (auto & hijo : v_hijos)
{
auto clave_hijo = hijo.get_clave();
// Comprobamos si el coste de un nodo repetido es menor que el original, y sie s así sustituimos ese coste en el nodo de la lsita y actualizamos la lista de propridad
typename std::unordered_map <decltype(nodo_inicial.get_clave()), size_t>::iterator it = claves.find(clave_hijo);
if (it == claves.end())
{ // No repetido
Nodo newNodo{
hijo,
iter_lista,
lista[iter_lista].coste_actual + coste_operador(hijo, nodo_objetivo),
false
};
lista.push_back(newNodo); // Queda en la pos lista.size()-1
Nodo_prioridad newNodo_prioridad{
lista.size() - 1,
heuristica(hijo, nodo_objetivo)
};
lista_prioridad.push(newNodo_prioridad);
claves[clave_hijo] = lista.size() - 1;
}
else if (lista[it->second].coste_actual > (lista[iter_lista].coste_actual + coste_operador(hijo, nodo_objetivo)))
{ // Repetido, pero el nuevo con menor coste
lista[it->second].padre = iter_lista;
lista[it->second].coste_actual = lista[iter_lista].coste_actual + coste_operador(hijo, nodo_objetivo);
lista_prioridad.push({ it->second, heuristica(hijo, nodo_objetivo) }); // flotará automáticamente antes que su homólogo de mayor coste
}
}
}
}
if (exito)
{
while (iter_lista != 0)
{
solucion.push_back(lista[iter_lista].nodo);
iter_lista = lista[iter_lista].padre;
}
solucion.push_back(lista[iter_lista].nodo);
}
return exito;
}
}
|
//
// BrickObject.h
// HedzupPongGame
//
// Created by Michael Dube on 2014/10/05.
// Copyright (c) 2014 tappnology. All rights reserved.
//
#import "HUPongGameObject.h"
@interface BrickObject : HUPongGameObject
{
}
@property (nonatomic) int ScorePOint;
@property (nonatomic) int hitCount;
@property (nonatomic) BOOL isActive;
- (void) removeBrick;
-(void) setUpObjectInParent:(SKScene*) parent andWithColour:(NSColor*)color;
@end
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char *find(char *haystack,char needle);
int main()
{
int i;
char* haystack = (char*)malloc(sizeof(char)*400);
char needle,c;
for(i=0;c!='\n';i++)
{
haystack[i]=getchar();
c=haystack[i];
}
scanf("%c",&needle);
printf("%ld",find(haystack,needle)-haystack);
return 0;
}
char *find(char *haystack, char needle)
{
int i;
for(i=0;i<strlen(haystack);i++)
{
if(needle==haystack[i])
{
return(haystack+i);
}
}
return NULL;
}
|
/*
* Client.h
*
* Created on: Nov 13, 2012
* Author: se312002
*/
#ifndef CLIENT_H_
#define CLIENT_H_
#include <string>
class Client {
public:
Client(const std::string &name);
virtual ~Client();
private:
std::string name_;
};
#endif /* CLIENT_H_ */
|
#ifndef MYIMAGEUTIL_H
#define MYIMAGEUTIL_H
#include "MyGeometry.h"
#include "MyImage.h"
enum RBGA_CHANNEL { RBGA_CHANNEL_RED, RBGA_CHANNEL_GREEN, RBGA_CHANNEL_BLUE, RBGA_CHANNEL_ALPHA};
enum SEPARATION_TYPE { SEPARATION_LIGHT, SEPARATION_DARK };
enum GRAYSCALE_TYPE { GRAYSCALE_MIN, GRAYSCALE_MED, GRAYSCALE_MAX, GRAYSCALE_LIGHTNESS, GRAYSCALE_AVG, GRAYSCALE_LUMINOSITY };
enum CHANNEL_COMPLEMENT { COMPLEMENT_OFF, COMPLEMENT_ON };
enum GAMMA_FUNCTION { GAMMA_FUNCTION_BLACKHOLE, GAMMA_FUNCTION_EXPAND };
class MyImageUtil
{
public:
/* Image distortion effects */
static void BlackHoleEffect(MyImage *src, MyCircle areaOfEffect);
static void ExpandEffect(MyImage *src, MyCircle areaOfEffect);
static void SwirlEffect(MyImage *src, MyCircle areaOfEffect, int nTwists);
/* Copy and paste */
static void CopyFromImage(MyImage *src, MyImage **dest, MyRectangle selection);
static void PasteToImage(MyImage *src, MyImage *dest, int x, int y);
/* Image filters */
static void GrayscaleImage(MyImage *src, MyImage *dest, GRAYSCALE_TYPE type);
static void SeparateChannel(MyImage *src, MyImage *dest, RBGA_CHANNEL channel, SEPARATION_TYPE type);
static void SubtractChannel(MyImage *src, MyImage *dest, RBGA_CHANNEL channel, SEPARATION_TYPE type);
/* Pixel functions */
static GLubyte *LerpPixels(GLubyte *a, GLubyte *b, double t, int channels);
static GLubyte *BilerpPixels(MyImage *image, double x, double y);
};
#endif // MYIMAGEUTIL_H
|
//
// NetworkKit.h
// NetworkKit
//
// Created by Muhammad Bassio on 8/23/17.
// Copyright © 2017 N8ive Apps. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for NetworkKit.
FOUNDATION_EXPORT double NetworkKitVersionNumber;
//! Project version string for NetworkKit.
FOUNDATION_EXPORT const unsigned char NetworkKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <NetworkKit/PublicHeader.h>
|
/*
* 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 NSDictionary, NSLock, NSMutableArray, NSTimer;
@interface VSCacheUpdateListener : NSObject
{
NSLock *_lock;
NSMutableArray *_updateRequestQueue;
NSDictionary *_dataProviders;
NSTimer *_flushTimer;
_Bool _isListening;
}
+ (id)sharedListenerIfExists;
+ (id)sharedListener;
- (void)_flush;
- (void)_enqueueRequest:(id)arg1;
- (void)_spokenLanguageChanged:(id)arg1;
- (void)performUpdateForModelIdentifier:(id)arg1 classIdentifier:(id)arg2;
- (void)stopListening;
- (void)startListening;
- (void)dealloc;
- (id)_initShared;
- (id)init;
@end
|
//
// UIStoryboardSegue.h
// UIKit
//
// Copyright 2011-2012 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <FakeUIKit/UIKitDefines.h>
@class UIViewController;
NS_CLASS_AVAILABLE_IOS(5_0) @interface UIStoryboardSegue : NSObject
// Convenience constructor for returning a segue that performs a handler block in its -perform method.
+ (instancetype)segueWithIdentifier:(NSString *)identifier source:(UIViewController *)source destination:(UIViewController *)destination performHandler:(void (^)(void))performHandler NS_AVAILABLE_IOS(6_0);
- (instancetype)initWithIdentifier:(NSString *)identifier source:(UIViewController *)source destination:(UIViewController *)destination; // Designated initializer
@property (nonatomic, readonly) NSString *identifier;
@property (nonatomic, readonly) id sourceViewController;
@property (nonatomic, readonly) id destinationViewController;
- (void)perform;
@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 "ML3Track.h"
@interface ML3Track (MPMediaAdditions)
+ (id)propertyForMPMediaEntityProperty:(id)arg1;
@end
|
void fill(char* needle, int* next, int n){
int i = 0, j = -1;
next[0] = -1;
while (i != n - 1)
{
//这里注意,i==0的时候实际上求的是next[1]的值,以此类推
if (j == -1 || needle[i] == needle[j])
{
++i;
++j;
next[i] = j;
}
else
{
j = next[j];
}
}
}
int strStr(char* haystack, char* needle) {
if(NULL == haystack || NULL == needle){
return -1;
}
int hlen = strlen(haystack);
int nlen = strlen(needle);
if(hlen < nlen){
return -1;
}
if(nlen == 0 || (hlen == 0 && nlen == 0)){
return 0;
}
int next[nlen];
int i = 0;
int j = 0;
int index = -1;
fill(needle, next, nlen);
while(j < hlen && i < nlen)
{
if (i == -1 || needle[i] == haystack[j])
{
++i;
++j;
}
else
{
i = next[i];
}
}
return i == nlen ? j - i: -1;
} |
//
// Pause.h
// PONG4English
//
// Created by Kévin Mondésir on 05/04/2014.
// Copyright (c) 2014 Kmonde. All rights reserved.
//
#ifndef PONG4English_Pause_h
#define PONG4English_Pause_h
#define PAUSESCREEN_VERTEX_COUNT 4
#define PAUSESCREEN_INDEX_COUNT 6
float pause_vertices[4][3]=
{
{90.0f,90.0f,1.0f},
{90.0f,-90.0f,1.0f},
{-90.0f,-90.0f,1.0f},
{-90.0f,90.0f,1.0f}
};
//La balle est bordeau
/*
float ball_colors[4][3]=
{
{0.45882353,0.023529412,0.043137255},
{0.45882353,0.023529412,0.043137255},
{0.45882353,0.023529412,0.043137255},
{0.45882353,0.023529412,0.043137255}
};/*/
float pause_colors[4][4]=
{
{0.0,0.0,0.0,0.75},
{0.0,0.0,0.0,0.75},
{0.0,0.0,0.0,0.75},
{0.0,0.0,0.0,0.75}
};
float pause_normals[4][3]=
{
{0.0f,0.0f,1.0f},
{0.0f,0.0f,1.0f},
{0.0f,0.0f,1.0f},
{0.0f,0.0f,1.0f}
};
unsigned int pause_indices[6]=
{
2,1,3,
1,0,3
};
#endif
|
/**
* alltests.c
*
* All tests for the pnC library
*
* @author David LAWRENCE
*
**/
// Std includes
#include <stdarg.h>
#include <stddef.h>
// Testing includes
#include <setjmp.h>
#include <cmocka.h>
// Personal includes
#include "pnC_tests.h"
#include "dynarray_tests.h"
int main() {
const struct CMUnitTest tests[] = {
// Testing the creation of a PN
cmocka_unit_test(create_pn_test1),
cmocka_unit_test(create_pn_test2),
cmocka_unit_test(create_pn_test3),
cmocka_unit_test(create_pn_test4),
// Testing the addition of pre arcs to a PN
cmocka_unit_test(add_pre_arc_test1),
cmocka_unit_test(add_pre_arc_test2),
cmocka_unit_test(add_pre_arc_test3),
// Testing the addition of post arcs to a PN
cmocka_unit_test(add_post_arc_test1),
cmocka_unit_test(add_post_arc_test2),
cmocka_unit_test(add_post_arc_test3),
// Testing the function that tells you which transition are enabled
cmocka_unit_test(t_enabled_test1),
cmocka_unit_test(t_enabled_test2),
cmocka_unit_test(t_enabled_test3),
// Testing the function that fire a transition if the later is enabled
cmocka_unit_test(t_enabled_fire_test1),
cmocka_unit_test(fire_a_transition_test1),
// Testing the creation of a dynamic array
cmocka_unit_test(create_array_test1),
cmocka_unit_test(create_array_test2),
cmocka_unit_test(create_array_test3),
// Testing the appending of an arc to a dynamic array
cmocka_unit_test(append_test1),
cmocka_unit_test(append_test2),
cmocka_unit_test(append_test3),
// Testing the setter and getter of the dynamic array
cmocka_unit_test(getset_test1),
cmocka_unit_test(get_test1),
cmocka_unit_test(set_test1)
};
// Execute tests
return cmocka_run_group_tests(tests, NULL, NULL);
}
|
/*
-----------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2016-2017 Jean Michel Catanho
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 STANDARDHEADERS_H
#define STANDARDHEADERS_H
/**
* C Headers
*/
#include <cassert>
#include <ctime>
#include <cmath>
/**
* STL Containers
*/
#include <vector>
#include <string>
#include <deque>
#include <queue>
/**
* I/O
*/
#include <iostream>
#include <fstream>
#include <sstream>
/**
* Other
*/
#include <algorithm>
#include <chrono>
#include <exception>
#include <memory>
#include <random>
#endif |
//
// CollectionsTests.h
// CollectionsTests
//
// Created by James Heller on 9/18/13.
// Copyright (c) 2013 SellJamHere. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
#define kTestSize 1000
|
/*
* Generated by class-dump 3.3.3 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard.
*/
@class NSString, NSURL;
@interface JunkMailFilter : NSObject
{
struct __LSMMap *_map;
NSString *_mapFilePath;
NSURL *_mapFileURL;
NSURL *_oldMapFileURL;
double _lsmThreshold;
BOOL _isDirty;
BOOL _isInTraining;
BOOL _useCleanMap;
}
+ (id)sharedInstance;
+ (id)_junkFilterUsageCounterKeys;
+ (long long)daysUntilTransition;
+ (BOOL)shouldUpdateTrainingDebt;
+ (void)incrementJunkMailTrainingDebtBy:(long long)arg1;
+ (void)incrementJunkMailTrainingCreditBy:(long long)arg1;
+ (void)resetJunkMailTrainingBalance;
+ (void)resetJunkMailUsageCounters;
- (void)dealloc;
- (void)finalize;
- (id)retain;
- (unsigned long long)retainCount;
- (void)release;
- (id)autorelease;
- (struct __LSMMap *)map;
- (void)setMap:(struct __LSMMap *)arg1;
@property(readonly) unsigned long long evaluatedMessageCount;
@property(readonly) unsigned long long evaluatedAsJunkMessageCount;
@property(readonly) unsigned long long manuallyMarkedAsJunkMessageCount;
@property(readonly) unsigned long long manuallyMarkedAsNotJunkMessageCount;
- (void)reset;
- (void)saveTraining;
@property(readonly) long long junkMailTrainingBalance;
@property(readonly) long long junkMailTrainingDebt;
@property(readonly) long long junkMailTrainingCredit;
@property(readonly) BOOL isEnabled;
- (id)state;
@property(readonly) BOOL gatherUsageCounts;
- (id)_usageCounter;
- (int)junkMailLevelForMessage:(id)arg1;
- (int)junkMailLevelForMessage:(id)arg1 junkRecorder:(id)arg2;
- (id)trainOnMessages:(id)arg1 junkMailLevel:(int)arg2;
- (void)userDidReplyToMessage:(id)arg1;
@property(nonatomic) BOOL isDirty;
- (void)_saveTrainingWithDelay;
@property(nonatomic) BOOL isInTraining; // @synthesize isInTraining=_isInTraining;
@property(nonatomic) double lsmThreshold; // @synthesize lsmThreshold=_lsmThreshold;
@property(retain) NSString *mapFilePath; // @synthesize mapFilePath=_mapFilePath;
@property(retain) NSURL *mapFileURL; // @synthesize mapFileURL=_mapFileURL;
@property(retain) NSURL *oldMapFileURL; // @synthesize oldMapFileURL=_oldMapFileURL;
@property(nonatomic) BOOL useCleanMap; // @synthesize useCleanMap=_useCleanMap;
@end
|
/*
* Generated by class-dump 3.3.3 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard.
*/
#import "NSPortDelegate-Protocol.h"
@protocol NSMachPortDelegate <NSPortDelegate>
@optional
- (void)handleMachMessage:(void *)arg1;
@end
|
//
// EventStorage.h
// DrawingApp
//
// Created by miyaeyo on 2015. 9. 23..
// Copyright (c) 2015년 miyaeyo. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DrawingDelegate.h"
#import "MyPoint.h"
@interface Recoder : NSObject
@property (nonatomic, weak) id <DrawingDelegate> delegate;
- (void)clear;
- (void)storePoint:(MyPoint *)point isEdge:(BOOL)edge;
- (NSArray *)takeOutLines;
@end
|
#ifndef GRAPH_H
#define GRAPH_H
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include "vertex.h"
#include "compressedVertex.h"
#include "parallel.h"
using namespace std;
// **************************************************************
// ADJACENCY ARRAY REPRESENTATION
// **************************************************************
// Class that handles implementation specific freeing of memory
// owned by the graph
struct Deletable {
public:
virtual void del() = 0;
};
template <class vertex>
struct Uncompressed_Mem : public Deletable {
public:
vertex* V;
long n;
long m;
void* allocatedInplace, * inEdges;
Uncompressed_Mem(vertex* VV, long nn, long mm, void* ai, void* _inEdges = NULL)
: V(VV), n(nn), m(mm), allocatedInplace(ai), inEdges(_inEdges) { }
void del() {
if (allocatedInplace == NULL)
for (long i=0; i < n; i++) V[i].del();
else free(allocatedInplace);
free(V);
if(inEdges != NULL) free(inEdges);
}
};
template <class vertex>
struct Uncompressed_Memhypergraph : public Deletable {
public:
vertex* V;
vertex* H;
long nv;
long mv;
long nh;
long mh;
void* edgesV, *inEdgesV, *edgesH, *inEdgesH;
Uncompressed_Memhypergraph(vertex* VV, vertex* HH, long nnv, long mmv, long nnh, long mmh, void* _edgesV, void* _edgesH, void* _inEdgesV = NULL, void* _inEdgesH = NULL)
: V(VV), H(HH), nv(nnv), mv(mmv), nh(nnh), mh(mmh), edgesV(_edgesV), edgesH(_edgesH), inEdgesV(_inEdgesV), inEdgesH(_inEdgesH) { }
void del() {
free(edgesV);
free(edgesH);
free(V);
free(H);
if(inEdgesV != NULL) free(inEdgesV);
if(inEdgesH != NULL) free(inEdgesH);
}
};
template <class vertex>
struct Compressed_Mem : public Deletable {
public:
vertex* V;
char* s;
Compressed_Mem(vertex* _V, char* _s) :
V(_V), s(_s) { }
void del() {
free(V);
free(s);
}
};
template <class vertex>
struct Compressed_Memhypergraph : public Deletable {
public:
vertex* V;
vertex* H;
char* s;
Compressed_Memhypergraph(vertex* _V, vertex* _H, char* _s) :
V(_V), H(_H), s(_s) { }
void del() {
free(V);
free(H);
free(s);
}
};
template <class vertex>
struct graph {
vertex *V;
long n;
long m;
bool transposed;
uintE* flags;
Deletable *D;
graph(vertex* _V, long _n, long _m, Deletable* _D) : V(_V), n(_n), m(_m),
D(_D), flags(NULL), transposed(0) {}
graph(vertex* _V, long _n, long _m, Deletable* _D, uintE* _flags) : V(_V),
n(_n), m(_m), D(_D), flags(_flags), transposed(0) {}
void del() {
if (flags != NULL) free(flags);
D->del();
free(D);
}
void transpose() {
if ((sizeof(vertex) == sizeof(asymmetricVertex)) ||
(sizeof(vertex) == sizeof(compressedAsymmetricVertex))) {
parallel_for(long i=0;i<n;i++) {
V[i].flipEdges();
}
transposed = !transposed;
}
}
};
template <class vertex>
struct hypergraph {
vertex *V;
vertex *H;
long nv;
long mv;
long nh;
long mh;
bool transposed;
uintE* flags;
Deletable *D;
hypergraph(vertex* _V, vertex* _H, long _nv, long _mv, long _nh, long _mh, Deletable* _D) : V(_V), H(_H), nv(_nv), mv(_mv), nh(_nh), mh(_mh),
D(_D), flags(NULL), transposed(0) {}
hypergraph(vertex* _V, vertex* _H, long _nv, long _mv, long _nh, long _mh, Deletable* _D, uintE* _flags) : V(_V), H(_H),
nv(_nv), mv(_mv), nh(_nh), mh(_mh), D(_D), flags(_flags), transposed(0) {}
void del() {
if (flags != NULL) free(flags);
D->del();
free(D);
}
void initFlags() {
flags = newA(uintE,max(nv,nh));
parallel_for(long i=0;i<max(nv,nh);i++) flags[i]=UINT_E_MAX;
}
void transpose() {
if ((sizeof(vertex) == sizeof(asymmetricVertex)) ||
(sizeof(vertex) == sizeof(compressedAsymmetricVertex))) {
parallel_for(long i=0;i<nv;i++) {
V[i].flipEdges();
}
parallel_for(long i=0;i<nh;i++) {
H[i].flipEdges();
}
transposed = !transposed;
}
}
};
#endif
|
//
// CCBlogsMasterTableViewController.h
// ChampShuttle
//
// Created by Matthew Huwiler on 4/15/14.
// Copyright (c) 2014 Champlain College. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CCBlogsMasterTableViewController : UITableViewController
@end
|
#pragma once
#include "Base.h"
namespace DepthUI{
class DEPTHUI_API Renderer
{
public:
uint viewport_pos_x;
uint viewport_pos_y;
uint viewport_size_x_absolute;
uint viewport_size_y_absolute;
public:
Renderer();
~Renderer();
};
} |
#ifndef TESTWINDOW2_H
#define TESTWINDOW2_H
#include "testshader2.h"
#include "batchtriangles.h"
#include <mw/window.h>
#include <mw/textureatlas.h>
class TestWindow2 : public mw::Window {
public:
TestWindow2(int majorGlVersion, int minorGlVersion) : textureAtlas_(2048, 2048) {
Window::setOpenGlVersion(majorGlVersion, minorGlVersion);
}
private:
void initPreLoop() override {
shader_ = std::make_shared<TestShader2>("testShader2_2_1.ver.glsl", "testShader2_2_1.fra.glsl");
sprite_ = textureAtlas_.add("tetris.bmp");
batch_ = std::make_shared<BatchTriangles>(shader_);
resize(mw::Window::getWidth(), mw::Window::getHeight());
shader_->setModelMatrix(mw::Matrix44<float>::I);
shader_->setProjectionMatrix(mw::Matrix44<float>::I);
batch_->addRectangle(0.1f, 0.4f, 0.2f, 0.2f);
batch_->addTriangle(TestShader2::Vertex(0, 0), TestShader2::Vertex(0.3f, 0), TestShader2::Vertex(0.3f, 0.3f));
batch_->addCircle(-0.5f, 0.5f, 0.3f, 40);
batch_->addRectangle(TestShader2::Vertex(-0.3f, -0.2f), TestShader2::Vertex(0, 0), TestShader2::Vertex(0.f, 0.1f), TestShader2::Vertex(-0.2f, 0.2f));
batch_->addCircle(0.5f, -0.5f, 0.3f, 0.6f, 30);
batch_->addLine(-0.7f, -0.9f, -0.7f, -0.1f, 0.2f);
for (float angle = 0.0; angle < 2 * 3.14; angle += 2 * 3.14f / 16) {
batch_->addLine(0.7f * std::cos(angle), 0.7f * std::sin(angle), 0.2f * std::cos(angle), 0.2f * std::sin(angle), 0.05f);
}
batch_->addRectangle(-0.9f, -0.9f, 0.3f, 0.3f, sprite_);
batch_->uploadToGraphicCard();
sprite_.bindTexture();
mw::checkGlError();
}
void update(double deltaTime) override {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
sprite_.bindTexture();
batch_->draw();
glDisable(GL_BLEND);
}
void eventUpdate(const SDL_Event& windowEvent) override {
switch (windowEvent.type) {
case SDL_QUIT:
quit();
break;
case SDL_WINDOWEVENT:
switch (windowEvent.window.event) {
case SDL_WINDOWEVENT_CLOSE:
quit();
break;
case SDL_WINDOWEVENT_RESIZED:
resize(windowEvent.window.data1, windowEvent.window.data2);
break;
}
break;
case SDL_KEYDOWN:
switch (windowEvent.key.keysym.sym) {
case SDLK_SPACE:
batch_->addLine(0.7f, -0.7f, 0.7f, 0.7f, 0.2f);
batch_->uploadToGraphicCard();
break;
case SDLK_ESCAPE:
quit();
break;
}
break;
}
}
void resize(int w, int h) {
mw::checkGlError();
glViewport(0, 0, w, h);
//shader_.setProjectionMatrix(glm::ortho(0, w, 0, h));
mw::checkGlError();
}
std::shared_ptr<TestShader2> shader_;
std::shared_ptr<BatchTriangles> batch_;
mw::Sprite sprite_;
mw::TextureAtlas textureAtlas_;
};
#endif // TESTWINDOW2_H
|
//
// InputEventController.h
// atvHelloWorld
//
// Created by Michael Gile on 9/12/11.
// Copyright 2011 Michael Gile. All rights reserved.
//
#import "BRTextEntryController.h"
@interface InputEventController : BRTextEntryController {
}
@end
|
#include "f2c.h"
#include "blaswrap.h"
/* Table of constant values */
static integer c__1 = 1;
static doublereal c_b10 = -1.;
/* Subroutine */ int dtbt02_(char *uplo, char *trans, char *diag, integer *n,
integer *kd, integer *nrhs, doublereal *ab, integer *ldab, doublereal
*x, integer *ldx, doublereal *b, integer *ldb, doublereal *work,
doublereal *resid)
{
/* System generated locals */
integer ab_dim1, ab_offset, b_dim1, b_offset, x_dim1, x_offset, i__1;
doublereal d__1, d__2;
/* Local variables */
integer j;
doublereal eps;
extern logical lsame_(char *, char *);
extern doublereal dasum_(integer *, doublereal *, integer *);
doublereal anorm, bnorm;
extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *,
doublereal *, integer *), dtbmv_(char *, char *, char *, integer *
, integer *, doublereal *, integer *, doublereal *, integer *), daxpy_(integer *, doublereal *,
doublereal *, integer *, doublereal *, integer *);
doublereal xnorm;
extern doublereal dlamch_(char *), dlantb_(char *, char *, char *,
integer *, integer *, doublereal *, integer *, doublereal *);
/* -- LAPACK test routine (version 3.1) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* DTBT02 computes the residual for the computed solution to a */
/* triangular system of linear equations A*x = b or A' *x = b when */
/* A is a triangular band matrix. Here A' is the transpose of A and */
/* x and b are N by NRHS matrices. The test ratio is the maximum over */
/* the number of right hand sides of */
/* norm(b - op(A)*x) / ( norm(op(A)) * norm(x) * EPS ), */
/* where op(A) denotes A or A' and EPS is the machine epsilon. */
/* Arguments */
/* ========= */
/* UPLO (input) CHARACTER*1 */
/* Specifies whether the matrix A is upper or lower triangular. */
/* = 'U': Upper triangular */
/* = 'L': Lower triangular */
/* TRANS (input) CHARACTER*1 */
/* Specifies the operation applied to A. */
/* = 'N': A *x = b (No transpose) */
/* = 'T': A'*x = b (Transpose) */
/* = 'C': A'*x = b (Conjugate transpose = Transpose) */
/* DIAG (input) CHARACTER*1 */
/* Specifies whether or not the matrix A is unit triangular. */
/* = 'N': Non-unit triangular */
/* = 'U': Unit triangular */
/* N (input) INTEGER */
/* The order of the matrix A. N >= 0. */
/* KD (input) INTEGER */
/* The number of superdiagonals or subdiagonals of the */
/* triangular band matrix A. KD >= 0. */
/* NRHS (input) INTEGER */
/* The number of right hand sides, i.e., the number of columns */
/* of the matrices X and B. NRHS >= 0. */
/* AB (input) DOUBLE PRECISION array, dimension (LDAB,N) */
/* The upper or lower triangular band matrix A, stored in the */
/* first kd+1 rows of the array. The j-th column of A is stored */
/* in the j-th column of the array AB as follows: */
/* if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; */
/* if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). */
/* LDAB (input) INTEGER */
/* The leading dimension of the array AB. LDAB >= KD+1. */
/* X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) */
/* The computed solution vectors for the system of linear */
/* equations. */
/* LDX (input) INTEGER */
/* The leading dimension of the array X. LDX >= max(1,N). */
/* B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) */
/* The right hand side vectors for the system of linear */
/* equations. */
/* LDB (input) INTEGER */
/* The leading dimension of the array B. LDB >= max(1,N). */
/* WORK (workspace) DOUBLE PRECISION array, dimension (N) */
/* RESID (output) DOUBLE PRECISION */
/* The maximum over the number of right hand sides of */
/* norm(op(A)*x - b) / ( norm(op(A)) * norm(x) * EPS ). */
/* ===================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. External Functions .. */
/* .. */
/* .. External Subroutines .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. Executable Statements .. */
/* Quick exit if N = 0 or NRHS = 0 */
/* Parameter adjustments */
ab_dim1 = *ldab;
ab_offset = 1 + ab_dim1;
ab -= ab_offset;
x_dim1 = *ldx;
x_offset = 1 + x_dim1;
x -= x_offset;
b_dim1 = *ldb;
b_offset = 1 + b_dim1;
b -= b_offset;
--work;
/* Function Body */
if (*n <= 0 || *nrhs <= 0) {
*resid = 0.;
return 0;
}
/* Compute the 1-norm of A or A'. */
if (lsame_(trans, "N")) {
anorm = dlantb_("1", uplo, diag, n, kd, &ab[ab_offset], ldab, &work[1]
);
} else {
anorm = dlantb_("I", uplo, diag, n, kd, &ab[ab_offset], ldab, &work[1]
);
}
/* Exit with RESID = 1/EPS if ANORM = 0. */
eps = dlamch_("Epsilon");
if (anorm <= 0.) {
*resid = 1. / eps;
return 0;
}
/* Compute the maximum over the number of right hand sides of */
/* norm(op(A)*x - b) / ( norm(op(A)) * norm(x) * EPS ). */
*resid = 0.;
i__1 = *nrhs;
for (j = 1; j <= i__1; ++j) {
dcopy_(n, &x[j * x_dim1 + 1], &c__1, &work[1], &c__1);
dtbmv_(uplo, trans, diag, n, kd, &ab[ab_offset], ldab, &work[1], &
c__1);
daxpy_(n, &c_b10, &b[j * b_dim1 + 1], &c__1, &work[1], &c__1);
bnorm = dasum_(n, &work[1], &c__1);
xnorm = dasum_(n, &x[j * x_dim1 + 1], &c__1);
if (xnorm <= 0.) {
*resid = 1. / eps;
} else {
/* Computing MAX */
d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps;
*resid = max(d__1,d__2);
}
/* L10: */
}
return 0;
/* End of DTBT02 */
} /* dtbt02_ */
|
#pragma once
#include <agge.text/font.h>
namespace agge
{
namespace tests
{
const glyph::path_point c_outline_1[] = {
{ path_command_move_to, 1.1f, 2.4f },
{ path_command_line_to, 4.1f, 7.5f },
{ path_command_line_to | path_flag_close, 5.5f, 1.1f },
};
const glyph::path_point c_outline_2[] = {
{ path_command_move_to, 1.1f, 2.4f },
{ path_command_line_to, 4.1f, 7.5f },
{ path_command_line_to, 4.1f, 4.5f },
{ path_command_line_to | path_flag_close, 5.5f, 1.1f },
};
const glyph::path_point c_outline_diamond[] = {
{ path_command_move_to, -2.1f, 0.0f },
{ path_command_line_to, 0.0f, -2.1f },
{ path_command_line_to, 2.1f, 0.0f },
{ path_command_line_to | path_flag_close, 0.0f, 2.1f },
};
}
}
|
#ifndef EPOXY_AUDIOPLAYER_H
#define EPOXY_AUDIOPLAYER_H
class AudioPlayer {
public:
static AudioPlayer* file(const char* fn);
// static AudioPlayer* url(const char* url);
virtual ~AudioPlayer() {}
virtual bool isPlaying() const = 0;
virtual double duration() const = 0;
virtual double progress() const = 0;
virtual void play() = 0;
virtual void seek(double t) = 0 ;
protected:
};
extern int playASound(const char* fn);
#endif
|
//
// GPKGFeatureIndexerIdQuery.h
// geopackage-ios
//
// Created by Brian Osborn on 2/11/20.
// Copyright © 2020 NGA. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* Feature Indexer Id query with nested SQL and arguments
*/
@interface GPKGFeatureIndexerIdQuery : NSObject
/**
* Initialize
*/
-(instancetype) init;
/**
* Add an id argument
*
* @param id id value
*/
-(void) addArgument: (NSNumber *) id;
/**
* Add an id argument
*
* @param id id value
*/
-(void) addArgumentInt: (int) id;
/**
* Get the number of ids
*
* @return count
*/
-(int) count;
/**
* Get the set of ids
*
* @return ids
*/
-(NSSet<NSNumber *> *) ids;
/**
* Check if the query has the id
*
* @param id id
* @return true if has id
*/
-(BOOL) hasId: (NSNumber *) id;
/**
* Check if the query has the id
*
* @param id id
* @return true if has id
*/
-(BOOL) hasIdInt: (int) id;
/**
* Check if the total number of query arguments is above the maximum allowed in a single query
*
* @return true if above the maximum allowed query arguments
*/
-(BOOL) aboveMaxArguments;
/**
* Check if the total number of query arguments is above the maximum allowed in a single query
*
* @param additionalArgs additional arguments
* @return true if above the maximum allowed query arguments
*/
-(BOOL) aboveMaxArgumentsWithAdditionalArgs: (NSArray *) additionalArgs;
/**
* Check if the total number of query arguments is above the maximum allowed in a single query
*
* @param additionalArgs additional argument count
* @return true if above the maximum allowed query arguments
*/
-(BOOL) aboveMaxArgumentsWithAdditionalArgsCount: (int) additionalArgs;
/**
* Get the SQL statement
*
* @return SQL
*/
-(NSString *) sql;
/**
* Get the arguments
*
* @return args
*/
-(NSArray *) args;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.