answer
stringlengths 15
1.25M
|
|---|
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/serial_reg.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <asm/mach-types.h>
#include <mach/board.h>
#include <mach/mux.h>
#include <mach/gpio.h>
#include <mach/fpga.h>
static struct clk * uart1_ck;
static struct clk * uart2_ck;
static struct clk * uart3_ck;
static inline unsigned int omap_serial_in(struct <API key> *up,
int offset)
{
offset <<= up->regshift;
return (unsigned int)__raw_readb(up->membase + offset);
}
static inline void omap_serial_outp(struct <API key> *p, int offset,
int value)
{
offset <<= p->regshift;
__raw_writeb(value, p->membase + offset);
}
/*
* Internal UARTs need to be initialized for the 8250 autoconfig to work
* properly. Note that the TX watermark initialization may not be needed
* once the 8250.c watermark handling code is merged.
*/
static void __init omap_serial_reset(struct <API key> *p)
{
omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */
omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */
omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */
if (!cpu_is_omap15xx()) {
omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));
}
}
static struct <API key> <API key>[] = {
{
.membase = OMAP1_IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = OMAP_UART1_BASE,
.irq = INT_UART1,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
},
{
.membase = OMAP1_IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = OMAP_UART2_BASE,
.irq = INT_UART2,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
},
{
.membase = OMAP1_IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = OMAP_UART3_BASE,
.irq = INT_UART3,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = <API key>,
.dev = {
.platform_data = <API key>,
},
};
/*
* Note that on Innovator-1510 UART2 pins conflict with USB2.
* By default UART2 does not work on Innovator-1510 if you have
* USB OHCI enabled. To use UART2, you must disable USB2 first.
*/
void __init omap_serial_init(void)
{
int i;
if (cpu_is_omap730()) {
<API key>[0].regshift = 0;
<API key>[1].regshift = 0;
<API key>[0].irq = <API key>;
<API key>[1].irq = <API key>;
}
if (cpu_is_omap850()) {
<API key>[0].regshift = 0;
<API key>[1].regshift = 0;
<API key>[0].irq = <API key>;
<API key>[1].irq = <API key>;
}
if (cpu_is_omap15xx()) {
<API key>[0].uartclk = OMAP1510_BASE_BAUD * 16;
<API key>[1].uartclk = OMAP1510_BASE_BAUD * 16;
<API key>[2].uartclk = OMAP1510_BASE_BAUD * 16;
}
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
unsigned char reg;
switch (i) {
case 0:
uart1_ck = clk_get(NULL, "uart1_ck");
if (IS_ERR(uart1_ck))
printk("Could not get uart1_ck\n");
else {
clk_enable(uart1_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart1_ck, 12000000);
}
if (cpu_is_omap15xx()) {
omap_cfg_reg(UART1_TX);
omap_cfg_reg(UART1_RTS);
if (<API key>()) {
reg = fpga_read(OMAP1510_FPGA_POWER);
reg |= <API key>;
fpga_write(reg, OMAP1510_FPGA_POWER);
udelay(10);
}
}
break;
case 1:
uart2_ck = clk_get(NULL, "uart2_ck");
if (IS_ERR(uart2_ck))
printk("Could not get uart2_ck\n");
else {
clk_enable(uart2_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart2_ck, 12000000);
else
clk_set_rate(uart2_ck, 48000000);
}
if (cpu_is_omap15xx()) {
omap_cfg_reg(UART2_TX);
omap_cfg_reg(UART2_RTS);
if (<API key>()) {
reg = fpga_read(OMAP1510_FPGA_POWER);
reg |= <API key>;
fpga_write(reg, OMAP1510_FPGA_POWER);
udelay(10);
}
}
break;
case 2:
uart3_ck = clk_get(NULL, "uart3_ck");
if (IS_ERR(uart3_ck))
printk("Could not get uart3_ck\n");
else {
clk_enable(uart3_ck);
if (cpu_is_omap15xx())
clk_set_rate(uart3_ck, 12000000);
}
if (cpu_is_omap15xx()) {
omap_cfg_reg(UART3_TX);
omap_cfg_reg(UART3_RX);
}
break;
}
omap_serial_reset(&<API key>[i]);
}
}
#ifdef <API key>
static irqreturn_t <API key>(int irq, void *dev_id)
{
/* Need to do something with serial port right after wake-up? */
return IRQ_HANDLED;
}
/*
* Reroutes serial RX lines to GPIO lines for the duration of
* sleep to allow waking up the device from serial port even
* in deep sleep.
*/
void <API key>(int enable)
{
if (!cpu_is_omap16xx())
return;
if (uart1_ck != NULL) {
if (enable)
omap_cfg_reg(V14_16XX_GPIO37);
else
omap_cfg_reg(V14_16XX_UART1_RX);
}
if (uart2_ck != NULL) {
if (enable)
omap_cfg_reg(R9_16XX_GPIO18);
else
omap_cfg_reg(R9_16XX_UART2_RX);
}
if (uart3_ck != NULL) {
if (enable)
omap_cfg_reg(L14_16XX_GPIO49);
else
omap_cfg_reg(L14_16XX_UART3_RX);
}
}
static void __init <API key>(int gpio_nr)
{
int ret;
ret = gpio_request(gpio_nr, "UART wake");
if (ret < 0) {
printk(KERN_ERR "Could not request UART wake GPIO: %i\n",
gpio_nr);
return;
}
<API key>(gpio_nr);
ret = request_irq(gpio_to_irq(gpio_nr), &<API key>,
IRQF_TRIGGER_RISING, "serial wakeup", NULL);
if (ret) {
gpio_free(gpio_nr);
printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",
gpio_nr);
return;
}
enable_irq_wake(gpio_to_irq(gpio_nr));
}
static int __init <API key>(void)
{
if (!cpu_is_omap16xx())
return 0;
if (uart1_ck != NULL)
<API key>(37);
if (uart2_ck != NULL)
<API key>(18);
if (uart3_ck != NULL)
<API key>(49);
return 0;
}
late_initcall(<API key>);
#endif /* <API key> */
static int __init omap_init(void)
{
return <API key>(&serial_device);
}
arch_initcall(omap_init);
|
#! /bin/sh
# This program is free software; you can redistribute it and/or modify
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Make sure AC_LIBOBJ and friends work.
# Please keep this in sync with sister test 'libobj16b.sh'.
required=cc
. test-init.sh
mv configure.ac configure.proto
cat >> configure.proto << 'END'
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
%LIBOBJ-STUFF% # Will be activated later.
AC_OUTPUT
END
cat > Makefile.am << 'END'
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
libtu_a_LIBADD = $(LIBOBJS)
include extra-checks.am
.PHONY: $(extra_checks) pre-test
pre-test: distdir
ls -l $(srcdir) $(builddir) $(distdir)
$(AR) tv libtu.a
$(extra_checks): pre-test
check-local: $(extra_checks)
maude-src:
grep dummy_maude $(srcdir)/maude.c
maude-dist:
grep dummy_maude $(distdir)/maude.c
liver-src:
grep dummy_liver $(srcdir)/liver.c
liver-dist:
grep dummy_liver $(distdir)/liver.c
liver-not-dist: distdir
test ! -r $(distdir)/liver.c
maude-not-dist: distdir
test ! -r $(distdir)/maude.c
maude-lib:
$(AR) t libtu.a | grep maude
maude-not-lib:
$(AR) t libtu.a | grep maude && exit 1; exit 0
liver-lib:
$(AR) t libtu.a | grep liver
liver-not-lib:
$(AR) t libtu.a | grep liver && exit 1; exit 0
END
cat > maude.c << 'END'
extern int dummy_maude;
END
cat > liver.c << 'END'
extern int dummy_liver;
END
sed '/%LIBOBJ-STUFF%/{
s/.*
i\
AC_LIBOBJ([maude])
}' configure.proto > configure.ac
cat configure.ac # For debugging.
cat > extra-checks.am << 'END'
extra_checks = maude-src maude-dist maude-lib liver-not-dist
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
./configure
$MAKE
$MAKE check
$MAKE distcheck
$MAKE distclean
# Avoid timestamp-related differences.
rm -rf autom4te*.cache
cat > extra-checks.am << 'END'
extra_checks = maude-src maude-dist liver-src liver-dist
if MAUDE_COND
extra_checks += maude-lib liver-not-lib
else
extra_checks += maude-not-lib liver-lib
endif
END
sed '/%LIBOBJ-STUFF%/{
s/.*
i\
AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
if test x"$MAUDE" = x"yes"; then\
AC_LIBOBJ([maude])\
else\
AC_LIBOBJ([liver])\
fi\
AC_LIBSOURCES([maude.c, liver.c])
}' configure.proto > configure.ac
cat configure.ac # For debugging.
$ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure MAUDE=yes
$MAKE
$MAKE check
$MAKE distcheck
$MAKE distclean
./configure MAUDE=no
$MAKE
$MAKE check
$MAKE distcheck
$MAKE distclean
:
|
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <arch/io.h>
#include "sis966.h"
#include <usbdebug.h>
static const u8 SiS_SiS7002_init[22][3]={
{0x04, 0x00, 0x06},
{0x0D, 0x00, 0x00},
{0x2C, 0xFF, 0x39},
{0x2D, 0xFF, 0x10},
{0x2E, 0xFF, 0x02},
{0x2F, 0xFF, 0x70},
{0x74, 0x00, 0x00},
{0x75, 0x00, 0x00},
{0x76, 0x00, 0x00},
{0x77, 0x00, 0x00},
{0x7A, 0x00, 0x00},
{0x7B, 0x00, 0x00},
{0x40, 0x00, 0x20},
{0x41, 0x00, 0x00},
{0x42, 0x00, 0x00},
{0x43, 0x00, 0x08},
{0x44, 0x00, 0x04},
{0x48, 0x00, 0x10},
{0x49, 0x00, 0x80},
{0x4A, 0x00, 0x07},
{0x4B, 0x00, 0x00},
{0x00, 0x00, 0x00} //End of table
};
static void usb2_init(struct device *dev)
{
u32 base;
struct resource *res;
int i;
u8 temp8;
print_debug("USB 2.0 INIT:
i = 0;
while(SiS_SiS7002_init[i][0] != 0)
{
temp8 = pci_read_config8(dev, SiS_SiS7002_init[i][0]);
temp8 &= SiS_SiS7002_init[i][1];
temp8 |= SiS_SiS7002_init[i][2];
pci_write_config8(dev, SiS_SiS7002_init[i][0], temp8);
i++;
};
res = find_resource(dev, 0x10);
if(!res)
return;
base = res->base;
printk(BIOS_DEBUG, "base = 0x%08x\n", base);
write32(base+0x20, 0x2);
#if DEBUG_USB2
print_debug("****** USB 2.0 PCI config ******");
print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C");
for(i=0;i<0xff;i+=4){
if((i%16)==0){
print_debug("\n");
print_debug_hex8(i);
print_debug(": ");
}
print_debug_hex32(pci_read_config32(dev,i));
print_debug(" ");
}
print_debug("\n");
#endif
print_debug("USB 2.0 INIT:<
}
static void usb2_set_resources(struct device *dev)
{
#if CONFIG_USBDEBUG
struct resource *res;
unsigned base;
unsigned old_debug;
old_debug = get_ehci_debug();
set_ehci_debug(0);
#endif
<API key>(dev);
#if CONFIG_USBDEBUG
res = find_resource(dev, 0x10);
set_ehci_debug(old_debug);
if (!res) return;
base = res->base;
set_ehci_base(base);
<API key>(dev, res, "");
#endif
}
static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
{
pci_write_config32(dev, 0x40,
((device & 0xffff) << 16) | (vendor & 0xffff));
}
static struct pci_operations lops_pci = {
.set_subsystem = lpci_set_subsystem,
};
static struct device_operations usb2_ops = {
.read_resources = <API key>,
.set_resources = usb2_set_resources,
.enable_resources = <API key>,
.init = usb2_init,
// .enable = sis966_enable,
.scan_bus = 0,
.ops_pci = &lops_pci,
};
static const struct pci_driver usb2_driver __pci_driver = {
.ops = &usb2_ops,
.vendor = PCI_VENDOR_ID_SIS,
.device = <API key>,
};
|
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Authors: Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Mark Evans, <evansmp@uhura.aston.ac.uk>
* Corey Minyard <wf-rch!minyard@relay.EU.net>
* Florian La Roche, <flla@stud.uni-sb.de>
* Charles Hedrick, <hedrick@klinzhai.rutgers.edu>
* Linus Torvalds, <torvalds@cs.helsinki.fi>
* Alan Cox, <gw4pts@gw4pts.ampr.org>
* Matthew Dillon, <dillon@apollo.west.oic.com>
* Arnt Gulbrandsen, <agulbra@nvg.unit.no>
* Jorge Cwik, <jorge@laser.satlink.net>
*/
/*
* Changes:
* Pedro Roque : Fast Retransmit/Recovery.
* Two receive queues.
* Retransmit queue handled by TCP.
* Better retransmit timer handling.
* New congestion avoidance.
* Header prediction.
* Variable renaming.
*
* Eric : Fast Retransmit.
* Randy Scott : MSS option defines.
* Eric Schenk : Fixes to slow start algorithm.
* Eric Schenk : Yet another double ACK bug.
* Eric Schenk : Delayed ACK bug fixes.
* Eric Schenk : Floyd style fast retrans war avoidance.
* David S. Miller : Don't allow zero congestion window.
* Eric Schenk : Fix retransmitter so that it sends
* next packet on ack of previous packet.
* Andi Kleen : Moved open_request checking here
* and process RSTs for open_requests.
* Andi Kleen : Better prune_queue, and other fixes.
* Andrey Savochkin: Fix RTT measurements in the presence of
* timestamps.
* Andrey Savochkin: Check sequence numbers correctly when
* removing SACKs due to in sequence incoming
* data segments.
* Andi Kleen: Make sure we never ack data there is not
* enough room for. Also make this condition
* a fatal error if it might still happen.
* Andi Kleen: Add tcp_measure_rcv_mss to make
* connections with MSS<min(MTU,ann. MSS)
* work without delayed acks.
* Andi Kleen: Process packets with PSH set in the
* fast path.
* J Hadi Salim: ECN support
* Andrei Gurtov,
* Pasi Sarolahti,
* Panu Kuhlberg: Experimental audit of TCP (re)transmission
* engine. Lots of bugs are found.
* Pasi Sarolahti: F-RTO for dealing with spurious RTOs
*/
#define pr_fmt(fmt) "TCP: " fmt
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/sysctl.h>
#include <linux/kernel.h>
#include <linux/prefetch.h>
#include <net/dst.h>
#include <net/tcp.h>
#include <net/inet_common.h>
#include <linux/ipsec.h>
#include <asm/unaligned.h>
#include <linux/errqueue.h>
int <API key> __read_mostly = 1;
int <API key> __read_mostly = 1;
int sysctl_tcp_sack __read_mostly = 1;
int sysctl_tcp_fack __read_mostly = 1;
int <API key> __read_mostly = <API key>;
int <API key> __read_mostly = 300;
EXPORT_SYMBOL(<API key>);
int sysctl_tcp_dsack __read_mostly = 1;
int sysctl_tcp_app_win __read_mostly = 31;
int <API key> __read_mostly = 1;
EXPORT_SYMBOL(<API key>);
/* rfc5961 challenge ack rate limiting */
int <API key> = 100;
int sysctl_tcp_stdurg __read_mostly;
int sysctl_tcp_rfc1337 __read_mostly;
int <API key> __read_mostly = NR_FILE;
int sysctl_tcp_frto __read_mostly = 2;
int <API key> __read_mostly;
int <API key> __read_mostly = 1;
int <API key> __read_mostly = 3;
int <API key> __read_mostly = HZ/2;
#define FLAG_DATA 0x01 /* Incoming frame contained data. */
#define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */
#define FLAG_DATA_ACKED 0x04 /* This ACK acknowledged new data. */
#define <API key> 0x08 /* "" "" some of which was retransmitted. */
#define FLAG_SYN_ACKED 0x10 /* This ACK acknowledged SYN. */
#define FLAG_DATA_SACKED 0x20 /* New SACK. */
#define FLAG_ECE 0x40 /* ECE in this ACK */
#define FLAG_SLOWPATH 0x100 /* Do not skip RFC checks for window update.*/
#define <API key> 0x200 /* Never retransmitted data are (s)acked */
#define <API key> 0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
#define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained D-SACK info */
#define FLAG_SACK_RENEGING 0x2000 /* snd_una advanced to a sacked seq */
#define <API key> 0x4000 /* <API key>() */
#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE)
#define <API key> (FLAG_ACKED|FLAG_DATA_SACKED)
#define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH)
#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))
/* Adapt the MSS value used to make delayed ack decision to the
* real world.
*/
static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
{
struct <API key> *icsk = inet_csk(sk);
const unsigned int lss = icsk->icsk_ack.last_seg_size;
unsigned int len;
icsk->icsk_ack.last_seg_size = 0;
/* skb->len may jitter because of SACKs, even if peer
* sends good full-sized frames.
*/
len = skb_shinfo(skb)->gso_size ? : skb->len;
if (len >= icsk->icsk_ack.rcv_mss) {
icsk->icsk_ack.rcv_mss = len;
} else {
/* Otherwise, we make more careful check taking into account,
* that SACKs block is variable.
*
* "len" is invariant segment length, including TCP header.
*/
len += skb->data - <API key>(skb);
if (len >= TCP_MSS_DEFAULT + sizeof(struct tcphdr) ||
/* If PSH is not set, packet should be
* full sized, provided peer TCP is not badly broken.
* This observation (if it is correct 8)) allows
* to handle super-low mtu links fairly.
*/
(len >= TCP_MIN_MSS + sizeof(struct tcphdr) &&
!(tcp_flag_word(tcp_hdr(skb)) & TCP_REMNANT))) {
/* Subtract also invariant (if peer is RFC compliant),
* tcp header plus fixed timestamp option length.
* Resulting "len" is MSS free of SACK jitter.
*/
len -= tcp_sk(sk)->tcp_header_len;
icsk->icsk_ack.last_seg_size = len;
if (len == lss) {
icsk->icsk_ack.rcv_mss = len;
return;
}
}
if (icsk->icsk_ack.pending & ICSK_ACK_PUSHED)
icsk->icsk_ack.pending |= ICSK_ACK_PUSHED2;
icsk->icsk_ack.pending |= ICSK_ACK_PUSHED;
}
}
static void tcp_incr_quickack(struct sock *sk)
{
struct <API key> *icsk = inet_csk(sk);
unsigned int quickacks = tcp_sk(sk)->rcv_wnd / (2 * icsk->icsk_ack.rcv_mss);
if (quickacks == 0)
quickacks = 2;
if (quickacks > icsk->icsk_ack.quick)
icsk->icsk_ack.quick = min(quickacks, TCP_MAX_QUICKACKS);
}
static void <API key>(struct sock *sk)
{
struct <API key> *icsk = inet_csk(sk);
tcp_incr_quickack(sk);
icsk->icsk_ack.pingpong = 0;
icsk->icsk_ack.ato = TCP_ATO_MIN;
}
/* Send ACKs quickly, if "quick" count is not exhausted
* and the session is not interactive.
*/
static inline bool <API key>(const struct sock *sk)
{
const struct <API key> *icsk = inet_csk(sk);
return icsk->icsk_ack.quick && !icsk->icsk_ack.pingpong;
}
static void tcp_ecn_queue_cwr(struct tcp_sock *tp)
{
if (tp->ecn_flags & TCP_ECN_OK)
tp->ecn_flags |= TCP_ECN_QUEUE_CWR;
}
static void tcp_ecn_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb)
{
if (tcp_hdr(skb)->cwr)
tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR;
}
static void <API key>(struct tcp_sock *tp)
{
tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR;
}
static void __tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
{
switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) {
case INET_ECN_NOT_ECT:
/* Funny extension: if ECT is not set on a segment,
* and we already seen ECT on a previous segment,
* it is probably a retransmit.
*/
if (tp->ecn_flags & TCP_ECN_SEEN)
<API key>((struct sock *)tp);
break;
case INET_ECN_CE:
if (tcp_ca_needs_ecn((struct sock *)tp))
tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_IS_CE);
if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
/* Better not delay acks, sender can have a very low cwnd */
<API key>((struct sock *)tp);
tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
}
tp->ecn_flags |= TCP_ECN_SEEN;
break;
default:
if (tcp_ca_needs_ecn((struct sock *)tp))
tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_NO_CE);
tp->ecn_flags |= TCP_ECN_SEEN;
break;
}
}
static void tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
{
if (tp->ecn_flags & TCP_ECN_OK)
__tcp_ecn_check_ce(tp, skb);
}
static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th)
{
if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr))
tp->ecn_flags &= ~TCP_ECN_OK;
}
static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th)
{
if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr))
tp->ecn_flags &= ~TCP_ECN_OK;
}
static bool <API key>(const struct tcp_sock *tp, const struct tcphdr *th)
{
if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK))
return true;
return false;
}
/* Buffer size and advertised window tuning.
*
* 1. Tuning sk->sk_sndbuf, when connection enters established state.
*/
static void tcp_sndbuf_expand(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
int sndmem, per_mss;
u32 nr_segs;
/* Worst case is non GSO/TSO : each frame consumes one skb
* and skb->head is kmalloced using power of two area of memory
*/
per_mss = max_t(u32, tp->rx_opt.mss_clamp, tp->mss_cache) +
MAX_TCP_HEADER +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
per_mss = roundup_pow_of_two(per_mss) +
SKB_DATA_ALIGN(sizeof(struct sk_buff));
nr_segs = max_t(u32, TCP_INIT_CWND, tp->snd_cwnd);
nr_segs = max_t(u32, nr_segs, tp->reordering + 1);
/* Fast Recovery (RFC 5681 3.2) :
* Cubic needs 1.7 factor, rounded to 2 to include
* extra cushion (application might react slowly to POLLOUT)
*/
sndmem = 2 * nr_segs * per_mss;
if (sk->sk_sndbuf < sndmem)
sk->sk_sndbuf = min(sndmem, sysctl_tcp_wmem[2]);
}
/* 2. Tuning advertised window (window_clamp, rcv_ssthresh)
*
* All tcp_full_space() is split to two parts: "network" buffer, allocated
* forward and advertised in receiver window (tp->rcv_wnd) and
* "application buffer", required to isolate scheduling/application
* latencies from network.
* window_clamp is maximal advertised window. It can be less than
* tcp_full_space(), in this case tcp_full_space() - window_clamp
* is reserved for "application" buffer. The less window_clamp is
* the smoother our behaviour from viewpoint of network, but the lower
* throughput and the higher sensitivity of the connection to losses. 8)
*
* rcv_ssthresh is more strict window_clamp used at "slow start"
* phase to predict further behaviour of this connection.
* It is used for two goals:
* - to enforce header prediction at sender, even when application
* requires some significant "application buffer". It is check #1.
* - to prevent pruning of receive queue because of misprediction
* of receiver window. Check #2.
*
* The scheme does not work when sender sends good segments opening
* window and then starts to feed us spaghetti. But it should work
* in common situations. Otherwise, we have to rely on queue collapsing.
*/
/* Slow part of check#2. */
static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
/* Optimize this! */
int truesize = tcp_win_from_space(skb->truesize) >> 1;
int window = tcp_win_from_space(sysctl_tcp_rmem[2]) >> 1;
while (tp->rcv_ssthresh <= window) {
if (truesize <= skb->len)
return 2 * inet_csk(sk)->icsk_ack.rcv_mss;
truesize >>= 1;
window >>= 1;
}
return 0;
}
static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
/* Check #1 */
if (tp->rcv_ssthresh < tp->window_clamp &&
(int)tp->rcv_ssthresh < tcp_space(sk) &&
!<API key>(sk)) {
int incr;
/* Check #2. Increase window, if skb with such overhead
* will fit to rcvbuf in future.
*/
if (tcp_win_from_space(skb->truesize) <= skb->len)
incr = 2 * tp->advmss;
else
incr = __tcp_grow_window(sk, skb);
if (incr) {
incr = max_t(int, incr, 2 * skb->len);
tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr,
tp->window_clamp);
inet_csk(sk)->icsk_ack.quick |= 1;
}
}
}
/* 3. Tuning rcvbuf, when connection enters established state. */
static void tcp_fixup_rcvbuf(struct sock *sk)
{
u32 mss = tcp_sk(sk)->advmss;
int rcvmem;
rcvmem = 2 * SKB_TRUESIZE(mss + MAX_TCP_HEADER) *
<API key>(mss);
/* Dynamic Right Sizing (DRS) has 2 to 3 RTT latency
* Allow enough cushion so that sender is not limited by our window
*/
if (<API key>)
rcvmem <<= 2;
if (sk->sk_rcvbuf < rcvmem)
sk->sk_rcvbuf = min(rcvmem, sysctl_tcp_rmem[2]);
}
/* 4. Try to fixup all. It is made immediately after connection enters
* established state.
*/
void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
int maxwin;
if (!(sk->sk_userlocks & SOCK_RCVBUF_LOCK))
tcp_fixup_rcvbuf(sk);
if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK))
tcp_sndbuf_expand(sk);
tp->rcvq_space.space = tp->rcv_wnd;
tp->rcvq_space.time = tcp_time_stamp;
tp->rcvq_space.seq = tp->copied_seq;
maxwin = tcp_full_space(sk);
if (tp->window_clamp >= maxwin) {
tp->window_clamp = maxwin;
if (sysctl_tcp_app_win && maxwin > 4 * tp->advmss)
tp->window_clamp = max(maxwin -
(maxwin >> sysctl_tcp_app_win),
4 * tp->advmss);
}
/* Force reservation of one segment. */
if (sysctl_tcp_app_win &&
tp->window_clamp > 2 * tp->advmss &&
tp->window_clamp + tp->advmss > maxwin)
tp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss);
tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp);
tp->snd_cwnd_stamp = tcp_time_stamp;
}
/* 5. Recalculate window clamp after socket hit its memory bounds. */
static void tcp_clamp_window(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
icsk->icsk_ack.quick = 0;
if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] &&
!(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&
!<API key>(sk) &&
sk_memory_allocated(sk) < sk_prot_mem_limits(sk, 0)) {
sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc),
sysctl_tcp_rmem[2]);
}
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
tp->rcv_ssthresh = min(tp->window_clamp, 2U * tp->advmss);
}
/* Initialize RCV_MSS value.
* RCV_MSS is an our guess about MSS used by the peer.
* We haven't any direct information about the MSS.
* It's better to underestimate the RCV_MSS rather than overestimate.
* Overestimations make us ACKing less frequently than needed.
* Underestimations are more easy to detect and fix by tcp_measure_rcv_mss().
*/
void <API key>(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache);
hint = min(hint, tp->rcv_wnd / 2);
hint = min(hint, TCP_MSS_DEFAULT);
hint = max(hint, TCP_MIN_MSS);
inet_csk(sk)->icsk_ack.rcv_mss = hint;
}
EXPORT_SYMBOL(<API key>);
static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep)
{
u32 new_sample = tp->rcv_rtt_est.rtt;
long m = sample;
if (m == 0)
m = 1;
if (new_sample != 0) {
/* If we sample in larger samples in the non-timestamp
* case, we could grossly overestimate the RTT especially
* with chatty applications or bulk transfer apps which
* are stalled on filesystem I/O.
*
* Also, since we are only going for a minimum in the
* non-timestamp case, we do not smooth things out
* else with timestamps disabled convergence takes too
* long.
*/
if (!win_dep) {
m -= (new_sample >> 3);
new_sample += m;
} else {
m <<= 3;
if (m < new_sample)
new_sample = m;
}
} else {
/* No previous measure. */
new_sample = m << 3;
}
if (tp->rcv_rtt_est.rtt != new_sample)
tp->rcv_rtt_est.rtt = new_sample;
}
static inline void tcp_rcv_rtt_measure(struct tcp_sock *tp)
{
if (tp->rcv_rtt_est.time == 0)
goto new_measure;
if (before(tp->rcv_nxt, tp->rcv_rtt_est.seq))
return;
tcp_rcv_rtt_update(tp, tcp_time_stamp - tp->rcv_rtt_est.time, 1);
new_measure:
tp->rcv_rtt_est.seq = tp->rcv_nxt + tp->rcv_wnd;
tp->rcv_rtt_est.time = tcp_time_stamp;
}
static inline void <API key>(struct sock *sk,
const struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tp->rx_opt.rcv_tsecr &&
(TCP_SKB_CB(skb)->end_seq -
TCP_SKB_CB(skb)->seq >= inet_csk(sk)->icsk_ack.rcv_mss))
tcp_rcv_rtt_update(tp, tcp_time_stamp - tp->rx_opt.rcv_tsecr, 0);
}
/*
* This function should be called every time data is copied to user space.
* It calculates the appropriate TCP receive buffer space.
*/
void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
int time;
int copied;
time = tcp_time_stamp - tp->rcvq_space.time;
if (time < (tp->rcv_rtt_est.rtt >> 3) || tp->rcv_rtt_est.rtt == 0)
return;
/* Number of bytes copied to user in last RTT */
copied = tp->copied_seq - tp->rcvq_space.seq;
if (copied <= tp->rcvq_space.space)
goto new_measure;
/* A bit of theory :
* copied = bytes received in previous RTT, our base window
* To cope with packet losses, we need a 2x factor
* To cope with slow start, and sender growing its cwin by 100 %
* every RTT, we need a 4x factor, because the ACK we are sending
* now is for the next RTT, not the current one :
* <prev RTT . ><current RTT .. ><next RTT .... >
*/
if (<API key> &&
!(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
int rcvwin, rcvmem, rcvbuf;
/* minimal window to cope with packet losses, assuming
* steady state. Add some cushion because of small variations.
*/
rcvwin = (copied << 1) + 16 * tp->advmss;
/* If rate increased by 25%,
* assume slow start, rcvwin = 3 * copied
* If rate increased by 50%,
* assume sender can use 2x growth, rcvwin = 4 * copied
*/
if (copied >=
tp->rcvq_space.space + (tp->rcvq_space.space >> 2)) {
if (copied >=
tp->rcvq_space.space + (tp->rcvq_space.space >> 1))
rcvwin <<= 1;
else
rcvwin += (rcvwin >> 1);
}
rcvmem = SKB_TRUESIZE(tp->advmss + MAX_TCP_HEADER);
while (tcp_win_from_space(rcvmem) < tp->advmss)
rcvmem += 128;
rcvbuf = min(rcvwin / tp->advmss * rcvmem, sysctl_tcp_rmem[2]);
if (rcvbuf > sk->sk_rcvbuf) {
sk->sk_rcvbuf = rcvbuf;
/* Make the window clamp follow along. */
tp->window_clamp = rcvwin;
}
}
tp->rcvq_space.space = copied;
new_measure:
tp->rcvq_space.seq = tp->copied_seq;
tp->rcvq_space.time = tcp_time_stamp;
}
/* There is something which you must keep in mind when you analyze the
* behavior of the tp->ato delayed ack timeout interval. When a
* connection starts up, we want to ack as quickly as possible. The
* problem is that "good" TCP's do slow start at the beginning of data
* transmission. The means that until we send the first few ACK's the
* sender will sit on his end and only queue most of his data, because
* he can only send snd_cwnd unacked packets at any given time. For
* each ACK we send, he increments snd_cwnd and transmits more of his
* queue. -DaveM
*/
static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
u32 now;
<API key>(sk);
tcp_measure_rcv_mss(sk, skb);
tcp_rcv_rtt_measure(tp);
now = tcp_time_stamp;
if (!icsk->icsk_ack.ato) {
/* The _first_ data packet received, initialize
* delayed ACK engine.
*/
tcp_incr_quickack(sk);
icsk->icsk_ack.ato = TCP_ATO_MIN;
} else {
int m = now - icsk->icsk_ack.lrcvtime;
if (m <= TCP_ATO_MIN / 2) {
/* The fastest case is the first. */
icsk->icsk_ack.ato = (icsk->icsk_ack.ato >> 1) + TCP_ATO_MIN / 2;
} else if (m < icsk->icsk_ack.ato) {
icsk->icsk_ack.ato = (icsk->icsk_ack.ato >> 1) + m;
if (icsk->icsk_ack.ato > icsk->icsk_rto)
icsk->icsk_ack.ato = icsk->icsk_rto;
} else if (m > icsk->icsk_rto) {
/* Too long gap. Apparently sender failed to
* restart window, so that we send ACKs quickly.
*/
tcp_incr_quickack(sk);
sk_mem_reclaim(sk);
}
}
icsk->icsk_ack.lrcvtime = now;
tcp_ecn_check_ce(tp, skb);
if (skb->len >= 128)
tcp_grow_window(sk, skb);
}
/* Called to compute a smoothed rtt estimate. The data fed to this
* routine either comes from timestamps, or from segments that were
* known _not_ to have been retransmitted [see Karn/Partridge
* Proceedings SIGCOMM 87]. The algorithm is from the SIGCOMM 88
* piece by Van Jacobson.
* NOTE: the next three routines used to be one big routine.
* To save cycles in the RFC 1323 implementation it was better to break
* it up into three procedures. -- erics
*/
static void tcp_rtt_estimator(struct sock *sk, long mrtt_us)
{
struct tcp_sock *tp = tcp_sk(sk);
long m = mrtt_us; /* RTT */
u32 srtt = tp->srtt_us;
/* The following amusing code comes from Jacobson's
* article in SIGCOMM '88. Note that rtt and mdev
* are scaled versions of rtt and mean deviation.
* This is designed to be as fast as possible
* m stands for "measurement".
*
* On a 1990 paper the rto value is changed to:
* RTO = rtt + 4 * mdev
*
* Funny. This algorithm seems to be very broken.
* These formulae increase RTO, when it should be decreased, increase
* too slowly, when it should be increased quickly, decrease too quickly
* etc. I guess in BSD RTO takes ONE value, so that it is absolutely
* does not matter how to _calculate_ it. Seems, it was trap
* that VJ failed to avoid. 8)
*/
if (srtt != 0) {
m -= (srtt >> 3); /* m is now error in rtt est */
srtt += m; /* rtt = 7/8 rtt + 1/8 new */
if (m < 0) {
m = -m; /* m is now abs(error) */
m -= (tp->mdev_us >> 2); /* similar update on mdev */
/* This is similar to one of Eifel findings.
* Eifel blocks mdev updates when rtt decreases.
* This solution is a bit different: we use finer gain
* for mdev in this case (alpha*beta).
* Like Eifel it also prevents growth of rto,
* but also it limits too fast rto decreases,
* happening in pure Eifel.
*/
if (m > 0)
m >>= 3;
} else {
m -= (tp->mdev_us >> 2); /* similar update on mdev */
}
tp->mdev_us += m; /* mdev = 3/4 mdev + 1/4 new */
if (tp->mdev_us > tp->mdev_max_us) {
tp->mdev_max_us = tp->mdev_us;
if (tp->mdev_max_us > tp->rttvar_us)
tp->rttvar_us = tp->mdev_max_us;
}
if (after(tp->snd_una, tp->rtt_seq)) {
if (tp->mdev_max_us < tp->rttvar_us)
tp->rttvar_us -= (tp->rttvar_us - tp->mdev_max_us) >> 2;
tp->rtt_seq = tp->snd_nxt;
tp->mdev_max_us = tcp_rto_min_us(sk);
}
} else {
/* no previous measure. */
srtt = m << 3; /* take the measured time to be rtt */
tp->mdev_us = m << 1; /* make sure rto = 3*rtt */
tp->rttvar_us = max(tp->mdev_us, tcp_rto_min_us(sk));
tp->mdev_max_us = tp->rttvar_us;
tp->rtt_seq = tp->snd_nxt;
}
tp->srtt_us = max(1U, srtt);
}
/* Set the sk_pacing_rate to allow proper sizing of TSO packets.
* Note: TCP stack does not yet implement pacing.
* FQ packet scheduler can be used to implement cheap but effective
* TCP pacing, to smooth the burst on large writes when packets
* in flight is significantly lower than cwnd (or rwin)
*/
static void <API key>(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
u64 rate;
/* set sk_pacing_rate to 200 % of current rate (mss * cwnd / srtt) */
rate = (u64)tp->mss_cache * 2 * (USEC_PER_SEC << 3);
rate *= max(tp->snd_cwnd, tp->packets_out);
if (likely(tp->srtt_us))
do_div(rate, tp->srtt_us);
/* ACCESS_ONCE() is needed because sch_fq fetches sk_pacing_rate
* without any lock. We want to make sure compiler wont store
* intermediate values in this location.
*/
ACCESS_ONCE(sk->sk_pacing_rate) = min_t(u64, rate,
sk->sk_max_pacing_rate);
}
/* Calculate rto without backoff. This is the second half of Van Jacobson's
* routine referred to above.
*/
static void tcp_set_rto(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
/* Old crap is replaced with new one. 8)
*
* More seriously:
* 1. If rtt variance happened to be less 50msec, it is hallucination.
* It cannot be less due to utterly erratic ACK generation made
* at least by solaris and freebsd. "Erratic ACKs" has _nothing_
* to do with delayed acks, because at cwnd>2 true delack timeout
* is invisible. Actually, Linux-2.4 also generates erratic
* ACKs in some circumstances.
*/
inet_csk(sk)->icsk_rto = __tcp_set_rto(tp);
/* 2. Fixups made earlier cannot be right.
* If we do not estimate RTO correctly without them,
* all the algo is pure shit and should be replaced
* with correct one. It is exactly, which we pretend to do.
*/
/* NOTE: clamping at TCP_RTO_MIN is not required, current algo
* guarantees that rto is higher.
*/
tcp_bound_rto(sk);
}
__u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst)
{
__u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0);
if (!cwnd)
cwnd = TCP_INIT_CWND;
return min_t(__u32, cwnd, tp->snd_cwnd_clamp);
}
/*
* Packet counting of FACK is based on in-order assumptions, therefore TCP
* disables it when reordering is detected
*/
void tcp_disable_fack(struct tcp_sock *tp)
{
/* RFC3517 uses different metric in lost marker => reset on change */
if (tcp_is_fack(tp))
tp->lost_skb_hint = NULL;
tp->rx_opt.sack_ok &= ~TCP_FACK_ENABLED;
}
/* Take a notice that peer is sending D-SACKs */
static void tcp_dsack_seen(struct tcp_sock *tp)
{
tp->rx_opt.sack_ok |= TCP_DSACK_SEEN;
}
static void <API key>(struct sock *sk, const int metric,
const int ts)
{
struct tcp_sock *tp = tcp_sk(sk);
if (metric > tp->reordering) {
int mib_idx;
tp->reordering = min(<API key>, metric);
/* This exciting event is worth to be remembered. 8) */
if (ts)
mib_idx = <API key>;
else if (tcp_is_reno(tp))
mib_idx = <API key>;
else if (tcp_is_fack(tp))
mib_idx = <API key>;
else
mib_idx = <API key>;
NET_INC_STATS_BH(sock_net(sk), mib_idx);
#if FASTRETRANS_DEBUG > 1
pr_debug("Disorder%d %d %u f%u s%u rr%d\n",
tp->rx_opt.sack_ok, inet_csk(sk)->icsk_ca_state,
tp->reordering,
tp->fackets_out,
tp->sacked_out,
tp->undo_marker ? tp->undo_retrans : 0);
#endif
tcp_disable_fack(tp);
}
if (metric > 0)
<API key>(tp);
}
/* This must be called before lost_out is incremented */
static void <API key>(struct tcp_sock *tp, struct sk_buff *skb)
{
if (!tp->retransmit_skb_hint ||
before(TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
tp->retransmit_skb_hint = skb;
if (!tp->lost_out ||
after(TCP_SKB_CB(skb)->end_seq, tp->retransmit_high))
tp->retransmit_high = TCP_SKB_CB(skb)->end_seq;
}
static void tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb)
{
if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) {
<API key>(tp, skb);
tp->lost_out += tcp_skb_pcount(skb);
TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
}
}
static void <API key>(struct tcp_sock *tp,
struct sk_buff *skb)
{
<API key>(tp, skb);
if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) {
tp->lost_out += tcp_skb_pcount(skb);
TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
}
}
static bool <API key>(struct tcp_sock *tp, bool is_dsack,
u32 start_seq, u32 end_seq)
{
/* Too far in future, or reversed (interpretation is ambiguous) */
if (after(end_seq, tp->snd_nxt) || !before(start_seq, end_seq))
return false;
/* Nasty start_seq wrap-around check (see comments above) */
if (!before(start_seq, tp->snd_nxt))
return false;
/* In outstanding window? ...This is valid exit for D-SACKs too.
* start_seq == snd_una is non-sensical (see comments above)
*/
if (after(start_seq, tp->snd_una))
return true;
if (!is_dsack || !tp->undo_marker)
return false;
/* ...Then it's D-SACK, and must reside below snd_una completely */
if (after(end_seq, tp->snd_una))
return false;
if (!before(start_seq, tp->undo_marker))
return true;
/* Too old */
if (!after(end_seq, tp->undo_marker))
return false;
/* Undo_marker boundary crossing (overestimates a lot). Known already:
* start_seq < undo_marker and end_seq >= undo_marker.
*/
return !before(start_seq, end_seq - tp->max_window);
}
/* Check for lost retransmit. This superb idea is borrowed from "ratehalving".
* Event "B". Later note: FACK people cheated me again 8), we have to account
* for reordering! Ugly, but should help.
*
* Search retransmitted skbs from write_queue that were sent when snd_nxt was
* less than what is now known to be received by the other end (derived from
* highest SACK block). Also calculate the lowest snd_nxt among the remaining
* retransmitted skbs to avoid some costly processing per ACKs.
*/
static void <API key>(struct sock *sk)
{
const struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
int cnt = 0;
u32 new_low_seq = tp->snd_nxt;
u32 received_upto = <API key>(tp);
if (!tcp_is_fack(tp) || !tp->retrans_out ||
!after(received_upto, tp->lost_retrans_low) ||
icsk->icsk_ca_state != TCP_CA_Recovery)
return;
tcp_for_write_queue(skb, sk) {
u32 ack_seq = TCP_SKB_CB(skb)->ack_seq;
if (skb == tcp_send_head(sk))
break;
if (cnt == tp->retrans_out)
break;
if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
continue;
if (!(TCP_SKB_CB(skb)->sacked & <API key>))
continue;
/* TODO: We would like to get rid of tcp_is_fack(tp) only
* constraint here (see above) but figuring out that at
* least tp->reordering SACK blocks reside between ack_seq
* and received_upto is not easy task to do cheaply with
* the available datastructures.
*
* Whether FACK should check here for tp->reordering segs
* in-between one could argue for either way (it would be
* rather simple to implement as we could count fack_count
* during the walk and do tp->fackets_out - fack_count).
*/
if (after(received_upto, ack_seq)) {
TCP_SKB_CB(skb)->sacked &= ~<API key>;
tp->retrans_out -= tcp_skb_pcount(skb);
<API key>(tp, skb);
NET_INC_STATS_BH(sock_net(sk), <API key>);
} else {
if (before(ack_seq, new_low_seq))
new_low_seq = ack_seq;
cnt += tcp_skb_pcount(skb);
}
}
if (tp->retrans_out)
tp->lost_retrans_low = new_low_seq;
}
static bool tcp_check_dsack(struct sock *sk, const struct sk_buff *ack_skb,
struct tcp_sack_block_wire *sp, int num_sacks,
u32 prior_snd_una)
{
struct tcp_sock *tp = tcp_sk(sk);
u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq);
u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq);
bool dup_sack = false;
if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) {
dup_sack = true;
tcp_dsack_seen(tp);
NET_INC_STATS_BH(sock_net(sk), <API key>);
} else if (num_sacks > 1) {
u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq);
u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq);
if (!after(end_seq_0, end_seq_1) &&
!before(start_seq_0, start_seq_1)) {
dup_sack = true;
tcp_dsack_seen(tp);
NET_INC_STATS_BH(sock_net(sk),
<API key>);
}
}
/* D-SACK for already forgotten data... Do dumb counting. */
if (dup_sack && tp->undo_marker && tp->undo_retrans > 0 &&
!after(end_seq_0, prior_snd_una) &&
after(end_seq_0, tp->undo_marker))
tp->undo_retrans
return dup_sack;
}
struct tcp_sacktag_state {
int reord;
int fack_count;
/* Timestamps for earliest and latest never-retransmitted segment
* that was SACKed. RTO needs the earliest RTT to stay conservative,
* but congestion control should still get an accurate delay signal.
*/
struct skb_mstamp first_sackt;
struct skb_mstamp last_sackt;
int flag;
};
/* Check if skb is fully within the SACK block. In presence of GSO skbs,
* the incoming SACK may not exactly match but we can find smaller MSS
* aligned portion of it that matches. Therefore we might need to fragment
* which may fail and creates some hassle (caller must handle error case
* returns).
*
* FIXME: this could be merged to shift decision code
*/
static int <API key>(struct sock *sk, struct sk_buff *skb,
u32 start_seq, u32 end_seq)
{
int err;
bool in_sack;
unsigned int pkt_len;
unsigned int mss;
in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) &&
!before(end_seq, TCP_SKB_CB(skb)->end_seq);
if (tcp_skb_pcount(skb) > 1 && !in_sack &&
after(TCP_SKB_CB(skb)->end_seq, start_seq)) {
mss = tcp_skb_mss(skb);
in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq);
if (!in_sack) {
pkt_len = start_seq - TCP_SKB_CB(skb)->seq;
if (pkt_len < mss)
pkt_len = mss;
} else {
pkt_len = end_seq - TCP_SKB_CB(skb)->seq;
if (pkt_len < mss)
return -EINVAL;
}
/* Round if necessary so that SACKs cover only full MSSes
* and/or the remaining small portion (if present)
*/
if (pkt_len > mss) {
unsigned int new_len = (pkt_len / mss) * mss;
if (!in_sack && new_len < pkt_len) {
new_len += mss;
if (new_len >= skb->len)
return 0;
}
pkt_len = new_len;
}
err = tcp_fragment(sk, skb, pkt_len, mss, GFP_ATOMIC);
if (err < 0)
return err;
}
return in_sack;
}
/* Mark the given newly-SACKed range as such, adjusting counters and hints. */
static u8 tcp_sacktag_one(struct sock *sk,
struct tcp_sacktag_state *state, u8 sacked,
u32 start_seq, u32 end_seq,
int dup_sack, int pcount,
const struct skb_mstamp *xmit_time)
{
struct tcp_sock *tp = tcp_sk(sk);
int fack_count = state->fack_count;
/* Account D-SACK for retransmitted packet. */
if (dup_sack && (sacked & TCPCB_RETRANS)) {
if (tp->undo_marker && tp->undo_retrans > 0 &&
after(end_seq, tp->undo_marker))
tp->undo_retrans
if (sacked & TCPCB_SACKED_ACKED)
state->reord = min(fack_count, state->reord);
}
/* Nothing to do; acked frame is about to be dropped (was ACKed). */
if (!after(end_seq, tp->snd_una))
return sacked;
if (!(sacked & TCPCB_SACKED_ACKED)) {
if (sacked & <API key>) {
/* If the segment is not tagged as lost,
* we do not clear RETRANS, believing
* that retransmission is still in flight.
*/
if (sacked & TCPCB_LOST) {
sacked &= ~(TCPCB_LOST|<API key>);
tp->lost_out -= pcount;
tp->retrans_out -= pcount;
}
} else {
if (!(sacked & TCPCB_RETRANS)) {
/* New sack for not retransmitted frame,
* which was in hole. It is reordering.
*/
if (before(start_seq,
<API key>(tp)))
state->reord = min(fack_count,
state->reord);
if (!after(end_seq, tp->high_seq))
state->flag |= <API key>;
if (state->first_sackt.v64 == 0)
state->first_sackt = *xmit_time;
state->last_sackt = *xmit_time;
}
if (sacked & TCPCB_LOST) {
sacked &= ~TCPCB_LOST;
tp->lost_out -= pcount;
}
}
sacked |= TCPCB_SACKED_ACKED;
state->flag |= FLAG_DATA_SACKED;
tp->sacked_out += pcount;
fack_count += pcount;
/* Lost marker hint past SACKed? Tweak RFC3517 cnt */
if (!tcp_is_fack(tp) && tp->lost_skb_hint &&
before(start_seq, TCP_SKB_CB(tp->lost_skb_hint)->seq))
tp->lost_cnt_hint += pcount;
if (fack_count > tp->fackets_out)
tp->fackets_out = fack_count;
}
/* D-SACK. We can detect redundant retransmission in S|R and plain R
* frames and clear it. undo_retrans is decreased above, L|R frames
* are accounted above as well.
*/
if (dup_sack && (sacked & <API key>)) {
sacked &= ~<API key>;
tp->retrans_out -= pcount;
}
return sacked;
}
/* Shift newly-SACKed bytes from this skb to the immediately previous
* already-SACKed sk_buff. Mark the newly-SACKed bytes as such.
*/
static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
struct tcp_sacktag_state *state,
unsigned int pcount, int shifted, int mss,
bool dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *prev = <API key>(sk, skb);
u32 start_seq = TCP_SKB_CB(skb)->seq; /* start of newly-SACKed */
u32 end_seq = start_seq + shifted; /* end of newly-SACKed */
BUG_ON(!pcount);
/* Adjust counters and hints for the newly sacked sequence
* range but discard the return value since prev is already
* marked. We must tag the range first because the seq
* advancement below implicitly advances
* <API key>() when skb is highest_sack.
*/
tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked,
start_seq, end_seq, dup_sack, pcount,
&skb->skb_mstamp);
if (skb == tp->lost_skb_hint)
tp->lost_cnt_hint += pcount;
TCP_SKB_CB(prev)->end_seq += shifted;
TCP_SKB_CB(skb)->seq += shifted;
tcp_skb_pcount_add(prev, pcount);
BUG_ON(tcp_skb_pcount(skb) < pcount);
tcp_skb_pcount_add(skb, -pcount);
/* When we're adding to gso_segs == 1, gso_size will be zero,
* in theory this shouldn't be necessary but as long as DSACK
* code can come after this skb later on it's better to keep
* setting gso_size to something.
*/
if (!skb_shinfo(prev)->gso_size) {
skb_shinfo(prev)->gso_size = mss;
skb_shinfo(prev)->gso_type = sk->sk_gso_type;
}
/* CHECKME: To clear or not to clear? Mimics normal skb currently */
if (tcp_skb_pcount(skb) <= 1) {
skb_shinfo(skb)->gso_size = 0;
skb_shinfo(skb)->gso_type = 0;
}
/* Difference in this won't matter, both ACKed by the same cumul. ACK */
TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
if (skb->len > 0) {
BUG_ON(!tcp_skb_pcount(skb));
NET_INC_STATS_BH(sock_net(sk), <API key>);
return false;
}
/* Whole SKB was eaten :-) */
if (skb == tp->retransmit_skb_hint)
tp->retransmit_skb_hint = prev;
if (skb == tp->lost_skb_hint) {
tp->lost_skb_hint = prev;
tp->lost_cnt_hint -= tcp_skb_pcount(prev);
}
TCP_SKB_CB(prev)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags;
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
TCP_SKB_CB(prev)->end_seq++;
if (skb == tcp_highest_sack(sk))
<API key>(sk, skb);
<API key>(skb, sk);
sk_wmem_free_skb(sk, skb);
NET_INC_STATS_BH(sock_net(sk), <API key>);
return true;
}
/* I wish gso_size would have a bit more sane initialization than
* something-or-zero which complicates things
*/
static int tcp_skb_seglen(const struct sk_buff *skb)
{
return tcp_skb_pcount(skb) == 1 ? skb->len : tcp_skb_mss(skb);
}
/* Shifting pages past head area doesn't work */
static int skb_can_shift(const struct sk_buff *skb)
{
return !skb_headlen(skb) && skb_is_nonlinear(skb);
}
/* Try collapsing SACK blocks spanning across multiple skbs to a single
* skb.
*/
static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
struct tcp_sacktag_state *state,
u32 start_seq, u32 end_seq,
bool dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *prev;
int mss;
int pcount = 0;
int len;
int in_sack;
if (!sk_can_gso(sk))
goto fallback;
/* Normally R but no L won't result in plain S */
if (!dup_sack &&
(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|<API key>)) == <API key>)
goto fallback;
if (!skb_can_shift(skb))
goto fallback;
/* This frame is about to be dropped (was ACKed). */
if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
goto fallback;
/* Can only happen with delayed DSACK + discard craziness */
if (unlikely(skb == <API key>(sk)))
goto fallback;
prev = <API key>(sk, skb);
if ((TCP_SKB_CB(prev)->sacked & TCPCB_TAGBITS) != TCPCB_SACKED_ACKED)
goto fallback;
in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) &&
!before(end_seq, TCP_SKB_CB(skb)->end_seq);
if (in_sack) {
len = skb->len;
pcount = tcp_skb_pcount(skb);
mss = tcp_skb_seglen(skb);
/* TODO: Fix DSACKs to not fragment already SACKed and we can
* drop this restriction as unnecessary
*/
if (mss != tcp_skb_seglen(prev))
goto fallback;
} else {
if (!after(TCP_SKB_CB(skb)->end_seq, start_seq))
goto noop;
/* CHECKME: This is non-MSS split case only?, this will
* cause skipped skbs due to advancing loop btw, original
* has that feature too
*/
if (tcp_skb_pcount(skb) <= 1)
goto noop;
in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq);
if (!in_sack) {
/* TODO: head merge to next could be attempted here
* if (!after(TCP_SKB_CB(skb)->end_seq, end_seq)),
* though it might not be worth of the additional hassle
*
* ...we can probably just fallback to what was done
* previously. We could try merging non-SACKed ones
* as well but it probably isn't going to buy off
* because later SACKs might again split them, and
* it would make skb timestamp tracking considerably
* harder problem.
*/
goto fallback;
}
len = end_seq - TCP_SKB_CB(skb)->seq;
BUG_ON(len < 0);
BUG_ON(len > skb->len);
/* MSS boundaries should be honoured or else pcount will
* severely break even though it makes things bit trickier.
* Optimize common case to avoid most of the divides
*/
mss = tcp_skb_mss(skb);
/* TODO: Fix DSACKs to not fragment already SACKed and we can
* drop this restriction as unnecessary
*/
if (mss != tcp_skb_seglen(prev))
goto fallback;
if (len == mss) {
pcount = 1;
} else if (len < mss) {
goto noop;
} else {
pcount = len / mss;
len = pcount * mss;
}
}
/* tcp_sacktag_one() won't SACK-tag ranges below snd_una */
if (!after(TCP_SKB_CB(skb)->seq + len, tp->snd_una))
goto fallback;
if (!skb_shift(prev, skb, len))
goto fallback;
if (!tcp_shifted_skb(sk, skb, state, pcount, len, mss, dup_sack))
goto out;
/* Hole filled allows collapsing with the next as well, this is very
* useful when hole on every nth skb pattern happens
*/
if (prev == <API key>(sk))
goto out;
skb = <API key>(sk, prev);
if (!skb_can_shift(skb) ||
(skb == tcp_send_head(sk)) ||
((TCP_SKB_CB(skb)->sacked & TCPCB_TAGBITS) != TCPCB_SACKED_ACKED) ||
(mss != tcp_skb_seglen(skb)))
goto out;
len = skb->len;
if (skb_shift(prev, skb, len)) {
pcount += tcp_skb_pcount(skb);
tcp_shifted_skb(sk, skb, state, tcp_skb_pcount(skb), len, mss, 0);
}
out:
state->fack_count += pcount;
return prev;
noop:
return skb;
fallback:
NET_INC_STATS_BH(sock_net(sk), <API key>);
return NULL;
}
static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
struct tcp_sack_block *next_dup,
struct tcp_sacktag_state *state,
u32 start_seq, u32 end_seq,
bool dup_sack_in)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *tmp;
<API key>(skb, sk) {
int in_sack = 0;
bool dup_sack = dup_sack_in;
if (skb == tcp_send_head(sk))
break;
/* queue is in-order => we can short-circuit the walk early */
if (!before(TCP_SKB_CB(skb)->seq, end_seq))
break;
if (next_dup &&
before(TCP_SKB_CB(skb)->seq, next_dup->end_seq)) {
in_sack = <API key>(sk, skb,
next_dup->start_seq,
next_dup->end_seq);
if (in_sack > 0)
dup_sack = true;
}
/* skb reference here is a bit tricky to get right, since
* shifting can eat and free both this skb and the next,
* so not even _safe variant of the loop is enough.
*/
if (in_sack <= 0) {
tmp = tcp_shift_skb_data(sk, skb, state,
start_seq, end_seq, dup_sack);
if (tmp) {
if (tmp != skb) {
skb = tmp;
continue;
}
in_sack = 0;
} else {
in_sack = <API key>(sk, skb,
start_seq,
end_seq);
}
}
if (unlikely(in_sack < 0))
break;
if (in_sack) {
TCP_SKB_CB(skb)->sacked =
tcp_sacktag_one(sk,
state,
TCP_SKB_CB(skb)->sacked,
TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(skb)->end_seq,
dup_sack,
tcp_skb_pcount(skb),
&skb->skb_mstamp);
if (!before(TCP_SKB_CB(skb)->seq,
<API key>(tp)))
<API key>(sk, skb);
}
state->fack_count += tcp_skb_pcount(skb);
}
return skb;
}
/* Avoid all extra work that is being done by sacktag while walking in
* a normal way
*/
static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
struct tcp_sacktag_state *state,
u32 skip_to_seq)
{
<API key>(skb, sk) {
if (skb == tcp_send_head(sk))
break;
if (after(TCP_SKB_CB(skb)->end_seq, skip_to_seq))
break;
state->fack_count += tcp_skb_pcount(skb);
}
return skb;
}
static struct sk_buff *<API key>(struct sk_buff *skb,
struct sock *sk,
struct tcp_sack_block *next_dup,
struct tcp_sacktag_state *state,
u32 skip_to_seq)
{
if (!next_dup)
return skb;
if (before(next_dup->start_seq, skip_to_seq)) {
skb = tcp_sacktag_skip(skb, sk, state, next_dup->start_seq);
skb = tcp_sacktag_walk(skb, sk, NULL, state,
next_dup->start_seq, next_dup->end_seq,
1);
}
return skb;
}
static int tcp_sack_cache_ok(const struct tcp_sock *tp, const struct tcp_sack_block *cache)
{
return cache < tp->recv_sack_cache + ARRAY_SIZE(tp->recv_sack_cache);
}
static int
<API key>(struct sock *sk, const struct sk_buff *ack_skb,
u32 prior_snd_una, struct tcp_sacktag_state *state)
{
struct tcp_sock *tp = tcp_sk(sk);
const unsigned char *ptr = (<API key>(ack_skb) +
TCP_SKB_CB(ack_skb)->sacked);
struct tcp_sack_block_wire *sp_wire = (struct tcp_sack_block_wire *)(ptr+2);
struct tcp_sack_block sp[TCP_NUM_SACKS];
struct tcp_sack_block *cache;
struct sk_buff *skb;
int num_sacks = min(TCP_NUM_SACKS, (ptr[1] - TCPOLEN_SACK_BASE) >> 3);
int used_sacks;
bool found_dup_sack = false;
int i, j;
int first_sack_index;
state->flag = 0;
state->reord = tp->packets_out;
if (!tp->sacked_out) {
if (WARN_ON(tp->fackets_out))
tp->fackets_out = 0;
<API key>(sk);
}
found_dup_sack = tcp_check_dsack(sk, ack_skb, sp_wire,
num_sacks, prior_snd_una);
if (found_dup_sack)
state->flag |= FLAG_DSACKING_ACK;
/* Eliminate too old ACKs, but take into
* account more or less fresh ones, they can
* contain valid SACK info.
*/
if (before(TCP_SKB_CB(ack_skb)->ack_seq, prior_snd_una - tp->max_window))
return 0;
if (!tp->packets_out)
goto out;
used_sacks = 0;
first_sack_index = 0;
for (i = 0; i < num_sacks; i++) {
bool dup_sack = !i && found_dup_sack;
sp[used_sacks].start_seq = get_unaligned_be32(&sp_wire[i].start_seq);
sp[used_sacks].end_seq = get_unaligned_be32(&sp_wire[i].end_seq);
if (!<API key>(tp, dup_sack,
sp[used_sacks].start_seq,
sp[used_sacks].end_seq)) {
int mib_idx;
if (dup_sack) {
if (!tp->undo_marker)
mib_idx = <API key>;
else
mib_idx = <API key>;
} else {
/* Don't count olds caused by ACK reordering */
if ((TCP_SKB_CB(ack_skb)->ack_seq != tp->snd_una) &&
!after(sp[used_sacks].end_seq, tp->snd_una))
continue;
mib_idx = <API key>;
}
NET_INC_STATS_BH(sock_net(sk), mib_idx);
if (i == 0)
first_sack_index = -1;
continue;
}
/* Ignore very old stuff early */
if (!after(sp[used_sacks].end_seq, prior_snd_una))
continue;
used_sacks++;
}
/* order SACK blocks to allow in order walk of the retrans queue */
for (i = used_sacks - 1; i > 0; i
for (j = 0; j < i; j++) {
if (after(sp[j].start_seq, sp[j + 1].start_seq)) {
swap(sp[j], sp[j + 1]);
/* Track where the first SACK block goes to */
if (j == first_sack_index)
first_sack_index = j + 1;
}
}
}
skb = <API key>(sk);
state->fack_count = 0;
i = 0;
if (!tp->sacked_out) {
/* It's already past, so skip checking against it */
cache = tp->recv_sack_cache + ARRAY_SIZE(tp->recv_sack_cache);
} else {
cache = tp->recv_sack_cache;
/* Skip empty blocks in at head of the cache */
while (tcp_sack_cache_ok(tp, cache) && !cache->start_seq &&
!cache->end_seq)
cache++;
}
while (i < used_sacks) {
u32 start_seq = sp[i].start_seq;
u32 end_seq = sp[i].end_seq;
bool dup_sack = (found_dup_sack && (i == first_sack_index));
struct tcp_sack_block *next_dup = NULL;
if (found_dup_sack && ((i + 1) == first_sack_index))
next_dup = &sp[i + 1];
/* Skip too early cached blocks */
while (tcp_sack_cache_ok(tp, cache) &&
!before(start_seq, cache->end_seq))
cache++;
/* Can skip some work by looking recv_sack_cache? */
if (tcp_sack_cache_ok(tp, cache) && !dup_sack &&
after(end_seq, cache->start_seq)) {
/* Head todo? */
if (before(start_seq, cache->start_seq)) {
skb = tcp_sacktag_skip(skb, sk, state,
start_seq);
skb = tcp_sacktag_walk(skb, sk, next_dup,
state,
start_seq,
cache->start_seq,
dup_sack);
}
/* Rest of the block already fully processed? */
if (!after(end_seq, cache->end_seq))
goto advance_sp;
skb = <API key>(skb, sk, next_dup,
state,
cache->end_seq);
/* ...tail remains todo... */
if (<API key>(tp) == cache->end_seq) {
/* ...but better entrypoint exists! */
skb = tcp_highest_sack(sk);
if (!skb)
break;
state->fack_count = tp->fackets_out;
cache++;
goto walk;
}
skb = tcp_sacktag_skip(skb, sk, state, cache->end_seq);
/* Check overlap against next cached too (past this one already) */
cache++;
continue;
}
if (!before(start_seq, <API key>(tp))) {
skb = tcp_highest_sack(sk);
if (!skb)
break;
state->fack_count = tp->fackets_out;
}
skb = tcp_sacktag_skip(skb, sk, state, start_seq);
walk:
skb = tcp_sacktag_walk(skb, sk, next_dup, state,
start_seq, end_seq, dup_sack);
advance_sp:
i++;
}
/* Clear the head of the cache sack blocks so we can skip it next time */
for (i = 0; i < ARRAY_SIZE(tp->recv_sack_cache) - used_sacks; i++) {
tp->recv_sack_cache[i].start_seq = 0;
tp->recv_sack_cache[i].end_seq = 0;
}
for (j = 0; j < used_sacks; j++)
tp->recv_sack_cache[i++] = sp[j];
if ((state->reord < tp->fackets_out) &&
((inet_csk(sk)->icsk_ca_state != TCP_CA_Loss) || tp->undo_marker))
<API key>(sk, tp->fackets_out - state->reord, 0);
<API key>(sk);
tcp_verify_left_out(tp);
out:
#if FASTRETRANS_DEBUG > 0
WARN_ON((int)tp->sacked_out < 0);
WARN_ON((int)tp->lost_out < 0);
WARN_ON((int)tp->retrans_out < 0);
WARN_ON((int)<API key>(tp) < 0);
#endif
return state->flag;
}
/* Limits sacked_out so that sum with lost_out isn't ever larger than
* packets_out. Returns false if sacked_out adjustement wasn't necessary.
*/
static bool <API key>(struct tcp_sock *tp)
{
u32 holes;
holes = max(tp->lost_out, 1U);
holes = min(holes, tp->packets_out);
if ((tp->sacked_out + holes) > tp->packets_out) {
tp->sacked_out = tp->packets_out - holes;
return true;
}
return false;
}
/* If we receive more dupacks than we expected counting segments
* in assumption of absent reordering, interpret this as reordering.
* The only another reason could be bug in receiver TCP.
*/
static void <API key>(struct sock *sk, const int addend)
{
struct tcp_sock *tp = tcp_sk(sk);
if (<API key>(tp))
<API key>(sk, tp->packets_out + addend, 0);
}
/* Emulate SACKs for SACKless connection: account for a new dupack. */
static void tcp_add_reno_sack(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
tp->sacked_out++;
<API key>(sk, 0);
tcp_verify_left_out(tp);
}
/* Account for ACK, ACKing some data in Reno Recovery phase. */
static void <API key>(struct sock *sk, int acked)
{
struct tcp_sock *tp = tcp_sk(sk);
if (acked > 0) {
/* One ACK acked hole. The rest eat duplicate ACKs. */
if (acked - 1 >= tp->sacked_out)
tp->sacked_out = 0;
else
tp->sacked_out -= acked - 1;
}
<API key>(sk, acked);
tcp_verify_left_out(tp);
}
static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
{
tp->sacked_out = 0;
}
void tcp_clear_retrans(struct tcp_sock *tp)
{
tp->retrans_out = 0;
tp->lost_out = 0;
tp->undo_marker = 0;
tp->undo_retrans = -1;
tp->fackets_out = 0;
tp->sacked_out = 0;
}
static inline void tcp_init_undo(struct tcp_sock *tp)
{
tp->undo_marker = tp->snd_una;
/* Retransmission still in flight may cause DSACKs later. */
tp->undo_retrans = tp->retrans_out ? : -1;
}
/* Enter Loss state. If we detect SACK reneging, forget all SACK information
* and reset tags completely, otherwise preserve SACKs. If receiver
* dropped its ofo queue, we will know this due to reneging detection.
*/
void tcp_enter_loss(struct sock *sk)
{
const struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
bool new_recovery = false;
bool is_reneg; /* is receiver reneging on SACKs? */
/* Reduce ssthresh if it has not yet been made inside this window. */
if (icsk->icsk_ca_state <= TCP_CA_Disorder ||
!after(tp->high_seq, tp->snd_una) ||
(icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) {
new_recovery = true;
tp->prior_ssthresh = <API key>(sk);
tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk);
tcp_ca_event(sk, CA_EVENT_LOSS);
tcp_init_undo(tp);
}
tp->snd_cwnd = 1;
tp->snd_cwnd_cnt = 0;
tp->snd_cwnd_stamp = tcp_time_stamp;
tp->retrans_out = 0;
tp->lost_out = 0;
if (tcp_is_reno(tp))
tcp_reset_reno_sack(tp);
skb = <API key>(sk);
is_reneg = skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED);
if (is_reneg) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
tp->sacked_out = 0;
tp->fackets_out = 0;
}
<API key>(tp);
tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
TCP_SKB_CB(skb)->sacked &= (~TCPCB_TAGBITS)|TCPCB_SACKED_ACKED;
if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED) || is_reneg) {
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_ACKED;
TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
tp->lost_out += tcp_skb_pcount(skb);
tp->retransmit_high = TCP_SKB_CB(skb)->end_seq;
}
}
tcp_verify_left_out(tp);
/* Timeout in disordered state after receiving substantial DUPACKs
* suggests that the degree of reordering is over-estimated.
*/
if (icsk->icsk_ca_state <= TCP_CA_Disorder &&
tp->sacked_out >= <API key>)
tp->reordering = min_t(unsigned int, tp->reordering,
<API key>);
tcp_set_ca_state(sk, TCP_CA_Loss);
tp->high_seq = tp->snd_nxt;
tcp_ecn_queue_cwr(tp);
/* F-RTO RFC5682 sec 3.1 step 1: retransmit SND.UNA if no previous
* loss recovery is underway except recurring timeout(s) on
* the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing
*/
tp->frto = sysctl_tcp_frto &&
(new_recovery || icsk->icsk_retransmits) &&
!inet_csk(sk)->icsk_mtup.probe_size;
}
/* If ACK arrived pointing to a remembered SACK, it means that our
* remembered SACKs do not reflect real state of receiver i.e.
* receiver _host_ is heavily congested (or buggy).
*
* To avoid big spurious retransmission bursts due to transient SACK
* scoreboard oddities that look like reneging, we give the receiver a
* little time (max(RTT/2, 10ms)) to send us some more ACKs that will
* restore sanity to the SACK scoreboard. If the apparent reneging
* persists until this RTO then we'll clear the SACK scoreboard.
*/
static bool <API key>(struct sock *sk, int flag)
{
if (flag & FLAG_SACK_RENEGING) {
struct tcp_sock *tp = tcp_sk(sk);
unsigned long delay = max(usecs_to_jiffies(tp->srtt_us >> 4),
msecs_to_jiffies(10));
<API key>(sk, ICSK_TIME_RETRANS,
delay, TCP_RTO_MAX);
return true;
}
return false;
}
static inline int tcp_fackets_out(const struct tcp_sock *tp)
{
return tcp_is_reno(tp) ? tp->sacked_out + 1 : tp->fackets_out;
}
/* Heurestics to calculate number of duplicate ACKs. There's no dupACKs
* counter when SACK is enabled (without SACK, sacked_out is used for
* that purpose).
*
* Instead, with FACK TCP uses fackets_out that includes both SACKed
* segments up to the highest received SACK block so far and holes in
* between them.
*
* With reordering, holes may still be in flight, so RFC3517 recovery
* uses pure sacked_out (total number of SACKed segments) even though
* it violates the RFC that uses duplicate ACKs, often these are equal
* but when e.g. out-of-window ACKs or packet duplication occurs,
* they differ. Since neither occurs due to loss, TCP should really
* ignore them.
*/
static inline int <API key>(const struct tcp_sock *tp)
{
return tcp_is_fack(tp) ? tp->fackets_out : tp->sacked_out + 1;
}
static bool <API key>(struct sock *sk, int flag)
{
struct tcp_sock *tp = tcp_sk(sk);
unsigned long delay;
/* Delay early retransmit and entering fast recovery for
* max(RTT/4, 2msec) unless ack has ECE mark, no RTT samples
* available, or RTO is scheduled to fire first.
*/
if (<API key> < 2 || <API key> > 3 ||
(flag & FLAG_ECE) || !tp->srtt_us)
return false;
delay = max(usecs_to_jiffies(tp->srtt_us >> 5),
msecs_to_jiffies(2));
if (!time_after(inet_csk(sk)->icsk_timeout, (jiffies + delay)))
return false;
<API key>(sk, <API key>, delay,
TCP_RTO_MAX);
return true;
}
/* This function decides, when we should leave Disordered state
* and enter Recovery phase, reducing congestion window.
*
* Main question: may we further continue forward transmission
* with the same cwnd?
*/
static bool tcp_time_to_recover(struct sock *sk, int flag)
{
struct tcp_sock *tp = tcp_sk(sk);
__u32 packets_out;
/* Trick#1: The loss is proven. */
if (tp->lost_out)
return true;
/* Not-A-Trick#2 : Classic rule... */
if (<API key>(tp) > tp->reordering)
return true;
/* Trick#4: It is still not OK... But will it be useful to delay
* recovery more?
*/
packets_out = tp->packets_out;
if (packets_out <= tp->reordering &&
tp->sacked_out >= max_t(__u32, packets_out/2, <API key>) &&
!tcp_may_send_now(sk)) {
/* We have nothing to send. This connection is limited
* either by receiver window or by application.
*/
return true;
}
/* If a thin stream is detected, retransmit after first
* received dupack. Employ only if SACK is supported in order
* to avoid possible corner-case series of spurious retransmissions
* Use only if there are no unsent data.
*/
if ((tp->thin_dupack || <API key>) &&
tcp_stream_is_thin(tp) && <API key>(tp) > 1 &&
tcp_is_sack(tp) && !tcp_send_head(sk))
return true;
/* Trick#6: TCP early retransmit, per RFC5827. To avoid spurious
* retransmissions due to small network reorderings, we implement
* Mitigation A.3 in the RFC and delay the retransmission for a short
* interval if appropriate.
*/
if (tp->do_early_retrans && !tp->retrans_out && tp->sacked_out &&
(tp->packets_out >= (tp->sacked_out + 1) && tp->packets_out < 4) &&
!tcp_may_send_now(sk))
return !<API key>(sk, flag);
return false;
}
/* Detect loss in event "A" above by marking head of queue up as lost.
* For FACK or non-SACK(Reno) senders, the first "packets" number of segments
* are considered lost. For RFC3517 SACK, a segment is considered lost if it
* has at least tp->reordering SACKed seqments above it; "packets" refers to
* the maximum SACKed segments to pass before reaching this limit.
*/
static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
int cnt, oldcnt;
int err;
unsigned int mss;
/* Use SACK to deduce losses of new sequences sent during recovery */
const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
WARN_ON(packets > tp->packets_out);
if (tp->lost_skb_hint) {
skb = tp->lost_skb_hint;
cnt = tp->lost_cnt_hint;
/* Head already handled? */
if (mark_head && skb != <API key>(sk))
return;
} else {
skb = <API key>(sk);
cnt = 0;
}
<API key>(skb, sk) {
if (skb == tcp_send_head(sk))
break;
/* TODO: do this better */
/* this is not the most efficient way to do this... */
tp->lost_skb_hint = skb;
tp->lost_cnt_hint = cnt;
if (after(TCP_SKB_CB(skb)->end_seq, loss_high))
break;
oldcnt = cnt;
if (tcp_is_fack(tp) || tcp_is_reno(tp) ||
(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
cnt += tcp_skb_pcount(skb);
if (cnt > packets) {
if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) ||
(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) ||
(oldcnt >= packets))
break;
mss = skb_shinfo(skb)->gso_size;
err = tcp_fragment(sk, skb, (packets - oldcnt) * mss,
mss, GFP_ATOMIC);
if (err < 0)
break;
cnt = packets;
}
tcp_skb_mark_lost(tp, skb);
if (mark_head)
break;
}
tcp_verify_left_out(tp);
}
/* Account newly detected lost packet(s) */
static void <API key>(struct sock *sk, int fast_rexmit)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_is_reno(tp)) {
tcp_mark_head_lost(sk, 1, 1);
} else if (tcp_is_fack(tp)) {
int lost = tp->fackets_out - tp->reordering;
if (lost <= 0)
lost = 1;
tcp_mark_head_lost(sk, lost, 0);
} else {
int sacked_upto = tp->sacked_out - tp->reordering;
if (sacked_upto >= 0)
tcp_mark_head_lost(sk, sacked_upto, 0);
else if (fast_rexmit)
tcp_mark_head_lost(sk, 1, 1);
}
}
/* CWND moderation, preventing bursts due to too big ACKs
* in dubious situations.
*/
static inline void tcp_moderate_cwnd(struct tcp_sock *tp)
{
tp->snd_cwnd = min(tp->snd_cwnd,
<API key>(tp) + tcp_max_burst(tp));
tp->snd_cwnd_stamp = tcp_time_stamp;
}
/* Nothing was retransmitted or returned timestamp is less
* than timestamp of the first retransmission.
*/
static inline bool tcp_packet_delayed(const struct tcp_sock *tp)
{
return !tp->retrans_stamp ||
(tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
before(tp->rx_opt.rcv_tsecr, tp->retrans_stamp));
}
/* Undo procedures. */
/* We can clear retrans_stamp when there are no retransmissions in the
* window. It would seem that it is trivially available for us in
* tp->retrans_out, however, that kind of assumptions doesn't consider
* what will happen if errors occur when sending retransmission for the
* second time. ...It could the that such segment has only
* TCPCB_EVER_RETRANS set at the present time. It seems that checking
* the head skb is enough except for some reneging corner cases that
* are not worth the effort.
*
* Main reason for all this complexity is the fact that connection dying
* time now depends on the validity of the retrans_stamp, in particular,
* that successive retransmissions of a segment must not advance
* retrans_stamp under any conditions.
*/
static bool <API key>(const struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
if (tp->retrans_out)
return true;
skb = <API key>(sk);
if (unlikely(skb && TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS))
return true;
return false;
}
#if FASTRETRANS_DEBUG > 1
static void DBGUNDO(struct sock *sk, const char *msg)
{
struct tcp_sock *tp = tcp_sk(sk);
struct inet_sock *inet = inet_sk(sk);
if (sk->sk_family == AF_INET) {
pr_debug("Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n",
msg,
&inet->inet_daddr, ntohs(inet->inet_dport),
tp->snd_cwnd, tcp_left_out(tp),
tp->snd_ssthresh, tp->prior_ssthresh,
tp->packets_out);
}
#if IS_ENABLED(CONFIG_IPV6)
else if (sk->sk_family == AF_INET6) {
struct ipv6_pinfo *np = inet6_sk(sk);
pr_debug("Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n",
msg,
&np->daddr, ntohs(inet->inet_dport),
tp->snd_cwnd, tcp_left_out(tp),
tp->snd_ssthresh, tp->prior_ssthresh,
tp->packets_out);
}
#endif
}
#else
#define DBGUNDO(x...) do { } while (0)
#endif
static void <API key>(struct sock *sk, bool unmark_loss)
{
struct tcp_sock *tp = tcp_sk(sk);
if (unmark_loss) {
struct sk_buff *skb;
tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
}
tp->lost_out = 0;
<API key>(tp);
}
if (tp->prior_ssthresh) {
const struct <API key> *icsk = inet_csk(sk);
if (icsk->icsk_ca_ops->undo_cwnd)
tp->snd_cwnd = icsk->icsk_ca_ops->undo_cwnd(sk);
else
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1);
if (tp->prior_ssthresh > tp->snd_ssthresh) {
tp->snd_ssthresh = tp->prior_ssthresh;
<API key>(tp);
}
} else {
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh);
}
tp->snd_cwnd_stamp = tcp_time_stamp;
tp->undo_marker = 0;
}
static inline bool tcp_may_undo(const struct tcp_sock *tp)
{
return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp));
}
/* People celebrate: "We love our President!" */
static bool <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_may_undo(tp)) {
int mib_idx;
/* Happy end! We did not retransmit anything
* or our original transmission succeeded.
*/
DBGUNDO(sk, inet_csk(sk)->icsk_ca_state == TCP_CA_Loss ? "loss" : "retrans");
<API key>(sk, false);
if (inet_csk(sk)->icsk_ca_state == TCP_CA_Loss)
mib_idx = <API key>;
else
mib_idx = <API key>;
NET_INC_STATS_BH(sock_net(sk), mib_idx);
}
if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
/* Hold old state until something *above* high_seq
* is ACKed. For Reno it is MUST to prevent false
* fast retransmits (RFC2582). SACK TCP is safe. */
tcp_moderate_cwnd(tp);
if (!<API key>(sk))
tp->retrans_stamp = 0;
return true;
}
tcp_set_ca_state(sk, TCP_CA_Open);
return false;
}
/* Try to undo cwnd reduction, because D-SACKs acked all retransmitted data */
static bool tcp_try_undo_dsack(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tp->undo_marker && !tp->undo_retrans) {
DBGUNDO(sk, "D-SACK");
<API key>(sk, false);
NET_INC_STATS_BH(sock_net(sk), <API key>);
return true;
}
return false;
}
/* Undo during loss recovery after partial ACK or using F-RTO. */
static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo)
{
struct tcp_sock *tp = tcp_sk(sk);
if (frto_undo || tcp_may_undo(tp)) {
<API key>(sk, true);
DBGUNDO(sk, "partial loss");
NET_INC_STATS_BH(sock_net(sk), <API key>);
if (frto_undo)
NET_INC_STATS_BH(sock_net(sk),
<API key>);
inet_csk(sk)->icsk_retransmits = 0;
if (frto_undo || tcp_is_sack(tp))
tcp_set_ca_state(sk, TCP_CA_Open);
return true;
}
return false;
}
static void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
tp->high_seq = tp->snd_nxt;
tp->tlp_high_seq = 0;
tp->snd_cwnd_cnt = 0;
tp->prior_cwnd = tp->snd_cwnd;
tp->prr_delivered = 0;
tp->prr_out = 0;
tp->snd_ssthresh = inet_csk(sk)->icsk_ca_ops->ssthresh(sk);
tcp_ecn_queue_cwr(tp);
}
static void tcp_cwnd_reduction(struct sock *sk, const int prior_unsacked,
int fast_rexmit)
{
struct tcp_sock *tp = tcp_sk(sk);
int sndcnt = 0;
int delta = tp->snd_ssthresh - <API key>(tp);
int newly_acked_sacked = prior_unsacked -
(tp->packets_out - tp->sacked_out);
tp->prr_delivered += newly_acked_sacked;
if (<API key>(tp) > tp->snd_ssthresh) {
u64 dividend = (u64)tp->snd_ssthresh * tp->prr_delivered +
tp->prior_cwnd - 1;
sndcnt = div_u64(dividend, tp->prior_cwnd) - tp->prr_out;
} else {
sndcnt = min_t(int, delta,
max_t(int, tp->prr_delivered - tp->prr_out,
newly_acked_sacked) + 1);
}
sndcnt = max(sndcnt, (fast_rexmit ? 1 : 0));
tp->snd_cwnd = <API key>(tp) + sndcnt;
}
static inline void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
/* Reset cwnd to ssthresh in CWR or Recovery (unless it's undone) */
if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR ||
(tp->undo_marker && tp->snd_ssthresh < <API key>)) {
tp->snd_cwnd = tp->snd_ssthresh;
tp->snd_cwnd_stamp = tcp_time_stamp;
}
tcp_ca_event(sk, <API key>);
}
/* Enter CWR state. Disable cwnd undo since congestion is proven with ECN */
void tcp_enter_cwr(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
tp->prior_ssthresh = 0;
if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) {
tp->undo_marker = 0;
<API key>(sk);
tcp_set_ca_state(sk, TCP_CA_CWR);
}
}
static void tcp_try_keep_open(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
int state = TCP_CA_Open;
if (tcp_left_out(tp) || <API key>(sk))
state = TCP_CA_Disorder;
if (inet_csk(sk)->icsk_ca_state != state) {
tcp_set_ca_state(sk, state);
tp->high_seq = tp->snd_nxt;
}
}
static void tcp_try_to_open(struct sock *sk, int flag, const int prior_unsacked)
{
struct tcp_sock *tp = tcp_sk(sk);
tcp_verify_left_out(tp);
if (!<API key>(sk))
tp->retrans_stamp = 0;
if (flag & FLAG_ECE)
tcp_enter_cwr(sk);
if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) {
tcp_try_keep_open(sk);
} else {
tcp_cwnd_reduction(sk, prior_unsacked, 0);
}
}
static void <API key>(struct sock *sk)
{
struct <API key> *icsk = inet_csk(sk);
icsk->icsk_mtup.search_high = icsk->icsk_mtup.probe_size - 1;
icsk->icsk_mtup.probe_size = 0;
}
static void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
/* FIXME: breaks with very large cwnd */
tp->prior_ssthresh = <API key>(sk);
tp->snd_cwnd = tp->snd_cwnd *
tcp_mss_to_mtu(sk, tp->mss_cache) /
icsk->icsk_mtup.probe_size;
tp->snd_cwnd_cnt = 0;
tp->snd_cwnd_stamp = tcp_time_stamp;
tp->snd_ssthresh = <API key>(sk);
icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size;
icsk->icsk_mtup.probe_size = 0;
tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
}
/* Do a simple retransmit without using the backoff mechanisms in
* tcp_timer. This is used for path mtu discovery.
* The socket is already locked here.
*/
void <API key>(struct sock *sk)
{
const struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
unsigned int mss = tcp_current_mss(sk);
u32 prior_lost = tp->lost_out;
tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
if (tcp_skb_seglen(skb) > mss &&
!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
if (TCP_SKB_CB(skb)->sacked & <API key>) {
TCP_SKB_CB(skb)->sacked &= ~<API key>;
tp->retrans_out -= tcp_skb_pcount(skb);
}
<API key>(tp, skb);
}
}
<API key>(tp);
if (prior_lost == tp->lost_out)
return;
if (tcp_is_reno(tp))
<API key>(tp);
tcp_verify_left_out(tp);
/* Don't muck with the congestion window here.
* Reason is that we do not increase amount of _data_
* in network, but units changed and effective
* cwnd/ssthresh really reduced now.
*/
if (icsk->icsk_ca_state != TCP_CA_Loss) {
tp->high_seq = tp->snd_nxt;
tp->snd_ssthresh = <API key>(sk);
tp->prior_ssthresh = 0;
tp->undo_marker = 0;
tcp_set_ca_state(sk, TCP_CA_Loss);
}
<API key>(sk);
}
EXPORT_SYMBOL(<API key>);
static void tcp_enter_recovery(struct sock *sk, bool ece_ack)
{
struct tcp_sock *tp = tcp_sk(sk);
int mib_idx;
if (tcp_is_reno(tp))
mib_idx = <API key>;
else
mib_idx = <API key>;
NET_INC_STATS_BH(sock_net(sk), mib_idx);
tp->prior_ssthresh = 0;
tcp_init_undo(tp);
if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) {
if (!ece_ack)
tp->prior_ssthresh = <API key>(sk);
<API key>(sk);
}
tcp_set_ca_state(sk, TCP_CA_Recovery);
}
/* Process an ACK in CA_Loss state. Move to CA_Open if lost data are
* recovered or spurious. Otherwise retransmits more on partial ACKs.
*/
static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack)
{
struct tcp_sock *tp = tcp_sk(sk);
bool recovered = !before(tp->snd_una, tp->high_seq);
if ((flag & <API key>) &&
tcp_try_undo_loss(sk, false))
return;
if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */
/* Step 3.b. A timeout is spurious if not all data are
* lost, i.e., never-retransmitted data are (s)acked.
*/
if ((flag & <API key>) &&
tcp_try_undo_loss(sk, true))
return;
if (after(tp->snd_nxt, tp->high_seq)) {
if (flag & FLAG_DATA_SACKED || is_dupack)
tp->frto = 0; /* Step 3.a. loss was real */
} else if (flag & <API key> && !recovered) {
tp->high_seq = tp->snd_nxt;
<API key>(sk, tcp_current_mss(sk),
TCP_NAGLE_OFF);
if (after(tp->snd_nxt, tp->high_seq))
return; /* Step 2.b */
tp->frto = 0;
}
}
if (recovered) {
/* F-RTO RFC5682 sec 3.1 step 2.a and 1st part of step 3.a */
<API key>(sk);
return;
}
if (tcp_is_reno(tp)) {
/* A Reno DUPACK means new data in F-RTO step 2.b above are
* delivered. Lower inflight to clock out (re)tranmissions.
*/
if (after(tp->snd_nxt, tp->high_seq) && is_dupack)
tcp_add_reno_sack(sk);
else if (flag & <API key>)
tcp_reset_reno_sack(tp);
}
<API key>(sk);
}
/* Undo during fast recovery after partial ACK. */
static bool <API key>(struct sock *sk, const int acked,
const int prior_unsacked)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tp->undo_marker && tcp_packet_delayed(tp)) {
/* Plain luck! Hole if filled with delayed
* packet, rather than with a retransmit.
*/
<API key>(sk, tcp_fackets_out(tp) + acked, 1);
/* We are getting evidence that the reordering degree is higher
* than we realized. If there are no retransmits out then we
* can undo. Otherwise we clock out new packets but do not
* mark more packets lost or retransmit more.
*/
if (tp->retrans_out) {
tcp_cwnd_reduction(sk, prior_unsacked, 0);
return true;
}
if (!<API key>(sk))
tp->retrans_stamp = 0;
DBGUNDO(sk, "partial recovery");
<API key>(sk, true);
NET_INC_STATS_BH(sock_net(sk), <API key>);
tcp_try_keep_open(sk);
return true;
}
return false;
}
/* Process an event, which can update packets-in-flight not trivially.
* Main goal of this function is to calculate new estimate for left_out,
* taking into account both packets sitting in receiver's buffer and
* packets lost by network.
*
* Besides that it does CWND reduction, when packet loss is detected
* and changes state of machine.
*
* It does _not_ decide what to send, it is made in function
* <API key>().
*/
static void <API key>(struct sock *sk, const int acked,
const int prior_unsacked,
bool is_dupack, int flag)
{
struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
bool do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) &&
(tcp_fackets_out(tp) > tp->reordering));
int fast_rexmit = 0;
if (WARN_ON(!tp->packets_out && tp->sacked_out))
tp->sacked_out = 0;
if (WARN_ON(!tp->sacked_out && tp->fackets_out))
tp->fackets_out = 0;
/* Now state machine starts.
* A. ECE, hence prohibit cwnd undoing, the reduction is required. */
if (flag & FLAG_ECE)
tp->prior_ssthresh = 0;
/* B. In all the states check for reneging SACKs. */
if (<API key>(sk, flag))
return;
/* C. Check consistency of the current state. */
tcp_verify_left_out(tp);
/* D. Check state exit conditions. State can be terminated
* when high_seq is ACKed. */
if (icsk->icsk_ca_state == TCP_CA_Open) {
WARN_ON(tp->retrans_out != 0);
tp->retrans_stamp = 0;
} else if (!before(tp->snd_una, tp->high_seq)) {
switch (icsk->icsk_ca_state) {
case TCP_CA_CWR:
/* CWR is to be held something *above* high_seq
* is ACKed for CWR bit to reach receiver. */
if (tp->snd_una != tp->high_seq) {
<API key>(sk);
tcp_set_ca_state(sk, TCP_CA_Open);
}
break;
case TCP_CA_Recovery:
if (tcp_is_reno(tp))
tcp_reset_reno_sack(tp);
if (<API key>(sk))
return;
<API key>(sk);
break;
}
}
/* E. Process state. */
switch (icsk->icsk_ca_state) {
case TCP_CA_Recovery:
if (!(flag & <API key>)) {
if (tcp_is_reno(tp) && is_dupack)
tcp_add_reno_sack(sk);
} else {
if (<API key>(sk, acked, prior_unsacked))
return;
/* Partial ACK arrived. Force fast retransmit. */
do_lost = tcp_is_reno(tp) ||
tcp_fackets_out(tp) > tp->reordering;
}
if (tcp_try_undo_dsack(sk)) {
tcp_try_keep_open(sk);
return;
}
break;
case TCP_CA_Loss:
tcp_process_loss(sk, flag, is_dupack);
if (icsk->icsk_ca_state != TCP_CA_Open)
return;
/* Fall through to processing in Open state. */
default:
if (tcp_is_reno(tp)) {
if (flag & <API key>)
tcp_reset_reno_sack(tp);
if (is_dupack)
tcp_add_reno_sack(sk);
}
if (icsk->icsk_ca_state <= TCP_CA_Disorder)
tcp_try_undo_dsack(sk);
if (!tcp_time_to_recover(sk, flag)) {
tcp_try_to_open(sk, flag, prior_unsacked);
return;
}
/* MTU probe failure: don't reduce cwnd */
if (icsk->icsk_ca_state < TCP_CA_CWR &&
icsk->icsk_mtup.probe_size &&
tp->snd_una == tp->mtu_probe.probe_seq_start) {
<API key>(sk);
/* Restores the reduction we did in tcp_mtup_probe() */
tp->snd_cwnd++;
<API key>(sk);
return;
}
/* Otherwise enter Recovery state */
tcp_enter_recovery(sk, (flag & FLAG_ECE));
fast_rexmit = 1;
}
if (do_lost)
<API key>(sk, fast_rexmit);
tcp_cwnd_reduction(sk, prior_unsacked, fast_rexmit);
<API key>(sk);
}
static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
long seq_rtt_us, long sack_rtt_us)
{
const struct tcp_sock *tp = tcp_sk(sk);
/* Prefer RTT measured from ACK's timing to TS-ECR. This is because
* broken middle-boxes or peers may corrupt TS-ECR fields. But
* Karn's algorithm forbids taking RTT if some retransmitted data
* is acked (RFC6298).
*/
if (flag & <API key>)
seq_rtt_us = -1L;
if (seq_rtt_us < 0)
seq_rtt_us = sack_rtt_us;
/* RTTM Rule: A TSecr value received in a segment is used to
* update the averaged RTT measurement only if the segment
* acknowledges some new data, i.e., only if it advances the
* left edge of the send window.
* See <API key>, section 3.3.
*/
if (seq_rtt_us < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
flag & FLAG_ACKED)
seq_rtt_us = jiffies_to_usecs(tcp_time_stamp - tp->rx_opt.rcv_tsecr);
if (seq_rtt_us < 0)
return false;
tcp_rtt_estimator(sk, seq_rtt_us);
tcp_set_rto(sk);
/* RFC6298: only reset backoff on valid RTT measurement. */
inet_csk(sk)->icsk_backoff = 0;
return true;
}
/* Compute time elapsed between (last) SYNACK and the ACK completing 3WHS. */
static void tcp_synack_rtt_meas(struct sock *sk, const u32 synack_stamp)
{
struct tcp_sock *tp = tcp_sk(sk);
long seq_rtt_us = -1L;
if (synack_stamp && !tp->total_retrans)
seq_rtt_us = jiffies_to_usecs(tcp_time_stamp - synack_stamp);
/* If the ACK acks both the SYNACK and the (Fast Open'd) data packets
* sent in SYN_RECV, SYNACK RTT is the smooth RTT computed in tcp_ack()
*/
if (!tp->srtt_us)
tcp_ack_update_rtt(sk, FLAG_SYN_ACKED, seq_rtt_us, -1L);
}
static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{
const struct <API key> *icsk = inet_csk(sk);
icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);
tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp;
}
/* Restart timer after forward progress on connection.
* RFC2988 recommends to restart timer to now+rto.
*/
void tcp_rearm_rto(struct sock *sk)
{
const struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
/* If the retrans timer is currently being used by Fast Open
* for SYN-ACK retrans purpose, stay put.
*/
if (tp->fastopen_rsk)
return;
if (!tp->packets_out) {
<API key>(sk, ICSK_TIME_RETRANS);
} else {
u32 rto = inet_csk(sk)->icsk_rto;
/* Offset the time elapsed after installing regular RTO */
if (icsk->icsk_pending == <API key> ||
icsk->icsk_pending == <API key>) {
struct sk_buff *skb = <API key>(sk);
const u32 rto_time_stamp =
tcp_skb_timestamp(skb) + rto;
s32 delta = (s32)(rto_time_stamp - tcp_time_stamp);
/* delta may not be positive if the socket is locked
* when the retrans timer fires and is rescheduled.
*/
if (delta > 0)
rto = delta;
}
<API key>(sk, ICSK_TIME_RETRANS, rto,
TCP_RTO_MAX);
}
}
/* This function is called when the delayed ER timer fires. TCP enters
* fast recovery and performs fast-retransmit.
*/
void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
tcp_rearm_rto(sk);
/* Stop if ER is disabled after the delayed ER timer is scheduled */
if (!tp->do_early_retrans)
return;
tcp_enter_recovery(sk, false);
<API key>(sk, 1);
<API key>(sk);
}
/* If we get here, the whole TSO packet has not been acked. */
static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
u32 packets_acked;
BUG_ON(!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una));
packets_acked = tcp_skb_pcount(skb);
if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq))
return 0;
packets_acked -= tcp_skb_pcount(skb);
if (packets_acked) {
BUG_ON(tcp_skb_pcount(skb) == 0);
BUG_ON(!before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq));
}
return packets_acked;
}
static void tcp_ack_tstamp(struct sock *sk, struct sk_buff *skb,
u32 prior_snd_una)
{
const struct skb_shared_info *shinfo;
/* Avoid cache line misses to get skb_shinfo() and shinfo->tx_flags */
if (likely(!(sk->sk_tsflags & <API key>)))
return;
shinfo = skb_shinfo(skb);
if ((shinfo->tx_flags & SKBTX_ACK_TSTAMP) &&
between(shinfo->tskey, prior_snd_una, tcp_sk(sk)->snd_una - 1))
__skb_tstamp_tx(skb, NULL, sk, SCM_TSTAMP_ACK);
}
/* Remove acknowledged frames from the retransmission queue. If our packet
* is before the ack sequence we can discard it as it's confirmed to have
* arrived at the other end.
*/
static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
u32 prior_snd_una,
struct tcp_sacktag_state *sack)
{
const struct <API key> *icsk = inet_csk(sk);
struct skb_mstamp first_ackt, last_ackt, now;
struct tcp_sock *tp = tcp_sk(sk);
u32 prior_sacked = tp->sacked_out;
u32 reord = tp->packets_out;
bool fully_acked = true;
long sack_rtt_us = -1L;
long seq_rtt_us = -1L;
long ca_rtt_us = -1L;
struct sk_buff *skb;
u32 pkts_acked = 0;
bool rtt_update;
int flag = 0;
first_ackt.v64 = 0;
while ((skb = <API key>(sk)) && skb != tcp_send_head(sk)) {
struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
u8 sacked = scb->sacked;
u32 acked_pcount;
tcp_ack_tstamp(sk, skb, prior_snd_una);
/* Determine how many packets and what bytes were acked, tso and else */
if (after(scb->end_seq, tp->snd_una)) {
if (tcp_skb_pcount(skb) == 1 ||
!after(tp->snd_una, scb->seq))
break;
acked_pcount = tcp_tso_acked(sk, skb);
if (!acked_pcount)
break;
fully_acked = false;
} else {
/* Speedup <API key>() and next loop */
prefetchw(skb->next);
acked_pcount = tcp_skb_pcount(skb);
}
if (unlikely(sacked & TCPCB_RETRANS)) {
if (sacked & <API key>)
tp->retrans_out -= acked_pcount;
flag |= <API key>;
} else if (!(sacked & TCPCB_SACKED_ACKED)) {
last_ackt = skb->skb_mstamp;
WARN_ON_ONCE(last_ackt.v64 == 0);
if (!first_ackt.v64)
first_ackt = last_ackt;
reord = min(pkts_acked, reord);
if (!after(scb->end_seq, tp->high_seq))
flag |= <API key>;
}
if (sacked & TCPCB_SACKED_ACKED)
tp->sacked_out -= acked_pcount;
if (sacked & TCPCB_LOST)
tp->lost_out -= acked_pcount;
tp->packets_out -= acked_pcount;
pkts_acked += acked_pcount;
/* Initial outgoing SYN's get put onto the write_queue
* just like anything else we transmit. It is not
* true data, and if we misinform our callers that
* this ACK acks real data, we will erroneously exit
* connection startup slow start one packet too
* quickly. This is severely frowned upon behavior.
*/
if (likely(!(scb->tcp_flags & TCPHDR_SYN))) {
flag |= FLAG_DATA_ACKED;
} else {
flag |= FLAG_SYN_ACKED;
tp->retrans_stamp = 0;
}
if (!fully_acked)
break;
<API key>(skb, sk);
sk_wmem_free_skb(sk, skb);
if (unlikely(skb == tp->retransmit_skb_hint))
tp->retransmit_skb_hint = NULL;
if (unlikely(skb == tp->lost_skb_hint))
tp->lost_skb_hint = NULL;
}
if (likely(between(tp->snd_up, prior_snd_una, tp->snd_una)))
tp->snd_up = tp->snd_una;
if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
flag |= FLAG_SACK_RENEGING;
skb_mstamp_get(&now);
if (likely(first_ackt.v64)) {
seq_rtt_us = skb_mstamp_us_delta(&now, &first_ackt);
ca_rtt_us = skb_mstamp_us_delta(&now, &last_ackt);
}
if (sack->first_sackt.v64) {
sack_rtt_us = skb_mstamp_us_delta(&now, &sack->first_sackt);
ca_rtt_us = skb_mstamp_us_delta(&now, &sack->last_sackt);
}
rtt_update = tcp_ack_update_rtt(sk, flag, seq_rtt_us, sack_rtt_us);
if (flag & FLAG_ACKED) {
tcp_rearm_rto(sk);
if (unlikely(icsk->icsk_mtup.probe_size &&
!after(tp->mtu_probe.probe_seq_end, tp->snd_una))) {
<API key>(sk);
}
if (tcp_is_reno(tp)) {
<API key>(sk, pkts_acked);
} else {
int delta;
/* Non-retransmitted hole got filled? That's reordering */
if (reord < prior_fackets)
<API key>(sk, tp->fackets_out - reord, 0);
delta = tcp_is_fack(tp) ? pkts_acked :
prior_sacked - tp->sacked_out;
tp->lost_cnt_hint -= min(tp->lost_cnt_hint, delta);
}
tp->fackets_out -= min(pkts_acked, tp->fackets_out);
} else if (skb && rtt_update && sack_rtt_us >= 0 &&
sack_rtt_us > skb_mstamp_us_delta(&now, &skb->skb_mstamp)) {
/* Do not re-arm RTO if the sack RTT is measured from data sent
* after when the head was last (re)transmitted. Otherwise the
* timeout may continue to extend in loss recovery.
*/
tcp_rearm_rto(sk);
}
if (icsk->icsk_ca_ops->pkts_acked)
icsk->icsk_ca_ops->pkts_acked(sk, pkts_acked, ca_rtt_us);
#if FASTRETRANS_DEBUG > 0
WARN_ON((int)tp->sacked_out < 0);
WARN_ON((int)tp->lost_out < 0);
WARN_ON((int)tp->retrans_out < 0);
if (!tp->packets_out && tcp_is_sack(tp)) {
icsk = inet_csk(sk);
if (tp->lost_out) {
pr_debug("Leak l=%u %d\n",
tp->lost_out, icsk->icsk_ca_state);
tp->lost_out = 0;
}
if (tp->sacked_out) {
pr_debug("Leak s=%u %d\n",
tp->sacked_out, icsk->icsk_ca_state);
tp->sacked_out = 0;
}
if (tp->retrans_out) {
pr_debug("Leak r=%u %d\n",
tp->retrans_out, icsk->icsk_ca_state);
tp->retrans_out = 0;
}
}
#endif
return flag;
}
static void tcp_ack_probe(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
/* Was it a usable window open? */
if (!after(TCP_SKB_CB(tcp_send_head(sk))->end_seq, tcp_wnd_end(tp))) {
icsk->icsk_backoff = 0;
<API key>(sk, ICSK_TIME_PROBE0);
/* Socket must be waked up by subsequent tcp_data_snd_check().
* This function is not for random using!
*/
} else {
unsigned long when = tcp_probe0_when(sk, TCP_RTO_MAX);
<API key>(sk, ICSK_TIME_PROBE0,
when, TCP_RTO_MAX);
}
}
static inline bool tcp_ack_is_dubious(const struct sock *sk, const int flag)
{
return !(flag & FLAG_NOT_DUP) || (flag & FLAG_CA_ALERT) ||
inet_csk(sk)->icsk_ca_state != TCP_CA_Open;
}
/* Decide wheather to run the increase function of congestion control. */
static inline bool tcp_may_raise_cwnd(const struct sock *sk, const int flag)
{
if (<API key>(sk))
return false;
/* If reordering is high then always grow cwnd whenever data is
* delivered regardless of its ordering. Otherwise stay conservative
* and only grow cwnd on in-order delivery (RFC5681). A stretched ACK w/
* new SACK or ECE mark may first advance cwnd here and later reduce
* cwnd in <API key>() based on more states.
*/
if (tcp_sk(sk)->reordering > <API key>)
return flag & <API key>;
return flag & FLAG_DATA_ACKED;
}
/* Check that window update is acceptable.
* The function assumes that snd_una<=ack<=snd_next.
*/
static inline bool <API key>(const struct tcp_sock *tp,
const u32 ack, const u32 ack_seq,
const u32 nwin)
{
return after(ack, tp->snd_una) ||
after(ack_seq, tp->snd_wl1) ||
(ack_seq == tp->snd_wl1 && nwin > tp->snd_wnd);
}
/* If we update tp->snd_una, also update tp->bytes_acked */
static void tcp_snd_una_update(struct tcp_sock *tp, u32 ack)
{
u32 delta = ack - tp->snd_una;
<API key>(&tp->syncp);
tp->bytes_acked += delta;
<API key>(&tp->syncp);
tp->snd_una = ack;
}
/* If we update tp->rcv_nxt, also update tp->bytes_received */
static void tcp_rcv_nxt_update(struct tcp_sock *tp, u32 seq)
{
u32 delta = seq - tp->rcv_nxt;
<API key>(&tp->syncp);
tp->bytes_received += delta;
<API key>(&tp->syncp);
tp->rcv_nxt = seq;
}
/* Update our send window.
*
* Window update algorithm, described in RFC793/RFC1122 (used in linux-2.2
* and in FreeBSD. NetBSD's one is even worse.) is wrong.
*/
static int <API key>(struct sock *sk, const struct sk_buff *skb, u32 ack,
u32 ack_seq)
{
struct tcp_sock *tp = tcp_sk(sk);
int flag = 0;
u32 nwin = ntohs(tcp_hdr(skb)->window);
if (likely(!tcp_hdr(skb)->syn))
nwin <<= tp->rx_opt.snd_wscale;
if (<API key>(tp, ack, ack_seq, nwin)) {
flag |= FLAG_WIN_UPDATE;
tcp_update_wl(tp, ack_seq);
if (tp->snd_wnd != nwin) {
tp->snd_wnd = nwin;
/* Note, it is the only place, where
* fast path is recovered for sending TCP.
*/
tp->pred_flags = 0;
tcp_fast_path_check(sk);
if (nwin > tp->max_window) {
tp->max_window = nwin;
tcp_sync_mss(sk, inet_csk(sk)->icsk_pmtu_cookie);
}
}
}
tcp_snd_una_update(tp, ack);
return flag;
}
/* Return true if we're currently rate-limiting out-of-window ACKs and
* thus shouldn't send a dupack right now. We rate-limit dupacks in
* response to out-of-window SYNs or ACKs to mitigate ACK loops or DoS
* attacks that send repeated SYNs or ACKs for the same connection. To
* do this, we do not send a duplicate SYNACK or ACK if the remote
* endpoint is sending out-of-window SYNs or pure ACKs at a high rate.
*/
bool <API key>(struct net *net, const struct sk_buff *skb,
int mib_idx, u32 *last_oow_ack_time)
{
/* Data packets without SYNs are not likely part of an ACK loop. */
if ((TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq) &&
!tcp_hdr(skb)->syn)
goto not_rate_limited;
if (*last_oow_ack_time) {
s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time);
if (0 <= elapsed && elapsed < <API key>) {
NET_INC_STATS_BH(net, mib_idx);
return true; /* rate-limited: don't send yet! */
}
}
*last_oow_ack_time = tcp_time_stamp;
not_rate_limited:
return false; /* not rate-limited: go ahead, send dupack now! */
}
/* RFC 5961 7 [ACK Throttling] */
static void <API key>(struct sock *sk, const struct sk_buff *skb)
{
/* unprotected vars, we dont care of overwrites */
static u32 challenge_timestamp;
static unsigned int challenge_count;
struct tcp_sock *tp = tcp_sk(sk);
u32 now;
/* First check our per-socket dupack rate limit. */
if (<API key>(sock_net(sk), skb,
<API key>,
&tp->last_oow_ack_time))
return;
/* Then check the check host-wide RFC 5961 rate limit. */
now = jiffies / HZ;
if (now != challenge_timestamp) {
challenge_timestamp = now;
challenge_count = 0;
}
if (++challenge_count <= <API key>) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
tcp_send_ack(sk);
}
}
static void tcp_store_ts_recent(struct tcp_sock *tp)
{
tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval;
tp->rx_opt.ts_recent_stamp = get_seconds();
}
static void <API key>(struct tcp_sock *tp, u32 seq)
{
if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) {
/* PAWS bug workaround wrt. ACK frames, the PAWS discard
* extra check below makes sure this can only happen
* for pure ACK frames. -DaveM
*
* Not only, also it occurs for expired timestamps.
*/
if (tcp_paws_check(&tp->rx_opt, 0))
tcp_store_ts_recent(tp);
}
}
/* This routine deals with acks during a TLP episode.
* We mark the end of a TLP episode on receiving TLP dupack or when
* ack is after tlp_high_seq.
* Ref: loss detection algorithm in <API key>.
*/
static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
{
struct tcp_sock *tp = tcp_sk(sk);
if (before(ack, tp->tlp_high_seq))
return;
if (flag & FLAG_DSACKING_ACK) {
/* This DSACK means original and TLP probe arrived; no loss */
tp->tlp_high_seq = 0;
} else if (after(ack, tp->tlp_high_seq)) {
/* ACK advances: there was a loss, so reduce cwnd. Reset
* tlp_high_seq in <API key>()
*/
<API key>(sk);
tcp_set_ca_state(sk, TCP_CA_CWR);
<API key>(sk);
tcp_try_keep_open(sk);
NET_INC_STATS_BH(sock_net(sk),
<API key>);
} else if (!(flag & (<API key> |
FLAG_NOT_DUP | FLAG_DATA_SACKED))) {
/* Pure dupack: original and TLP probe arrived; no loss */
tp->tlp_high_seq = 0;
}
}
static inline void tcp_in_ack_event(struct sock *sk, u32 flags)
{
const struct <API key> *icsk = inet_csk(sk);
if (icsk->icsk_ca_ops->in_ack_event)
icsk->icsk_ca_ops->in_ack_event(sk, flags);
}
/* This routine deals with incoming acks, but not outgoing ones. */
static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
{
struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct tcp_sacktag_state sack_state;
u32 prior_snd_una = tp->snd_una;
u32 ack_seq = TCP_SKB_CB(skb)->seq;
u32 ack = TCP_SKB_CB(skb)->ack_seq;
bool is_dupack = false;
u32 prior_fackets;
int prior_packets = tp->packets_out;
const int prior_unsacked = tp->packets_out - tp->sacked_out;
int acked = 0; /* Number of packets newly acked */
sack_state.first_sackt.v64 = 0;
/* We very likely will need to access write queue head. */
prefetchw(sk->sk_write_queue.next);
/* If the ack is older than previous acks
* then we can probably ignore it.
*/
if (before(ack, prior_snd_una)) {
/* RFC 5961 5.2 [Blind Data Injection Attack].[Mitigation] */
if (before(ack, prior_snd_una - tp->max_window)) {
<API key>(sk, skb);
return -1;
}
goto old_ack;
}
/* If the ack includes data we haven't sent yet, discard
* this segment (RFC793 Section 3.9).
*/
if (after(ack, tp->snd_nxt))
goto invalid_ack;
if (icsk->icsk_pending == <API key> ||
icsk->icsk_pending == <API key>)
tcp_rearm_rto(sk);
if (after(ack, prior_snd_una)) {
flag |= <API key>;
icsk->icsk_retransmits = 0;
}
prior_fackets = tp->fackets_out;
/* ts_recent update must be made after we are sure that the packet
* is in window.
*/
if (flag & <API key>)
<API key>(tp, TCP_SKB_CB(skb)->seq);
if (!(flag & FLAG_SLOWPATH) && after(ack, prior_snd_una)) {
/* Window is constant, pure forward advance.
* No more checks are required.
* Note, we use the fact that SND.UNA>=SND.WL2.
*/
tcp_update_wl(tp, ack_seq);
tcp_snd_una_update(tp, ack);
flag |= FLAG_WIN_UPDATE;
tcp_in_ack_event(sk, CA_ACK_WIN_UPDATE);
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPACKS);
} else {
u32 ack_ev_flags = CA_ACK_SLOWPATH;
if (ack_seq != TCP_SKB_CB(skb)->end_seq)
flag |= FLAG_DATA;
else
NET_INC_STATS_BH(sock_net(sk), <API key>);
flag |= <API key>(sk, skb, ack, ack_seq);
if (TCP_SKB_CB(skb)->sacked)
flag |= <API key>(sk, skb, prior_snd_una,
&sack_state);
if (<API key>(tp, tcp_hdr(skb))) {
flag |= FLAG_ECE;
ack_ev_flags |= CA_ACK_ECE;
}
if (flag & FLAG_WIN_UPDATE)
ack_ev_flags |= CA_ACK_WIN_UPDATE;
tcp_in_ack_event(sk, ack_ev_flags);
}
/* We passed data and got it acked, remove any soft error
* log. Something worked...
*/
sk->sk_err_soft = 0;
icsk->icsk_probes_out = 0;
tp->rcv_tstamp = tcp_time_stamp;
if (!prior_packets)
goto no_queue;
/* See if we can take anything off of the retransmit queue. */
acked = tp->packets_out;
flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una,
&sack_state);
acked -= tp->packets_out;
/* Advance cwnd if state allows */
if (tcp_may_raise_cwnd(sk, flag))
tcp_cong_avoid(sk, ack, acked);
if (tcp_ack_is_dubious(sk, flag)) {
is_dupack = !(flag & (<API key> | FLAG_NOT_DUP));
<API key>(sk, acked, prior_unsacked,
is_dupack, flag);
}
if (tp->tlp_high_seq)
tcp_process_tlp_ack(sk, ack, flag);
if ((flag & <API key>) || !(flag & FLAG_NOT_DUP)) {
struct dst_entry *dst = __sk_dst_get(sk);
if (dst)
dst_confirm(dst);
}
if (icsk->icsk_pending == ICSK_TIME_RETRANS)
<API key>(sk);
<API key>(sk);
return 1;
no_queue:
/* If data was DSACKed, see if we can undo a cwnd reduction. */
if (flag & FLAG_DSACKING_ACK)
<API key>(sk, acked, prior_unsacked,
is_dupack, flag);
/* If this ack opens up a zero window, clear backoff. It was
* being used to time the probes, and is probably far higher than
* it needs to be for normal retransmission.
*/
if (tcp_send_head(sk))
tcp_ack_probe(sk);
if (tp->tlp_high_seq)
tcp_process_tlp_ack(sk, ack, flag);
return 1;
invalid_ack:
SOCK_DEBUG(sk, "Ack %u after %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
return -1;
old_ack:
/* If data was SACKed, tag it and see if we should send more data.
* If data was DSACKed, see if we can undo a cwnd reduction.
*/
if (TCP_SKB_CB(skb)->sacked) {
flag |= <API key>(sk, skb, prior_snd_una,
&sack_state);
<API key>(sk, acked, prior_unsacked,
is_dupack, flag);
}
SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
return 0;
}
static void <API key>(int len, const unsigned char *cookie,
bool syn, struct tcp_fastopen_cookie *foc,
bool exp_opt)
{
/* Valid only in SYN or SYN-ACK with an even length. */
if (!foc || !syn || len < 0 || (len & 1))
return;
if (len >= <API key> &&
len <= <API key>)
memcpy(foc->val, cookie, len);
else if (len != 0)
len = -1;
foc->len = len;
foc->exp = exp_opt;
}
/* Look for tcp options. Normally only called on SYN and SYNACK packets.
* But, this can also be called on packets in the established flow when
* the fast version below fails.
*/
void tcp_parse_options(const struct sk_buff *skb,
struct <API key> *opt_rx, int estab,
struct tcp_fastopen_cookie *foc)
{
const unsigned char *ptr;
const struct tcphdr *th = tcp_hdr(skb);
int length = (th->doff * 4) - sizeof(struct tcphdr);
ptr = (const unsigned char *)(th + 1);
opt_rx->saw_tstamp = 0;
while (length > 0) {
int opcode = *ptr++;
int opsize;
switch (opcode) {
case TCPOPT_EOL:
return;
case TCPOPT_NOP: /* Ref: RFC 793 section 3.1 */
length
continue;
default:
opsize = *ptr++;
if (opsize < 2) /* "silly options" */
return;
if (opsize > length)
return; /* don't parse partial options */
switch (opcode) {
case TCPOPT_MSS:
if (opsize == TCPOLEN_MSS && th->syn && !estab) {
u16 in_mss = get_unaligned_be16(ptr);
if (in_mss) {
if (opt_rx->user_mss &&
opt_rx->user_mss < in_mss)
in_mss = opt_rx->user_mss;
opt_rx->mss_clamp = in_mss;
}
}
break;
case TCPOPT_WINDOW:
if (opsize == TCPOLEN_WINDOW && th->syn &&
!estab && <API key>) {
__u8 snd_wscale = *(__u8 *)ptr;
opt_rx->wscale_ok = 1;
if (snd_wscale > 14) {
<API key>("%s: Illegal window scaling value %d >14 received\n",
__func__,
snd_wscale);
snd_wscale = 14;
}
opt_rx->snd_wscale = snd_wscale;
}
break;
case TCPOPT_TIMESTAMP:
if ((opsize == TCPOLEN_TIMESTAMP) &&
((estab && opt_rx->tstamp_ok) ||
(!estab && <API key>))) {
opt_rx->saw_tstamp = 1;
opt_rx->rcv_tsval = get_unaligned_be32(ptr);
opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4);
}
break;
case TCPOPT_SACK_PERM:
if (opsize == TCPOLEN_SACK_PERM && th->syn &&
!estab && sysctl_tcp_sack) {
opt_rx->sack_ok = TCP_SACK_SEEN;
tcp_sack_reset(opt_rx);
}
break;
case TCPOPT_SACK:
if ((opsize >= (TCPOLEN_SACK_BASE + <API key>)) &&
!((opsize - TCPOLEN_SACK_BASE) % <API key>) &&
opt_rx->sack_ok) {
TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th;
}
break;
#ifdef CONFIG_TCP_MD5SIG
case TCPOPT_MD5SIG:
/*
* The MD5 Hash has already been
* checked (see tcp_v{4,6}_do_rcv()).
*/
break;
#endif
case TCPOPT_FASTOPEN:
<API key>(
opsize - <API key>,
ptr, th->syn, foc, false);
break;
case TCPOPT_EXP:
/* Fast Open option shares code 254 using a
* 16 bits magic number.
*/
if (opsize >= <API key> &&
get_unaligned_be16(ptr) ==
<API key>)
<API key>(opsize -
<API key>,
ptr + 2, th->syn, foc, true);
break;
}
ptr += opsize-2;
length -= opsize;
}
}
}
EXPORT_SYMBOL(tcp_parse_options);
static bool <API key>(struct tcp_sock *tp, const struct tcphdr *th)
{
const __be32 *ptr = (const __be32 *)(th + 1);
if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16)
| (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) {
tp->rx_opt.saw_tstamp = 1;
++ptr;
tp->rx_opt.rcv_tsval = ntohl(*ptr);
++ptr;
if (*ptr)
tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset;
else
tp->rx_opt.rcv_tsecr = 0;
return true;
}
return false;
}
/* Fast parse options. This hopes to only see timestamps.
* If it is wrong it falls back on tcp_parse_options().
*/
static bool <API key>(const struct sk_buff *skb,
const struct tcphdr *th, struct tcp_sock *tp)
{
/* In the spirit of fast parsing, compare doff directly to constant
* values. Because equality is used, short doff can be ignored here.
*/
if (th->doff == (sizeof(*th) / 4)) {
tp->rx_opt.saw_tstamp = 0;
return false;
} else if (tp->rx_opt.tstamp_ok &&
th->doff == ((sizeof(*th) + <API key>) / 4)) {
if (<API key>(tp, th))
return true;
}
tcp_parse_options(skb, &tp->rx_opt, 1, NULL);
if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
tp->rx_opt.rcv_tsecr -= tp->tsoffset;
return true;
}
#ifdef CONFIG_TCP_MD5SIG
/*
* Parse MD5 Signature option
*/
const u8 *<API key>(const struct tcphdr *th)
{
int length = (th->doff << 2) - sizeof(*th);
const u8 *ptr = (const u8 *)(th + 1);
/* If the TCP option is too short, we can short cut */
if (length < TCPOLEN_MD5SIG)
return NULL;
while (length > 0) {
int opcode = *ptr++;
int opsize;
switch (opcode) {
case TCPOPT_EOL:
return NULL;
case TCPOPT_NOP:
length
continue;
default:
opsize = *ptr++;
if (opsize < 2 || opsize > length)
return NULL;
if (opcode == TCPOPT_MD5SIG)
return opsize == TCPOLEN_MD5SIG ? ptr : NULL;
}
ptr += opsize - 2;
length -= opsize;
}
return NULL;
}
EXPORT_SYMBOL(<API key>);
#endif
/* Sorry, PAWS as specified is broken wrt. pure-ACKs -DaveM
*
* It is not fatal. If this ACK does _not_ change critical state (seqs, window)
* it can pass through stack. So, the following predicate verifies that
* this segment is not used for anything but congestion avoidance or
* fast retransmit. Moreover, we even are able to eliminate most of such
* second order effects, if we apply some small "replay" window (~RTO)
* to timestamp space.
*
* All these measures still do not guarantee that we reject wrapped ACKs
* on networks with high bandwidth, when sequence space is recycled fastly,
* but it guarantees that such events will be very rare and do not affect
* connection seriously. This doesn't look nice, but alas, PAWS is really
* buggy extension.
*
* [ Later note. Even worse! It is buggy for segments _with_ data. RFC
* states that events when retransmit arrives after original data are rare.
* It is a blatant lie. VJ forgot about fast retransmit! 8)8) It is
* the biggest problem on large power networks even with minor reordering.
* OK, let's give it small replay window. If peer clock is even 1hz, it is safe
* up to bandwidth of 18Gigabit/sec. 8) ]
*/
static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb)
{
const struct tcp_sock *tp = tcp_sk(sk);
const struct tcphdr *th = tcp_hdr(skb);
u32 seq = TCP_SKB_CB(skb)->seq;
u32 ack = TCP_SKB_CB(skb)->ack_seq;
return (/* 1. Pure ACK with correct sequence number. */
(th->ack && seq == TCP_SKB_CB(skb)->end_seq && seq == tp->rcv_nxt) &&
/* 2. ... and duplicate ACK. */
ack == tp->snd_una &&
/* 3. ... and does not update window. */
!<API key>(tp, ack, seq, ntohs(th->window) << tp->rx_opt.snd_wscale) &&
/* 4. ... and sits in replay window. */
(s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) <= (inet_csk(sk)->icsk_rto * 1024) / HZ);
}
static inline bool tcp_paws_discard(const struct sock *sk,
const struct sk_buff *skb)
{
const struct tcp_sock *tp = tcp_sk(sk);
return !tcp_paws_check(&tp->rx_opt, TCP_PAWS_WINDOW) &&
!tcp_disordered_ack(sk, skb);
}
/* Check segment sequence number for validity.
*
* Segment controls are considered valid, if the segment
* fits to the window after truncation to the window. Acceptability
* of data (and SYN, FIN, of course) is checked separately.
* See tcp_data_queue(), for example.
*
* Also, controls (RST is main one) are accepted using RCV.WUP instead
* of RCV.NXT. Peer still did not advance his SND.UNA when we
* delayed ACK, so that hisSND.UNA<=ourRCV.WUP.
* (borrowed from freebsd)
*/
static inline bool tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq)
{
return !before(end_seq, tp->rcv_wup) &&
!after(seq, tp->rcv_nxt + tcp_receive_window(tp));
}
/* When we get a reset we do this. */
void tcp_reset(struct sock *sk)
{
/* We want the right error as BSD sees it (and indeed as we do). */
switch (sk->sk_state) {
case TCP_SYN_SENT:
sk->sk_err = ECONNREFUSED;
break;
case TCP_CLOSE_WAIT:
sk->sk_err = EPIPE;
break;
case TCP_CLOSE:
return;
default:
sk->sk_err = ECONNRESET;
}
/* This barrier is coupled with smp_rmb() in tcp_poll() */
smp_wmb();
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_error_report(sk);
tcp_done(sk);
}
/*
* Process the FIN bit. This now behaves as it is supposed to work
* and the FIN takes effect when it is validly part of sequence
* space. Not before when we get holes.
*
* If we are ESTABLISHED, a received fin moves us to CLOSE-WAIT
* (and thence onto LAST-ACK and finally, CLOSE, we never enter
* TIME-WAIT)
*
* If we are in FINWAIT-1, a received FIN indicates simultaneous
* close and we go into CLOSING (and later onto TIME-WAIT)
*
* If we are in FINWAIT-2, a received FIN moves us to TIME-WAIT.
*/
static void tcp_fin(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
const struct dst_entry *dst;
<API key>(sk);
sk->sk_shutdown |= RCV_SHUTDOWN;
sock_set_flag(sk, SOCK_DONE);
switch (sk->sk_state) {
case TCP_SYN_RECV:
case TCP_ESTABLISHED:
/* Move to CLOSE_WAIT */
tcp_set_state(sk, TCP_CLOSE_WAIT);
dst = __sk_dst_get(sk);
if (!dst || !dst_metric(dst, RTAX_QUICKACK))
inet_csk(sk)->icsk_ack.pingpong = 1;
break;
case TCP_CLOSE_WAIT:
case TCP_CLOSING:
/* Received a retransmission of the FIN, do
* nothing.
*/
break;
case TCP_LAST_ACK:
/* RFC793: Remain in the LAST-ACK state. */
break;
case TCP_FIN_WAIT1:
/* This case occurs when a simultaneous close
* happens, we must ack the received FIN and
* enter the CLOSING state.
*/
tcp_send_ack(sk);
tcp_set_state(sk, TCP_CLOSING);
break;
case TCP_FIN_WAIT2:
/* Received a FIN -- send ACK and enter TIME_WAIT. */
tcp_send_ack(sk);
tcp_time_wait(sk, TCP_TIME_WAIT, 0);
break;
default:
/* Only TCP_LISTEN and TCP_CLOSE are left, in these
* cases we should never reach this piece of code.
*/
pr_err("%s: Impossible, sk->sk_state=%d\n",
__func__, sk->sk_state);
break;
}
/* It _is_ possible, that we have something out-of-order _after_ FIN.
* Probably, we should reset in this case. For now drop them.
*/
__skb_queue_purge(&tp->out_of_order_queue);
if (tcp_is_sack(tp))
tcp_sack_reset(&tp->rx_opt);
sk_mem_reclaim(sk);
if (!sock_flag(sk, SOCK_DEAD)) {
sk->sk_state_change(sk);
/* Do not send POLL_HUP for half duplex close. */
if (sk->sk_shutdown == SHUTDOWN_MASK ||
sk->sk_state == TCP_CLOSE)
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_HUP);
else
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
}
}
static inline bool tcp_sack_extend(struct tcp_sack_block *sp, u32 seq,
u32 end_seq)
{
if (!after(seq, sp->end_seq) && !after(sp->start_seq, end_seq)) {
if (before(seq, sp->start_seq))
sp->start_seq = seq;
if (after(end_seq, sp->end_seq))
sp->end_seq = end_seq;
return true;
}
return false;
}
static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
int mib_idx;
if (before(seq, tp->rcv_nxt))
mib_idx = <API key>;
else
mib_idx = <API key>;
NET_INC_STATS_BH(sock_net(sk), mib_idx);
tp->rx_opt.dsack = 1;
tp->duplicate_sack[0].start_seq = seq;
tp->duplicate_sack[0].end_seq = end_seq;
}
}
static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq)
{
struct tcp_sock *tp = tcp_sk(sk);
if (!tp->rx_opt.dsack)
tcp_dsack_set(sk, seq, end_seq);
else
tcp_sack_extend(tp->duplicate_sack, seq, end_seq);
}
static void tcp_send_dupack(struct sock *sk, const struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
<API key>(sk);
if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
u32 end_seq = TCP_SKB_CB(skb)->end_seq;
if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))
end_seq = tp->rcv_nxt;
tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, end_seq);
}
}
tcp_send_ack(sk);
}
/* These routines update the SACK block as out-of-order packets arrive or
* in-order packets close up the sequence space.
*/
static void <API key>(struct tcp_sock *tp)
{
int this_sack;
struct tcp_sack_block *sp = &tp->selective_acks[0];
struct tcp_sack_block *swalk = sp + 1;
/* See if the recent change to the first SACK eats into
* or hits the sequence space of other SACK blocks, if so coalesce.
*/
for (this_sack = 1; this_sack < tp->rx_opt.num_sacks;) {
if (tcp_sack_extend(sp, swalk->start_seq, swalk->end_seq)) {
int i;
/* Zap SWALK, by moving every further SACK up by one slot.
* Decrease num_sacks.
*/
tp->rx_opt.num_sacks
for (i = this_sack; i < tp->rx_opt.num_sacks; i++)
sp[i] = sp[i + 1];
continue;
}
this_sack++, swalk++;
}
}
static void <API key>(struct sock *sk, u32 seq, u32 end_seq)
{
struct tcp_sock *tp = tcp_sk(sk);
struct tcp_sack_block *sp = &tp->selective_acks[0];
int cur_sacks = tp->rx_opt.num_sacks;
int this_sack;
if (!cur_sacks)
goto new_sack;
for (this_sack = 0; this_sack < cur_sacks; this_sack++, sp++) {
if (tcp_sack_extend(sp, seq, end_seq)) {
/* Rotate this_sack to the first one. */
for (; this_sack > 0; this_sack
swap(*sp, *(sp - 1));
if (cur_sacks > 1)
<API key>(tp);
return;
}
}
/* Could not find an adjacent existing SACK, build a new one,
* put it at the front, and shift everyone else down. We
* always know there is at least one SACK present already here.
*
* If the sack array is full, forget about the last one.
*/
if (this_sack >= TCP_NUM_SACKS) {
this_sack
tp->rx_opt.num_sacks
sp
}
for (; this_sack > 0; this_sack
*sp = *(sp - 1);
new_sack:
/* Build the new head SACK, and we're done. */
sp->start_seq = seq;
sp->end_seq = end_seq;
tp->rx_opt.num_sacks++;
}
/* RCV.NXT advances, some SACKs should be eaten. */
static void tcp_sack_remove(struct tcp_sock *tp)
{
struct tcp_sack_block *sp = &tp->selective_acks[0];
int num_sacks = tp->rx_opt.num_sacks;
int this_sack;
/* Empty ofo queue, hence, all the SACKs are eaten. Clear. */
if (skb_queue_empty(&tp->out_of_order_queue)) {
tp->rx_opt.num_sacks = 0;
return;
}
for (this_sack = 0; this_sack < num_sacks;) {
/* Check if the start of the sack is covered by RCV.NXT. */
if (!before(tp->rcv_nxt, sp->start_seq)) {
int i;
/* RCV.NXT must cover all the block! */
WARN_ON(before(tp->rcv_nxt, sp->end_seq));
/* Zap this SACK, by moving forward any other SACKS. */
for (i = this_sack+1; i < num_sacks; i++)
tp->selective_acks[i-1] = tp->selective_acks[i];
num_sacks
continue;
}
this_sack++;
sp++;
}
tp->rx_opt.num_sacks = num_sacks;
}
/**
* tcp_try_coalesce - try to merge skb to prior one
* @sk: socket
* @to: prior buffer
* @from: buffer to add in queue
* @fragstolen: pointer to boolean
*
* Before queueing skb @from after @to, try to merge them
* to reduce overall memory use and queue lengths, if cost is small.
* Packets in ofo or receive queues can stay a long time.
* Better try to coalesce them right now to avoid future collapses.
* Returns true if caller should free @from instead of queueing it
*/
static bool tcp_try_coalesce(struct sock *sk,
struct sk_buff *to,
struct sk_buff *from,
bool *fragstolen)
{
int delta;
*fragstolen = false;
/* Its possible this segment overlaps with prior segment in queue */
if (TCP_SKB_CB(from)->seq != TCP_SKB_CB(to)->end_seq)
return false;
if (!skb_try_coalesce(to, from, fragstolen, &delta))
return false;
atomic_add(delta, &sk->sk_rmem_alloc);
sk_mem_charge(sk, delta);
NET_INC_STATS_BH(sock_net(sk), <API key>);
TCP_SKB_CB(to)->end_seq = TCP_SKB_CB(from)->end_seq;
TCP_SKB_CB(to)->ack_seq = TCP_SKB_CB(from)->ack_seq;
TCP_SKB_CB(to)->tcp_flags |= TCP_SKB_CB(from)->tcp_flags;
return true;
}
/* This one checks to see if we can put data from the
* out_of_order queue into the receive_queue.
*/
static void tcp_ofo_queue(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
__u32 dsack_high = tp->rcv_nxt;
struct sk_buff *skb, *tail;
bool fragstolen, eaten;
while ((skb = skb_peek(&tp->out_of_order_queue)) != NULL) {
if (after(TCP_SKB_CB(skb)->seq, tp->rcv_nxt))
break;
if (before(TCP_SKB_CB(skb)->seq, dsack_high)) {
__u32 dsack = dsack_high;
if (before(TCP_SKB_CB(skb)->end_seq, dsack_high))
dsack_high = TCP_SKB_CB(skb)->end_seq;
tcp_dsack_extend(sk, TCP_SKB_CB(skb)->seq, dsack);
}
__skb_unlink(skb, &tp->out_of_order_queue);
if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
SOCK_DEBUG(sk, "ofo packet was already received\n");
__kfree_skb(skb);
continue;
}
SOCK_DEBUG(sk, "ofo requeuing : rcv_next %X seq %X - %X\n",
tp->rcv_nxt, TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(skb)->end_seq);
tail = skb_peek_tail(&sk->sk_receive_queue);
eaten = tail && tcp_try_coalesce(sk, tail, skb, &fragstolen);
tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
if (!eaten)
__skb_queue_tail(&sk->sk_receive_queue, skb);
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
tcp_fin(sk);
if (eaten)
kfree_skb_partial(skb, fragstolen);
}
}
static bool tcp_prune_ofo_queue(struct sock *sk);
static int tcp_prune_queue(struct sock *sk);
static int <API key>(struct sock *sk, struct sk_buff *skb,
unsigned int size)
{
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
!sk_rmem_schedule(sk, skb, size)) {
if (tcp_prune_queue(sk) < 0)
return -1;
if (!sk_rmem_schedule(sk, skb, size)) {
if (!tcp_prune_ofo_queue(sk))
return -1;
if (!sk_rmem_schedule(sk, skb, size))
return -1;
}
}
return 0;
}
static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb1;
u32 seq, end_seq;
tcp_ecn_check_ce(tp, skb);
if (unlikely(<API key>(sk, skb, skb->truesize))) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
__kfree_skb(skb);
return;
}
/* Disable header prediction. */
tp->pred_flags = 0;
<API key>(sk);
NET_INC_STATS_BH(sock_net(sk), <API key>);
SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
skb1 = skb_peek_tail(&tp->out_of_order_queue);
if (!skb1) {
/* Initial out of order segment, build 1 SACK. */
if (tcp_is_sack(tp)) {
tp->rx_opt.num_sacks = 1;
tp->selective_acks[0].start_seq = TCP_SKB_CB(skb)->seq;
tp->selective_acks[0].end_seq =
TCP_SKB_CB(skb)->end_seq;
}
__skb_queue_head(&tp->out_of_order_queue, skb);
goto end;
}
seq = TCP_SKB_CB(skb)->seq;
end_seq = TCP_SKB_CB(skb)->end_seq;
if (seq == TCP_SKB_CB(skb1)->end_seq) {
bool fragstolen;
if (!tcp_try_coalesce(sk, skb1, skb, &fragstolen)) {
__skb_queue_after(&tp->out_of_order_queue, skb1, skb);
} else {
tcp_grow_window(sk, skb);
kfree_skb_partial(skb, fragstolen);
skb = NULL;
}
if (!tp->rx_opt.num_sacks ||
tp->selective_acks[0].end_seq != seq)
goto add_sack;
/* Common case: data arrive in order after hole. */
tp->selective_acks[0].end_seq = end_seq;
goto end;
}
/* Find place to insert this segment. */
while (1) {
if (!after(TCP_SKB_CB(skb1)->seq, seq))
break;
if (skb_queue_is_first(&tp->out_of_order_queue, skb1)) {
skb1 = NULL;
break;
}
skb1 = skb_queue_prev(&tp->out_of_order_queue, skb1);
}
/* Do skb overlap to previous one? */
if (skb1 && before(seq, TCP_SKB_CB(skb1)->end_seq)) {
if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
/* All the bits are present. Drop. */
NET_INC_STATS_BH(sock_net(sk), <API key>);
__kfree_skb(skb);
skb = NULL;
tcp_dsack_set(sk, seq, end_seq);
goto add_sack;
}
if (after(seq, TCP_SKB_CB(skb1)->seq)) {
/* Partial overlap. */
tcp_dsack_set(sk, seq,
TCP_SKB_CB(skb1)->end_seq);
} else {
if (skb_queue_is_first(&tp->out_of_order_queue,
skb1))
skb1 = NULL;
else
skb1 = skb_queue_prev(
&tp->out_of_order_queue,
skb1);
}
}
if (!skb1)
__skb_queue_head(&tp->out_of_order_queue, skb);
else
__skb_queue_after(&tp->out_of_order_queue, skb1, skb);
/* And clean segments covered by new one as whole. */
while (!skb_queue_is_last(&tp->out_of_order_queue, skb)) {
skb1 = skb_queue_next(&tp->out_of_order_queue, skb);
if (!after(end_seq, TCP_SKB_CB(skb1)->seq))
break;
if (before(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
end_seq);
break;
}
__skb_unlink(skb1, &tp->out_of_order_queue);
tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
TCP_SKB_CB(skb1)->end_seq);
NET_INC_STATS_BH(sock_net(sk), <API key>);
__kfree_skb(skb1);
}
add_sack:
if (tcp_is_sack(tp))
<API key>(sk, seq, end_seq);
end:
if (skb) {
tcp_grow_window(sk, skb);
skb_set_owner_r(skb, sk);
}
}
static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb, int hdrlen,
bool *fragstolen)
{
int eaten;
struct sk_buff *tail = skb_peek_tail(&sk->sk_receive_queue);
__skb_pull(skb, hdrlen);
eaten = (tail &&
tcp_try_coalesce(sk, tail, skb, fragstolen)) ? 1 : 0;
tcp_rcv_nxt_update(tcp_sk(sk), TCP_SKB_CB(skb)->end_seq);
if (!eaten) {
__skb_queue_tail(&sk->sk_receive_queue, skb);
skb_set_owner_r(skb, sk);
}
return eaten;
}
int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
{
struct sk_buff *skb;
bool fragstolen;
if (size == 0)
return 0;
skb = alloc_skb(size, sk->sk_allocation);
if (!skb)
goto err;
if (<API key>(sk, skb, skb->truesize))
goto err_free;
if (memcpy_from_msg(skb_put(skb, size), msg, size))
goto err_free;
TCP_SKB_CB(skb)->seq = tcp_sk(sk)->rcv_nxt;
TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + size;
TCP_SKB_CB(skb)->ack_seq = tcp_sk(sk)->snd_una - 1;
if (tcp_queue_rcv(sk, skb, 0, &fragstolen)) {
WARN_ON_ONCE(fragstolen); /* should not happen */
__kfree_skb(skb);
}
return size;
err_free:
kfree_skb(skb);
err:
return -ENOMEM;
}
static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
int eaten = -1;
bool fragstolen = false;
if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
goto drop;
skb_dst_drop(skb);
__skb_pull(skb, tcp_hdr(skb)->doff * 4);
tcp_ecn_accept_cwr(tp, skb);
tp->rx_opt.dsack = 0;
/* Queue data for delivery to the user.
* Packets in sequence go to the receive queue.
* Out of sequence packets to the out_of_order_queue.
*/
if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) {
if (tcp_receive_window(tp) == 0)
goto out_of_window;
/* Ok. In sequence. In window. */
if (tp->ucopy.task == current &&
tp->copied_seq == tp->rcv_nxt && tp->ucopy.len &&
sock_owned_by_user(sk) && !tp->urg_data) {
int chunk = min_t(unsigned int, skb->len,
tp->ucopy.len);
__set_current_state(TASK_RUNNING);
local_bh_enable();
if (!<API key>(skb, 0, tp->ucopy.msg, chunk)) {
tp->ucopy.len -= chunk;
tp->copied_seq += chunk;
eaten = (chunk == skb->len);
<API key>(sk);
}
local_bh_disable();
}
if (eaten <= 0) {
queue_and_out:
if (eaten < 0) {
if (skb_queue_len(&sk->sk_receive_queue) == 0)
<API key>(sk, skb->truesize);
else if (<API key>(sk, skb, skb->truesize))
goto drop;
}
eaten = tcp_queue_rcv(sk, skb, 0, &fragstolen);
}
tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
if (skb->len)
tcp_event_data_recv(sk, skb);
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
tcp_fin(sk);
if (!skb_queue_empty(&tp->out_of_order_queue)) {
tcp_ofo_queue(sk);
/* RFC2581. 4.2. SHOULD send immediate ACK, when
* gap in queue is filled.
*/
if (skb_queue_empty(&tp->out_of_order_queue))
inet_csk(sk)->icsk_ack.pingpong = 0;
}
if (tp->rx_opt.num_sacks)
tcp_sack_remove(tp);
tcp_fast_path_check(sk);
if (eaten > 0)
kfree_skb_partial(skb, fragstolen);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk);
return;
}
if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
/* A retransmit, 2nd most common case. Force an immediate ack. */
NET_INC_STATS_BH(sock_net(sk), <API key>);
tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
out_of_window:
<API key>(sk);
<API key>(sk);
drop:
__kfree_skb(skb);
return;
}
/* Out of window. F.e. zero window probe. */
if (!before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt + tcp_receive_window(tp)))
goto out_of_window;
<API key>(sk);
if (before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
/* Partial packet, seq < rcv_next < end_seq */
SOCK_DEBUG(sk, "partial packet: rcv_next %X seq %X - %X\n",
tp->rcv_nxt, TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(skb)->end_seq);
tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, tp->rcv_nxt);
/* If window is closed, drop tail of packet. But after
* remembering D-SACK for its head made in previous line.
*/
if (!tcp_receive_window(tp))
goto out_of_window;
goto queue_and_out;
}
tcp_data_queue_ofo(sk, skb);
}
static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb,
struct sk_buff_head *list)
{
struct sk_buff *next = NULL;
if (!skb_queue_is_last(list, skb))
next = skb_queue_next(list, skb);
__skb_unlink(skb, list);
__kfree_skb(skb);
NET_INC_STATS_BH(sock_net(sk), <API key>);
return next;
}
/* Collapse contiguous sequence of skbs head..tail with
* sequence numbers start..end.
*
* If tail is NULL, this means until the end of the list.
*
* Segments with FIN/SYN are not collapsed (only because this
* simplifies code)
*/
static void
tcp_collapse(struct sock *sk, struct sk_buff_head *list,
struct sk_buff *head, struct sk_buff *tail,
u32 start, u32 end)
{
struct sk_buff *skb, *n;
bool end_of_skbs;
/* First, check that queue is collapsible and find
* the point where collapsing can be useful. */
skb = head;
restart:
end_of_skbs = true;
<API key>(list, skb, n) {
if (skb == tail)
break;
/* No new bits? It is possible on ofo queue. */
if (!before(start, TCP_SKB_CB(skb)->end_seq)) {
skb = tcp_collapse_one(sk, skb, list);
if (!skb)
break;
goto restart;
}
/* The first skb to collapse is:
* - not SYN/FIN and
* - bloated or contains data before "start" or
* overlaps to the next one.
*/
if (!(TCP_SKB_CB(skb)->tcp_flags & (TCPHDR_SYN | TCPHDR_FIN)) &&
(tcp_win_from_space(skb->truesize) > skb->len ||
before(TCP_SKB_CB(skb)->seq, start))) {
end_of_skbs = false;
break;
}
if (!skb_queue_is_last(list, skb)) {
struct sk_buff *next = skb_queue_next(list, skb);
if (next != tail &&
TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(next)->seq) {
end_of_skbs = false;
break;
}
}
/* Decided to skip this, advance start seq. */
start = TCP_SKB_CB(skb)->end_seq;
}
if (end_of_skbs ||
(TCP_SKB_CB(skb)->tcp_flags & (TCPHDR_SYN | TCPHDR_FIN)))
return;
while (before(start, end)) {
int copy = min_t(int, SKB_MAX_ORDER(0, 0), end - start);
struct sk_buff *nskb;
nskb = alloc_skb(copy, GFP_ATOMIC);
if (!nskb)
return;
memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start;
__skb_queue_before(list, skb, nskb);
skb_set_owner_r(nskb, sk);
/* Copy data, releasing collapsed skbs. */
while (copy > 0) {
int offset = start - TCP_SKB_CB(skb)->seq;
int size = TCP_SKB_CB(skb)->end_seq - start;
BUG_ON(offset < 0);
if (size > 0) {
size = min(copy, size);
if (skb_copy_bits(skb, offset, skb_put(nskb, size), size))
BUG();
TCP_SKB_CB(nskb)->end_seq += size;
copy -= size;
start += size;
}
if (!before(start, TCP_SKB_CB(skb)->end_seq)) {
skb = tcp_collapse_one(sk, skb, list);
if (!skb ||
skb == tail ||
(TCP_SKB_CB(skb)->tcp_flags & (TCPHDR_SYN | TCPHDR_FIN)))
return;
}
}
}
}
/* Collapse ofo queue. Algorithm: select contiguous sequence of skbs
* and tcp_collapse() them until all the queue is collapsed.
*/
static void <API key>(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb = skb_peek(&tp->out_of_order_queue);
struct sk_buff *head;
u32 start, end;
if (!skb)
return;
start = TCP_SKB_CB(skb)->seq;
end = TCP_SKB_CB(skb)->end_seq;
head = skb;
for (;;) {
struct sk_buff *next = NULL;
if (!skb_queue_is_last(&tp->out_of_order_queue, skb))
next = skb_queue_next(&tp->out_of_order_queue, skb);
skb = next;
/* Segment is terminated when we see gap or when
* we are at the end of all the queue. */
if (!skb ||
after(TCP_SKB_CB(skb)->seq, end) ||
before(TCP_SKB_CB(skb)->end_seq, start)) {
tcp_collapse(sk, &tp->out_of_order_queue,
head, skb, start, end);
head = skb;
if (!skb)
break;
/* Start new segment */
start = TCP_SKB_CB(skb)->seq;
end = TCP_SKB_CB(skb)->end_seq;
} else {
if (before(TCP_SKB_CB(skb)->seq, start))
start = TCP_SKB_CB(skb)->seq;
if (after(TCP_SKB_CB(skb)->end_seq, end))
end = TCP_SKB_CB(skb)->end_seq;
}
}
}
/*
* Purge the out-of-order queue.
* Return true if queue was pruned.
*/
static bool tcp_prune_ofo_queue(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
bool res = false;
if (!skb_queue_empty(&tp->out_of_order_queue)) {
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_OFOPRUNED);
__skb_queue_purge(&tp->out_of_order_queue);
/* Reset SACK state. A conforming SACK implementation will
* do the same at a timeout based retransmit. When a connection
* is in a sad state like this, we care only about integrity
* of the connection not performance.
*/
if (tp->rx_opt.sack_ok)
tcp_sack_reset(&tp->rx_opt);
sk_mem_reclaim(sk);
res = true;
}
return res;
}
/* Reduce allocated memory if we can, trying to get
* the socket within its memory limits again.
*
* Return less than zero if we should start dropping frames
* until the socket owning process reads some of the data
* to stabilize the situation.
*/
static int tcp_prune_queue(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq);
NET_INC_STATS_BH(sock_net(sk), <API key>);
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
tcp_clamp_window(sk);
else if (<API key>(sk))
tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss);
<API key>(sk);
if (!skb_queue_empty(&sk->sk_receive_queue))
tcp_collapse(sk, &sk->sk_receive_queue,
skb_peek(&sk->sk_receive_queue),
NULL,
tp->copied_seq, tp->rcv_nxt);
sk_mem_reclaim(sk);
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf)
return 0;
/* Collapsing did not help, destructive actions follow.
* This must not ever occur. */
tcp_prune_ofo_queue(sk);
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf)
return 0;
/* If we are really being abused, tell the caller to silently
* drop receive data on the floor. It will get retransmitted
* and hopefully then we'll have sufficient space.
*/
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_RCVPRUNED);
/* Massive buffer overcommit. */
tp->pred_flags = 0;
return -1;
}
static bool <API key>(const struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
/* If the user specified a specific send buffer setting, do
* not modify it.
*/
if (sk->sk_userlocks & SOCK_SNDBUF_LOCK)
return false;
/* If we are under global TCP memory pressure, do not expand. */
if (<API key>(sk))
return false;
/* If we are under soft global TCP memory pressure, do not expand. */
if (sk_memory_allocated(sk) >= sk_prot_mem_limits(sk, 0))
return false;
/* If we filled the congestion window, do not expand. */
if (<API key>(tp) >= tp->snd_cwnd)
return false;
return true;
}
/* When incoming ACK allowed to free some skb from write_queue,
* we remember this event in flag SOCK_QUEUE_SHRUNK and wake up socket
* on the exit from tcp input handler.
*
* PROBLEM: sndbuf expansion does not work well with largesend.
*/
static void tcp_new_space(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
if (<API key>(sk)) {
tcp_sndbuf_expand(sk);
tp->snd_cwnd_stamp = tcp_time_stamp;
}
sk->sk_write_space(sk);
}
static void tcp_check_space(struct sock *sk)
{
if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) {
sock_reset_flag(sk, SOCK_QUEUE_SHRUNK);
/* pairs with tcp_poll() */
<API key>();
if (sk->sk_socket &&
test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
tcp_new_space(sk);
}
}
static inline void tcp_data_snd_check(struct sock *sk)
{
<API key>(sk);
tcp_check_space(sk);
}
/*
* Check if sending an ack is needed.
*/
static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
{
struct tcp_sock *tp = tcp_sk(sk);
/* More than one full frame received... */
if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss &&
/* ... and right edge of window advances far enough.
* (tcp_recvmsg() will send ACK otherwise). Or...
*/
__tcp_select_window(sk) >= tp->rcv_wnd) ||
/* We ACK each frame or... */
<API key>(sk) ||
/* We have out of order data. */
(ofo_possible && skb_peek(&tp->out_of_order_queue))) {
/* Then ack it now */
tcp_send_ack(sk);
} else {
/* Else, send delayed ack. */
<API key>(sk);
}
}
static inline void tcp_ack_snd_check(struct sock *sk)
{
if (!<API key>(sk)) {
/* We sent a data segment already. */
return;
}
__tcp_ack_snd_check(sk, 1);
}
/*
* This routine is only called when we have urgent data
* signaled. Its the 'slow' part of tcp_urg. It could be
* moved inline now as tcp_urg is only called from one
* place. We handle URGent data wrong. We have to - as
* BSD still doesn't use the correction from RFC961.
* For 1003.1g we should support a new option TCP_STDURG to permit
* either form (or just set the sysctl tcp_stdurg).
*/
static void tcp_check_urg(struct sock *sk, const struct tcphdr *th)
{
struct tcp_sock *tp = tcp_sk(sk);
u32 ptr = ntohs(th->urg_ptr);
if (ptr && !sysctl_tcp_stdurg)
ptr
ptr += ntohl(th->seq);
/* Ignore urgent data that we've already seen and read. */
if (after(tp->copied_seq, ptr))
return;
/* Do not replay urg ptr.
*
* NOTE: interesting situation not covered by specs.
* Misbehaving sender may send urg ptr, pointing to segment,
* which we already have in ofo queue. We are not able to fetch
* such data and will stay in TCP_URG_NOTYET until will be eaten
* by recvmsg(). Seems, we are not obliged to handle such wicked
* situations. But it is worth to think about possibility of some
* DoSes using some hypothetical application level deadlock.
*/
if (before(ptr, tp->rcv_nxt))
return;
/* Do we already have a newer (or duplicate) urgent pointer? */
if (tp->urg_data && !after(ptr, tp->urg_seq))
return;
/* Tell the world about our new urgent pointer. */
sk_send_sigurg(sk);
/* We may be adding urgent data when the last byte read was
* urgent. To do this requires some care. We cannot just ignore
* tp->copied_seq since we would read the last urgent byte again
* as data, nor can we alter copied_seq until this data arrives
* or we break the semantics of SIOCATMARK (and thus sockatmark())
*
* NOTE. Double Dutch. Rendering to plain English: author of comment
* above did something sort of send("A", MSG_OOB); send("B", MSG_OOB);
* and expect that both A and B disappear from stream. This is _wrong_.
* Though this happens in BSD with high probability, this is occasional.
* Any application relying on this is buggy. Note also, that fix "works"
* only in this artificial test. Insert some normal data between A and B and we will
* decline of BSD again. Verdict: it is better to remove to trap
* buggy users.
*/
if (tp->urg_seq == tp->copied_seq && tp->urg_data &&
!sock_flag(sk, SOCK_URGINLINE) && tp->copied_seq != tp->rcv_nxt) {
struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
tp->copied_seq++;
if (skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)) {
__skb_unlink(skb, &sk->sk_receive_queue);
__kfree_skb(skb);
}
}
tp->urg_data = TCP_URG_NOTYET;
tp->urg_seq = ptr;
/* Disable header prediction. */
tp->pred_flags = 0;
}
/* This is the 'fast' part of urgent handling. */
static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th)
{
struct tcp_sock *tp = tcp_sk(sk);
/* Check if we get a new urgent pointer - normally not. */
if (th->urg)
tcp_check_urg(sk, th);
/* Do we wait for any urgent data? - normally not... */
if (tp->urg_data == TCP_URG_NOTYET) {
u32 ptr = tp->urg_seq - ntohl(th->seq) + (th->doff * 4) -
th->syn;
/* Is the urgent pointer pointing into this packet? */
if (ptr < skb->len) {
u8 tmp;
if (skb_copy_bits(skb, ptr, &tmp, 1))
BUG();
tp->urg_data = TCP_URG_VALID | tmp;
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk);
}
}
}
static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen)
{
struct tcp_sock *tp = tcp_sk(sk);
int chunk = skb->len - hlen;
int err;
local_bh_enable();
if (<API key>(skb))
err = <API key>(skb, hlen, tp->ucopy.msg, chunk);
else
err = <API key>(skb, hlen, tp->ucopy.msg);
if (!err) {
tp->ucopy.len -= chunk;
tp->copied_seq += chunk;
<API key>(sk);
}
local_bh_disable();
return err;
}
static __sum16 <API key>(struct sock *sk,
struct sk_buff *skb)
{
__sum16 result;
if (sock_owned_by_user(sk)) {
local_bh_enable();
result = <API key>(skb);
local_bh_disable();
} else {
result = <API key>(skb);
}
return result;
}
static inline bool <API key>(struct sock *sk,
struct sk_buff *skb)
{
return !<API key>(skb) &&
<API key>(sk, skb);
}
/* Does PAWS and seqno based validation of an incoming segment, flags will
* play significant role here.
*/
static bool <API key>(struct sock *sk, struct sk_buff *skb,
const struct tcphdr *th, int syn_inerr)
{
struct tcp_sock *tp = tcp_sk(sk);
/* RFC1323: H1. Apply PAWS check first. */
if (<API key>(skb, th, tp) && tp->rx_opt.saw_tstamp &&
tcp_paws_discard(sk, skb)) {
if (!th->rst) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
if (!<API key>(sock_net(sk), skb,
<API key>,
&tp->last_oow_ack_time))
tcp_send_dupack(sk, skb);
goto discard;
}
/* Reset is accepted even if it did not pass PAWS. */
}
/* Step 1: check sequence number */
if (!tcp_sequence(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq)) {
/* RFC793, page 37: "In all states except SYN-SENT, all reset
* (RST) segments are validated by checking their SEQ-fields."
* And page 69: "If an incoming segment is not acceptable,
* an acknowledgment should be sent in reply (unless the RST
* bit is set, if so drop the segment and return)".
*/
if (!th->rst) {
if (th->syn)
goto syn_challenge;
if (!<API key>(sock_net(sk), skb,
<API key>,
&tp->last_oow_ack_time))
tcp_send_dupack(sk, skb);
}
goto discard;
}
/* Step 2: check RST bit */
if (th->rst) {
/* RFC 5961 3.2 :
* If sequence number exactly matches RCV.NXT, then
* RESET the connection
* else
* Send a challenge ACK
*/
if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt)
tcp_reset(sk);
else
<API key>(sk, skb);
goto discard;
}
/* step 3: check security and precedence [ignored] */
/* step 4: Check for a SYN
* RFC 5961 4.2 : Send a challenge ack
*/
if (th->syn) {
syn_challenge:
if (syn_inerr)
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
NET_INC_STATS_BH(sock_net(sk), <API key>);
<API key>(sk, skb);
goto discard;
}
return true;
discard:
__kfree_skb(skb);
return false;
}
/*
* TCP receive function for the ESTABLISHED state.
*
* It is split into a fast path and a slow path. The fast path is
* disabled when:
* - A zero window was announced from us - zero window probing
* is only handled properly in the slow path.
* - Out of order segments arrived.
* - Urgent data is expected.
* - There is no buffer space left
* - Unexpected TCP flags/window values/header lengths are received
* (detected by checking the TCP header against pred_flags)
* - Data is sent in both directions. Fast path only supports pure senders
* or pure receivers (this means either the sequence number or the ack
* value must stay constant)
* - Unexpected TCP option.
*
* When these conditions are not satisfied it drops into a standard
* receive procedure patterned after RFC793 to handle all cases.
* The first three cases are guaranteed by proper pred_flags setting,
* the rest is checked inline. Fast processing is turned on in
* tcp_data_queue when everything is OK.
*/
void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
const struct tcphdr *th, unsigned int len)
{
struct tcp_sock *tp = tcp_sk(sk);
if (unlikely(!sk->sk_rx_dst))
inet_csk(sk)->icsk_af_ops->sk_rx_dst_set(sk, skb);
/*
* Header prediction.
* The code loosely follows the one in the famous
* "30 instruction TCP receive" Van Jacobson mail.
*
* Van's trick is to deposit buffers into socket queue
* on a device interrupt, to call tcp_recv function
* on the receive process context and checksum and copy
* the buffer to user space. smart...
*
* Our current scheme is not silly either but we take the
* extra cost of the net_bh soft interrupt processing...
* We do checksum and copy also but from device to kernel.
*/
tp->rx_opt.saw_tstamp = 0;
/* pred_flags is 0xS?10 << 16 + snd_wnd
* if header_prediction is to be made
* 'S' will always be tp->tcp_header_len >> 2
* '?' will be 0 for the fast path, otherwise pred_flags is 0 to
* turn it off (when there are holes in the receive
* space for instance)
* PSH flag is ignored.
*/
if ((tcp_flag_word(th) & TCP_HP_BITS) == tp->pred_flags &&
TCP_SKB_CB(skb)->seq == tp->rcv_nxt &&
!after(TCP_SKB_CB(skb)->ack_seq, tp->snd_nxt)) {
int tcp_header_len = tp->tcp_header_len;
/* Timestamp header prediction: tcp_header_len
* is automatically equal to th->doff*4 due to pred_flags
* match.
*/
/* Check timestamp */
if (tcp_header_len == sizeof(struct tcphdr) + <API key>) {
/* No? Slow path! */
if (!<API key>(tp, th))
goto slow_path;
/* If PAWS failed, check it more carefully in slow path */
if ((s32)(tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent) < 0)
goto slow_path;
/* DO NOT update ts_recent here, if checksum fails
* and timestamp was corrupted part, it will result
* in a hung connection since we will drop all
* future packets due to the PAWS test.
*/
}
if (len <= tcp_header_len) {
/* Bulk data transfer: sender */
if (len == tcp_header_len) {
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if (tcp_header_len ==
(sizeof(struct tcphdr) + <API key>) &&
tp->rcv_nxt == tp->rcv_wup)
tcp_store_ts_recent(tp);
/* We know that such packets are checksummed
* on entry.
*/
tcp_ack(sk, skb, 0);
__kfree_skb(skb);
tcp_data_snd_check(sk);
return;
} else { /* Header too small */
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
goto discard;
}
} else {
int eaten = 0;
bool fragstolen = false;
if (tp->ucopy.task == current &&
tp->copied_seq == tp->rcv_nxt &&
len - tcp_header_len <= tp->ucopy.len &&
sock_owned_by_user(sk)) {
__set_current_state(TASK_RUNNING);
if (!tcp_copy_to_iovec(sk, skb, tcp_header_len)) {
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if (tcp_header_len ==
(sizeof(struct tcphdr) +
<API key>) &&
tp->rcv_nxt == tp->rcv_wup)
tcp_store_ts_recent(tp);
<API key>(sk, skb);
__skb_pull(skb, tcp_header_len);
tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
NET_INC_STATS_BH(sock_net(sk), <API key>);
eaten = 1;
}
}
if (!eaten) {
if (<API key>(sk, skb))
goto csum_error;
if ((int)skb->truesize > sk->sk_forward_alloc)
goto step5;
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if (tcp_header_len ==
(sizeof(struct tcphdr) + <API key>) &&
tp->rcv_nxt == tp->rcv_wup)
tcp_store_ts_recent(tp);
<API key>(sk, skb);
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITS);
/* Bulk data transfer: receiver */
eaten = tcp_queue_rcv(sk, skb, tcp_header_len,
&fragstolen);
}
tcp_event_data_recv(sk, skb);
if (TCP_SKB_CB(skb)->ack_seq != tp->snd_una) {
/* Well, only one small jumplet in fast path... */
tcp_ack(sk, skb, FLAG_DATA);
tcp_data_snd_check(sk);
if (!<API key>(sk))
goto no_ack;
}
__tcp_ack_snd_check(sk, 0);
no_ack:
if (eaten)
kfree_skb_partial(skb, fragstolen);
sk->sk_data_ready(sk);
return;
}
}
slow_path:
if (len < (th->doff << 2) || <API key>(sk, skb))
goto csum_error;
if (!th->ack && !th->rst && !th->syn)
goto discard;
/*
* Standard slow path.
*/
if (!<API key>(sk, skb, th, 1))
return;
step5:
if (tcp_ack(sk, skb, FLAG_SLOWPATH | <API key>) < 0)
goto discard;
<API key>(sk, skb);
/* Process urgent data. */
tcp_urg(sk, skb, th);
/* step 7: process the segment text */
tcp_data_queue(sk, skb);
tcp_data_snd_check(sk);
tcp_ack_snd_check(sk);
return;
csum_error:
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_CSUMERRORS);
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
discard:
__kfree_skb(skb);
}
EXPORT_SYMBOL(tcp_rcv_established);
void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
tcp_set_state(sk, TCP_ESTABLISHED);
if (skb) {
icsk->icsk_af_ops->sk_rx_dst_set(sk, skb);
<API key>(sk, skb);
}
/* Make sure socket is routed, for correct metrics. */
icsk->icsk_af_ops->rebuild_header(sk);
tcp_init_metrics(sk);
<API key>(sk);
/* Prevent spurious tcp_cwnd_restart() on first data
* packet.
*/
tp->lsndtime = tcp_time_stamp;
<API key>(sk);
if (sock_flag(sk, SOCK_KEEPOPEN))
<API key>(sk, keepalive_time_when(tp));
if (!tp->rx_opt.snd_wscale)
__tcp_fast_path_on(tp, tp->snd_wnd);
else
tp->pred_flags = 0;
if (!sock_flag(sk, SOCK_DEAD)) {
sk->sk_state_change(sk);
sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
}
}
static bool <API key>(struct sock *sk, struct sk_buff *synack,
struct tcp_fastopen_cookie *cookie)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *data = tp->syn_data ? <API key>(sk) : NULL;
u16 mss = tp->rx_opt.mss_clamp, try_exp = 0;
bool syn_drop = false;
if (mss == tp->rx_opt.user_mss) {
struct <API key> opt;
/* Get original SYNACK MSS value if user MSS sets mss_clamp */
tcp_clear_options(&opt);
opt.user_mss = opt.mss_clamp = 0;
tcp_parse_options(synack, &opt, 0, NULL);
mss = opt.mss_clamp;
}
if (!tp->syn_fastopen) {
/* Ignore an unsolicited cookie */
cookie->len = -1;
} else if (tp->total_retrans) {
/* SYN timed out and the SYN-ACK neither has a cookie nor
* acknowledges data. Presumably the remote received only
* the retransmitted (regular) SYNs: either the original
* SYN-data or the corresponding SYN-ACK was dropped.
*/
syn_drop = (cookie->len < 0 && data);
} else if (cookie->len < 0 && !tp->syn_data) {
/* We requested a cookie but didn't get it. If we did not use
* the (old) exp opt format then try so next time (try_exp=1).
* Otherwise we go back to use the RFC7413 opt (try_exp=2).
*/
try_exp = tp->syn_fastopen_exp ? 2 : 1;
}
<API key>(sk, mss, cookie, syn_drop, try_exp);
if (data) { /* Retransmit unacked data in SYN */
<API key>(data, sk) {
if (data == tcp_send_head(sk) ||
<API key>(sk, data))
break;
}
tcp_rearm_rto(sk);
NET_INC_STATS_BH(sock_net(sk), <API key>);
return true;
}
tp->syn_data_acked = tp->syn_data;
if (tp->syn_data_acked)
NET_INC_STATS_BH(sock_net(sk), <API key>);
return false;
}
static int <API key>(struct sock *sk, struct sk_buff *skb,
const struct tcphdr *th, unsigned int len)
{
struct <API key> *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct tcp_fastopen_cookie foc = { .len = -1 };
int saved_clamp = tp->rx_opt.mss_clamp;
tcp_parse_options(skb, &tp->rx_opt, 0, &foc);
if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
tp->rx_opt.rcv_tsecr -= tp->tsoffset;
if (th->ack) {
/* rfc793:
* "If the state is SYN-SENT then
* first check the ACK bit
* If the ACK bit is set
* If SEG.ACK =< ISS, or SEG.ACK > SND.NXT, send
* a reset (unless the RST bit is set, if so drop
* the segment and return)"
*/
if (!after(TCP_SKB_CB(skb)->ack_seq, tp->snd_una) ||
after(TCP_SKB_CB(skb)->ack_seq, tp->snd_nxt))
goto reset_and_undo;
if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
!between(tp->rx_opt.rcv_tsecr, tp->retrans_stamp,
tcp_time_stamp)) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
goto reset_and_undo;
}
/* Now ACK is acceptable.
*
* "If the RST bit is set
* If the ACK was acceptable then signal the user "error:
* connection reset", drop the segment, enter CLOSED state,
* delete TCB, and return."
*/
if (th->rst) {
tcp_reset(sk);
goto discard;
}
/* rfc793:
* "fifth, if neither of the SYN or RST bits is set then
* drop the segment and return."
*
* See note below!
* --ANK(990513)
*/
if (!th->syn)
goto discard_and_undo;
/* rfc793:
* "If the SYN bit is on ...
* are acceptable then ...
* (our SYN has been ACKed), change the connection
* state to ESTABLISHED..."
*/
tcp_ecn_rcv_synack(tp, th);
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
tcp_ack(sk, skb, FLAG_SLOWPATH);
/* Ok.. it's good. Set up sequence numbers and
* move to established.
*/
tp->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
tp->rcv_wup = TCP_SKB_CB(skb)->seq + 1;
/* RFC1323: The window in SYN & SYN/ACK segments is
* never scaled.
*/
tp->snd_wnd = ntohs(th->window);
if (!tp->rx_opt.wscale_ok) {
tp->rx_opt.snd_wscale = tp->rx_opt.rcv_wscale = 0;
tp->window_clamp = min(tp->window_clamp, 65535U);
}
if (tp->rx_opt.saw_tstamp) {
tp->rx_opt.tstamp_ok = 1;
tp->tcp_header_len =
sizeof(struct tcphdr) + <API key>;
tp->advmss -= <API key>;
tcp_store_ts_recent(tp);
} else {
tp->tcp_header_len = sizeof(struct tcphdr);
}
if (tcp_is_sack(tp) && sysctl_tcp_fack)
tcp_enable_fack(tp);
tcp_mtup_init(sk);
tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
<API key>(sk);
/* Remember, tcp_poll() does not lock socket!
* Change state from SYN-SENT only after copied_seq
* is initialized. */
tp->copied_seq = tp->rcv_nxt;
smp_mb();
tcp_finish_connect(sk, skb);
if ((tp->syn_fastopen || tp->syn_data) &&
<API key>(sk, skb, &foc))
return -1;
if (sk->sk_write_pending ||
icsk->icsk_accept_queue.rskq_defer_accept ||
icsk->icsk_ack.pingpong) {
/* Save one ACK. Data will be ready after
* several ticks, if write_pending is set.
*
* It may be deleted, but with this feature tcpdumps
* look so _wonderfully_ clever, that I was not able
* to stand against the temptation 8) --ANK
*/
<API key>(sk);
icsk->icsk_ack.lrcvtime = tcp_time_stamp;
<API key>(sk);
<API key>(sk, ICSK_TIME_DACK,
TCP_DELACK_MAX, TCP_RTO_MAX);
discard:
__kfree_skb(skb);
return 0;
} else {
tcp_send_ack(sk);
}
return -1;
}
/* No ACK in the segment */
if (th->rst) {
/* rfc793:
* "If the RST bit is set
*
* Otherwise (no ACK) drop the segment and return."
*/
goto discard_and_undo;
}
/* PAWS check. */
if (tp->rx_opt.ts_recent_stamp && tp->rx_opt.saw_tstamp &&
tcp_paws_reject(&tp->rx_opt, 0))
goto discard_and_undo;
if (th->syn) {
/* We see SYN without ACK. It is attempt of
* simultaneous connect with crossed SYNs.
* Particularly, it can be connect to self.
*/
tcp_set_state(sk, TCP_SYN_RECV);
if (tp->rx_opt.saw_tstamp) {
tp->rx_opt.tstamp_ok = 1;
tcp_store_ts_recent(tp);
tp->tcp_header_len =
sizeof(struct tcphdr) + <API key>;
} else {
tp->tcp_header_len = sizeof(struct tcphdr);
}
tp->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
tp->rcv_wup = TCP_SKB_CB(skb)->seq + 1;
/* RFC1323: The window in SYN & SYN/ACK segments is
* never scaled.
*/
tp->snd_wnd = ntohs(th->window);
tp->snd_wl1 = TCP_SKB_CB(skb)->seq;
tp->max_window = tp->snd_wnd;
tcp_ecn_rcv_syn(tp, th);
tcp_mtup_init(sk);
tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
<API key>(sk);
tcp_send_synack(sk);
#if 0
/* Note, we could accept data and URG from this segment.
* There are no obstacles to make this (except that we must
* either change tcp_recvmsg() to prevent it from returning data
* before 3WHS completes per RFC793, or employ TCP Fast Open).
*
* However, if we ignore data in ACKless segments sometimes,
* we have no reasons to accept it sometimes.
* Also, seems the code doing it in step6 of <API key>
* is not flawless. So, discard packet for sanity.
* Uncomment this return to process the data.
*/
return -1;
#else
goto discard;
#endif
}
/* "fifth, if neither of the SYN or RST bits is set then
* drop the segment and return."
*/
discard_and_undo:
tcp_clear_options(&tp->rx_opt);
tp->rx_opt.mss_clamp = saved_clamp;
goto discard;
reset_and_undo:
tcp_clear_options(&tp->rx_opt);
tp->rx_opt.mss_clamp = saved_clamp;
return 1;
}
/*
* This function implements the receiving procedure of RFC 793 for
* all states except ESTABLISHED and TIME_WAIT.
* It's called from both tcp_v4_rcv and tcp_v6_rcv and should be
* address independent.
*/
int <API key>(struct sock *sk, struct sk_buff *skb,
const struct tcphdr *th, unsigned int len)
{
struct tcp_sock *tp = tcp_sk(sk);
struct <API key> *icsk = inet_csk(sk);
struct request_sock *req;
int queued = 0;
bool acceptable;
u32 synack_stamp;
tp->rx_opt.saw_tstamp = 0;
switch (sk->sk_state) {
case TCP_CLOSE:
goto discard;
case TCP_LISTEN:
if (th->ack)
return 1;
if (th->rst)
goto discard;
if (th->syn) {
if (th->fin)
goto discard;
if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
return 1;
/* Now we have several options: In theory there is
* nothing else in the frame. KA9Q has an option to
* send data with the syn, BSD accepts data with the
* syn up to the [to be] advertised window and
* Solaris 2.1 gives you a protocol error. For now
* we just ignore it, that fits the spec precisely
* and avoids incompatibilities. It would be nice in
* future to drop through and process the data.
*
* Now that TTCP is starting to be used we ought to
* queue this data.
* But, this leaves one open to an easy denial of
* service attack, and SYN cookies can't defend
* against this problem. So, we drop the data
* in the interest of security over speed unless
* it's still in use.
*/
kfree_skb(skb);
return 0;
}
goto discard;
case TCP_SYN_SENT:
queued = <API key>(sk, skb, th, len);
if (queued >= 0)
return queued;
/* Do step6 onward by hand. */
tcp_urg(sk, skb, th);
__kfree_skb(skb);
tcp_data_snd_check(sk);
return 0;
}
req = tp->fastopen_rsk;
if (req) {
WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV &&
sk->sk_state != TCP_FIN_WAIT1);
if (!tcp_check_req(sk, skb, req, true))
goto discard;
}
if (!th->ack && !th->rst && !th->syn)
goto discard;
if (!<API key>(sk, skb, th, 0))
return 0;
/* step 5: check the ACK field */
acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH |
<API key>) > 0;
switch (sk->sk_state) {
case TCP_SYN_RECV:
if (!acceptable)
return 1;
/* Once we leave TCP_SYN_RECV, we no longer need req
* so release it.
*/
if (req) {
synack_stamp = tcp_rsk(req)->snt_synack;
tp->total_retrans = req->num_retrans;
<API key>(sk, req, false);
} else {
synack_stamp = tp->lsndtime;
/* Make sure socket is routed, for correct metrics. */
icsk->icsk_af_ops->rebuild_header(sk);
<API key>(sk);
tcp_mtup_init(sk);
tp->copied_seq = tp->rcv_nxt;
<API key>(sk);
}
smp_mb();
tcp_set_state(sk, TCP_ESTABLISHED);
sk->sk_state_change(sk);
/* Note, that this wakeup is only for marginal crossed SYN case.
* Passively open sockets are not waked up, because
* sk->sk_sleep == NULL and sk->sk_socket == NULL.
*/
if (sk->sk_socket)
sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale;
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
tcp_synack_rtt_meas(sk, synack_stamp);
if (tp->rx_opt.tstamp_ok)
tp->advmss -= <API key>;
if (req) {
/* Re-arm the timer because data may have been sent out.
* This is similar to the regular data transmission case
* when new data has just been ack'ed.
*
* (TFO) - we could try to be more aggressive and
* retransmitting any data sooner based on when they
* are sent out.
*/
tcp_rearm_rto(sk);
} else
tcp_init_metrics(sk);
<API key>(sk);
/* Prevent spurious tcp_cwnd_restart() on first data packet */
tp->lsndtime = tcp_time_stamp;
<API key>(sk);
tcp_fast_path_on(tp);
break;
case TCP_FIN_WAIT1: {
struct dst_entry *dst;
int tmo;
/* If we enter the TCP_FIN_WAIT1 state and we are a
* Fast Open socket and this is the first acceptable
* ACK we have received, this would have acknowledged
* our SYNACK so stop the SYNACK timer.
*/
if (req) {
/* Return RST if ack_seq is invalid.
* Note that RFC793 only says to generate a
* DUPACK for it but for TCP Fast Open it seems
* better to treat this case like TCP_SYN_RECV
* above.
*/
if (!acceptable)
return 1;
/* We no longer need the request sock. */
<API key>(sk, req, false);
tcp_rearm_rto(sk);
}
if (tp->snd_una != tp->write_seq)
break;
tcp_set_state(sk, TCP_FIN_WAIT2);
sk->sk_shutdown |= SEND_SHUTDOWN;
dst = __sk_dst_get(sk);
if (dst)
dst_confirm(dst);
if (!sock_flag(sk, SOCK_DEAD)) {
/* Wake up lingering close() */
sk->sk_state_change(sk);
break;
}
if (tp->linger2 < 0 ||
(TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
tcp_done(sk);
NET_INC_STATS_BH(sock_net(sk), <API key>);
return 1;
}
tmo = tcp_fin_time(sk);
if (tmo > TCP_TIMEWAIT_LEN) {
<API key>(sk, tmo - TCP_TIMEWAIT_LEN);
} else if (th->fin || sock_owned_by_user(sk)) {
/* Bad case. We could lose such FIN otherwise.
* It is not a big problem, but it looks confusing
* and not so rare event. We still can lose it now,
* if it spins in bh_lock_sock(), but it is really
* marginal case.
*/
<API key>(sk, tmo);
} else {
tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
goto discard;
}
break;
}
case TCP_CLOSING:
if (tp->snd_una == tp->write_seq) {
tcp_time_wait(sk, TCP_TIME_WAIT, 0);
goto discard;
}
break;
case TCP_LAST_ACK:
if (tp->snd_una == tp->write_seq) {
tcp_update_metrics(sk);
tcp_done(sk);
goto discard;
}
break;
}
/* step 6: check the URG bit */
tcp_urg(sk, skb, th);
/* step 7: process the segment text */
switch (sk->sk_state) {
case TCP_CLOSE_WAIT:
case TCP_CLOSING:
case TCP_LAST_ACK:
if (!before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt))
break;
case TCP_FIN_WAIT1:
case TCP_FIN_WAIT2:
/* RFC 793 says to queue data in these states,
* RFC 1122 says we MUST send a reset.
* BSD 4.4 also does reset.
*/
if (sk->sk_shutdown & RCV_SHUTDOWN) {
if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
tcp_reset(sk);
return 1;
}
}
/* Fall through */
case TCP_ESTABLISHED:
tcp_data_queue(sk, skb);
queued = 1;
break;
}
/* tcp_data could move socket to TIME-WAIT */
if (sk->sk_state != TCP_CLOSE) {
tcp_data_snd_check(sk);
tcp_ack_snd_check(sk);
}
if (!queued) {
discard:
__kfree_skb(skb);
}
return 0;
}
EXPORT_SYMBOL(<API key>);
static inline void pr_drop_req(struct request_sock *req, __u16 port, int family)
{
struct inet_request_sock *ireq = inet_rsk(req);
if (family == AF_INET)
net_dbg_ratelimited("drop open request from %pI4/%u\n",
&ireq->ir_rmt_addr, port);
#if IS_ENABLED(CONFIG_IPV6)
else if (family == AF_INET6)
net_dbg_ratelimited("drop open request from %pI6/%u\n",
&ireq->ir_v6_rmt_addr, port);
#endif
}
/* RFC3168 : 6.1.1 SYN packets must not have ECT/ECN bits set
*
* If we receive a SYN packet with these bits set, it means a
* network is playing bad games with TOS bits. In order to
* avoid possible false congestion notifications, we disable
* TCP ECN negotiation.
*
* Exception: tcp_ca wants ECN. This is required for DCTCP
* congestion control: Linux DCTCP asserts ECT on all packets,
* including SYN, which is most optimal solution; however,
* others, such as FreeBSD do not.
*/
static void <API key>(struct request_sock *req,
const struct sk_buff *skb,
const struct sock *listen_sk,
const struct dst_entry *dst)
{
const struct tcphdr *th = tcp_hdr(skb);
const struct net *net = sock_net(listen_sk);
bool th_ecn = th->ece && th->cwr;
bool ect, ecn_ok;
if (!th_ecn)
return;
ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield);
ecn_ok = net->ipv4.sysctl_tcp_ecn || dst_feature(dst, RTAX_FEATURE_ECN);
if ((!ect && ecn_ok) || tcp_ca_needs_ecn(listen_sk))
inet_rsk(req)->ecn_ok = 1;
}
static void tcp_openreq_init(struct request_sock *req,
const struct <API key> *rx_opt,
struct sk_buff *skb, const struct sock *sk)
{
struct inet_request_sock *ireq = inet_rsk(req);
req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */
req->cookie_ts = 0;
tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
tcp_rsk(req)->snt_synack = tcp_time_stamp;
tcp_rsk(req)->last_oow_ack_time = 0;
req->mss = rx_opt->mss_clamp;
req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
ireq->tstamp_ok = rx_opt->tstamp_ok;
ireq->sack_ok = rx_opt->sack_ok;
ireq->snd_wscale = rx_opt->snd_wscale;
ireq->wscale_ok = rx_opt->wscale_ok;
ireq->acked = 0;
ireq->ecn_ok = 0;
ireq->ir_rmt_port = tcp_hdr(skb)->source;
ireq->ir_num = ntohs(tcp_hdr(skb)->dest);
ireq->ir_mark = inet_request_mark(sk, skb);
}
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
struct sock *sk_listener)
{
struct request_sock *req = reqsk_alloc(ops, sk_listener);
if (req) {
struct inet_request_sock *ireq = inet_rsk(req);
<API key>(ireq, flags);
ireq->opt = NULL;
atomic64_set(&ireq->ir_cookie, 0);
ireq->ireq_state = TCP_NEW_SYN_RECV;
write_pnet(&ireq->ireq_net, sock_net(sk_listener));
ireq->ireq_family = sk_listener->sk_family;
}
return req;
}
EXPORT_SYMBOL(inet_reqsk_alloc);
/*
* Return true if a syncookie should be sent
*/
static bool <API key>(struct sock *sk,
const struct sk_buff *skb,
const char *proto)
{
const char *msg = "Dropping request";
bool want_cookie = false;
struct listen_sock *lopt;
#ifdef CONFIG_SYN_COOKIES
if (<API key>) {
msg = "Sending cookies";
want_cookie = true;
NET_INC_STATS_BH(sock_net(sk), <API key>);
} else
#endif
NET_INC_STATS_BH(sock_net(sk), <API key>);
lopt = inet_csk(sk)->icsk_accept_queue.listen_opt;
if (!lopt->synflood_warned && <API key> != 2) {
lopt->synflood_warned = 1;
pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n",
proto, ntohs(tcp_hdr(skb)->dest), msg);
}
return want_cookie;
}
static void <API key>(const struct sock *sk,
struct request_sock *req,
const struct sk_buff *skb)
{
if (tcp_sk(sk)->save_syn) {
u32 len = <API key>(skb) + tcp_hdrlen(skb);
u32 *copy;
copy = kmalloc(len + sizeof(u32), GFP_ATOMIC);
if (copy) {
copy[0] = len;
memcpy(©[1], skb_network_header(skb), len);
req->saved_syn = copy;
}
}
}
int tcp_conn_request(struct request_sock_ops *rsk_ops,
const struct <API key> *af_ops,
struct sock *sk, struct sk_buff *skb)
{
struct <API key> tmp_opt;
struct request_sock *req;
struct tcp_sock *tp = tcp_sk(sk);
struct dst_entry *dst = NULL;
__u32 isn = TCP_SKB_CB(skb)->tcp_tw_isn;
bool want_cookie = false, fastopen;
struct flowi fl;
struct tcp_fastopen_cookie foc = { .len = -1 };
int err;
/* TW buckets are converted to open requests without
* limitations, they conserve resources and peer is
* evidently real one.
*/
if ((<API key> == 2 ||
<API key>(sk)) && !isn) {
want_cookie = <API key>(sk, skb, rsk_ops->slab_name);
if (!want_cookie)
goto drop;
}
/* Accept backlog is full. If we have already queued enough
* of warm entries in syn queue, drop request. It is better than
* clogging syn queue with openreqs with exponentially increasing
* timeout.
*/
if (sk_acceptq_is_full(sk) && <API key>(sk) > 1) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
goto drop;
}
req = inet_reqsk_alloc(rsk_ops, sk);
if (!req)
goto drop;
tcp_rsk(req)->af_specific = af_ops;
tcp_clear_options(&tmp_opt);
tmp_opt.mss_clamp = af_ops->mss_clamp;
tmp_opt.user_mss = tp->rx_opt.user_mss;
tcp_parse_options(skb, &tmp_opt, 0, want_cookie ? NULL : &foc);
if (want_cookie && !tmp_opt.saw_tstamp)
tcp_clear_options(&tmp_opt);
tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
tcp_openreq_init(req, &tmp_opt, skb, sk);
/* Note: tcp_v6_init_req() might override ir_iif for link locals */
inet_rsk(req)->ir_iif = sk->sk_bound_dev_if;
af_ops->init_req(req, sk, skb);
if (<API key>(sk, skb, req))
goto drop_and_free;
if (!want_cookie && !isn) {
/* VJ's idea. We save last timestamp seen
* from the destination in peer table, when entering
* state TIME-WAIT, and check against it before
* accepting new connection request.
*
* If "isn" is not zero, this request hit alive
* timewait bucket, so that all the necessary checks
* are made in the function processing timewait state.
*/
if (tcp_death_row.sysctl_tw_recycle) {
bool strict;
dst = af_ops->route_req(sk, &fl, req, &strict);
if (dst && strict &&
!tcp_peer_is_proven(req, dst, true,
tmp_opt.saw_tstamp)) {
NET_INC_STATS_BH(sock_net(sk), <API key>);
goto drop_and_release;
}
}
/* Kill the following clause, if you dislike this way. */
else if (!<API key> &&
(<API key> - <API key>(sk) <
(<API key> >> 2)) &&
!tcp_peer_is_proven(req, dst, false,
tmp_opt.saw_tstamp)) {
/* Without syncookies last quarter of
* backlog is filled with destinations,
* proven to be alive.
* It means that we continue to communicate
* to destinations, already remembered
* to the moment of synflood.
*/
pr_drop_req(req, ntohs(tcp_hdr(skb)->source),
rsk_ops->family);
goto drop_and_release;
}
isn = af_ops->init_seq(skb);
}
if (!dst) {
dst = af_ops->route_req(sk, &fl, req, NULL);
if (!dst)
goto drop_and_free;
}
<API key>(req, skb, sk, dst);
if (want_cookie) {
isn = <API key>(af_ops, sk, skb, &req->mss);
req->cookie_ts = tmp_opt.tstamp_ok;
if (!tmp_opt.tstamp_ok)
inet_rsk(req)->ecn_ok = 0;
}
tcp_rsk(req)->snt_isn = isn;
<API key>(req, sk, dst);
fastopen = !want_cookie &&
tcp_try_fastopen(sk, skb, req, &foc, dst);
err = af_ops->send_synack(sk, dst, &fl, req,
<API key>(skb), &foc);
if (!fastopen) {
if (err || want_cookie)
goto drop_and_free;
tcp_rsk(req)->tfo_listener = false;
af_ops->queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
}
<API key>(sk, req, skb);
return 0;
drop_and_release:
dst_release(dst);
drop_and_free:
reqsk_free(req);
drop:
NET_INC_STATS_BH(sock_net(sk), <API key>);
return 0;
}
EXPORT_SYMBOL(tcp_conn_request);
|
#include "qgsapplication.h"
#include "qgscomposition.h"
#include "qgscomposerlabel.h"
#include "qgscomposershape.h"
#include "qgscomposerarrow.h"
#include "qgscomposerhtml.h"
#include "qgscomposerframe.h"
#include "qgsmapsettings.h"
#include <QObject>
#include <QtTest/QtTest>
class TestQgsComposition : public QObject
{
Q_OBJECT
public:
TestQgsComposition();
private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init();// will be called before each testfunction is executed.
void cleanup();// will be called after every testfunction.
void itemsOnPage(); //test fetching matching items on a set page
void shouldExportPage(); //test the shouldExportPage method
void pageIsEmpty(); //test the pageIsEmpty method
private:
QgsComposition* mComposition;
QgsMapSettings mMapSettings;
QString mReport;
};
TestQgsComposition::TestQgsComposition()
: mComposition( NULL )
{
}
void TestQgsComposition::initTestCase()
{
QgsApplication::init();
QgsApplication::initQgis();
//create composition
mMapSettings.<API key>( true );
mMapSettings.setMapUnits( QGis::Meters );
mComposition = new QgsComposition( mMapSettings );
mComposition->setPaperSize( 297, 210 ); //A4 landscape
mComposition->setNumPages( 3 );
mReport = "<h1>Composition Tests</h1>\n";
}
void TestQgsComposition::cleanupTestCase()
{
delete mComposition;
QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
QgsApplication::exitQgis();
}
void TestQgsComposition::init()
{
}
void TestQgsComposition::cleanup()
{
}
void TestQgsComposition::itemsOnPage()
{
//add some items to the composition
QgsComposerLabel* label1 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label1 );
label1->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 1 );
QgsComposerLabel* label2 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label2 );
label2->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 1 );
QgsComposerLabel* label3 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label3 );
label3->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 2 );
QgsComposerShape* shape1 = new QgsComposerShape( mComposition );
mComposition->addComposerShape( shape1 );
shape1->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 1 );
QgsComposerShape* shape2 = new QgsComposerShape( mComposition );
mComposition->addComposerShape( shape2 );
shape2->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 2 );
QgsComposerArrow* arrow1 = new QgsComposerArrow( mComposition );
mComposition->addComposerArrow( arrow1 );
arrow1->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 3 );
QgsComposerArrow* arrow2 = new QgsComposerArrow( mComposition );
mComposition->addComposerArrow( arrow2 );
arrow2->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 3 );
//fetch items - remember that these numbers include the paper item!
QList<QgsComposerItem*> items;
mComposition->composerItemsOnPage( items, 0 );
//should be 4 items on page 1
QCOMPARE( items.length(), 4 );
mComposition->composerItemsOnPage( items, 1 );
//should be 3 items on page 2
QCOMPARE( items.length(), 3 );
mComposition->composerItemsOnPage( items, 2 );
//should be 3 items on page 3
QCOMPARE( items.length(), 3 );
//check fetching specific item types
QList<QgsComposerLabel*> labels;
mComposition->composerItemsOnPage( labels, 0 );
//should be 2 labels on page 1
QCOMPARE( labels.length(), 2 );
mComposition->composerItemsOnPage( labels, 1 );
//should be 1 label on page 2
QCOMPARE( labels.length(), 1 );
mComposition->composerItemsOnPage( labels, 2 );
//should be no label on page 3
QCOMPARE( labels.length(), 0 );
QList<QgsComposerShape*> shapes;
mComposition->composerItemsOnPage( shapes, 0 );
//should be 1 shapes on page 1
QCOMPARE( shapes.length(), 1 );
mComposition->composerItemsOnPage( shapes, 1 );
//should be 1 shapes on page 2
QCOMPARE( shapes.length(), 1 );
mComposition->composerItemsOnPage( shapes, 2 );
//should be no shapes on page 3
QCOMPARE( shapes.length(), 0 );
QList<QgsComposerArrow*> arrows;
mComposition->composerItemsOnPage( arrows, 0 );
//should be no arrows on page 1
QCOMPARE( arrows.length(), 0 );
mComposition->composerItemsOnPage( arrows, 1 );
//should be no arrows on page 2
QCOMPARE( arrows.length(), 0 );
mComposition->composerItemsOnPage( arrows, 2 );
//should be 2 arrows on page 3
QCOMPARE( arrows.length(), 2 );
mComposition->removeComposerItem( label1 );
mComposition->removeComposerItem( label2 );
mComposition->removeComposerItem( label3 );
mComposition->removeComposerItem( shape1 );
mComposition->removeComposerItem( shape2 );
mComposition->removeComposerItem( arrow1 );
mComposition->removeComposerItem( arrow2 );
//check again with removed items
mComposition->composerItemsOnPage( labels, 0 );
QCOMPARE( labels.length(), 0 );
mComposition->composerItemsOnPage( labels, 1 );
QCOMPARE( labels.length(), 0 );
mComposition->composerItemsOnPage( labels, 2 );
QCOMPARE( labels.length(), 0 );
}
void TestQgsComposition::shouldExportPage()
{
mComposition->setPaperSize( 297, 200 );
mComposition->setNumPages( 2 );
QgsComposerHtml* htmlItem = new QgsComposerHtml( mComposition, false );
//frame on page 1
QgsComposerFrame* frame1 = new QgsComposerFrame( mComposition, htmlItem, 0, 0, 100, 100 );
//frame on page 2
QgsComposerFrame* frame2 = new QgsComposerFrame( mComposition, htmlItem, 0, 320, 100, 100 );
frame2->setHidePageIfEmpty( true );
htmlItem->addFrame( frame1 );
htmlItem->addFrame( frame2 );
htmlItem->setContentMode( QgsComposerHtml::ManualHtml );
//short content, so frame 2 should be empty
htmlItem->setHtml( QString( "<p><i>Test manual <b>html</b></i></p>" ) );
htmlItem->loadHtml();
QCOMPARE( mComposition->shouldExportPage( 1 ), true );
QCOMPARE( mComposition->shouldExportPage( 2 ), false );
//long content, so frame 2 should not be empty
htmlItem->setHtml( QString( "<p style=\"height: 10000px\"><i>Test manual <b>html</b></i></p>" ) );
htmlItem->loadHtml();
QCOMPARE( mComposition->shouldExportPage( 1 ), true );
QCOMPARE( mComposition->shouldExportPage( 2 ), true );
//...and back again...
htmlItem->setHtml( QString( "<p><i>Test manual <b>html</b></i></p>" ) );
htmlItem->loadHtml();
QCOMPARE( mComposition->shouldExportPage( 1 ), true );
QCOMPARE( mComposition->shouldExportPage( 2 ), false );
mComposition->removeMultiFrame( htmlItem );
delete htmlItem;
}
void TestQgsComposition::pageIsEmpty()
{
//add some items to the composition
QgsComposerLabel* label1 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label1 );
label1->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 1 );
QgsComposerLabel* label2 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label2 );
label2->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 1 );
QgsComposerLabel* label3 = new QgsComposerLabel( mComposition );
mComposition->addComposerLabel( label3 );
label3->setItemPosition( 10, 10, 50, 50, QgsComposerItem::UpperLeft, false, 3 );
//only page 2 should be empty
QCOMPARE( mComposition->pageIsEmpty( 1 ), false );
QCOMPARE( mComposition->pageIsEmpty( 2 ), true );
QCOMPARE( mComposition->pageIsEmpty( 3 ), false );
//remove the items
mComposition->removeComposerItem( label1 );
mComposition->removeComposerItem( label2 );
mComposition->removeComposerItem( label3 );
//expect everything to be empty now
QCOMPARE( mComposition->pageIsEmpty( 1 ), true );
QCOMPARE( mComposition->pageIsEmpty( 2 ), true );
QCOMPARE( mComposition->pageIsEmpty( 3 ), true );
}
QTEST_MAIN( TestQgsComposition )
#include "testqgscomposition.moc"
|
#include <wchar.h>
#ifdef WCSPBRK
# define wcspbrk WCSPBRK
#endif
/* Find the first occurrence in WCS of any wide-character in ACCEPT. */
wchar_t *
wcspbrk (const wchar_t *wcs, const wchar_t *accept)
{
while (*wcs != L'\0')
if (wcschr (accept, *wcs) == NULL)
++wcs;
else
return (wchar_t *) wcs;
return NULL;
}
libc_hidden_def (wcspbrk)
|
<?php
// $Id: theme-settings.php,v 1.6 2008/05/13 09:19:13 johnalbin Exp $
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
* An array of saved settings for this theme.
* @return
* A form array.
*/
function STARTERKIT_settings($saved_settings) {
// Get the default values from the .info file.
$themes = list_themes();
$defaults = $themes['STARTERKIT']->info['settings'];
// Merge the saved variables and their default values.
$settings = array_merge($defaults, $saved_settings);
$form = array();
/* -- Delete this line if you want to use this setting
$form['subtheme_example'] = array(
'#type' => 'checkbox',
'#title' => t('Use this sample setting'),
'#default_value' => $settings['subtheme_example'],
'#description' => t("This option doesn't do anything; it's just an example."),
);
// */
// Add the base theme's settings.
include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';
$form += zen_settings($saved_settings, $defaults);
// Remove some of the base theme's settings.
unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
// Return the form
return $form;
}
|
#ifndef LSFCONFIGDIALOG_H
#define LSFCONFIGDIALOG_H
#ifdef ENABLE_SSH
//Doxygen should ignore this file:
@cond
#include <QtGui/QDialog>
namespace Ui {
class LsfConfigDialog;
}
namespace GlobalSearch {
class AbstractDialog;
class OptBase;
class LsfQueueInterface;
class LsfConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit LsfConfigDialog(AbstractDialog *parent,
OptBase *o,
LsfQueueInterface *p);
virtual ~LsfConfigDialog();
public slots:
void updateGUI();
protected slots:
void accept();
void reject();
protected:
OptBase *m_opt;
LsfQueueInterface *m_lsf;
private:
Ui::LsfConfigDialog *ui;
};
}
@endcond
#endif // ENABLE_SSH
#endif // LSFCONFIGDIALOG_H
|
#!/usr/bin/env perl
# This script runs the transactional stress test "stress_tx_rr" against the
# transactional storage engine and looks for errors in two log files:
# var/stress/<timestamp>/mysql-stress-test.log
# var/log/master.err
# The script assumes current working dir is mysql-test/.
# Regarding the server error log, currently only error lines containing the
# string "Error:" will be reported as a critical error, in addition to signs
# of crashes.
# In the stress test log, all lines matching the regex "S\d:" (denoting an
# error with a specified severity) will be reported as errors.
# Error information including the full server log in the case of server crash
# is output to standard out.
# This script is and should be silent if no errors are detected.
use File::Find;
use File::Spec;
use Cwd;
use Cwd 'abs_path';
use Getopt::Long;
# Checking script is run from the correct location
if (! -f "mysql-test-run.pl") {
print("\nERROR: This script should be run from the \'\<INSTALL_DIR\>/mysql-test\' directory.\n");
error(1);
}
$runlog="rr_trx.log";
my $errorFound;
my $installdir=abs_path(File::Spec->updir());
my $f=abs_path($0);
my ($v,$d,$f)=File::Spec->splitpath($f);
my $testsuitedir=$v.$d;
# Run stress test, redirect output to tmp file.
# Duration is specified in seconds. Some nice values:
# 5 minutes = 300
# 30 minutes = 1800
# 1 hour = 3600
# 2 hours = 7200
# 5 hours = 18000
# 12 hours = 43200
$opt_duration=600;
# Special handling for the InnoDB plugin
$plugin_params="\"--plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so\"";
$plugin_params=~s/so/dll/g if (windows());
$opt_help="";
$opt_try="";
$opt_engine="";
$opt_threads=10;
# Collection command line options
GetOptions("engine:s" => \$opt_engine,
"duration=i" => \$opt_duration,
"threads=i" => \$opt_treads,
"try", "help") || usage();
if ($opt_help) { usage(); }
if (!$opt_engine) {
print("\nERROR: --engine=\<engine\> argument is required!!!\n");
usage();
}
# setting specific engine parameters
$engine_options="";
# for innodb engine
if ($opt_engine eq "InnoDB") {
$engine_options=
"--mysqld=--innodb " .
"--mysqld=--<API key>=2 " .
" ";
}
elsif ($opt_engine eq "InnoDB_plugin") {
$engine_options=
"--mysqld=--innodb " .
"--mysqld=--<API key> " .
#"--mysqld=--plugin_dir=".$installdir."/lib " .
"--mysqld=--plugin_dir=".$installdir."/storage/innodb_plugin/.libs " .
"--mysqld=--<API key>=2 " .
"--mysqld=".$plugin_params." " .
" ";
}
# add parameters for a new engine by modifying the 'elsif' section below
elsif ($opt_engine eq "zz") {
$engine_options=
" ";
}
else {
print("\nERROR: '".$opt_engine."' - unknown engine\n");
add_engine_help();
}
# From this point forward there is no difference between the build in InnoDB and the plugin
$opt_engine='InnoDB' if ($opt_engine eq 'InnoDB_plugin');
# checking that custom files for that engine exist
$engine_lower= lc($opt_engine);
$missing=0;
if (!-f $testsuitedir.'init_'.$engine_lower.'.txt') {
print("\nERROR: config file 'init_".$engine_lower.".txt' missing.");
$missing=1;
}
if (!-f $testsuitedir.'t/init_'.$engine_lower.'.test') {
print("\nERROR: config file 'init_".$engine_lower.".test' missing.");
$missing=1;
}
if (!-f $testsuitedir.'r/init_'.$engine_lower.'.result') {
print("\nERROR: config file 'init_".$engine_lower.".result' missing.");
$missing=1;
}
add_engine_help() if ($missing);
# bilding test command line
$cmd="MTR_VERSION=1 " .
"perl ./mysql-test-run.pl " .
"--comment=stress_tx_rr_".$opt_engine." " .
"--stress " .
"--stress-init-file=init_".$engine_lower.".txt " .
"--stress-test-file=run.txt " .
"--stress-suite=engines/rr_trx " .
"--<API key>=".$opt_duration." " .
"--stress-threads=".$opt_threads." " .
"--mysqld=--log-output=file " .
"--mysqld=--sql-mode=<API key> " .
"--skip-im " .
$engine_options .
" > ".$runlog." 2>&1";
# running the test
print("\n Running \'rr_trx\' test with ".$opt_threads." clients\n");
print(" for ".$opt_duration." seconds using the ".$opt_engine." storag engine.\n");
print("\n Log file: ".$runlog."\n");
if ($opt_try) {
print("\nThe following command will execute:\n");
print("$cmd\n\n");
exit(0);
}
system $cmd;
# Check for crash and other severe errors in the server log.
# Open log file. If MTR_VERSION=1 this is in var/log/master.err.
# Otherwise, it is in ?... [stress_tx_rr not yet runnable with MTR_VERSION=2]
# Assuming current directory mysql-test/
my $serverlog=getcwd() . "/var/log/master.err";
open(SERVERLOG, $serverlog)
or die "Unable to open $serverlog. Test not run?";
my @servererrors = (); # Lines with "Severe" errors in server error log
my @crash = (); # Empty if no stack trace detected, non-empty otherwise.
# Grep for errors and crashes. Going line-by-line since the file can be large.
while (<SERVERLOG>) {
$line = $_;
push @crash, $line if /This could be because you hit a bug/;
push @servererrors, $line if /Error:/;
}
close(SERVERLOG);
if (@crash) {
# Crash (stack trace) detected in server log.
print "Transactional stress test stress_tx_rr:\n\n";
print "SERVER CRASH DETECTED!\n";
print "Server log: $serverlog printed at the bottom of this log.\n\n";
print "
}
if (@servererrors) {
# "Severe" errors detected. Print error lines to std out
print "CRITICAL ERRORS:\n\n";
foreach $error (@servererrors) {
print $error;
}
print "\n
}
# Check for errors reported by mysql-stress-test.pl. Transactional consistency
# issues are shown as result diffs.
my $dir;
find(\&finddir, cwd); # sets variable $dir
# Open log file
my $logfile="$dir/mysql-stress-test.log";
open(LOGFILE, $logfile)
or die "Unable to open $logfile. Test not run?";
my @errors = ();
my @heading = ();
# Grep for errors. Going line-by-line since the file can be large.
while (<LOGFILE>) {
#push @errors, $_ if ! /No Errors/;
push @errors, $_ if /S\d:/;
push @heading, $_ if /TestID|=====/;
}
close(LOGFILE);
# Print all errors, i.e. all lines that do not contain the string "No Errors"
if (@errors) {
$errorFound = 1;
print "Stress test main log file: $logfile\n";
print "Errors follow:\n\n";
# First print the heading
foreach $header_line (@heading) {
print $header_line;
}
foreach $error (@errors) {
print $error;
}
}
# If errors in server log, output the log and exit 1?
if (@servererrors or @crash) {
$errorFound = 1;
print "\n
print "Server error log (master.err):\n\n";
open(SERVERLOG, $serverlog)
or die "Unable to open $serverlog!";
while (<SERVERLOG>) {
print $_;
}
close(SERVERLOG);
}
if ($errorFound) {
# Exit with error code != 0 if we found an error.
print("\nTest Completed with errors. \n");
print(" - See ".$runlog." for summary.\n");
print(" - See files under var/stress for details.\n");
exit 1;
}
print("\nTest Completed - See ".$runlog." for details\n");
# Helper routines etc.
sub finddir {
my $file = $File::Find::name; # complete path to the file
return unless -d $file; # process directories (-d), not files (-f)
return unless $_ =~ m/^\d{14}$/; # check if file matches timstamp regex,
# must be 14 digits
$dir=$file;
#$dir= $_; # $_ = just the file name, no path
return $_;
}
sub usage
{
print <<EOF;
SYNTAX $0 --engine=<engine> [--duration=<nn>] [--thread=<nn>] [--try]
--engine=<engine>
The engine used to run the test. \<engine\> needs to be provided exactly as
it is reprted in the SHOW ENGINES comand.
EXCEPTION: In order to use the InnoDB plugin, specify 'InnoDB_plugin'
Required option.
--duration=nn
The time the test should run for in seconds. Defaut value is 600 seconds (10 minutes).
Optional parameter
--threads=nn
The number of clients used by the test driver. Defaut value is 10.
Optional parameter
--try
Do not run the actual test but show what will be run
Optional parameter
EOF
exit(0);
}
sub add_engine_help
{
print <<EOF;
\nThis test is can be run against any transactional engine. However scripts need to be modifed in order
to support such engines (support to InnoDB is provided as an example).
In order to add support for a new engine, you will need to modify scripts as follows:
1) cd to INSTALL_DIR/mysql-test/suite/engines/rr_trx
2) Modify the 'run_stress_rr.pl' file by adding an 'elsif' section for your engine and have it
include specifc values required to be passed as startup parameters to the MySQL server by
specifying them using "--mysqld" options (see InnoDB example).
3) Copy the 'init_innodb.txt' file to 'init_<engine>.txt file and change its content to be "init_<engine>".
4) In the 't' directory copy the "init_innodb.test" file to "init_\<engine\>.test" and change the value of
the '\$engine' variable to \<engine\>.
5) In the 'r' directory copy "the init_innodb.result" file to "init_\<engine\>.result" and change refrences
to 'InnoDB' to \<engine\>.
EOF
exit(0);
}
sub windows {
if (
($^O eq 'MSWin32') ||
($^O eq 'MSWin64')
) {
return 1;
} else {
return 0;
}
}
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include "acl-util.h"
#include "util.h"
#include "strv.h"
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
acl_entry_t i;
int r;
assert(acl);
assert(entry);
for (r = acl_get_entry(acl, ACL_FIRST_ENTRY, &i);
r > 0;
r = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) {
acl_tag_t tag;
uid_t *u;
bool b;
if (acl_get_tag_type(i, &tag) < 0)
return -errno;
if (tag != ACL_USER)
continue;
u = acl_get_qualifier(i);
if (!u)
return -errno;
b = *u == uid;
acl_free(u);
if (b) {
*entry = i;
return 1;
}
}
if (r < 0)
return -errno;
return 0;
}
int <API key>(acl_t *acl_p) {
acl_entry_t i;
int r;
assert(acl_p);
for (r = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i);
r > 0;
r = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) {
acl_tag_t tag;
if (acl_get_tag_type(i, &tag) < 0)
return -errno;
if (tag == ACL_MASK)
return 0;
if (IN_SET(tag, ACL_USER, ACL_GROUP))
goto calc;
}
if (r < 0)
return -errno;
return 0;
calc:
if (acl_calc_mask(acl_p) < 0)
return -errno;
return 1;
}
int <API key>(acl_t *acl_p, const char *path) {
acl_entry_t i;
int r;
bool have_user_obj = false, have_group_obj = false, have_other = false;
struct stat st;
_cleanup_(acl_freep) acl_t basic = NULL;
assert(acl_p);
for (r = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i);
r > 0;
r = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) {
acl_tag_t tag;
if (acl_get_tag_type(i, &tag) < 0)
return -errno;
if (tag == ACL_USER_OBJ)
have_user_obj = true;
else if (tag == ACL_GROUP_OBJ)
have_group_obj = true;
else if (tag == ACL_OTHER)
have_other = true;
if (have_user_obj && have_group_obj && have_other)
return 0;
}
if (r < 0)
return -errno;
r = stat(path, &st);
if (r < 0)
return -errno;
basic = acl_from_mode(st.st_mode);
if (!basic)
return -errno;
for (r = acl_get_entry(basic, ACL_FIRST_ENTRY, &i);
r > 0;
r = acl_get_entry(basic, ACL_NEXT_ENTRY, &i)) {
acl_tag_t tag;
acl_entry_t dst;
if (acl_get_tag_type(i, &tag) < 0)
return -errno;
if ((tag == ACL_USER_OBJ && have_user_obj) ||
(tag == ACL_GROUP_OBJ && have_group_obj) ||
(tag == ACL_OTHER && have_other))
continue;
r = acl_create_entry(acl_p, &dst);
if (r < 0)
return -errno;
r = acl_copy_entry(dst, i);
if (r < 0)
return -errno;
}
if (r < 0)
return -errno;
return 0;
}
int search_acl_groups(char*** dst, const char* path, bool* belong) {
acl_t acl;
assert(path);
assert(belong);
acl = acl_get_file(path, ACL_TYPE_DEFAULT);
if (acl) {
acl_entry_t entry;
int r;
r = acl_get_entry(acl, ACL_FIRST_ENTRY, &entry);
while (r > 0) {
acl_tag_t tag;
gid_t *gid;
char *name;
r = acl_get_tag_type(entry, &tag);
if (r < 0)
break;
if (tag != ACL_GROUP)
goto next;
gid = acl_get_qualifier(entry);
if (!gid)
break;
if (in_gid(*gid) > 0) {
*belong = true;
break;
}
name = gid_to_name(*gid);
if (!name) {
acl_free(acl);
return log_oom();
}
r = strv_consume(dst, name);
if (r < 0) {
acl_free(acl);
return log_oom();
}
next:
r = acl_get_entry(acl, ACL_NEXT_ENTRY, &entry);
}
acl_free(acl);
}
return 0;
}
int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask) {
_cleanup_free_ char **a = NULL, **d = NULL; /* strings are not be freed */
_cleanup_strv_free_ char **split;
char **entry;
int r = -EINVAL;
_cleanup_(acl_freep) acl_t a_acl = NULL, d_acl = NULL;
split = strv_split(text, ",");
if (!split)
return log_oom();
STRV_FOREACH(entry, split) {
char *p;
p = startswith(*entry, "default:");
if (!p)
p = startswith(*entry, "d:");
if (p)
r = strv_push(&d, p);
else
r = strv_push(&a, *entry);
}
if (r < 0)
return r;
if (!strv_isempty(a)) {
_cleanup_free_ char *join;
join = strv_join(a, ",");
if (!join)
return -ENOMEM;
a_acl = acl_from_text(join);
if (!a_acl)
return -EINVAL;
if (want_mask) {
r = <API key>(&a_acl);
if (r < 0)
return r;
}
}
if (!strv_isempty(d)) {
_cleanup_free_ char *join;
join = strv_join(d, ",");
if (!join)
return -ENOMEM;
d_acl = acl_from_text(join);
if (!d_acl)
return -EINVAL;
if (want_mask) {
r = <API key>(&d_acl);
if (r < 0)
return r;
}
}
*acl_access = a_acl;
*acl_default = d_acl;
a_acl = d_acl = NULL;
return 0;
}
int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl) {
_cleanup_(acl_freep) acl_t old;
acl_entry_t i;
int r;
old = acl_get_file(path, type);
if (!old)
return -errno;
for (r = acl_get_entry(new, ACL_FIRST_ENTRY, &i);
r > 0;
r = acl_get_entry(new, ACL_NEXT_ENTRY, &i)) {
acl_entry_t j;
if (acl_create_entry(&old, &j) < 0)
return -errno;
if (acl_copy_entry(j, i) < 0)
return -errno;
}
if (r < 0)
return -errno;
*acl = old;
old = NULL;
return 0;
}
|
// Use, modification and distribution are subject to the
#include <pch_light.hpp>
#include "test_trigamma.hpp"
void expected_results()
{
// Define the max and mean errors expected for
// various compilers and platforms.
const char* largest_type;
#ifndef <API key>
if(boost::math::policies::digits<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
{
largest_type = "(long\\s+)?double|real_concept";
}
else
{
largest_type = "long double|real_concept";
}
#else
largest_type = "(long\\s+)?double|real_concept";
#endif
add_expected_result(
".*", // compiler
".*", // stdlib
".*", // platform
largest_type, // test type(s)
".*", // test data group
".*", 20, 10); // test function
// Finish off by printing out the compiler/stdlib/platform names,
// we do this to make it easier to mark up expected error rates.
std::cout << "Tests run with " << BOOST_COMPILER << ", "
<< BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
}
<API key>( test_main )
{
expected_results();
<API key>;
test_trigamma(0.0F, "float");
test_trigamma(0.0, "double");
#ifndef <API key>
test_trigamma(0.0L, "long double");
test_trigamma(boost::math::concepts::real_concept(0.1), "real_concept");
#endif
}
|
module.exports={A:{A:{"2":"H G SB","4":"F C A B"},B:{"4":"D q W I"},C:{"4":"0 1 2 3 QB E K H G F C A B D q W I L M N O P Q R S T U V s X Y Z a b c d e f J h i j k l m n o p u v w t y r g OB NB"},D:{"4":"0 1 2 6 9 E K H G F C A B D q W I L M N O P Q R S T U V s X Y Z a b c d e f J h i j k l m n o p u v w t y r g CB RB AB"},E:{"2":"7 BB","4":"E K H G F C A DB EB FB GB HB IB"},F:{"2":"C","4":"4 5 B D I L M N O P Q R S T U V s X Y Z a b c d e f J h i j k l m n o p JB KB LB MB PB z"},G:{"4":"7 8 F x TB UB VB WB XB YB ZB aB"},H:{"4":"bB"},I:{"2":"3 E cB dB eB fB x","4":"g gB hB"},J:{"2":"G A"},K:{"4":"4 5 A B D J z"},L:{"4":"6"},M:{"4":"r"},N:{"4":"A B"},O:{"2":"iB"},P:{"4":"E"},Q:{"4":"jB"},R:{"4":"kB"}},B:2,C:"WAI-ARIA Accessibility features"};
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_data/b53.h>
#include <linux/phy.h>
#include <linux/etherdevice.h>
#include <linux/if_bridge.h>
#include <net/dsa.h>
#include <net/switchdev.h>
#include "b53_regs.h"
#include "b53_priv.h"
struct b53_mib_desc {
u8 size;
u8 offset;
const char *name;
};
/* BCM5365 MIB counters */
static const struct b53_mib_desc b53_mibs_65[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "<API key>" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "<API key>" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
};
#define B53_MIBS_65_SIZE ARRAY_SIZE(b53_mibs_65)
/* BCM63xx MIB counters */
static const struct b53_mib_desc b53_mibs_63xx[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x0c, "TxQoSPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "<API key>" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x3c, "TxQoSOctets" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "<API key>" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
{ 4, 0xa0, "RxSymbolErrors" },
{ 4, 0xa4, "RxQoSPkts" },
{ 8, 0xa8, "RxQoSOctets" },
{ 4, 0xb0, "<API key>" },
{ 4, 0xb4, "<API key>" },
{ 4, 0xb8, "<API key>" },
{ 4, 0xbc, "<API key>" },
{ 4, 0xc0, "RxDiscarded" },
};
#define B53_MIBS_63XX_SIZE ARRAY_SIZE(b53_mibs_63xx)
/* MIB counters */
static const struct b53_mib_desc b53_mibs[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "<API key>" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x50, "RxOctets" },
{ 4, 0x58, "RxUndersizePkts" },
{ 4, 0x5c, "RxPausePkts" },
{ 4, 0x60, "Pkts64Octets" },
{ 4, 0x64, "Pkts65to127Octets" },
{ 4, 0x68, "Pkts128to255Octets" },
{ 4, 0x6c, "Pkts256to511Octets" },
{ 4, 0x70, "Pkts512to1023Octets" },
{ 4, 0x74, "<API key>" },
{ 4, 0x78, "RxOversizePkts" },
{ 4, 0x7c, "RxJabbers" },
{ 4, 0x80, "RxAlignmentErrors" },
{ 4, 0x84, "RxFCSErrors" },
{ 8, 0x88, "RxGoodOctets" },
{ 4, 0x90, "RxDropPkts" },
{ 4, 0x94, "RxUnicastPkts" },
{ 4, 0x98, "RxMulticastPkts" },
{ 4, 0x9c, "RxBroadcastPkts" },
{ 4, 0xa0, "RxSAChanges" },
{ 4, 0xa4, "RxFragments" },
{ 4, 0xa8, "RxJumboPkts" },
{ 4, 0xac, "RxSymbolErrors" },
{ 4, 0xc0, "RxDiscarded" },
};
#define B53_MIBS_SIZE ARRAY_SIZE(b53_mibs)
static int b53_do_vlan_op(struct b53_device *dev, u8 op)
{
unsigned int i;
b53_write8(dev, B53_ARLIO_PAGE, dev->vta_regs[0], VTA_START_CMD | op);
for (i = 0; i < 10; i++) {
u8 vta;
b53_read8(dev, B53_ARLIO_PAGE, dev->vta_regs[0], &vta);
if (!(vta & VTA_START_CMD))
return 0;
usleep_range(100, 200);
}
return -EIO;
}
static void b53_set_vlan_entry(struct b53_device *dev, u16 vid,
struct b53_vlan *vlan)
{
if (is5325(dev)) {
u32 entry = 0;
if (vlan->members) {
entry = ((vlan->untag & VA_UNTAG_MASK_25) <<
VA_UNTAG_S_25) | vlan->members;
if (dev->core_rev >= 3)
entry |= VA_VALID_25_R4 | vid << VA_VID_HIGH_S;
else
entry |= VA_VALID_25;
}
b53_write32(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_25, entry);
b53_write16(dev, B53_VLAN_PAGE, <API key>, vid |
VTA_RW_STATE_WR | VTA_RW_OP_EN);
} else if (is5365(dev)) {
u16 entry = 0;
if (vlan->members)
entry = ((vlan->untag & VA_UNTAG_MASK_65) <<
VA_UNTAG_S_65) | vlan->members | VA_VALID_65;
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_65, entry);
b53_write16(dev, B53_VLAN_PAGE, <API key>, vid |
VTA_RW_STATE_WR | VTA_RW_OP_EN);
} else {
b53_write16(dev, B53_ARLIO_PAGE, dev->vta_regs[1], vid);
b53_write32(dev, B53_ARLIO_PAGE, dev->vta_regs[2],
(vlan->untag << VTE_UNTAG_S) | vlan->members);
b53_do_vlan_op(dev, VTA_CMD_WRITE);
}
dev_dbg(dev->ds->dev, "VID: %d, members: 0x%04x, untag: 0x%04x\n",
vid, vlan->members, vlan->untag);
}
static void b53_get_vlan_entry(struct b53_device *dev, u16 vid,
struct b53_vlan *vlan)
{
if (is5325(dev)) {
u32 entry = 0;
b53_write16(dev, B53_VLAN_PAGE, <API key>, vid |
VTA_RW_STATE_RD | VTA_RW_OP_EN);
b53_read32(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_25, &entry);
if (dev->core_rev >= 3)
vlan->valid = !!(entry & VA_VALID_25_R4);
else
vlan->valid = !!(entry & VA_VALID_25);
vlan->members = entry & VA_MEMBER_MASK;
vlan->untag = (entry >> VA_UNTAG_S_25) & VA_UNTAG_MASK_25;
} else if (is5365(dev)) {
u16 entry = 0;
b53_write16(dev, B53_VLAN_PAGE, <API key>, vid |
VTA_RW_STATE_WR | VTA_RW_OP_EN);
b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_65, &entry);
vlan->valid = !!(entry & VA_VALID_65);
vlan->members = entry & VA_MEMBER_MASK;
vlan->untag = (entry >> VA_UNTAG_S_65) & VA_UNTAG_MASK_65;
} else {
u32 entry = 0;
b53_write16(dev, B53_ARLIO_PAGE, dev->vta_regs[1], vid);
b53_do_vlan_op(dev, VTA_CMD_READ);
b53_read32(dev, B53_ARLIO_PAGE, dev->vta_regs[2], &entry);
vlan->members = entry & VTE_MEMBERS;
vlan->untag = (entry >> VTE_UNTAG_S) & VTE_MEMBERS;
vlan->valid = true;
}
}
static void b53_set_forwarding(struct b53_device *dev, int enable)
{
u8 mgmt;
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (enable)
mgmt |= SM_SW_FWD_EN;
else
mgmt &= ~SM_SW_FWD_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
}
static void b53_enable_vlan(struct b53_device *dev, bool enable)
{
u8 mgmt, vc0, vc1, vc4 = 0, vc5;
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL0, &vc0);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL1, &vc1);
if (is5325(dev) || is5365(dev)) {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_25, &vc5);
} else if (is63xx(dev)) {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_63XX, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_63XX, &vc5);
} else {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, &vc5);
}
mgmt &= ~SM_SW_FWD_MODE;
if (enable) {
vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID;
vc1 |= <API key> | VC1_RX_MCST_FWD_EN;
vc4 &= ~<API key>;
vc4 |= <API key> << VC4_ING_VID_CHECK_S;
vc5 |= <API key>;
if (is5325(dev))
vc0 &= ~VC0_RESERVED_1;
if (is5325(dev) || is5365(dev))
vc1 |= VC1_RX_MCST_TAG_EN;
} else {
vc0 &= ~(VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID);
vc1 &= ~(<API key> | VC1_RX_MCST_FWD_EN);
vc4 &= ~<API key>;
vc5 &= ~<API key>;
if (is5325(dev) || is5365(dev))
vc4 |= VC4_ING_VID_VIO_FWD << VC4_ING_VID_CHECK_S;
else
vc4 |= <API key> << VC4_ING_VID_CHECK_S;
if (is5325(dev) || is5365(dev))
vc1 &= ~VC1_RX_MCST_TAG_EN;
}
if (!is5325(dev) && !is5365(dev))
vc5 &= ~VC5_VID_FFF_EN;
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL0, vc0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL1, vc1);
if (is5325(dev) || is5365(dev)) {
/* enable the high 8 bit vid check on 5325 */
if (is5325(dev) && enable)
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3,
VC3_HIGH_8BIT_EN);
else
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_25, vc5);
} else if (is63xx(dev)) {
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3_63XX, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_63XX, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_63XX, vc5);
} else {
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, vc5);
}
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
}
static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100)
{
u32 port_mask = 0;
u16 max_size = JMS_MIN_SIZE;
if (is5325(dev) || is5365(dev))
return -EINVAL;
if (enable) {
port_mask = dev->enabled_ports;
max_size = JMS_MAX_SIZE;
if (allow_10_100)
port_mask |= JPM_10_100_JUMBO_EN;
}
b53_write32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, port_mask);
return b53_write16(dev, B53_JUMBO_PAGE, dev->jumbo_size_reg, max_size);
}
static int b53_flush_arl(struct b53_device *dev, u8 mask)
{
unsigned int i;
b53_write8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL,
FAST_AGE_DONE | FAST_AGE_DYNAMIC | mask);
for (i = 0; i < 10; i++) {
u8 fast_age_ctrl;
b53_read8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL,
&fast_age_ctrl);
if (!(fast_age_ctrl & FAST_AGE_DONE))
goto out;
msleep(1);
}
return -ETIMEDOUT;
out:
/* Only age dynamic entries (default behavior) */
b53_write8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL, FAST_AGE_DYNAMIC);
return 0;
}
static int b53_fast_age_port(struct b53_device *dev, int port)
{
b53_write8(dev, B53_CTRL_PAGE, <API key>, port);
return b53_flush_arl(dev, FAST_AGE_PORT);
}
static int b53_fast_age_vlan(struct b53_device *dev, u16 vid)
{
b53_write16(dev, B53_CTRL_PAGE, <API key>, vid);
return b53_flush_arl(dev, FAST_AGE_VLAN);
}
static void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)
{
struct b53_device *dev = ds_to_priv(ds);
unsigned int i;
u16 pvlan;
/* Enable the IMP port to be in the same VLAN as the other ports
* on a per-port basis such that we only have Port i and IMP in
* the same VLAN.
*/
b53_for_each_port(dev, i) {
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), &pvlan);
pvlan |= BIT(cpu_port);
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), pvlan);
}
}
static int b53_enable_port(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
struct b53_device *dev = ds_to_priv(ds);
unsigned int cpu_port = dev->cpu_port;
u16 pvlan;
/* Clear the Rx and Tx disable bits and set to no spanning tree */
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), 0);
/* Set this port, and only this one to be in the default VLAN,
* if member of a bridge, restore its membership prior to
* bringing down this port.
*/
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
pvlan &= ~0x1ff;
pvlan |= BIT(port);
pvlan |= dev->ports[port].vlan_ctl_mask;
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
b53_imp_vlan_setup(ds, cpu_port);
return 0;
}
static void b53_disable_port(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
struct b53_device *dev = ds_to_priv(ds);
u8 reg;
/* Disable Tx/Rx for the port */
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), ®);
reg |= <API key> | <API key>;
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), reg);
}
static void b53_enable_cpu_port(struct b53_device *dev)
{
unsigned int cpu_port = dev->cpu_port;
u8 port_ctrl;
/* BCM5325 CPU port is at 8 */
if ((is5325(dev) || is5365(dev)) && cpu_port == B53_CPU_PORT_25)
cpu_port = B53_CPU_PORT;
port_ctrl = <API key> |
<API key> |
<API key>;
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(cpu_port), port_ctrl);
}
static void b53_enable_mib(struct b53_device *dev)
{
u8 gc;
b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &gc);
gc &= ~(GC_RESET_MIB | GC_MIB_AC_EN);
b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc);
}
static int b53_configure_vlan(struct b53_device *dev)
{
struct b53_vlan vl = { 0 };
int i;
/* clear all vlan entries */
if (is5325(dev) || is5365(dev)) {
for (i = 1; i < dev->num_vlans; i++)
b53_set_vlan_entry(dev, i, &vl);
} else {
b53_do_vlan_op(dev, VTA_CMD_CLEAR);
}
b53_enable_vlan(dev, false);
b53_for_each_port(dev, i)
b53_write16(dev, B53_VLAN_PAGE,
<API key>(i), 1);
if (!is5325(dev) && !is5365(dev))
b53_set_jumbo(dev, dev->enable_jumbo, false);
return 0;
}
static void <API key>(struct b53_device *dev)
{
int gpio = dev->reset_gpio;
if (gpio < 0)
return;
/* Reset sequence: RESET low(50ms)->high(20ms)
*/
gpio_set_value(gpio, 0);
mdelay(50);
gpio_set_value(gpio, 1);
mdelay(20);
dev->current_page = 0xff;
}
static int b53_switch_reset(struct b53_device *dev)
{
u8 mgmt;
<API key>(dev);
if (is539x(dev)) {
b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x83);
b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x00);
}
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (!(mgmt & SM_SW_FWD_EN)) {
mgmt &= ~SM_SW_FWD_MODE;
mgmt |= SM_SW_FWD_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (!(mgmt & SM_SW_FWD_EN)) {
dev_err(dev->dev, "Failed to enable switch!\n");
return -EINVAL;
}
}
b53_enable_mib(dev);
return b53_flush_arl(dev, FAST_AGE_STATIC);
}
static int b53_phy_read16(struct dsa_switch *ds, int addr, int reg)
{
struct b53_device *priv = ds_to_priv(ds);
u16 value = 0;
int ret;
if (priv->ops->phy_read16)
ret = priv->ops->phy_read16(priv, addr, reg, &value);
else
ret = b53_read16(priv, B53_PORT_MII_PAGE(addr),
reg * 2, &value);
return ret ? ret : value;
}
static int b53_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val)
{
struct b53_device *priv = ds_to_priv(ds);
if (priv->ops->phy_write16)
return priv->ops->phy_write16(priv, addr, reg, val);
return b53_write16(priv, B53_PORT_MII_PAGE(addr), reg * 2, val);
}
static int b53_reset_switch(struct b53_device *priv)
{
/* reset vlans */
priv->enable_jumbo = false;
memset(priv->vlans, 0, sizeof(*priv->vlans) * priv->num_vlans);
memset(priv->ports, 0, sizeof(*priv->ports) * priv->num_ports);
return b53_switch_reset(priv);
}
static int b53_apply_config(struct b53_device *priv)
{
/* disable switching */
b53_set_forwarding(priv, 0);
b53_configure_vlan(priv);
/* enable switching */
b53_set_forwarding(priv, 1);
return 0;
}
static void b53_reset_mib(struct b53_device *priv)
{
u8 gc;
b53_read8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &gc);
b53_write8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc | GC_RESET_MIB);
msleep(1);
b53_write8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc & ~GC_RESET_MIB);
msleep(1);
}
static const struct b53_mib_desc *b53_get_mib(struct b53_device *dev)
{
if (is5365(dev))
return b53_mibs_65;
else if (is63xx(dev))
return b53_mibs_63xx;
else
return b53_mibs;
}
static unsigned int b53_get_mib_size(struct b53_device *dev)
{
if (is5365(dev))
return B53_MIBS_65_SIZE;
else if (is63xx(dev))
return B53_MIBS_63XX_SIZE;
else
return B53_MIBS_SIZE;
}
static void b53_get_strings(struct dsa_switch *ds, int port, uint8_t *data)
{
struct b53_device *dev = ds_to_priv(ds);
const struct b53_mib_desc *mibs = b53_get_mib(dev);
unsigned int mib_size = b53_get_mib_size(dev);
unsigned int i;
for (i = 0; i < mib_size; i++)
memcpy(data + i * ETH_GSTRING_LEN,
mibs[i].name, ETH_GSTRING_LEN);
}
static void <API key>(struct dsa_switch *ds, int port,
uint64_t *data)
{
struct b53_device *dev = ds_to_priv(ds);
const struct b53_mib_desc *mibs = b53_get_mib(dev);
unsigned int mib_size = b53_get_mib_size(dev);
const struct b53_mib_desc *s;
unsigned int i;
u64 val = 0;
if (is5365(dev) && port == 5)
port = 8;
mutex_lock(&dev->stats_mutex);
for (i = 0; i < mib_size; i++) {
s = &mibs[i];
if (s->size == 8) {
b53_read64(dev, B53_MIB_PAGE(port), s->offset, &val);
} else {
u32 val32;
b53_read32(dev, B53_MIB_PAGE(port), s->offset,
&val32);
val = val32;
}
data[i] = (u64)val;
}
mutex_unlock(&dev->stats_mutex);
}
static int b53_get_sset_count(struct dsa_switch *ds)
{
struct b53_device *dev = ds_to_priv(ds);
return b53_get_mib_size(dev);
}
static int b53_set_addr(struct dsa_switch *ds, u8 *addr)
{
return 0;
}
static int b53_setup(struct dsa_switch *ds)
{
struct b53_device *dev = ds_to_priv(ds);
unsigned int port;
int ret;
ret = b53_reset_switch(dev);
if (ret) {
dev_err(ds->dev, "failed to reset switch\n");
return ret;
}
b53_reset_mib(dev);
ret = b53_apply_config(dev);
if (ret)
dev_err(ds->dev, "failed to apply configuration\n");
for (port = 0; port < dev->num_ports; port++) {
if (BIT(port) & ds->enabled_port_mask)
b53_enable_port(ds, port, NULL);
else if (dsa_is_cpu_port(ds, port))
b53_enable_cpu_port(dev);
else
b53_disable_port(ds, port, NULL);
}
return ret;
}
static void b53_adjust_link(struct dsa_switch *ds, int port,
struct phy_device *phydev)
{
struct b53_device *dev = ds_to_priv(ds);
u8 rgmii_ctrl = 0, reg = 0, off;
if (!<API key>(phydev))
return;
/* Override the port settings */
if (port == dev->cpu_port) {
off = <API key>;
reg = PORT_OVERRIDE_EN;
} else {
off = <API key>(port);
reg = GMII_PO_EN;
}
/* Set the link UP */
if (phydev->link)
reg |= PORT_OVERRIDE_LINK;
if (phydev->duplex == DUPLEX_FULL)
reg |= <API key>;
switch (phydev->speed) {
case 2000:
reg |= <API key>;
/* fallthrough */
case SPEED_1000:
reg |= <API key>;
break;
case SPEED_100:
reg |= <API key>;
break;
case SPEED_10:
reg |= <API key>;
break;
default:
dev_err(ds->dev, "unknown speed: %d\n", phydev->speed);
return;
}
/* Enable flow control on BCM5301x's CPU port */
if (is5301x(dev) && port == dev->cpu_port)
reg |= <API key> | <API key>;
if (phydev->pause) {
if (phydev->asym_pause)
reg |= <API key>;
reg |= <API key>;
}
b53_write8(dev, B53_CTRL_PAGE, off, reg);
if (is531x5(dev) && <API key>(phydev)) {
if (port == 8)
off = B53_RGMII_CTRL_IMP;
else
off = B53_RGMII_CTRL_P(port);
/* Configure the port RGMII clock delay by DLL disabled and
* tx_clk aligned timing (restoring to reset defaults)
*/
b53_read8(dev, B53_CTRL_PAGE, off, &rgmii_ctrl);
rgmii_ctrl &= ~(RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC |
<API key>);
/* <API key> means TX internal delay, make
* sure that we enable the port TX clock internal delay to
* account for this internal delay that is inserted, otherwise
* the switch won't be able to receive correctly.
*
* <API key> means that we are not introducing
* any delay neither on transmission nor reception, so the
* BCM53125 must also be configured accordingly to account for
* the lack of delay and introduce
*
* The BCM53125 switch has its RX clock and TX clock control
* swapped, hence the reason why we modify the TX clock path in
* the "RGMII" case
*/
if (phydev->interface == <API key>)
rgmii_ctrl |= RGMII_CTRL_DLL_TXC;
if (phydev->interface == <API key>)
rgmii_ctrl |= RGMII_CTRL_DLL_TXC | RGMII_CTRL_DLL_RXC;
rgmii_ctrl |= <API key>;
b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
dev_info(ds->dev, "Configured port %d for %s\n", port,
phy_modes(phydev->interface));
}
/* configure MII port if necessary */
if (is5325(dev)) {
b53_read8(dev, B53_CTRL_PAGE, <API key>,
®);
/* reverse mii needs to be enabled */
if (!(reg & <API key>)) {
b53_write8(dev, B53_CTRL_PAGE, <API key>,
reg | <API key>);
b53_read8(dev, B53_CTRL_PAGE, <API key>,
®);
if (!(reg & <API key>)) {
dev_err(ds->dev,
"Failed to enable reverse MII mode\n");
return;
}
}
} else if (is5301x(dev)) {
if (port != dev->cpu_port) {
u8 po_reg = <API key>(dev->cpu_port);
u8 gmii_po;
b53_read8(dev, B53_CTRL_PAGE, po_reg, &gmii_po);
gmii_po |= GMII_PO_LINK |
GMII_PO_RX_FLOW |
GMII_PO_TX_FLOW |
GMII_PO_EN |
GMII_PO_SPEED_2000M;
b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
}
}
}
static int b53_vlan_filtering(struct dsa_switch *ds, int port,
bool vlan_filtering)
{
return 0;
}
static int b53_vlan_prepare(struct dsa_switch *ds, int port,
const struct <API key> *vlan,
struct switchdev_trans *trans)
{
struct b53_device *dev = ds_to_priv(ds);
if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0)
return -EOPNOTSUPP;
if (vlan->vid_end > dev->num_vlans)
return -ERANGE;
b53_enable_vlan(dev, true);
return 0;
}
static void b53_vlan_add(struct dsa_switch *ds, int port,
const struct <API key> *vlan,
struct switchdev_trans *trans)
{
struct b53_device *dev = ds_to_priv(ds);
bool untagged = vlan->flags & <API key>;
bool pvid = vlan->flags & <API key>;
unsigned int cpu_port = dev->cpu_port;
struct b53_vlan *vl;
u16 vid;
for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
vl = &dev->vlans[vid];
b53_get_vlan_entry(dev, vid, vl);
vl->members |= BIT(port) | BIT(cpu_port);
if (untagged)
vl->untag |= BIT(port);
else
vl->untag &= ~BIT(port);
vl->untag &= ~BIT(cpu_port);
b53_set_vlan_entry(dev, vid, vl);
b53_fast_age_vlan(dev, vid);
}
if (pvid) {
b53_write16(dev, B53_VLAN_PAGE, <API key>(port),
vlan->vid_end);
b53_fast_age_vlan(dev, vid);
}
}
static int b53_vlan_del(struct dsa_switch *ds, int port,
const struct <API key> *vlan)
{
struct b53_device *dev = ds_to_priv(ds);
bool untagged = vlan->flags & <API key>;
struct b53_vlan *vl;
u16 vid;
u16 pvid;
b53_read16(dev, B53_VLAN_PAGE, <API key>(port), &pvid);
for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
vl = &dev->vlans[vid];
b53_get_vlan_entry(dev, vid, vl);
vl->members &= ~BIT(port);
if (pvid == vid) {
if (is5325(dev) || is5365(dev))
pvid = 1;
else
pvid = 0;
}
if (untagged)
vl->untag &= ~(BIT(port));
b53_set_vlan_entry(dev, vid, vl);
b53_fast_age_vlan(dev, vid);
}
b53_write16(dev, B53_VLAN_PAGE, <API key>(port), pvid);
b53_fast_age_vlan(dev, pvid);
return 0;
}
static int b53_vlan_dump(struct dsa_switch *ds, int port,
struct <API key> *vlan,
int (*cb)(struct switchdev_obj *obj))
{
struct b53_device *dev = ds_to_priv(ds);
u16 vid, vid_start = 0, pvid;
struct b53_vlan *vl;
int err = 0;
if (is5325(dev) || is5365(dev))
vid_start = 1;
b53_read16(dev, B53_VLAN_PAGE, <API key>(port), &pvid);
/* Use our software cache for dumps, since we do not have any HW
* operation returning only the used/valid VLANs
*/
for (vid = vid_start; vid < dev->num_vlans; vid++) {
vl = &dev->vlans[vid];
if (!vl->valid)
continue;
if (!(vl->members & BIT(port)))
continue;
vlan->vid_begin = vlan->vid_end = vid;
vlan->flags = 0;
if (vl->untag & BIT(port))
vlan->flags |= <API key>;
if (pvid == vid)
vlan->flags |= <API key>;
err = cb(&vlan->obj);
if (err)
break;
}
return err;
}
/* Address Resolution Logic routines */
static int b53_arl_op_wait(struct b53_device *dev)
{
unsigned int timeout = 10;
u8 reg;
do {
b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, ®);
if (!(reg & ARLTBL_START_DONE))
return 0;
usleep_range(1000, 2000);
} while (timeout
dev_warn(dev->dev, "timeout waiting for ARL to finish: 0x%02x\n", reg);
return -ETIMEDOUT;
}
static int b53_arl_rw_op(struct b53_device *dev, unsigned int op)
{
u8 reg;
if (op > ARLTBL_RW)
return -EINVAL;
b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, ®);
reg |= ARLTBL_START_DONE;
if (op)
reg |= ARLTBL_RW;
else
reg &= ~ARLTBL_RW;
b53_write8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, reg);
return b53_arl_op_wait(dev);
}
static int b53_arl_read(struct b53_device *dev, u64 mac,
u16 vid, struct b53_arl_entry *ent, u8 *idx,
bool is_valid)
{
unsigned int i;
int ret;
ret = b53_arl_op_wait(dev);
if (ret)
return ret;
/* Read the bins */
for (i = 0; i < dev->num_arl_entries; i++) {
u64 mac_vid;
u32 fwd_entry;
b53_read64(dev, B53_ARLIO_PAGE,
<API key>(i), &mac_vid);
b53_read32(dev, B53_ARLIO_PAGE,
<API key>(i), &fwd_entry);
b53_arl_to_entry(ent, mac_vid, fwd_entry);
if (!(fwd_entry & ARLTBL_VALID))
continue;
if ((mac_vid & ARLTBL_MAC_MASK) != mac)
continue;
*idx = i;
}
return -ENOENT;
}
static int b53_arl_op(struct b53_device *dev, int op, int port,
const unsigned char *addr, u16 vid, bool is_valid)
{
struct b53_arl_entry ent;
u32 fwd_entry;
u64 mac, mac_vid = 0;
u8 idx = 0;
int ret;
/* Convert the array into a 64-bit MAC */
mac = b53_mac_to_u64(addr);
/* Perform a read for the given MAC and VID */
b53_write48(dev, B53_ARLIO_PAGE, B53_MAC_ADDR_IDX, mac);
b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid);
/* Issue a read operation for this MAC */
ret = b53_arl_rw_op(dev, 1);
if (ret)
return ret;
ret = b53_arl_read(dev, mac, vid, &ent, &idx, is_valid);
/* If this is a read, just finish now */
if (op)
return ret;
/* We could not find a matching MAC, so reset to a new entry */
if (ret) {
fwd_entry = 0;
idx = 1;
}
memset(&ent, 0, sizeof(ent));
ent.port = port;
ent.is_valid = is_valid;
ent.vid = vid;
ent.is_static = true;
memcpy(ent.mac, addr, ETH_ALEN);
b53_arl_from_entry(&mac_vid, &fwd_entry, &ent);
b53_write64(dev, B53_ARLIO_PAGE,
<API key>(idx), mac_vid);
b53_write32(dev, B53_ARLIO_PAGE,
<API key>(idx), fwd_entry);
return b53_arl_rw_op(dev, 0);
}
static int b53_fdb_prepare(struct dsa_switch *ds, int port,
const struct <API key> *fdb,
struct switchdev_trans *trans)
{
struct b53_device *priv = ds_to_priv(ds);
/* 5325 and 5365 require some more massaging, but could
* be supported eventually
*/
if (is5325(priv) || is5365(priv))
return -EOPNOTSUPP;
return 0;
}
static void b53_fdb_add(struct dsa_switch *ds, int port,
const struct <API key> *fdb,
struct switchdev_trans *trans)
{
struct b53_device *priv = ds_to_priv(ds);
if (b53_arl_op(priv, 0, port, fdb->addr, fdb->vid, true))
pr_err("%s: failed to add MAC address\n", __func__);
}
static int b53_fdb_del(struct dsa_switch *ds, int port,
const struct <API key> *fdb)
{
struct b53_device *priv = ds_to_priv(ds);
return b53_arl_op(priv, 0, port, fdb->addr, fdb->vid, false);
}
static int b53_arl_search_wait(struct b53_device *dev)
{
unsigned int timeout = 1000;
u8 reg;
do {
b53_read8(dev, B53_ARLIO_PAGE, B53_ARL_SRCH_CTL, ®);
if (!(reg & ARL_SRCH_STDN))
return 0;
if (reg & ARL_SRCH_VLID)
return 0;
usleep_range(1000, 2000);
} while (timeout
return -ETIMEDOUT;
}
static void b53_arl_search_rd(struct b53_device *dev, u8 idx,
struct b53_arl_entry *ent)
{
u64 mac_vid;
u32 fwd_entry;
b53_read64(dev, B53_ARLIO_PAGE,
<API key>(idx), &mac_vid);
b53_read32(dev, B53_ARLIO_PAGE,
B53_ARL_SRCH_RSTL(idx), &fwd_entry);
b53_arl_to_entry(ent, mac_vid, fwd_entry);
}
static int b53_fdb_copy(struct net_device *dev, int port,
const struct b53_arl_entry *ent,
struct <API key> *fdb,
int (*cb)(struct switchdev_obj *obj))
{
if (!ent->is_valid)
return 0;
if (port != ent->port)
return 0;
ether_addr_copy(fdb->addr, ent->mac);
fdb->vid = ent->vid;
fdb->ndm_state = ent->is_static ? NUD_NOARP : NUD_REACHABLE;
return cb(&fdb->obj);
}
static int b53_fdb_dump(struct dsa_switch *ds, int port,
struct <API key> *fdb,
int (*cb)(struct switchdev_obj *obj))
{
struct b53_device *priv = ds_to_priv(ds);
struct net_device *dev = ds->ports[port].netdev;
struct b53_arl_entry results[2];
unsigned int count = 0;
int ret;
u8 reg;
/* Start search operation */
reg = ARL_SRCH_STDN;
b53_write8(priv, B53_ARLIO_PAGE, B53_ARL_SRCH_CTL, reg);
do {
ret = b53_arl_search_wait(priv);
if (ret)
return ret;
b53_arl_search_rd(priv, 0, &results[0]);
ret = b53_fdb_copy(dev, port, &results[0], fdb, cb);
if (ret)
return ret;
if (priv->num_arl_entries > 2) {
b53_arl_search_rd(priv, 1, &results[1]);
ret = b53_fdb_copy(dev, port, &results[1], fdb, cb);
if (ret)
return ret;
if (!results[0].is_valid && !results[1].is_valid)
break;
}
} while (count++ < 1024);
return 0;
}
static int b53_br_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
struct b53_device *dev = ds_to_priv(ds);
u16 pvlan, reg;
unsigned int i;
dev->ports[port].bridge_dev = bridge;
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
b53_for_each_port(dev, i) {
if (dev->ports[i].bridge_dev != bridge)
continue;
/* Add this local port to the remote port VLAN control
* membership and update the remote port bitmask
*/
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), ®);
reg |= BIT(port);
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), reg);
dev->ports[i].vlan_ctl_mask = reg;
pvlan |= BIT(i);
}
/* Configure the local port VLAN control membership to include
* remote ports and update the local port bitmask
*/
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
dev->ports[port].vlan_ctl_mask = pvlan;
return 0;
}
static void b53_br_leave(struct dsa_switch *ds, int port)
{
struct b53_device *dev = ds_to_priv(ds);
struct net_device *bridge = dev->ports[port].bridge_dev;
struct b53_vlan *vl = &dev->vlans[0];
unsigned int i;
u16 pvlan, reg, pvid;
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan);
b53_for_each_port(dev, i) {
/* Don't touch the remaining ports */
if (dev->ports[i].bridge_dev != bridge)
continue;
b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), ®);
reg &= ~BIT(port);
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i), reg);
dev->ports[port].vlan_ctl_mask = reg;
/* Prevent self removal to preserve isolation */
if (port != i)
pvlan &= ~BIT(i);
}
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
dev->ports[port].vlan_ctl_mask = pvlan;
dev->ports[port].bridge_dev = NULL;
if (is5325(dev) || is5365(dev))
pvid = 1;
else
pvid = 0;
b53_get_vlan_entry(dev, pvid, vl);
vl->members |= BIT(port) | BIT(dev->cpu_port);
vl->untag |= BIT(port) | BIT(dev->cpu_port);
b53_set_vlan_entry(dev, pvid, vl);
}
static void <API key>(struct dsa_switch *ds, int port,
u8 state)
{
struct b53_device *dev = ds_to_priv(ds);
u8 hw_state, cur_hw_state;
u8 reg;
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), ®);
cur_hw_state = reg & <API key>;
switch (state) {
case BR_STATE_DISABLED:
hw_state = PORT_CTRL_DIS_STATE;
break;
case BR_STATE_LISTENING:
hw_state = <API key>;
break;
case BR_STATE_LEARNING:
hw_state = <API key>;
break;
case BR_STATE_FORWARDING:
hw_state = PORT_CTRL_FWD_STATE;
break;
case BR_STATE_BLOCKING:
hw_state = <API key>;
break;
default:
dev_err(ds->dev, "invalid STP state: %d\n", state);
return;
}
/* Fast-age ARL entries if we are moving a port from Learning or
* Forwarding (cur_hw_state) state to Disabled, Blocking or Listening
* state (hw_state)
*/
if (cur_hw_state != hw_state) {
if (cur_hw_state >= <API key> &&
hw_state <= <API key>) {
if (b53_fast_age_port(dev, port)) {
dev_err(ds->dev, "fast ageing failed\n");
return;
}
}
}
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), ®);
reg &= ~<API key>;
reg |= hw_state;
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), reg);
}
static struct dsa_switch_driver b53_switch_ops = {
.tag_protocol = DSA_TAG_PROTO_NONE,
.setup = b53_setup,
.set_addr = b53_set_addr,
.get_strings = b53_get_strings,
.get_ethtool_stats = <API key>,
.get_sset_count = b53_get_sset_count,
.phy_read = b53_phy_read16,
.phy_write = b53_phy_write16,
.adjust_link = b53_adjust_link,
.port_enable = b53_enable_port,
.port_disable = b53_disable_port,
.port_bridge_join = b53_br_join,
.port_bridge_leave = b53_br_leave,
.port_stp_state_set = <API key>,
.port_vlan_filtering = b53_vlan_filtering,
.port_vlan_prepare = b53_vlan_prepare,
.port_vlan_add = b53_vlan_add,
.port_vlan_del = b53_vlan_del,
.port_vlan_dump = b53_vlan_dump,
.port_fdb_prepare = b53_fdb_prepare,
.port_fdb_dump = b53_fdb_dump,
.port_fdb_add = b53_fdb_add,
.port_fdb_del = b53_fdb_del,
};
struct b53_chip_data {
u32 chip_id;
const char *dev_name;
u16 vlans;
u16 enabled_ports;
u8 cpu_port;
u8 vta_regs[3];
u8 arl_entries;
u8 duplex_reg;
u8 jumbo_pm_reg;
u8 jumbo_size_reg;
};
#define B53_VTA_REGS \
{ B53_VT_ACCESS, B53_VT_INDEX, B53_VT_ENTRY }
#define B53_VTA_REGS_9798 \
{ B53_VT_ACCESS_9798, B53_VT_INDEX_9798, B53_VT_ENTRY_9798 }
#define B53_VTA_REGS_63XX \
{ B53_VT_ACCESS_63XX, B53_VT_INDEX_63XX, B53_VT_ENTRY_63XX }
static const struct b53_chip_data b53_switch_chips[] = {
{
.chip_id = BCM5325_DEVICE_ID,
.dev_name = "BCM5325",
.vlans = 16,
.enabled_ports = 0x1f,
.arl_entries = 2,
.cpu_port = B53_CPU_PORT_25,
.duplex_reg = B53_DUPLEX_STAT_FE,
},
{
.chip_id = BCM5365_DEVICE_ID,
.dev_name = "BCM5365",
.vlans = 256,
.enabled_ports = 0x1f,
.arl_entries = 2,
.cpu_port = B53_CPU_PORT_25,
.duplex_reg = B53_DUPLEX_STAT_FE,
},
{
.chip_id = BCM5395_DEVICE_ID,
.dev_name = "BCM5395",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM5397_DEVICE_ID,
.dev_name = "BCM5397",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_9798,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM5398_DEVICE_ID,
.dev_name = "BCM5398",
.vlans = 4096,
.enabled_ports = 0x7f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_9798,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53115_DEVICE_ID,
.dev_name = "BCM53115",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.vta_regs = B53_VTA_REGS,
.cpu_port = B53_CPU_PORT,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53125_DEVICE_ID,
.dev_name = "BCM53125",
.vlans = 4096,
.enabled_ports = 0xff,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53128_DEVICE_ID,
.dev_name = "BCM53128",
.vlans = 4096,
.enabled_ports = 0x1ff,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM63XX_DEVICE_ID,
.dev_name = "BCM63xx",
.vlans = 4096,
.enabled_ports = 0, /* pdata must provide them */
.arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_63XX,
.duplex_reg = <API key>,
.jumbo_pm_reg = <API key>,
.jumbo_size_reg = <API key>,
},
{
.chip_id = BCM53010_DEVICE_ID,
.dev_name = "BCM53010",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53011_DEVICE_ID,
.dev_name = "BCM53011",
.vlans = 4096,
.enabled_ports = 0x1bf,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53012_DEVICE_ID,
.dev_name = "BCM53012",
.vlans = 4096,
.enabled_ports = 0x1bf,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53018_DEVICE_ID,
.dev_name = "BCM53018",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM53019_DEVICE_ID,
.dev_name = "BCM53019",
.vlans = 4096,
.enabled_ports = 0x1f,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
.chip_id = BCM58XX_DEVICE_ID,
.dev_name = "BCM585xx/586xx/88312",
.vlans = 4096,
.enabled_ports = 0x1ff,
.arl_entries = 4,
.cpu_port = B53_CPU_PORT_25,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
};
static int b53_switch_init(struct b53_device *dev)
{
struct dsa_switch *ds = dev->ds;
unsigned int i;
int ret;
for (i = 0; i < ARRAY_SIZE(b53_switch_chips); i++) {
const struct b53_chip_data *chip = &b53_switch_chips[i];
if (chip->chip_id == dev->chip_id) {
if (!dev->enabled_ports)
dev->enabled_ports = chip->enabled_ports;
dev->name = chip->dev_name;
dev->duplex_reg = chip->duplex_reg;
dev->vta_regs[0] = chip->vta_regs[0];
dev->vta_regs[1] = chip->vta_regs[1];
dev->vta_regs[2] = chip->vta_regs[2];
dev->jumbo_pm_reg = chip->jumbo_pm_reg;
ds->drv = &b53_switch_ops;
dev->cpu_port = chip->cpu_port;
dev->num_vlans = chip->vlans;
dev->num_arl_entries = chip->arl_entries;
break;
}
}
/* check which BCM5325x version we have */
if (is5325(dev)) {
u8 vc4;
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, &vc4);
/* check reserved bits */
switch (vc4 & 3) {
case 1:
/* BCM5325E */
break;
case 3:
/* BCM5325F - do not use port 4 */
dev->enabled_ports &= ~BIT(4);
break;
default:
/* On the BCM47XX SoCs this is the supported internal switch.*/
#ifndef CONFIG_BCM47XX
/* BCM5325M */
return -EINVAL;
#else
break;
#endif
}
} else if (dev->chip_id == BCM53115_DEVICE_ID) {
u64 strap_value;
b53_read48(dev, B53_STAT_PAGE, B53_STRAP_VALUE, &strap_value);
/* use second IMP port if GMII is enabled */
if (strap_value & SV_GMII_CTRL_115)
dev->cpu_port = 5;
}
/* cpu port is always last */
dev->num_ports = dev->cpu_port + 1;
dev->enabled_ports |= BIT(dev->cpu_port);
dev->ports = devm_kzalloc(dev->dev,
sizeof(struct b53_port) * dev->num_ports,
GFP_KERNEL);
if (!dev->ports)
return -ENOMEM;
dev->vlans = devm_kzalloc(dev->dev,
sizeof(struct b53_vlan) * dev->num_vlans,
GFP_KERNEL);
if (!dev->vlans)
return -ENOMEM;
dev->reset_gpio = <API key>(dev);
if (dev->reset_gpio >= 0) {
ret = <API key>(dev->dev, dev->reset_gpio,
GPIOF_OUT_INIT_HIGH, "robo_reset");
if (ret)
return ret;
}
return 0;
}
struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
void *priv)
{
struct dsa_switch *ds;
struct b53_device *dev;
ds = devm_kzalloc(base, sizeof(*ds) + sizeof(*dev), GFP_KERNEL);
if (!ds)
return NULL;
dev = (struct b53_device *)(ds + 1);
ds->priv = dev;
ds->dev = base;
dev->dev = base;
dev->ds = ds;
dev->priv = priv;
dev->ops = ops;
mutex_init(&dev->reg_mutex);
mutex_init(&dev->stats_mutex);
return dev;
}
EXPORT_SYMBOL(b53_switch_alloc);
int b53_switch_detect(struct b53_device *dev)
{
u32 id32;
u16 tmp;
u8 id8;
int ret;
ret = b53_read8(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id8);
if (ret)
return ret;
switch (id8) {
case 0:
/* BCM5325 and BCM5365 do not have this register so reads
* return 0. But the read operation did succeed, so assume this
* is one of them.
*
* Next check if we can write to the 5325's VTA register; for
* 5365 it is read only.
*/
b53_write16(dev, B53_VLAN_PAGE, <API key>, 0xf);
b53_read16(dev, B53_VLAN_PAGE, <API key>, &tmp);
if (tmp == 0xf)
dev->chip_id = BCM5325_DEVICE_ID;
else
dev->chip_id = BCM5365_DEVICE_ID;
break;
case BCM5395_DEVICE_ID:
case BCM5397_DEVICE_ID:
case BCM5398_DEVICE_ID:
dev->chip_id = id8;
break;
default:
ret = b53_read32(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id32);
if (ret)
return ret;
switch (id32) {
case BCM53115_DEVICE_ID:
case BCM53125_DEVICE_ID:
case BCM53128_DEVICE_ID:
case BCM53010_DEVICE_ID:
case BCM53011_DEVICE_ID:
case BCM53012_DEVICE_ID:
case BCM53018_DEVICE_ID:
case BCM53019_DEVICE_ID:
dev->chip_id = id32;
break;
default:
pr_err("unsupported switch detected (BCM53%02x/BCM%x)\n",
id8, id32);
return -ENODEV;
}
}
if (dev->chip_id == BCM5325_DEVICE_ID)
return b53_read8(dev, B53_STAT_PAGE, B53_REV_ID_25,
&dev->core_rev);
else
return b53_read8(dev, B53_MGMT_PAGE, B53_REV_ID,
&dev->core_rev);
}
EXPORT_SYMBOL(b53_switch_detect);
int b53_switch_register(struct b53_device *dev)
{
int ret;
if (dev->pdata) {
dev->chip_id = dev->pdata->chip_id;
dev->enabled_ports = dev->pdata->enabled_ports;
}
if (!dev->chip_id && b53_switch_detect(dev))
return -EINVAL;
ret = b53_switch_init(dev);
if (ret)
return ret;
pr_info("found switch: %s, rev %i\n", dev->name, dev->core_rev);
return dsa_register_switch(dev->ds, dev->ds->dev->of_node);
}
EXPORT_SYMBOL(b53_switch_register);
MODULE_AUTHOR("Jonas Gorski <jogo@openwrt.org>");
MODULE_DESCRIPTION("B53 switch library");
MODULE_LICENSE("Dual BSD/GPL");
|
#ifndef __ASM_POSIX_TYPES_H
#define __ASM_POSIX_TYPES_H
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
#define __kernel_old_uid_t __kernel_old_uid_t
#ifdef __ILP32__
typedef long long __kernel_long_t;
typedef unsigned long long __kernel_ulong_t;
#define __kernel_long_t __kernel_long_t
#endif
#include <asm-generic/posix_types.h>
#endif /* __ASM_POSIX_TYPES_H */
|
<html lang="en">
<head>
<title>Incompatibilities - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Trouble.html#Trouble" title="Trouble">
<link rel="prev" href="Interoperation.html#Interoperation" title="Interoperation">
<link rel="next" href="Fixed-Headers.html#Fixed-Headers" title="Fixed Headers">
<link href="http:
<!
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Incompatibilities"></a>
<p>
Next: <a rel="next" accesskey="n" href="Fixed-Headers.html#Fixed-Headers">Fixed Headers</a>,
Previous: <a rel="previous" accesskey="p" href="Interoperation.html#Interoperation">Interoperation</a>,
Up: <a rel="up" accesskey="u" href="Trouble.html#Trouble">Trouble</a>
<hr>
</div>
<h3 class="section">10.4 Incompatibilities of GCC</h3>
<p><a name="<API key>"></a><a name="<API key>"></a>
There are several noteworthy incompatibilities between GNU C and K&R
(non-ISO) versions of C.
<a name="<API key>"></a>
<a name="<API key>"></a>
<a name="<API key>"></a>
<ul><li>GCC normally makes string constants read-only. If several
identical-looking string constants are used, GCC stores only one
copy of the string.
<p><a name="<API key>"></a>One consequence is that you cannot call <code>mktemp</code> with a string
constant argument. The function <code>mktemp</code> always alters the
string its argument points to.
<p><a name="<API key>"></a><a name="<API key>"></a><a name="<API key>"></a>Another consequence is that <code>sscanf</code> does not work on some very
old systems when passed a string constant as its format control string
or input. This is because <code>sscanf</code> incorrectly tries to write
into the string constant. Likewise <code>fscanf</code> and <code>scanf</code>.
<p>The solution to these problems is to change the program to use
<code>char</code>-array variables with initialization strings for these
purposes instead of string constants.
<li><code>-2147483648</code> is positive.
<p>This is because 2147483648 cannot fit in the type <code>int</code>, so
(following the ISO C rules) its data type is <code>unsigned long int</code>.
Negating this value yields 2147483648 again.
<li>GCC does not substitute macro arguments when they appear inside of
string constants. For example, the following macro in GCC
<pre class="smallexample"> #define foo(a) "a"
</pre>
<p class="noindent">will produce output <code>"a"</code> regardless of what the argument <var>a</var> is.
<p><a name="<API key>"></a><a name="<API key>"></a><li>When you use <code>setjmp</code> and <code>longjmp</code>, the only automatic
variables guaranteed to remain valid are those declared
<code>volatile</code>. This is a consequence of automatic register
allocation. Consider this function:
<pre class="smallexample"> jmp_buf j;
foo ()
{
int a, b;
a = fun1 ();
if (setjmp (j))
return a;
a = fun2 ();
/* <code>longjmp (j)</code><span class="roman"> may occur in </span><code>fun3</code><span class="roman">.</span> */
return a + fun3 ();
}
</pre>
<p>Here <code>a</code> may or may not be restored to its first value when the
<code>longjmp</code> occurs. If <code>a</code> is allocated in a register, then
its first value is restored; otherwise, it keeps the last value stored
in it.
<p><a name="index-W-3029"></a>If you use the <samp><span class="option">-W</span></samp> option with the <samp><span class="option">-O</span></samp> option, you will
get a warning when GCC thinks such a problem might be possible.
<li>Programs that use preprocessing directives in the middle of macro
arguments do not work with GCC. For example, a program like this
will not work:
<pre class="smallexample"> foobar (
#define luser
hack)
</pre>
<p>ISO C does not permit such a construct.
<li>K&R compilers allow comments to cross over an inclusion boundary
(i.e. started in an include file and ended in the including file).
<p><a name="<API key>"></a><a name="<API key>"></a><a name="<API key>"></a><li>Declarations of external variables and functions within a block apply
only to the block containing the declaration. In other words, they
have the same scope as any other declaration in the same place.
<p>In some other C compilers, a <code>extern</code> declaration affects all the
rest of the file even if it happens within a block.
<li>In traditional C, you can combine <code>long</code>, etc., with a typedef name,
as shown here:
<pre class="smallexample"> typedef int foo;
typedef long foo bar;
</pre>
<p>In ISO C, this is not allowed: <code>long</code> and other type modifiers
require an explicit <code>int</code>.
<p><a name="<API key>"></a><li>PCC allows typedef names to be used as function parameters.
<li>Traditional C allows the following erroneous pair of declarations to
appear together in a given scope:
<pre class="smallexample"> typedef int foo;
typedef foo foo;
</pre>
<li>GCC treats all characters of identifiers as significant. According to
K&R-1 (2.2), “No more than the first eight characters are significant,
although more may be used.”. Also according to K&R-1 (2.2), “An
identifier is a sequence of letters and digits; the first character must
be a letter. The underscore _ counts as a letter.”, but GCC also
allows dollar signs in identifiers.
<p><a name="<API key>"></a><li>PCC allows whitespace in the middle of compound assignment operators
such as ‘<samp><span class="samp">+=</span></samp>’. GCC, following the ISO standard, does not
allow this.
<p><a name="<API key>"></a><a name="index-g_t_0027-3036"></a><li>GCC complains about unterminated character constants inside of
preprocessing conditionals that fail. Some programs have English
comments enclosed in conditionals that are guaranteed to fail; if these
comments contain apostrophes, GCC will probably report an error. For
example, this code would produce an error:
<pre class="smallexample"> #if 0
You can't expect this to work.
#endif
</pre>
<p>The best solution to such a problem is to put the text into an actual
C comment delimited by ‘<samp><span class="samp"></span></samp>’.
<li>Many user programs contain the declaration ‘<samp><span class="samp">long time ();</span></samp>’. In the
past, the system header files on many systems did not actually declare
<code>time</code>, so it did not matter what type your program declared it to
return. But in systems with ISO C headers, <code>time</code> is declared to
return <code>time_t</code>, and if that is not the same as <code>long</code>, then
‘<samp><span class="samp">long time ();</span></samp>’ is erroneous.
<p>The solution is to change your program to use appropriate system headers
(<code><time.h></code> on systems with ISO C headers) and not to declare
<code>time</code> if the system header files declare it, or failing that to
use <code>time_t</code> as the return type of <code>time</code>.
<p><a name="<API key>"></a><li>When compiling functions that return <code>float</code>, PCC converts it to
a double. GCC actually returns a <code>float</code>. If you are concerned
with PCC compatibility, you should declare your functions to return
<code>double</code>; you might as well say what you mean.
<p><a name="<API key>"></a><a name="index-unions-3039"></a><li>When compiling functions that return structures or unions, GCC
output code normally uses a method different from that used on most
versions of Unix. As a result, code compiled with GCC cannot call
a structure-returning function compiled with PCC, and vice versa.
<p>The method used by GCC is as follows: a structure or union which is
1, 2, 4 or 8 bytes long is returned like a scalar. A structure or union
with any other size is stored into an address supplied by the caller
(usually in a special, fixed register, but on some machines it is passed
on the stack). The target hook <code><API key></code>
tells GCC where to pass this address.
<p>By contrast, PCC on most target machines returns structures and unions
of any size by copying the data into an area of static storage, and then
returning the address of that storage as if it were a pointer value.
The caller must copy the data from that memory area to the place where
the value is wanted. GCC does not use this method because it is
slower and nonreentrant.
<p>On some newer machines, PCC uses a reentrant convention for all
structure and union returning. GCC on most of these machines uses a
compatible convention when returning structures and unions in memory,
but still returns small structures and unions in registers.
<p><a name="<API key>"></a>You can tell GCC to use a compatible convention for all structure and
union returning with the option <samp><span class="option">-fpcc-struct-return</span></samp>.
<p><a name="<API key>"></a><a name="<API key>"></a><li>GCC complains about program fragments such as ‘<samp><span class="samp">0x74ae-0x4000</span></samp>’
which appear to be two hexadecimal constants separated by the minus
operator. Actually, this string is a single <dfn>preprocessing token</dfn>.
Each such token must correspond to one token in C. Since this does not,
GCC prints an error message. Although it may appear obvious that what
is meant is an operator and two values, the ISO C standard specifically
requires that this be treated as erroneous.
<p>A <dfn>preprocessing token</dfn> is a <dfn>preprocessing number</dfn> if it
begins with a digit and is followed by letters, underscores, digits,
periods and ‘<samp><span class="samp">e+</span></samp>’, ‘<samp><span class="samp">e-</span></samp>’, ‘<samp><span class="samp">E+</span></samp>’, ‘<samp><span class="samp">E-</span></samp>’, ‘<samp><span class="samp">p+</span></samp>’,
‘<samp><span class="samp">p-</span></samp>’, ‘<samp><span class="samp">P+</span></samp>’, or ‘<samp><span class="samp">P-</span></samp>’ character sequences. (In strict C89
mode, the sequences ‘<samp><span class="samp">p+</span></samp>’, ‘<samp><span class="samp">p-</span></samp>’, ‘<samp><span class="samp">P+</span></samp>’ and ‘<samp><span class="samp">P-</span></samp>’ cannot
appear in preprocessing numbers.)
<p>To make the above program fragment valid, place whitespace in front of
the minus sign. This whitespace will end the preprocessing number.
</ul>
</body></html>
|
#include "trp_client.hpp"
#include "TransporterFacade.hpp"
#include <NdbMem.h>
trp_client::trp_client()
: m_blockNo(~Uint32(0)), m_facade(0)
{
m_mutex = NdbMutex_Create();
m_locked_for_poll = false;
m_send_nodes_cnt = 0;
m_send_buffers = new TFBuffer[MAX_NODES];
}
trp_client::~trp_client()
{
/**
* require that trp_client user
* doesnt destroy object when holding any locks
*/
m_poll.assert_destroy();
close();
<API key>(m_poll.m_condition);
m_poll.m_condition = NULL;
NdbMutex_Destroy(m_mutex);
m_mutex = NULL;
assert(m_send_nodes_cnt == 0);
assert(m_locked_for_poll == false);
delete [] m_send_buffers;
}
Uint32
trp_client::open(TransporterFacade* tf, int blockNo,
bool receive_thread)
{
Uint32 res = 0;
assert(m_facade == 0);
if (m_facade == 0)
{
m_facade = tf;
/**
For user threads we only store up to 16 threads before waking
them up, for receiver threads we store up to 256 threads before
waking them up.
*/
if (receive_thread)
{
m_poll.m_lock_array_size = 256;
}
else
{
m_poll.m_lock_array_size = 16;
}
m_poll.m_locked_clients = (trp_client**)
NdbMem_Allocate(sizeof(trp_client**) * m_poll.m_lock_array_size);
if (m_poll.m_locked_clients == NULL)
{
return 0;
}
res = tf->open_clnt(this, blockNo);
if (res != 0)
{
m_blockNo = refToBlock(res);
}
else
{
NdbMem_Free(m_poll.m_locked_clients);
m_poll.m_locked_clients = NULL;
m_facade = 0;
}
}
return res;
}
Uint32
trp_client::getOwnNodeId() const
{
return m_facade->theOwnId;
}
void
trp_client::close()
{
if (m_facade)
{
m_facade->close_clnt(this);
m_facade = 0;
m_blockNo = ~Uint32(0);
if (m_poll.m_locked_clients)
{
NdbMem_Free(m_poll.m_locked_clients);
m_poll.m_locked_clients = NULL;
}
}
}
void
trp_client::start_poll()
{
NdbMutex_Lock(m_mutex);
assert(m_poll.m_locked == false);
m_poll.m_locked = true;
m_facade->start_poll(this);
}
void
trp_client::do_poll(Uint32 to)
{
m_facade->do_poll(this, to);
}
void
trp_client::complete_poll()
{
assert(m_poll.m_locked == true);
m_facade->complete_poll(this);
m_poll.m_locked = false;
NdbMutex_Unlock(m_mutex);
}
int
trp_client::do_forceSend(int val)
{
/**
* since force send is disabled in this "version"
* set forceSend=1 always...
*/
val = 1;
if (val == 0)
{
flush_send_buffers();
return 0;
}
else if (val == 1)
{
for (Uint32 i = 0; i < m_send_nodes_cnt; i++)
{
Uint32 n = m_send_nodes_list[i];
TFBuffer* b = m_send_buffers + n;
TFBufferGuard g0(* b);
m_facade-><API key>(n, b);
b->clear();
}
m_send_nodes_cnt = 0;
m_send_nodes_mask.clear();
return 1;
}
return 0;
}
int
trp_client::<API key>(const NdbApiSignal* signal, Uint32 nodeId)
{
return m_facade->m_poll_owner->raw_sendSignal(signal, nodeId);
}
int
trp_client::safe_sendSignal(const NdbApiSignal* signal, Uint32 nodeId)
{
int res;
if ((res = <API key>(signal, nodeId)) != -1)
{
m_facade->m_poll_owner->flush_send_buffers();
}
return res;
}
Uint32 *
trp_client::getWritePtr(NodeId node, Uint32 lenBytes, Uint32 prio,
Uint32 max_use)
{
TFBuffer* b = m_send_buffers+node;
TFBufferGuard g0(* b);
bool found = m_send_nodes_mask.get(node);
if (likely(found))
{
TFPage * page = b->m_tail;
assert(page != 0);
if (page->m_bytes + page->m_start + lenBytes <= page->max_data_bytes())
{
return (Uint32 *)(page->m_data + page->m_start + page->m_bytes);
}
}
else
{
Uint32 cnt = m_send_nodes_cnt;
m_send_nodes_mask.set(node);
m_send_nodes_list[cnt] = node;
m_send_nodes_cnt = cnt + 1;
}
TFPage* page = m_facade->alloc_sb_page();
if (likely(page != 0))
{
page->init();
if (b->m_tail == NULL)
{
assert(!found);
b->m_head = page;
b->m_tail = page;
}
else
{
assert(found);
assert(b->m_head != NULL);
b->m_tail->m_next = page;
b->m_tail = page;
}
return (Uint32 *)(page->m_data);
}
if (b->m_tail == 0)
{
assert(!found);
m_send_nodes_mask.clear(node);
m_send_nodes_cnt
}
else
{
assert(found);
}
return NULL;
}
/**
* This is the implementation used by the NDB API. I update the
* current send buffer size every time a thread gets the send mutex and
* links their buffers to the common pool of buffers. I recalculate the
* buffer size also every time a send to the node has been completed.
*
* The values we read here are read unprotected, the idea is that the
* value reported from here should only used for guidance. So it should
* only implement throttling, it should not completely stop send activities,
* merely delay it. So the harm in getting an inconsistent view of data
* should not be high. Also we expect measures of slowing down to occur
* at a fairly early stage, so not close to when the buffers are filling up.
*/
void
trp_client::getSendBufferLevel(NodeId node, SB_LevelType &level)
{
Uint32 <API key> = m_facade-><API key>(node);
Uint64 <API key> =
m_facade->m_send_buffer.<API key>();
Uint64 <API key> =
m_facade->m_send_buffer.<API key>();
<API key>(<API key>,
<API key>,
<API key>,
0,
level);
return;
}
Uint32
trp_client::updateWritePtr(NodeId node, Uint32 lenBytes, Uint32 prio)
{
TFBuffer* b = m_send_buffers+node;
TFBufferGuard g0(* b);
assert(m_send_nodes_mask.get(node));
assert(b->m_head != 0);
assert(b->m_tail != 0);
TFPage *page = b->m_tail;
assert(page->m_bytes + lenBytes <= page->max_data_bytes());
page->m_bytes += lenBytes;
b->m_bytes_in_buffer += lenBytes;
return b->m_bytes_in_buffer;
}
void
trp_client::flush_send_buffers()
{
assert(m_poll.m_locked);
Uint32 cnt = m_send_nodes_cnt;
for (Uint32 i = 0; i<cnt; i++)
{
Uint32 node = m_send_nodes_list[i];
assert(m_send_nodes_mask.get(node));
TFBuffer* b = m_send_buffers + node;
TFBufferGuard g0(* b);
m_facade->flush_send_buffer(node, b);
b->clear();
}
m_send_nodes_cnt = 0;
m_send_nodes_mask.clear();
}
bool
trp_client::forceSend(NodeId node)
{
do_forceSend();
return true;
}
#include "NdbImpl.hpp"
PollGuard::PollGuard(NdbImpl& impl)
{
m_clnt = &impl;
m_waiter= &impl.theWaiter;
m_clnt->start_poll();
<API key> = false;
}
/*
This is a common routine for possibly forcing the send of buffered signals
and receiving response the thread is waiting for. It is designed to be
useful from:
1) PK, UK lookups using the asynchronous interface
This routine uses the wait_for_input routine instead since it has
special end conditions due to the asynchronous nature of its usage.
2) Scans
3) dictSignal
It uses a NdbWaiter object to wait on the events and this object is
linked into the conditional wait queue. Thus this object contains
a reference to its place in the queue.
It replaces the method receiveResponse previously used on the Ndb object
*/
int PollGuard::wait_n_unlock(int wait_time, Uint32 nodeId, Uint32 state,
bool forceSend)
{
int ret_val;
m_waiter->set_node(nodeId);
m_waiter->set_state(state);
ret_val= <API key>(wait_time, forceSend);
unlock_and_signal();
return ret_val;
}
int PollGuard::wait_scan(int wait_time, Uint32 nodeId, bool forceSend)
{
m_waiter->set_node(nodeId);
m_waiter->set_state(WAIT_SCAN);
return <API key>(wait_time, forceSend);
}
int PollGuard::<API key>(int wait_time, bool forceSend)
{
int ret_val;
m_clnt->do_forceSend(forceSend ? 1 : 0);
NDB_TICKS curr_ticks = <API key>();
/* Use nanosecond to calculate when wait_time has expired. */
Int64 remain_wait_nano = ((Int64)wait_time) * 1000000;
const int maxsleep = (wait_time == -1 || wait_time > 10) ? 10 : wait_time;
do
{
wait_for_input(maxsleep);
const NDB_TICKS start_ticks = curr_ticks;
curr_ticks = <API key>();
const Uint64 waited_nano = NdbTick_Elapsed(start_ticks,curr_ticks).nanoSec();
m_clnt->recordWaitTimeNanos(waited_nano);
Uint32 state= m_waiter->get_state();
if (state == NO_WAIT)
{
return 0;
}
else if (state == WAIT_NODE_FAILURE)
{
ret_val= -2;
m_waiter->set_state(NO_WAIT);
break;
}
if (wait_time == -1)
{
#ifdef NOT_USED
ndbout << "Waited <API key>, continuing wait" << endl;
#endif
continue;
}
remain_wait_nano -= waited_nano;
if (remain_wait_nano <= 0)
{
#ifdef VM_TRACE
ndbout << "Time-out state is " << m_waiter->get_state() << endl;
#endif
m_waiter->set_state(WST_WAIT_TIMEOUT);
ret_val= -1;
break;
}
/**
* Ensure any signals sent by receivers are sent by send thread
* eventually by flushing buffers to global area.
*/
m_clnt->flush_send_buffers();
} while (1);
#ifdef VM_TRACE
ndbout << "ERR: receiveResponse - theImpl->theWaiter.m_state = ";
ndbout << m_waiter->get_state() << endl;
#endif
return ret_val;
}
void PollGuard::wait_for_input(int wait_time)
{
m_clnt->do_poll(wait_time);
}
void PollGuard::unlock_and_signal()
{
if (!<API key>)
{
m_clnt->complete_poll();
<API key> = true;
}
}
|
#include "qglrenderer.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(<API key>)
#error "The header file 'qglrenderer.h' doesn't include <QObject>."
#elif <API key> != 67
#error "This file was generated using the moc from 5.2.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
<API key>
struct <API key> {
QByteArrayData data[4];
char stringdata[38];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
<API key>(len, \
offsetof(<API key>, stringdata) + ofs \
- idx * sizeof(QByteArrayData) \
)
static const <API key> <API key> = {
{
QT_MOC_LITERAL(0, 0, 11),
QT_MOC_LITERAL(1, 12, 14),
QT_MOC_LITERAL(2, 27, 0),
QT_MOC_LITERAL(3, 28, 8)
},
"QGLRenderer\0closeRequested\0\0newFrame\0"
};
#undef QT_MOC_LITERAL
static const uint <API key>[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 0, 24, 2, 0x06,
// slots: name, argc, parameters, tag, flags
3, 0, 25, 2, 0x0a,
// signals: parameters
QMetaType::Void,
// slots: parameters
QMetaType::Void,
0 // eod
};
void QGLRenderer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QGLRenderer *_t = static_cast<QGLRenderer *>(_o);
switch (_id) {
case 0: _t->closeRequested(); break;
case 1: _t->newFrame(); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (QGLRenderer::*_t)();
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&QGLRenderer::closeRequested)) {
*result = 0;
}
}
}
Q_UNUSED(_a);
}
const QMetaObject QGLRenderer::staticMetaObject = {
{ &QGLWidget::staticMetaObject, <API key>.data,
<API key>, qt_static_metacall, 0, 0}
};
const QMetaObject *QGLRenderer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QGLRenderer::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, <API key>.stringdata))
return static_cast<void*>(const_cast< QGLRenderer*>(this));
return QGLWidget::qt_metacast(_clname);
}
int QGLRenderer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QGLWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::<API key>) {
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 2;
}
return _id;
}
// SIGNAL 0
void QGLRenderer::closeRequested()
{
QMetaObject::activate(this, &staticMetaObject, 0, 0);
}
<API key>
|
#include <stddef.h>
#include <sys/ioctl.h>
/* Wait for pending output to be written on FD. */
int
__libc_tcdrain (int fd)
{
return __ioctl (fd, TIOCDRAIN);
}
weak_alias (__libc_tcdrain, tcdrain)
|
<?php
// |zen-cart Open Source E-commerce |
// | available through the world-wide-web at the following url: |
// | to obtain it through the world-wide-web, please send a note to |
// | Do Not Remove: Coded for Zen-Cart by geeks4u.com |
// | Dedicated to Memory of Amelita "Emmy" Abordo Gelarderes |
// $Id: <API key>.php,v 1.2 2004/08/26
define('<API key>', 'Latest News');
define('TEXT_LINK_MORE', 'More...');
define('TEXT_TRAIL_STR', '...');
?>
|
/* MELFAS HEX to C converter v1.9 for MMS100 [2012.01.27] */
const UINT16 <API key> = 0x7C00; /* 31.0 KBytes ( 31744 Bytes ) */
const UINT8 MELFAS_binary_2[] = {
/* Module revision : R31 */
/* Firmware version : V4D */
0x00, 0x20, 0x00, 0x20, 0x79, 0x02, 0x00, 0x00,
0x39, 0x02, 0x00, 0x00, 0x3D, 0x02, 0x00, 0x00,
0x41, 0x02, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00,
0x49, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4D, 0x02, 0x00, 0x00,
0x51, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x55, 0x02, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00,
0x39, 0x01, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00,
0x25, 0x01, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00,
0x35, 0x02, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x75, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00,
0x30, 0xB5, 0x11, 0x4B, 0x11, 0x4A, 0x1B, 0x88,
0x12, 0x78, 0xD3, 0x18, 0xDB, 0xB2, 0xE1, 0x2B,
0x02, 0xD0, 0xE5, 0x2B, 0x17, 0xD1, 0x09, 0xE0,
0x0D, 0x49, 0x0E, 0x4A, 0x04, 0x23, 0x01, 0x3B,
0xDB, 0xB2, 0xC8, 0x5C, 0x98, 0x54, 0x00, 0x2B,
0xF9, 0xD1, 0x0C, 0xE0, 0x0A, 0x4C, 0x09, 0x48,
0x0A, 0x49, 0x0B, 0x4A, 0x04, 0x23, 0x01, 0x3B,
0xDB, 0xB2, 0xE5, 0x5C, 0x1D, 0x54, 0xCD, 0x5C,
0x9D, 0x54, 0x00, 0x2B, 0xF7, 0xD1, 0x30, 0xBD,
0x28, 0x00, 0x00, 0x20, 0x2A, 0x00, 0x00, 0x20,
0x2D, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x50,
0x35, 0x00, 0x00, 0x20, 0x31, 0x00, 0x00, 0x20,
0x10, 0x00, 0x00, 0x50, 0x03, 0x4A, 0x00, 0x23,
0x13, 0x70, 0x80, 0x22, 0xD2, 0x05, 0x13, 0x70,
0x70, 0x47, 0xC0, 0x46, 0x00, 0x00, 0x00, 0x20,
0x06, 0x4B, 0x00, 0x22, 0x5A, 0x70, 0x80, 0x23,
0xDB, 0x05, 0x59, 0x69, 0x04, 0x4A, 0x0A, 0x40,
0x5A, 0x61, 0x59, 0x69, 0x03, 0x4A, 0x0A, 0x40,
0x5A, 0x61, 0x70, 0x47, 0x00, 0x00, 0x00, 0x20,
0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xEF,
0x70, 0xB5, 0xA0, 0x23, 0xDB, 0x05, 0x1C, 0x7A,
0x24, 0x4D, 0x0F, 0x22, 0x14, 0x40, 0x2A, 0x78,
0x23, 0x4E, 0x00, 0x2A, 0x06, 0xD0, 0x23, 0x4B,
0x1B, 0x68, 0x98, 0x47, 0x00, 0x23, 0x2B, 0x70,
0x34, 0x70, 0x3A, 0xE0, 0x9B, 0x7A, 0x32, 0x78,
0xE1, 0x07, 0x02, 0xD5, 0x1E, 0x4A, 0x13, 0x80,
0x07, 0xE0, 0x08, 0x21, 0x0C, 0x42, 0x0A, 0xD0,
0x1C, 0x4B, 0x1A, 0x78, 0x52, 0x18, 0xD2, 0xB2,
0x1A, 0x70, 0xFF, 0xF7, 0x8D, 0xFF, 0x1A, 0x4B,
0x1B, 0x68, 0x98, 0x47, 0x19, 0xE0, 0xA1, 0x07,
0x0D, 0xD5, 0x08, 0x2A, 0x01, 0xD0, 0x01, 0x2A,
0x01, 0xD1, 0x16, 0x4B, 0x02, 0xE0, 0x12, 0x4A,
0x13, 0x80, 0x15, 0x4B, 0x1B, 0x68, 0x98, 0x47,
0x00, 0x22, 0x10, 0x4B, 0x08, 0xE0, 0x63, 0x07,
0x07, 0xD5, 0x11, 0x4B, 0x1B, 0x68, 0x98, 0x47,
0x0C, 0x4B, 0x1A, 0x78, 0x08, 0x32, 0xD2, 0xB2,
0x1A, 0x70, 0x07, 0x4B, 0x01, 0x22, 0x1C, 0x70,
0xA0, 0x23, 0xDB, 0x05, 0x1A, 0x72, 0x0B, 0x49,
0x10, 0x22, 0x1A, 0x72, 0x00, 0x22, 0x0A, 0x70,
0x1A, 0x72, 0x70, 0xBD, 0x2C, 0x00, 0x00, 0x20,
0x2B, 0x00, 0x00, 0x20, 0x24, 0x00, 0x00, 0x20,
0x28, 0x00, 0x00, 0x20, 0x2A, 0x00, 0x00, 0x20,
0x1C, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x20,
0x18, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x20,
0x03, 0x4A, 0x00, 0x23, 0x93, 0x70, 0x80, 0x22,
0xD2, 0x05, 0x53, 0x70, 0x70, 0x47, 0xC0, 0x46,
0x00, 0x00, 0x00, 0x20, 0x70, 0x47, 0xC0, 0x46,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x00, 0xB5, 0xFE, 0xE7, 0x00, 0xB5, 0xFE, 0xE7,
0x38, 0xB5, 0x80, 0x23, 0xDB, 0x05, 0xFB, 0x21,
0x5A, 0x68, 0x59, 0x60, 0x99, 0x68, 0x08, 0x21,
0x99, 0x60, 0x00, 0x22, 0xD9, 0x68, 0xDA, 0x60,
0x19, 0x6C, 0x80, 0x21, 0xC9, 0x01, 0x19, 0x64,
0x19, 0x69, 0x44, 0x49, 0x19, 0x61, 0x44, 0x4B,
0x44, 0x49, 0x00, 0xE0, 0x04, 0xC3, 0x8B, 0x42,
0xFC, 0xD3, 0x43, 0x4B, 0x43, 0x4A, 0x9B, 0x0A,
0xDB, 0xB2, 0x13, 0x70, 0x42, 0x4B, 0x43, 0x49,
0x1B, 0x68, 0x9B, 0x0A, 0xDB, 0xB2, 0x53, 0x70,
0x41, 0x4B, 0x1B, 0x68, 0x9B, 0x0A, 0xDB, 0xB2,
0x93, 0x70, 0x40, 0x4B, 0x1B, 0x68, 0x9B, 0x0A,
0xDB, 0xB2, 0xD3, 0x70, 0x00, 0x23, 0x0B, 0x70,
0x03, 0x23, 0x08, 0xE0, 0x58, 0x1C, 0x15, 0x5C,
0xD4, 0x5C, 0xA5, 0x42, 0x07, 0xD9, 0xD4, 0x5C,
0x01, 0x34, 0xE4, 0xB2, 0x0C, 0x54, 0x01, 0x3B,
0xDB, 0xB2, 0xFF, 0x2B, 0xF2, 0xD1, 0x30, 0x4A,
0x11, 0x78, 0x35, 0x4A, 0x11, 0x70, 0x11, 0x1C,
0xFF, 0x2B, 0x03, 0xD1, 0x2D, 0x4B, 0xDB, 0x78,
0x1E, 0x2B, 0x04, 0xD9, 0xFF, 0x23, 0x4B, 0x70,
0x8B, 0x70, 0xCB, 0x70, 0x0B, 0xE0, 0x2A, 0x4B,
0x1B, 0x68, 0x1B, 0x78, 0x53, 0x70, 0x2A, 0x4B,
0x1B, 0x68, 0x1B, 0x78, 0x93, 0x70, 0x29, 0x4B,
0x1B, 0x68, 0x1B, 0x78, 0xD3, 0x70, 0x28, 0x4B,
0xDA, 0x78, 0xFF, 0x2A, 0x08, 0xD0, 0x9A, 0x78,
0xFF, 0x2A, 0x05, 0xD0, 0x5B, 0x78, 0xFF, 0x2B,
0x02, 0xD0, 0x00, 0xF0, 0x67, 0xF8, 0x38, 0xBD,
0x22, 0x4B, 0x23, 0x4A, 0xC0, 0x21, 0x13, 0x60,
0x22, 0x4A, 0x49, 0x00, 0x13, 0x60, 0x22, 0x4A,
0x22, 0x48, 0x13, 0x60, 0x22, 0x4A, 0x13, 0x60,
0x22, 0x4B, 0x02, 0x22, 0x5A, 0x50, 0xC0, 0x21,
0x91, 0x40, 0x5C, 0x58, 0x20, 0x40, 0x58, 0x50,
0x1F, 0x49, 0x04, 0x24, 0x08, 0x69, 0x20, 0x43,
0x08, 0x61, 0x62, 0xB6, 0x1A, 0x60, 0x80, 0x23,
0xDB, 0x05, 0x1A, 0x6C, 0x80, 0x22, 0x12, 0x02,
0x1A, 0x64, 0x1A, 0x6C, 0x80, 0x22, 0xD2, 0x01,
0x1A, 0x64, 0x9A, 0x68, 0x80, 0x22, 0x52, 0x00,
0x9A, 0x60, 0xA0, 0x22, 0xD2, 0x05, 0x91, 0x68,
0x14, 0x49, 0x91, 0x60, 0x1A, 0x6C, 0x00, 0x22,
0x1A, 0x64, 0xFE, 0xE7, 0x10, 0x4F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x20, 0x3C, 0x00, 0x00, 0x20,
0xFF, 0x03, 0x00, 0x00, 0x31, 0x00, 0x00, 0x20,
0x08, 0x04, 0x00, 0x00, 0x35, 0x00, 0x00, 0x20,
0x0C, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00,
0x2D, 0x00, 0x00, 0x20, 0xF9, 0x03, 0x00, 0x00,
0x24, 0x00, 0x00, 0x20, 0x18, 0x00, 0x00, 0x20,
0x1C, 0x00, 0x00, 0x20, 0xFF, 0x00, 0xFF, 0xFF,
0x20, 0x00, 0x00, 0x20, 0x00, 0xE1, 0x00, 0xE0,
0x00, 0xED, 0x00, 0xE0, 0x00, 0x00, 0xC8, 0x42,
0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x4D, 0x31, 0x48, 0x30, 0x43, 0x4F, 0x34, 0x35,
0xFF, 0x5B, 0x00, 0x00, 0xFF, 0x73, 0x00, 0x00,
0xFF, 0x7B, 0x00, 0x00, 0xF7, 0xB5, 0x03, 0xF0,
0xC3, 0xFC, 0x05, 0xF0, 0x33, 0xF8, 0x00, 0x20,
0x05, 0xF0, 0xF2, 0xFB, 0x4E, 0x4B, 0x33, 0x33,
0x1B, 0x78, 0x5E, 0x42, 0x73, 0x41, 0x10, 0x26,
0xF6, 0x1A, 0x4C, 0x4B, 0x1E, 0x70, 0x4C, 0x4B,
0x1A, 0x68, 0x01, 0x3A, 0x53, 0x42, 0x5A, 0x41,
0x4A, 0x4B, 0x1A, 0x70, 0x4A, 0x4B, 0x1C, 0x78,
0x00, 0x2C, 0x22, 0xD1, 0x49, 0x4A, 0x01, 0x25,
0x14, 0x70, 0x1D, 0x70, 0x00, 0xF0, 0x52, 0xFA,
0x47, 0x4B, 0x28, 0x1C, 0xDA, 0x78, 0x9A, 0x70,
0x5C, 0x70, 0x05, 0xF0, 0xD1, 0xFB, 0x03, 0xF0,
0x7F, 0xFB, 0x01, 0xF0, 0x17, 0xFB, 0x80, 0x23,
0xDB, 0x05, 0x1A, 0x6C, 0x7F, 0x21, 0x8A, 0x43,
0x1A, 0x64, 0x00, 0xF0, 0xF5, 0xFD, 0x02, 0xF0,
0x4B, 0xFF, 0x01, 0xF0, 0x0B, 0xFB, 0x01, 0xF0,
0xA3, 0xFA, 0x3C, 0x4B, 0x02, 0x20, 0x1B, 0x68,
0x98, 0x47, 0x3B, 0x4C, 0x23, 0x78, 0x00, 0x2B,
0x03, 0xD1, 0x3A, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x0F, 0xD0, 0x23, 0x78, 0x00, 0xF0, 0x94, 0xFC,
0x22, 0x78, 0x2E, 0x4B, 0x00, 0x2A, 0x01, 0xD0,
0x1E, 0x70, 0x01, 0xE0, 0x0D, 0x22, 0x1A, 0x70,
0x31, 0x4A, 0x00, 0x23, 0x13, 0x70, 0x31, 0x4A,
0x13, 0x70, 0x2C, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x2C, 0xD0, 0x2F, 0x4D, 0x2B, 0x78, 0x00, 0x2B,
0x28, 0xD0, 0x2A, 0x4C, 0x13, 0x20, 0x23, 0x68,
0x98, 0x47, 0x00, 0xF0, 0x0F, 0xFA, 0x03, 0xF0,
0x08, 0xFB, 0x03, 0xF0, 0x8B, 0xFA, 0x29, 0x4B,
0x18, 0x78, 0x01, 0xF0, 0xA1, 0xF8, 0x00, 0xF0,
0xC7, 0xFD, 0x27, 0x4A, 0x01, 0x23, 0x13, 0x70,
0x26, 0x4A, 0x13, 0x80, 0x02, 0xF0, 0xDE, 0xFF,
0x2B, 0x78, 0x00, 0x2B, 0xFC, 0xD1, 0x23, 0x68,
0x14, 0x20, 0x98, 0x47, 0x00, 0xF0, 0xF6, 0xF9,
0x03, 0xF0, 0xEF, 0xFA, 0x03, 0xF0, 0x72, 0xFA,
0x1C, 0x4B, 0x18, 0x78, 0x01, 0xF0, 0x88, 0xF8,
0x10, 0x4B, 0x1E, 0x70, 0x00, 0xF0, 0x7E, 0xFF,
0x0E, 0x4C, 0x27, 0x78, 0x78, 0xB2, 0x13, 0x28,
0x00, 0xD9, 0x8D, 0xE1, 0x05, 0xF0, 0xD4, 0xF8,
0x74, 0x00, 0x8C, 0x01, 0x78, 0x01, 0x8C, 0x01,
0x8C, 0x01, 0x8C, 0x01, 0x8C, 0x01, 0x8C, 0x01,
0x8C, 0x01, 0x8C, 0x01, 0x8C, 0x01, 0x8C, 0x01,
0x8C, 0x01, 0x68, 0x00, 0x8C, 0x01, 0x3A, 0x00,
0x30, 0x00, 0x5F, 0x00, 0x8C, 0x01, 0x89, 0x01,
0xAE, 0x09, 0x00, 0x20, 0x1D, 0x03, 0x00, 0x20,
0x50, 0x11, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0xE9, 0x01, 0x00, 0x20, 0xEA, 0x01, 0x00, 0x20,
0xAA, 0x0A, 0x00, 0x20, 0xF8, 0x01, 0x00, 0x20,
0xE8, 0x01, 0x00, 0x20, 0xE7, 0x01, 0x00, 0x20,
0xE5, 0x01, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0xF6, 0x03, 0x00, 0x20, 0x08, 0x03, 0x00, 0x20,
0xB1, 0x4B, 0x00, 0x22, 0x1A, 0x70, 0x00, 0xF0,
0x7D, 0xFE, 0xB0, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x00, 0xD0, 0x55, 0xE1, 0xAE, 0x4C, 0x23, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20, 0xAD, 0x49,
0x03, 0xF0, 0xB8, 0xFC, 0x23, 0x78, 0x00, 0x2B,
0x06, 0xD0, 0x01, 0x21, 0x00, 0x20, 0xAA, 0x4A,
0x0B, 0x1C, 0x00, 0x90, 0x03, 0xF0, 0x56, 0xFC,
0xA8, 0x4B, 0x98, 0x78, 0x03, 0xF0, 0x78, 0xFA,
0xA7, 0x4D, 0xE8, 0x7B, 0x03, 0xF0, 0x52, 0xF8,
0xA6, 0x4C, 0x20, 0x60, 0x28, 0x7C, 0x03, 0xF0,
0x4D, 0xF8, 0x11, 0x23, 0x60, 0x60, 0xEB, 0x56,
0xEA, 0x7B, 0x53, 0x43, 0xA3, 0x60, 0x9A, 0x4B,
0x00, 0x22, 0x1A, 0x70, 0xA0, 0x4B, 0x1B, 0x78,
0xA0, 0x4B, 0x18, 0x78, 0x01, 0xF0, 0x14, 0xF8,
0x95, 0x4B, 0x9D, 0x4D, 0x00, 0x24, 0x1C, 0x70,
0x2B, 0x78, 0x00, 0xF0, 0x29, 0xFD, 0x03, 0xF0,
0x8B, 0xFF, 0x00, 0xF0, 0x25, 0xFD, 0x2C, 0x70,
0x8F, 0x4B, 0x01, 0x24, 0x1C, 0x70, 0x00, 0xF0,
0x9B, 0xFC, 0x97, 0x4B, 0x1B, 0x68, 0x9A, 0x05,
0x13, 0xD5, 0x96, 0x4A, 0x96, 0x4B, 0x04, 0x20,
0x1A, 0x60, 0x96, 0x4B, 0x19, 0x68, 0x01, 0x43,
0x19, 0x60, 0x19, 0x68, 0x02, 0x20, 0x81, 0x43,
0x19, 0x60, 0x19, 0x68, 0x0C, 0x43, 0x1C, 0x60,
0x91, 0x4B, 0x00, 0x21, 0x19, 0x60, 0x91, 0x4B,
0x1A, 0x60, 0x91, 0x4C, 0x03, 0x20, 0x23, 0x68,
0x98, 0x47, 0x03, 0xF0, 0x3F, 0xF8, 0x23, 0x68,
0x05, 0x20, 0x98, 0x47, 0x02, 0xF0, 0xE4, 0xFF,
0x8C, 0x4C, 0x8D, 0x4D, 0x01, 0x20, 0x40, 0x42,
0x21, 0x1C, 0x2A, 0x1C, 0x04, 0xF0, 0x4C, 0xFC,
0x79, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x03, 0xD0,
0x0C, 0x20, 0x88, 0x49, 0x03, 0xF0, 0x4E, 0xFC,
0x87, 0x4A, 0x23, 0x68, 0x13, 0x80, 0x2B, 0x68,
0x53, 0x80, 0x73, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x06, 0xD0, 0x01, 0x23, 0x02, 0x21, 0x00, 0x93,
0x0C, 0x20, 0x0B, 0x1C, 0x03, 0xF0, 0xE6, 0xFB,
0x7B, 0x4C, 0x06, 0x20, 0x23, 0x68, 0x98, 0x47,
0x03, 0xF0, 0xF4, 0xFF, 0x04, 0xF0, 0x64, 0xF9,
0x04, 0xF0, 0x98, 0xFB, 0x00, 0xF0, 0x62, 0xF9,
0x04, 0xF0, 0x06, 0xFD, 0x04, 0xF0, 0x7E, 0xFE,
0x78, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x2A, 0xD1,
0x23, 0x68, 0x07, 0x20, 0x98, 0x47, 0x01, 0xF0,
0x51, 0xFA, 0x23, 0x68, 0x08, 0x20, 0x98, 0x47,
0x02, 0xF0, 0xB2, 0xFF, 0x02, 0xF0, 0xBA, 0xFF,
0x23, 0x68, 0x09, 0x20, 0x98, 0x47, 0x01, 0xF0,
0x69, 0xFA, 0x01, 0xF0, 0xD1, 0xFB, 0x23, 0x68,
0x0A, 0x20, 0x98, 0x47, 0x01, 0xF0, 0x6E, 0xFC,
0x02, 0xF0, 0x44, 0xFB, 0x23, 0x68, 0x0B, 0x20,
0x98, 0x47, 0x01, 0xF0, 0xB8, 0xFE, 0x01, 0xF0,
0xD7, 0xFF, 0x23, 0x68, 0x0E, 0x20, 0x98, 0x47,
0x02, 0xF0, 0x84, 0xF8, 0x02, 0xF0, 0xF2, 0xF9,
0x23, 0x68, 0x10, 0x20, 0x98, 0x47, 0x00, 0xF0,
0x81, 0xF9, 0x5B, 0x4B, 0x0F, 0x20, 0x1B, 0x68,
0x98, 0x47, 0x5E, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x3C, 0xD1, 0x02, 0xF0, 0x4F, 0xFA, 0x5C, 0x4B,
0x1A, 0x68, 0x5C, 0x4B, 0x00, 0x2A, 0x04, 0xD1,
0x5B, 0x49, 0x09, 0x68, 0x00, 0x29, 0x00, 0xDD,
0x1A, 0x70, 0x47, 0x4A, 0x19, 0x78, 0x32, 0x32,
0x12, 0x78, 0x91, 0x42, 0x01, 0xD3, 0x00, 0x22,
0x1A, 0x70, 0x1B, 0x78, 0x00, 0x2B, 0x21, 0xD1,
0x53, 0x4B, 0x51, 0x4C, 0x1B, 0x68, 0x00, 0x2B,
0x09, 0xDD, 0x20, 0x68, 0x00, 0x28, 0x06, 0xD1,
0x39, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x02, 0xD0,
0x4E, 0x49, 0x03, 0xF0, 0xCF, 0xFB, 0x4E, 0x4B,
0x1B, 0x68, 0x98, 0x47, 0x23, 0x68, 0x00, 0x2B,
0x0A, 0xDD, 0x49, 0x4B, 0x18, 0x68, 0x00, 0x28,
0x06, 0xD1, 0x31, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x02, 0xD0, 0x48, 0x49, 0x03, 0xF0, 0xBE, 0xFB,
0x02, 0xF0, 0x72, 0xFA, 0x41, 0x4B, 0x1A, 0x78,
0x01, 0x32, 0x1A, 0x70, 0x32, 0x4B, 0x1B, 0x68,
0x9A, 0x05, 0x23, 0xD5, 0x34, 0x4B, 0x18, 0x68,
0x2A, 0x4B, 0x1A, 0x79, 0x19, 0x78, 0x2F, 0x4B,
0x18, 0x1A, 0x53, 0x1C, 0x98, 0x40, 0x04, 0xF0,
0x8D, 0xFF, 0x23, 0x4C, 0x2F, 0x4D, 0x23, 0x78,
0x28, 0x60, 0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20,
0x39, 0x49, 0x03, 0xF0, 0x9F, 0xFB, 0x23, 0x78,
0x00, 0x2B, 0x06, 0xD0, 0x00, 0x20, 0x01, 0x21,
0x2A, 0x1C, 0x04, 0x23, 0x00, 0x90, 0x03, 0xF0,
0x3D, 0xFB, 0x24, 0x4B, 0x01, 0x21, 0x1A, 0x68,
0x8A, 0x43, 0x1A, 0x60, 0x80, 0x23, 0xDB, 0x05,
0x9A, 0x6C, 0x01, 0x21, 0x0A, 0x43, 0x9A, 0x64,
0x00, 0xF0, 0x1E, 0xFC, 0x2D, 0x4B, 0x00, 0x20,
0x18, 0x56, 0x00, 0xF0, 0x5D, 0xFE, 0x17, 0xE0,
0x0F, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x03, 0xD0,
0x05, 0x20, 0x29, 0x49, 0x03, 0xF0, 0x7A, 0xFB,
0x01, 0x20, 0x00, 0xF0, 0xF9, 0xFE, 0x00, 0x20,
0x00, 0xF0, 0xF6, 0xFE, 0x13, 0x23, 0x23, 0x70,
0x06, 0xE0, 0x00, 0xF0, 0x0D, 0xFC, 0x03, 0xE0,
0x13, 0x4B, 0x11, 0x20, 0x1B, 0x68, 0x98, 0x47,
0x20, 0x4B, 0x1F, 0x70, 0xEB, 0xE5, 0xC0, 0x46,
0xEA, 0x01, 0x00, 0x20, 0xE0, 0x01, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x34, 0x59, 0x00, 0x00,
0xAC, 0x0A, 0x00, 0x20, 0xAA, 0x0A, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xFC, 0x02, 0x00, 0x20,
0x1D, 0x03, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x58, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0x00,
0x14, 0xE0, 0x00, 0xE0, 0x10, 0xE0, 0x00, 0xE0,
0x18, 0xE0, 0x00, 0xE0, 0xFC, 0x01, 0x00, 0x20,
0xF8, 0x01, 0x00, 0x20, 0x34, 0x11, 0x00, 0x20,
0x38, 0x11, 0x00, 0x20, 0x38, 0x59, 0x00, 0x00,
0x54, 0x11, 0x00, 0x20, 0x48, 0x11, 0x00, 0x20,
0x20, 0x01, 0x00, 0x20, 0xCA, 0x00, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x3E, 0x59, 0x00, 0x00,
0x00, 0x02, 0x00, 0x20, 0x47, 0x59, 0x00, 0x00,
0x51, 0x59, 0x00, 0x00, 0xB3, 0x01, 0x00, 0x20,
0x5E, 0x59, 0x00, 0x00, 0x56, 0x00, 0x00, 0x20,
0x08, 0xB5, 0x01, 0xF0, 0x99, 0xFD, 0x01, 0xF0,
0xB3, 0xFD, 0x03, 0x4B, 0x1B, 0x68, 0x98, 0x47,
0x02, 0xF0, 0xD2, 0xF9, 0x08, 0xBD, 0xC0, 0x46,
0x00, 0x02, 0x00, 0x20, 0x10, 0xB5, 0x04, 0xF0,
0xEF, 0xFD, 0x05, 0x4C, 0x00, 0x20, 0x23, 0x68,
0x98, 0x47, 0x04, 0xF0, 0x19, 0xFE, 0x23, 0x68,
0x01, 0x20, 0x98, 0x47, 0x10, 0xBD, 0xC0, 0x46,
0xF8, 0x01, 0x00, 0x20, 0x7F, 0xB5, 0x17, 0x4D,
0x17, 0x4B, 0x5B, 0x1B, 0x03, 0x93, 0x17, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0, 0x00, 0x20,
0x01, 0x21, 0x03, 0xAA, 0x04, 0x23, 0x00, 0x90,
0x03, 0xF0, 0xA0, 0xFA, 0x12, 0x4E, 0x18, 0xE0,
0x14, 0x2C, 0x00, 0xDD, 0x14, 0x24, 0xE1, 0xB2,
0x08, 0x1C, 0x03, 0xE0, 0x01, 0x38, 0xC0, 0xB2,
0x2B, 0x5C, 0x33, 0x54, 0x00, 0x28, 0xF9, 0xD1,
0x0A, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x04, 0xD0,
0x09, 0x4A, 0x01, 0x23, 0x00, 0x90, 0x03, 0xF0,
0x89, 0xFA, 0x03, 0x9B, 0x2D, 0x19, 0x1B, 0x1B,
0x03, 0x93, 0x03, 0x9C, 0x00, 0x2C, 0xE3, 0xD1,
0x7F, 0xBD, 0xC0, 0x46, 0x0C, 0x1E, 0x00, 0x20,
0x00, 0x20, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0x54, 0x11, 0x00, 0x20, 0x13, 0xB5, 0x1E, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x37, 0xD0, 0x1D, 0x4C,
0x00, 0x23, 0x23, 0x70, 0x1C, 0x4B, 0x04, 0x20,
0x1B, 0x68, 0x98, 0x47, 0x1B, 0x4B, 0x1C, 0x4A,
0x59, 0x68, 0x1B, 0x68, 0x11, 0x80, 0x53, 0x80,
0x1A, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x02, 0x21, 0x00, 0x93, 0x18, 0x20,
0x0B, 0x1C, 0x03, 0xF0, 0x5B, 0xFA, 0x23, 0x78,
0x15, 0x4C, 0x00, 0x2B, 0x1A, 0xD0, 0x13, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20,
0x12, 0x49, 0x03, 0xF0, 0xA7, 0xFA, 0x12, 0x4A,
0x01, 0x23, 0x13, 0x70, 0x22, 0x68, 0x02, 0x2A,
0x04, 0xDC, 0xD2, 0x18, 0x22, 0x60, 0x0F, 0x4A,
0x13, 0x70, 0x08, 0xE0, 0xFF, 0xF7, 0x74, 0xFF,
0x0D, 0x4B, 0x0D, 0x22, 0x1A, 0x70, 0x00, 0x23,
0x23, 0x60, 0x00, 0xE0, 0x23, 0x60, 0x13, 0xBD,
0x1C, 0x03, 0x00, 0x20, 0x3D, 0x11, 0x00, 0x20,
0xF8, 0x01, 0x00, 0x20, 0x70, 0x01, 0x00, 0x20,
0x54, 0x11, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0x84, 0x01, 0x00, 0x20, 0xD0, 0x58, 0x00, 0x00,
0x48, 0x11, 0x00, 0x20, 0x14, 0x09, 0x00, 0x20,
0x1D, 0x03, 0x00, 0x20, 0xF0, 0xB5, 0xBA, 0x4B,
0x85, 0xB0, 0x04, 0x33, 0xDB, 0x7F, 0x00, 0x24,
0xB8, 0x49, 0x0A, 0x22, 0x09, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0x10, 0x1C, 0x58, 0x43, 0x08, 0x18,
0x3C, 0x25, 0x40, 0x5F, 0x00, 0x28, 0x00, 0xD0,
0x01, 0x24, 0x00, 0x2B, 0xF3, 0xD1, 0xB2, 0x4B,
0xB2, 0x4A, 0x1B, 0x78, 0x07, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0x19, 0x1D, 0x49, 0x00, 0x89, 0x5E,
0x00, 0x29, 0x00, 0xD0, 0x01, 0x24, 0x00, 0x2B,
0xF5, 0xD1, 0xAD, 0x4A, 0x00, 0x2C, 0x04, 0xD1,
0x13, 0x68, 0xAC, 0x49, 0x8B, 0x42, 0x01, 0xD0,
0x01, 0x33, 0x13, 0x60, 0xAA, 0x4B, 0x00, 0x22,
0x1A, 0x70, 0xA4, 0x4B, 0x1A, 0x68, 0xA2, 0x4B,
0x00, 0x2A, 0x7C, 0xD1, 0xA3, 0x4A, 0x12, 0x68,
0x00, 0x2A, 0x78, 0xD1, 0x1A, 0x1C, 0x34, 0x32,
0x10, 0x78, 0x00, 0x28, 0x41, 0xD1, 0xA3, 0x4A,
0x12, 0x78, 0x01, 0x2A, 0x17, 0xD1, 0xA2, 0x4B,
0x18, 0x70, 0xA2, 0x4B, 0x1A, 0x70, 0xA2, 0x4B,
0x18, 0x70, 0xA2, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x02, 0xD0, 0xA1, 0x49, 0x03, 0xF0, 0x2E, 0xFA,
0x99, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x01, 0xF0,
0x9F, 0xFC, 0x01, 0xF0, 0xB9, 0xFC, 0x97, 0x4B,
0x00, 0x22, 0x1A, 0x70, 0x67, 0xE1, 0x9B, 0x4A,
0x3C, 0x33, 0x1B, 0x78, 0x12, 0x68, 0x9A, 0x42,
0x1F, 0xDB, 0x96, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x02, 0xD0, 0x97, 0x49, 0x03, 0xF0, 0x16, 0xFA,
0x96, 0x4B, 0x87, 0x49, 0x1A, 0x68, 0x3D, 0x31,
0x01, 0x32, 0x1A, 0x60, 0x09, 0x78, 0x8A, 0x42,
0x0F, 0xDB, 0x00, 0x20, 0x18, 0x60, 0x8A, 0x4B,
0x18, 0x70, 0x8A, 0x4B, 0x18, 0x70, 0x8B, 0x4B,
0x1B, 0x78, 0x83, 0x42, 0x02, 0xD0, 0x8E, 0x49,
0x03, 0xF0, 0x00, 0xFA, 0x82, 0x4B, 0x02, 0x22,
0x1A, 0x70, 0x85, 0x4B, 0x8B, 0x4A, 0x00, 0x21,
0x19, 0x70, 0x10, 0x68, 0x85, 0x4B, 0x19, 0x60,
0x13, 0x1C, 0x88, 0x42, 0x0E, 0xDD, 0x01, 0x38,
0x10, 0x60, 0x8C, 0x42, 0x00, 0xD0, 0x11, 0x60,
0x1A, 0x68, 0x01, 0x2A, 0x00, 0xD0, 0x18, 0xE1,
0x00, 0x22, 0x1A, 0x60, 0x76, 0x4B, 0x03, 0x22,
0x1A, 0x70, 0x28, 0xE1, 0x80, 0x4B, 0x81, 0x49,
0x04, 0x33, 0xDB, 0x8F, 0x8B, 0x42, 0x00, 0xD1,
0x0B, 0xE1, 0x7F, 0x49, 0x09, 0x68, 0x99, 0x42,
0x00, 0xDA, 0x06, 0xE1, 0x68, 0x4B, 0x6C, 0x48,
0x19, 0x1C, 0x3E, 0x31, 0x09, 0x78, 0x00, 0x68,
0x88, 0x42, 0x00, 0xDA, 0xFD, 0xE0, 0x3F, 0x33,
0x1B, 0x78, 0x13, 0x60, 0xF9, 0xE0, 0x04, 0x33,
0xD8, 0x7F, 0x00, 0x23, 0x1A, 0x1C, 0x75, 0x49,
0x31, 0xE0, 0x01, 0x38, 0xC0, 0xB2, 0x0A, 0x24,
0x44, 0x43, 0x5E, 0x4F, 0x3D, 0x19, 0x3C, 0x26,
0xAD, 0x5F, 0x00, 0x2D, 0x27, 0xDD, 0x0C, 0x19,
0x3C, 0x27, 0xE4, 0x5F, 0x00, 0x2C, 0x22, 0xDD,
0x44, 0x00, 0x0D, 0x19, 0xAF, 0x88, 0x57, 0x4D,
0x3E, 0xB2, 0x2C, 0x19, 0xA4, 0x88, 0x25, 0xB2,
0x76, 0x1B, 0x02, 0xD4, 0x3C, 0x1B, 0xA4, 0xB2,
0x01, 0xE0, 0xE4, 0x1B, 0xA4, 0xB2, 0x05, 0x1C,
0x64, 0x4E, 0x50, 0x4F, 0x10, 0x35, 0x6D, 0x00,
0xA2, 0x18, 0xAC, 0x5B, 0xED, 0x5B, 0x27, 0xB2,
0x2E, 0xB2, 0x92, 0xB2, 0xBF, 0x1B, 0x02, 0xD4,
0x64, 0x1B, 0xA4, 0xB2, 0x01, 0xE0, 0x2C, 0x1B,
0xA4, 0xB2, 0xE3, 0x18, 0x9B, 0xB2, 0x00, 0x28,
0xCB, 0xD1, 0x56, 0x49, 0x08, 0x60, 0x4D, 0x49,
0x0C, 0x78, 0x43, 0x49, 0x00, 0x2C, 0x40, 0xD0,
0x34, 0x31, 0x0B, 0x78, 0x00, 0x2B, 0x00, 0xD0,
0xB3, 0xE0, 0x4A, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x02, 0xD0, 0x53, 0x49, 0x03, 0xF0, 0x7E, 0xF9,
0x4F, 0x4C, 0x52, 0x4A, 0x23, 0x68, 0x13, 0x80,
0x51, 0x4B, 0x1B, 0x68, 0x53, 0x80, 0x43, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0, 0x01, 0x23,
0x02, 0x21, 0x00, 0x93, 0x00, 0x20, 0x0B, 0x1C,
0x03, 0xF0, 0x14, 0xF9, 0x32, 0x49, 0x20, 0x68,
0x4A, 0x8F, 0x3B, 0x4B, 0x90, 0x42, 0x14, 0xDA,
0x41, 0x4A, 0x47, 0x48, 0x45, 0x32, 0x12, 0x78,
0x00, 0x68, 0x90, 0x42, 0x0D, 0xDA, 0x1B, 0x78,
0x00, 0x2B, 0x00, 0xD0, 0x89, 0xE0, 0x37, 0x4B,
0x3C, 0x31, 0x1A, 0x68, 0x09, 0x78, 0x8A, 0x42,
0x00, 0xDB, 0x82, 0xE0, 0x01, 0x32, 0x1A, 0x60,
0x7F, 0xE0, 0x01, 0x22, 0x1A, 0x70, 0x31, 0x4A,
0x00, 0x23, 0x13, 0x60, 0x31, 0x4A, 0x13, 0x60,
0x77, 0xE0, 0x08, 0x1C, 0x34, 0x30, 0x00, 0x78,
0x00, 0x28, 0x72, 0xD1, 0x32, 0x48, 0x09, 0x8F,
0x00, 0x68, 0x88, 0x42, 0x09, 0xDB, 0x2E, 0x49,
0x33, 0x48, 0x45, 0x31, 0x09, 0x78, 0x00, 0x68,
0x88, 0x42, 0x02, 0xDB, 0x22, 0x49, 0x01, 0x20,
0x08, 0x70, 0x1F, 0x49, 0x09, 0x78, 0x00, 0x29,
0x08, 0xD1, 0x15, 0x49, 0x08, 0x8F, 0x27, 0x49,
0x88, 0x42, 0x5A, 0xD0, 0x1C, 0x49, 0x09, 0x78,
0x00, 0x29, 0x56, 0xD0, 0x11, 0x49, 0x09, 0x68,
0x01, 0x29, 0x05, 0xDC, 0x0E, 0x49, 0xC9, 0x8E,
0x8A, 0x42, 0x01, 0xD8, 0x8B, 0x42, 0x49, 0xD9,
0x13, 0x4B, 0x00, 0x20, 0x18, 0x70, 0x13, 0x4B,
0x01, 0x22, 0x1A, 0x70, 0x12, 0x4B, 0x18, 0x70,
0x12, 0x4B, 0x1B, 0x78, 0x83, 0x42, 0x02, 0xD0,
0x11, 0x49, 0x03, 0xF0, 0x0F, 0xF9, 0x0A, 0x4B,
0x01, 0x22, 0x1A, 0x70, 0x01, 0xF0, 0x80, 0xFB,
0x01, 0xF0, 0x9A, 0xFB, 0x35, 0xE0, 0xC0, 0x46,
0xAE, 0x09, 0x00, 0x20, 0x9C, 0x0D, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0xE0, 0x00, 0x00, 0x20,
0xC8, 0x01, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0x7F,
0xB3, 0x01, 0x00, 0x20, 0xB4, 0x01, 0x00, 0x20,
0xDC, 0x01, 0x00, 0x20, 0xDD, 0x01, 0x00, 0x20,
0xD4, 0x01, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0xDA, 0x58, 0x00, 0x00, 0xD8, 0x01, 0x00, 0x20,
0xE4, 0x58, 0x00, 0x00, 0xD0, 0x01, 0x00, 0x20,
0xEC, 0x58, 0x00, 0x00, 0xCC, 0x01, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x00,
0x34, 0x11, 0x00, 0x20, 0x20, 0x03, 0x00, 0x20,
0xF5, 0x58, 0x00, 0x00, 0x54, 0x11, 0x00, 0x20,
0x38, 0x11, 0x00, 0x20, 0x0D, 0x4B, 0x01, 0x22,
0x1A, 0x70, 0x0D, 0x4B, 0x34, 0x33, 0x1B, 0x78,
0x00, 0x2B, 0x10, 0xD0, 0x0B, 0x4B, 0x1A, 0x78,
0x00, 0x2A, 0x0C, 0xD0, 0x0A, 0x4A, 0x00, 0x21,
0x51, 0x56, 0x03, 0x29, 0x07, 0xD0, 0x09, 0x49,
0x09, 0x78, 0x48, 0x42, 0x41, 0x41, 0x01, 0x31,
0x11, 0x70, 0x00, 0x22, 0x1A, 0x70, 0x05, 0xB0,
0xF0, 0xBD, 0xC0, 0x46, 0xB4, 0x01, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xDC, 0x01, 0x00, 0x20,
0xB3, 0x01, 0x00, 0x20, 0xDD, 0x01, 0x00, 0x20,
0x10, 0xB5, 0x54, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x0A, 0xD0, 0x53, 0x4B, 0x1B, 0x68, 0x98, 0x47,
0x01, 0xF0, 0x1A, 0xFB, 0x01, 0xF0, 0x34, 0xFB,
0x01, 0xF0, 0x56, 0xFF, 0x02, 0xF0, 0x90, 0xFB,
0x4E, 0x4B, 0x02, 0x21, 0x1A, 0x68, 0x8A, 0x43,
0x1A, 0x60, 0x19, 0x68, 0x80, 0x22, 0xD2, 0x05,
0x90, 0x68, 0x91, 0x60, 0x19, 0x68, 0x08, 0x20,
0x81, 0x43, 0x19, 0x60, 0x19, 0x68, 0x90, 0x68,
0x91, 0x60, 0x19, 0x68, 0x04, 0x20, 0x81, 0x43,
0x19, 0x60, 0x1B, 0x68, 0x91, 0x68, 0x93, 0x60,
0x40, 0x4B, 0x18, 0x78, 0x42, 0x4B, 0x1B, 0x78,
0x00, 0x28, 0x32, 0xD0, 0x00, 0x2B, 0x03, 0xD0,
0x00, 0x20, 0x40, 0x49, 0x03, 0xF0, 0x7A, 0xF8,
0x3F, 0x4B, 0x80, 0x22, 0x19, 0x68, 0x52, 0x00,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0xA0, 0x23,
0xDB, 0x05, 0x99, 0x68, 0x9A, 0x60, 0x37, 0x4B,
0x3A, 0x4A, 0x19, 0x68, 0x0A, 0x40, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x99, 0x68,
0x9A, 0x60, 0x37, 0x4A, 0x01, 0x21, 0x11, 0x70,
0x19, 0x68, 0x80, 0x22, 0x52, 0x04, 0x0A, 0x43,
0x1A, 0x60, 0xC0, 0x46, 0xC0, 0x46, 0xC0, 0x46,
0xC0, 0x46, 0x62, 0xB6, 0x31, 0x4A, 0x19, 0x68,
0x0A, 0x40, 0x1A, 0x60, 0xBF, 0xF3, 0x6F, 0x8F,
0xFA, 0x20, 0xC0, 0x00, 0x02, 0xF0, 0x6E, 0xFC,
0x11, 0xE0, 0x00, 0x2B, 0x02, 0xD0, 0x2C, 0x49,
0x03, 0xF0, 0x48, 0xF8, 0x2B, 0x48, 0x02, 0xF0,
0x65, 0xFC, 0x2B, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x05, 0xD1, 0x2A, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x01, 0xD1, 0x02, 0xF0, 0x59, 0xFE, 0x1D, 0x4B,
0x02, 0x21, 0x1A, 0x68, 0x0A, 0x43, 0x1A, 0x60,
0x19, 0x68, 0x80, 0x22, 0xD2, 0x05, 0x90, 0x68,
0x91, 0x60, 0x23, 0x49, 0x01, 0x31, 0xC8, 0x7F,
0x08, 0x21, 0x00, 0x28, 0x06, 0xD0, 0x18, 0x68,
0x01, 0x43, 0x19, 0x60, 0x19, 0x68, 0x90, 0x68,
0x91, 0x60, 0x05, 0xE0, 0x18, 0x68, 0x88, 0x43,
0x18, 0x60, 0x19, 0x68, 0x90, 0x68, 0x91, 0x60,
0x1A, 0x68, 0x04, 0x21, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0xFA, 0x20,
0x99, 0x68, 0xC0, 0x00, 0x9A, 0x60, 0x02, 0xF0,
0x31, 0xFC, 0x06, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x06, 0xD0, 0x12, 0x4C, 0x0D, 0x20, 0x23, 0x68,
0x98, 0x47, 0x23, 0x68, 0x12, 0x20, 0x98, 0x47,
0x10, 0xBD, 0xC0, 0x46, 0xE8, 0x01, 0x00, 0x20,
0x68, 0x00, 0x00, 0x20, 0x14, 0x00, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0xFB, 0x58, 0x00, 0x00,
0x0C, 0x00, 0x00, 0x20, 0xFF, 0xFE, 0xFF, 0xFF,
0x2C, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0xFE,
0x01, 0x59, 0x00, 0x00, 0x40, 0x42, 0x0F, 0x00,
0xE5, 0x01, 0x00, 0x20, 0xE4, 0x01, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xF8, 0x01, 0x00, 0x20,
0x10, 0xB5, 0x31, 0x4B, 0x02, 0x24, 0x19, 0x78,
0x30, 0x4B, 0x4A, 0xB2, 0x1B, 0x78, 0x00, 0x2B,
0x25, 0xD0, 0x2F, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x21, 0xD1, 0x2E, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x1D, 0xD1, 0x2D, 0x4B, 0xA2, 0x42, 0x07, 0xD0,
0x2C, 0x48, 0x80, 0x7B, 0x00, 0x28, 0x03, 0xD1,
0x2B, 0x48, 0x00, 0x68, 0x00, 0x28, 0x03, 0xD0,
0x00, 0x21, 0x19, 0x60, 0x01, 0x24, 0x0E, 0xE0,
0x28, 0x4A, 0x18, 0x68, 0x92, 0x68, 0x90, 0x42,
0x01, 0xDA, 0x01, 0x30, 0x18, 0x60, 0x00, 0x29,
0x36, 0xD0, 0x21, 0x4B, 0x00, 0x24, 0x1B, 0x68,
0x93, 0x42, 0x16, 0xDA, 0x30, 0xE0, 0x63, 0xB2,
0x93, 0x42, 0x2D, 0xD0, 0x01, 0x2B, 0x1D, 0xD0,
0x02, 0x2B, 0x02, 0xD0, 0x00, 0x2B, 0x0C, 0xD0,
0x24, 0xE0, 0x1D, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x03, 0xD0, 0x00, 0x20, 0x1B, 0x49, 0x02, 0xF0,
0xA5, 0xFF, 0x00, 0x20, 0x02, 0xF0, 0x78, 0xFB,
0x18, 0xE0, 0x17, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x03, 0xD0, 0x00, 0x20, 0x16, 0x49, 0x02, 0xF0,
0x99, 0xFF, 0x12, 0x4B, 0x58, 0x68, 0x02, 0xF0,
0x6B, 0xFB, 0x0B, 0xE0, 0x10, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20, 0x11, 0x49,
0x02, 0xF0, 0x8C, 0xFF, 0x0B, 0x4B, 0x18, 0x68,
0x02, 0xF0, 0x5E, 0xFB, 0x02, 0x4B, 0x1C, 0x70,
0x02, 0xF0, 0x4C, 0xFB, 0x10, 0xBD, 0xC0, 0x46,
0x3C, 0x00, 0x00, 0x20, 0x1C, 0x03, 0x00, 0x20,
0xE3, 0x01, 0x00, 0x20, 0xE2, 0x01, 0x00, 0x20,
0x5C, 0x00, 0x00, 0x20, 0x70, 0x01, 0x00, 0x20,
0xE0, 0x00, 0x00, 0x20, 0xFC, 0x02, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x09, 0x59, 0x00, 0x00,
0x0E, 0x59, 0x00, 0x00, 0x13, 0x59, 0x00, 0x00,
0x08, 0xB5, 0x02, 0xF0, 0x5F, 0xFB, 0x08, 0xBD,
0x08, 0xB5, 0x02, 0xF0, 0x4D, 0xFB, 0x08, 0xBD,
0x08, 0xB5, 0x02, 0xF0, 0xE5, 0xFA, 0x80, 0x23,
0xDB, 0x05, 0x9A, 0x6C, 0x01, 0x21, 0x0A, 0x43,
0x9A, 0x64, 0xFF, 0xF7, 0xF1, 0xFF, 0x08, 0xBD,
0xF0, 0xB5, 0x87, 0xB0, 0xFF, 0xF7, 0xF0, 0xFF,
0x78, 0x4A, 0x79, 0x4C, 0x53, 0x78, 0x15, 0x78,
0x78, 0x48, 0x10, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x9A, 0x1C, 0x67, 0x46, 0xB2, 0x18, 0x79, 0x01,
0x52, 0x00, 0x12, 0x5B, 0xC9, 0x18, 0x4F, 0x00,
0x3A, 0x52, 0x73, 0x4A, 0x00, 0x27, 0x8F, 0x54,
0x00, 0x2B, 0xEF, 0xD1, 0x63, 0x46, 0x5A, 0x1E,
0xD2, 0xB2, 0x00, 0x2B, 0x04, 0xD0, 0x56, 0x1C,
0x2B, 0x1C, 0xB6, 0x01, 0x94, 0x46, 0xF3, 0xE7,
0x6C, 0x4B, 0x6D, 0x4C, 0x1B, 0x78, 0x6D, 0x48,
0x67, 0x49, 0x6D, 0x4A, 0x0E, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0xE5, 0x5C, 0xC6, 0x5C, 0x01, 0x35,
0x02, 0x36, 0xAD, 0x01, 0xAD, 0x19, 0x6D, 0x00,
0x6E, 0x5A, 0x5D, 0x00, 0xAE, 0x52, 0x67, 0x4D,
0x00, 0x26, 0xEE, 0x54, 0x00, 0x2B, 0xEE, 0xD1,
0x65, 0x25, 0x03, 0x95, 0x5B, 0x4C, 0x66, 0xE0,
0xFF, 0xF7, 0xB2, 0xFF, 0x26, 0x78, 0x63, 0x78,
0x05, 0x96, 0x2D, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x58, 0x4F, 0xF0, 0x18, 0x04, 0x9D, 0x40, 0x00,
0x9A, 0x1C, 0xC0, 0x5B, 0xAD, 0x18, 0x54, 0x4F,
0x6D, 0x00, 0xEF, 0x5B, 0xC7, 0x1B, 0x04, 0xD4,
0x51, 0x4F, 0xED, 0x5B, 0x45, 0x1B, 0x02, 0x95,
0x03, 0xE0, 0x4F, 0x4F, 0xED, 0x5B, 0x2D, 0x1A,
0x02, 0x95, 0x04, 0x98, 0x87, 0x18, 0x4C, 0x48,
0x7F, 0x00, 0xC0, 0x5B, 0x4B, 0x4F, 0x84, 0x46,
0xF0, 0x18, 0x42, 0x00, 0x15, 0x1C, 0x62, 0x46,
0xEA, 0x53, 0x49, 0x4D, 0x2F, 0x5C, 0x02, 0x9D,
0xBD, 0x42, 0x00, 0xDA, 0x3D, 0x1C, 0x46, 0x4F,
0x3D, 0x54, 0x00, 0x2B, 0xD2, 0xD1, 0x0B, 0x1C,
0x59, 0x1E, 0xC9, 0xB2, 0x00, 0x2B, 0x05, 0xD0,
0x48, 0x1C, 0x80, 0x01, 0x05, 0x9B, 0x4E, 0x01,
0x04, 0x90, 0xF2, 0xE7, 0x3F, 0x4B, 0x3C, 0x4A,
0x1B, 0x78, 0x22, 0xE0, 0x3E, 0x4D, 0x01, 0x3B,
0xDB, 0xB2, 0x3E, 0x4F, 0xEE, 0x5C, 0x3E, 0x48,
0xFD, 0x5C, 0x59, 0x00, 0x01, 0x36, 0x09, 0x5A,
0x02, 0x35, 0xB0, 0x01, 0x40, 0x19, 0x40, 0x00,
0x87, 0x5A, 0x80, 0x5A, 0xCF, 0x1B, 0x01, 0xD4,
0x09, 0x1A, 0x00, 0xE0, 0x41, 0x1A, 0xB6, 0x01,
0x75, 0x19, 0x2F, 0x48, 0x6D, 0x00, 0x46, 0x5B,
0x33, 0x48, 0x5D, 0x00, 0x2E, 0x52, 0x33, 0x48,
0xC5, 0x5C, 0xA9, 0x42, 0x00, 0xDA, 0x29, 0x1C,
0xC1, 0x54, 0x00, 0x2B, 0xDA, 0xD1, 0x03, 0x9B,
0x01, 0x3B, 0xDB, 0xB2, 0x03, 0x93, 0x00, 0x2B,
0x92, 0xD1, 0x61, 0x78, 0x24, 0x78, 0x24, 0x4A,
0x04, 0x94, 0x1E, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x45, 0x01, 0xED, 0x18, 0x21, 0x4F, 0x6D, 0x00,
0xEE, 0x5B, 0x25, 0x88, 0xAC, 0x46, 0x9D, 0x1C,
0x66, 0x45, 0x09, 0xD9, 0x27, 0x88, 0xF6, 0x1B,
0x8F, 0x01, 0xBC, 0x46, 0x65, 0x44, 0x6D, 0x00,
0xB6, 0xB2, 0xAF, 0x5A, 0xAE, 0x52, 0x05, 0xE0,
0x8E, 0x01, 0x75, 0x19, 0x6D, 0x00, 0xAE, 0x5A,
0x00, 0x26, 0xAE, 0x52, 0x00, 0x2B, 0xE1, 0xD1,
0x01, 0x1C, 0x48, 0x1E, 0xC0, 0xB2, 0x00, 0x29,
0x05, 0xD0, 0x41, 0x1C, 0x18, 0x4F, 0xCC, 0x01,
0x04, 0x9B, 0xE4, 0x19, 0xF2, 0xE7, 0x11, 0x4B,
0x13, 0x4F, 0x1B, 0x78, 0x10, 0x4E, 0x15, 0x48,
0x10, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0xF5, 0x5C,
0x13, 0x49, 0xED, 0x01, 0x5A, 0x00, 0x6D, 0x18,
0xD4, 0x5B, 0x29, 0x88, 0x8C, 0x42, 0x03, 0xD9,
0x2D, 0x88, 0x64, 0x1B, 0x84, 0x52, 0x01, 0xE0,
0x00, 0x25, 0x85, 0x52, 0x00, 0x2B, 0xEC, 0xD1,
0x07, 0xB0, 0xF0, 0xBD, 0x0A, 0x03, 0x00, 0x20,
0x00, 0x40, 0x00, 0x40, 0xF8, 0x03, 0x00, 0x20,
0xB3, 0x0A, 0x00, 0x20, 0x7C, 0x09, 0x00, 0x20,
0x30, 0x75, 0x00, 0x00, 0x2A, 0x75, 0x00, 0x00,
0x14, 0x02, 0x00, 0x20, 0xA4, 0x0A, 0x00, 0x20,
0x02, 0x40, 0x00, 0x40, 0x3C, 0x0D, 0x00, 0x20,
0x82, 0x40, 0x00, 0x40, 0xF0, 0xB5, 0x87, 0xB0,
0x02, 0xF0, 0x4A, 0xF8, 0x02, 0xF0, 0x60, 0xF9,
0x00, 0x28, 0xFB, 0xD1, 0x52, 0x4B, 0x1B, 0x78,
0x02, 0x2B, 0x09, 0xD0, 0x51, 0x4B, 0x52, 0x49,
0x40, 0x33, 0x1A, 0x78, 0x53, 0x42, 0x54, 0x18,
0xE0, 0x54, 0x01, 0x33, 0x93, 0x42, 0xFA, 0xDD,
0x4C, 0x4E, 0x4E, 0x4F, 0x33, 0x1C, 0x40, 0x33,
0x1C, 0x78, 0x64, 0x42, 0x0C, 0xE0, 0xFA, 0x78,
0x80, 0x23, 0x12, 0x19, 0xD2, 0xB2, 0xDB, 0x05,
0x1A, 0x71, 0xFF, 0xF7, 0xC1, 0xFE, 0x28, 0x78,
0x20, 0x18, 0x03, 0xF0, 0xF3, 0xFD, 0x01, 0x34,
0x35, 0x1C, 0x40, 0x35, 0x2B, 0x78, 0x9C, 0x42,
0xED, 0xDD, 0x00, 0x26, 0x25, 0xE0, 0x2C, 0x78,
0x2F, 0x1C, 0x64, 0x42, 0x40, 0x3F, 0x1A, 0xE0,
0x3E, 0x4B, 0xDA, 0x78, 0x80, 0x23, 0x12, 0x19,
0xDB, 0x05, 0xD2, 0xB2, 0x1A, 0x71, 0xFF, 0xF7,
0xA7, 0xFE, 0x2D, 0x78, 0x04, 0xA9, 0x65, 0x19,
0x05, 0xAA, 0x28, 0x1C, 0x03, 0xF0, 0xF8, 0xFD,
0x35, 0x49, 0x04, 0x9B, 0x4A, 0x5D, 0xFF, 0x2B,
0x00, 0xDD, 0xFF, 0x23, 0x9A, 0x42, 0x00, 0xDA,
0x1A, 0x1C, 0x4A, 0x55, 0x01, 0x34, 0x3D, 0x1C,
0x40, 0x35, 0x2B, 0x78, 0x9C, 0x42, 0xDF, 0xDD,
0x01, 0x36, 0x2F, 0x4A, 0x2B, 0x4D, 0x13, 0x78,
0x40, 0x35, 0x9E, 0x42, 0xD3, 0xDB, 0x01, 0xF0,
0xDF, 0xFF, 0x2C, 0x49, 0x2A, 0x78, 0x0D, 0x78,
0x2B, 0x49, 0x27, 0x48, 0x09, 0x78, 0x01, 0x23,
0x03, 0x91, 0x9B, 0x1A, 0x00, 0x21, 0x29, 0x4C,
0x10, 0x18, 0x94, 0x46, 0x11, 0xE0, 0xC6, 0x18,
0x72, 0x1E, 0x12, 0x78, 0xC7, 0x5C, 0x6A, 0x43,
0x02, 0x92, 0x03, 0x9A, 0x57, 0x43, 0x02, 0x9A,
0xD7, 0x19, 0x72, 0x78, 0x6A, 0x43, 0xBA, 0x18,
0x94, 0x42, 0x01, 0xDB, 0x94, 0xB2, 0x19, 0x1C,
0x01, 0x33, 0x9C, 0x45, 0xEB, 0xDC, 0x19, 0x4B,
0x1D, 0x4C, 0xDA, 0x78, 0x51, 0x18, 0xC9, 0xB2,
0x99, 0x70, 0x13, 0x4B, 0x18, 0x78, 0x00, 0x28,
0x05, 0xD1, 0x23, 0x78, 0x00, 0x2B, 0x02, 0xD0,
0x18, 0x49, 0x02, 0xF0, 0xB7, 0xFD, 0x23, 0x78,
0x00, 0x2B, 0x0B, 0xD0, 0x0D, 0x4B, 0x00, 0x20,
0x40, 0x33, 0x19, 0x78, 0x0C, 0x4A, 0x49, 0x00,
0x01, 0x31, 0xC9, 0xB2, 0x01, 0x23, 0x00, 0x90,
0x02, 0xF0, 0x50, 0xFD, 0x0E, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x06, 0xD0, 0x01, 0x21, 0x00, 0x20,
0x0D, 0x4A, 0x0B, 0x1C, 0x00, 0x90, 0x02, 0xF0,
0x45, 0xFD, 0x07, 0xB0, 0xF0, 0xBD, 0xC0, 0x46,
0xE0, 0x01, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x93, 0x01, 0x00, 0x20, 0xAA, 0x0A, 0x00, 0x20,
0x87, 0x0D, 0x00, 0x20, 0x54, 0x00, 0x00, 0x20,
0x55, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x00,
0xEB, 0x01, 0x00, 0x20, 0x1A, 0x59, 0x00, 0x00,
0xAC, 0x0A, 0x00, 0x20, 0x13, 0xB5, 0x24, 0x4B,
0x24, 0x4C, 0x1B, 0x68, 0x00, 0x2B, 0x0E, 0xD0,
0x23, 0x78, 0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20,
0x21, 0x49, 0x02, 0xF0, 0x77, 0xFD, 0xFF, 0xF7,
0x6D, 0xFA, 0x23, 0x78, 0x00, 0x2B, 0x02, 0xD1,
0x02, 0xF0, 0x38, 0xF8, 0xFE, 0xE7, 0x23, 0x78,
0x00, 0x2B, 0x09, 0xD0, 0x1B, 0x4C, 0x23, 0x68,
0xDA, 0x00, 0x05, 0xD5, 0xFF, 0xF7, 0x5E, 0xFA,
0x22, 0x68, 0x19, 0x4B, 0x13, 0x40, 0x23, 0x60,
0x14, 0x4C, 0x23, 0x78, 0x00, 0x2B, 0x22, 0xD0,
0x14, 0x4B, 0x1B, 0x68, 0x5A, 0x01, 0x1E, 0xD5,
0x14, 0x49, 0x00, 0x20, 0x02, 0xF0, 0x56, 0xFD,
0x13, 0x4B, 0x14, 0x4A, 0x19, 0x88, 0x11, 0x80,
0x59, 0x88, 0x51, 0x80, 0x99, 0x88, 0x91, 0x80,
0xDB, 0x88, 0xD3, 0x80, 0x10, 0x4B, 0x1B, 0x78,
0x13, 0x81, 0x23, 0x78, 0x00, 0x2B, 0x05, 0xD0,
0x00, 0x20, 0x05, 0x21, 0x02, 0x23, 0x00, 0x90,
0x02, 0xF0, 0xE8, 0xFC, 0x05, 0x4B, 0x0B, 0x4A,
0x19, 0x68, 0x0A, 0x40, 0x1A, 0x60, 0x13, 0xBD,
0x0C, 0x1E, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0x20, 0x59, 0x00, 0x00, 0x58, 0x00, 0x00, 0x20,
0xFF, 0xFF, 0xFF, 0xEF, 0x27, 0x59, 0x00, 0x00,
0x04, 0x02, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0xAA, 0x0A, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0xFB,
0x10, 0xB5, 0x02, 0x28, 0x04, 0xD0, 0x03, 0x28,
0x45, 0xD0, 0x01, 0x28, 0x33, 0xD1, 0x15, 0xE0,
0xFF, 0xF7, 0xF6, 0xF9, 0x29, 0x4B, 0x2A, 0x4C,
0x40, 0x33, 0x1B, 0x78, 0x29, 0x49, 0x50, 0x22,
0x23, 0x70, 0x29, 0x48, 0x04, 0xF0, 0xA6, 0xF9,
0x28, 0x4B, 0x0D, 0x20, 0x1B, 0x68, 0x98, 0x47,
0xFF, 0xF7, 0xF4, 0xF9, 0x23, 0x78, 0x10, 0x2B,
0x1A, 0xD1, 0x14, 0xE0, 0xFF, 0xF7, 0xE0, 0xF9,
0x1E, 0x4B, 0x1F, 0x4C, 0x40, 0x33, 0x1B, 0x78,
0x21, 0x49, 0x50, 0x22, 0x23, 0x70, 0x1E, 0x48,
0x04, 0xF0, 0x90, 0xF9, 0x1D, 0x4B, 0x0C, 0x20,
0x1B, 0x68, 0x98, 0x47, 0xFF, 0xF7, 0xDE, 0xF9,
0x23, 0x78, 0x10, 0x2B, 0x04, 0xD1, 0x1B, 0x4B,
0xDA, 0x78, 0x9A, 0x70, 0x02, 0xF0, 0xD1, 0xFA,
0x02, 0xF0, 0x54, 0xFA, 0x20, 0xE0, 0x18, 0x4B,
0x1A, 0x78, 0x00, 0x2A, 0x05, 0xD0, 0x17, 0x4A,
0x11, 0x68, 0x01, 0x31, 0x11, 0x60, 0x00, 0x22,
0x1A, 0x70, 0x15, 0x4B, 0x1A, 0x68, 0x13, 0x2A,
0x05, 0xDD, 0x00, 0x22, 0x1A, 0x60, 0x0A, 0x4B,
0x10, 0x22, 0x1A, 0x70, 0x0C, 0xE0, 0x0F, 0x4B,
0x1A, 0x68, 0x3B, 0x2A, 0x08, 0xDD, 0x00, 0x22,
0x1A, 0x60, 0x0E, 0x4B, 0x01, 0x20, 0x1B, 0x68,
0x98, 0x47, 0x0D, 0x4B, 0x01, 0x22, 0x1A, 0x70,
0x10, 0xBD, 0xC0, 0x46, 0xAE, 0x09, 0x00, 0x20,
0x1D, 0x03, 0x00, 0x20, 0x4A, 0x74, 0x00, 0x00,
0x48, 0x0D, 0x00, 0x20, 0xF8, 0x01, 0x00, 0x20,
0x9A, 0x74, 0x00, 0x00, 0xAA, 0x0A, 0x00, 0x20,
0xC4, 0x01, 0x00, 0x20, 0xC0, 0x01, 0x00, 0x20,
0xBC, 0x01, 0x00, 0x20, 0x6C, 0x00, 0x00, 0x20,
0xE7, 0x01, 0x00, 0x20, 0x10, 0xB5, 0x0C, 0x4B,
0x01, 0x22, 0x99, 0x79, 0x00, 0x23, 0x00, 0xE0,
0x23, 0x1C, 0x5C, 0x1C, 0x10, 0x1C, 0xE4, 0xB2,
0x98, 0x40, 0x81, 0x42, 0xF8, 0xDA, 0x07, 0x4A,
0x07, 0x21, 0x13, 0x71, 0x80, 0x22, 0xD2, 0x05,
0x0B, 0x40, 0x19, 0x02, 0x10, 0x6C, 0x04, 0x4B,
0x03, 0x40, 0x0B, 0x43, 0x13, 0x64, 0x10, 0xBD,
0x48, 0x0D, 0x00, 0x20, 0x5C, 0x00, 0x00, 0x20,
0xFF, 0xF8, 0xFF, 0xFF, 0x06, 0x4B, 0x07, 0x22,
0xD9, 0x79, 0x80, 0x23, 0xDB, 0x05, 0x18, 0x6C,
0x11, 0x40, 0x04, 0x4A, 0x09, 0x02, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x64, 0x70, 0x47, 0xC0, 0x46,
0x48, 0x0D, 0x00, 0x20, 0xFF, 0xF8, 0xFF, 0xFF,
0xF0, 0xB5, 0x8D, 0xB0, 0x04, 0x90, 0xFF, 0xF7,
0xC9, 0xFF, 0xC7, 0x4B, 0xC7, 0x48, 0xDE, 0x78,
0x00, 0x21, 0x05, 0x96, 0x9C, 0x78, 0x07, 0xE0,
0x01, 0x3B, 0xDB, 0xB2, 0xEE, 0x18, 0x76, 0x00,
0x31, 0x52, 0x00, 0x2B, 0xF8, 0xD1, 0x05, 0x92,
0x05, 0x9A, 0x05, 0x9E, 0x01, 0x3A, 0xD2, 0xB2,
0x00, 0x2E, 0x02, 0xD0, 0x23, 0x1C, 0x55, 0x01,
0xF3, 0xE7, 0x04, 0x9F, 0x00, 0x2F, 0x05, 0xD0,
0xBB, 0x4B, 0x05, 0x9E, 0x5B, 0x7B, 0x06, 0x96,
0x03, 0x93, 0x04, 0xE0, 0xB9, 0x4B, 0x02, 0x27,
0x9B, 0x78, 0x06, 0x97, 0x03, 0x93, 0x68, 0x46,
0x0C, 0x21, 0x0B, 0x56, 0xB2, 0x4C, 0x0B, 0x93,
0x5B, 0x42, 0x09, 0x93, 0xAA, 0xE0, 0x6A, 0x46,
0x18, 0x23, 0x9A, 0x56, 0xE6, 0x7A, 0x27, 0x1C,
0x02, 0x92, 0x0D, 0xE0, 0x30, 0x1C, 0x00, 0x21,
0x2A, 0x1C, 0x02, 0x9B, 0x02, 0xF0, 0x4C, 0xF9,
0x30, 0x1C, 0x01, 0x21, 0x2A, 0x1C, 0x02, 0x9B,
0x02, 0xF0, 0x46, 0xF9, 0x01, 0x36, 0xF6, 0xB2,
0xBB, 0x7A, 0xFA, 0x7A, 0xD2, 0x18, 0x3B, 0x1C,
0x96, 0x42, 0xEB, 0xDB, 0x04, 0x9E, 0x00, 0x2E,
0x00, 0xD1, 0x0E, 0x3D, 0x68, 0x46, 0x18, 0x21,
0x08, 0x56, 0x5E, 0x7B, 0x9E, 0x4F, 0x02, 0x90,
0x0D, 0xE0, 0x30, 0x1C, 0x00, 0x21, 0x2A, 0x1C,
0x02, 0x9B, 0x02, 0xF0, 0x2D, 0xF9, 0x30, 0x1C,
0x01, 0x21, 0x2A, 0x1C, 0x02, 0x9B, 0x02, 0xF0,
0x27, 0xF9, 0x01, 0x36, 0xF6, 0xB2, 0x7A, 0x7B,
0x3B, 0x7B, 0xD3, 0x18, 0x9E, 0x42, 0xEC, 0xDB,
0xFF, 0xF7, 0xAE, 0xFC, 0x96, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x06, 0xD0, 0x01, 0x23, 0x18, 0x1C,
0x19, 0x1C, 0x0B, 0xAA, 0x00, 0x93, 0x02, 0xF0,
0xAD, 0xFB, 0x00, 0x25, 0x8C, 0x4E, 0x90, 0x4F,
0x0E, 0xE0, 0x3B, 0x78, 0x00, 0x2B, 0x09, 0xD0,
0x8E, 0x4B, 0xEA, 0x01, 0xD2, 0x18, 0x00, 0x23,
0xB1, 0x78, 0x01, 0x20, 0x00, 0x93, 0x02, 0x23,
0x02, 0xF0, 0x9C, 0xFB, 0x01, 0x35, 0xED, 0xB2,
0xF3, 0x78, 0x9D, 0x42, 0xED, 0xD3, 0x0B, 0x9A,
0xB6, 0x78, 0xD2, 0xB2, 0x02, 0x96, 0x07, 0x92,
0x80, 0x4D, 0x39, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x08, 0x9E, 0x99, 0x1C, 0x71, 0x18, 0x82, 0x4F,
0x49, 0x00, 0xCE, 0x5B, 0xD1, 0x18, 0x48, 0x00,
0x40, 0x5B, 0xB7, 0xB2, 0xB8, 0x42, 0x14, 0xDC,
0xC0, 0x1B, 0x01, 0x1C, 0x80, 0x31, 0x01, 0xDA,
0x80, 0x20, 0x40, 0x42, 0xD7, 0x18, 0x7F, 0x28,
0x00, 0xDD, 0x7F, 0x20, 0x79, 0x49, 0x78, 0x54,
0xD1, 0x18, 0x48, 0x00, 0x2E, 0x52, 0x1C, 0x27,
0x6E, 0x46, 0x77, 0x48, 0xBE, 0x5D, 0x0E, 0x54,
0x13, 0xE0, 0x04, 0x9E, 0x00, 0x2E, 0x10, 0xD0,
0x74, 0x4E, 0xB0, 0x42, 0x08, 0xD0, 0x71, 0x4E,
0x8E, 0x57, 0x80, 0x19, 0x87, 0x42, 0x03, 0xDA,
0x6F, 0x48, 0x0E, 0x5C, 0x01, 0x36, 0x0E, 0x54,
0xD1, 0x18, 0x01, 0x27, 0x49, 0x00, 0x7F, 0x42,
0x6F, 0x52, 0x00, 0x2B, 0xC6, 0xD1, 0x63, 0x46,
0x5E, 0x1E, 0xF6, 0xB2, 0x00, 0x2B, 0x06, 0xD0,
0x72, 0x1C, 0x92, 0x01, 0x08, 0x92, 0x02, 0x9B,
0x72, 0x01, 0xB4, 0x46, 0xF1, 0xE7, 0x0B, 0x9B,
0x01, 0x3B, 0x0B, 0x93, 0x0B, 0x9D, 0x09, 0x9E,
0xB5, 0x42, 0x00, 0xDB, 0x4F, 0xE7, 0x04, 0x9F,
0x00, 0x2F, 0x45, 0xD0, 0xA0, 0x78, 0xE3, 0x78,
0x04, 0x90, 0x61, 0x78, 0x56, 0x4A, 0x06, 0x91,
0x24, 0x78, 0x02, 0x94, 0x11, 0x7C, 0xD0, 0x7A,
0x5B, 0x4C, 0x08, 0x18, 0xC0, 0xB2, 0x07, 0x90,
0x12, 0x7B, 0x89, 0x18, 0xC9, 0xB2, 0x08, 0x91,
0x55, 0x4A, 0x28, 0xE0, 0x03, 0x9E, 0x01, 0x3B,
0xDB, 0xB2, 0x00, 0x2E, 0x01, 0xD1, 0xC7, 0x18,
0xD6, 0x55, 0x06, 0x9E, 0xB1, 0x42, 0x02, 0xD2,
0x02, 0x9F, 0xBB, 0x42, 0x0C, 0xD3, 0xEF, 0x18,
0xC6, 0x18, 0x09, 0x97, 0x97, 0x5D, 0xBC, 0x46,
0x09, 0x9F, 0xE7, 0x5D, 0xBC, 0x44, 0x08, 0x9F,
0xBC, 0x44, 0x67, 0x46, 0x97, 0x55, 0x0B, 0xE0,
0xEF, 0x18, 0xC6, 0x18, 0x09, 0x97, 0x97, 0x5D,
0xBC, 0x46, 0x09, 0x9F, 0xE7, 0x5D, 0xBC, 0x44,
0x07, 0x9F, 0xBC, 0x44, 0x67, 0x46, 0x97, 0x55,
0x00, 0x2B, 0xD7, 0xD1, 0x0B, 0x1C, 0x59, 0x1E,
0xC9, 0xB2, 0x00, 0x2B, 0x3E, 0xD0, 0x26, 0x25,
0x04, 0x9B, 0x48, 0x01, 0x4D, 0x43, 0xF3, 0xE7,
0x63, 0x7C, 0xE2, 0x79, 0x07, 0x25, 0x9A, 0x18,
0x03, 0x92, 0x34, 0x4A, 0xA0, 0x7B, 0x02, 0x21,
0x52, 0x5E, 0x26, 0x79, 0xAD, 0x1A, 0x6D, 0x00,
0x86, 0x19, 0xED, 0xB2, 0x34, 0x49, 0x84, 0x46,
0x09, 0xE0, 0xB8, 0x18, 0x44, 0x5C, 0x01, 0x32,
0x2C, 0x19, 0x44, 0x54, 0xD2, 0xB2, 0xB2, 0x42,
0xF7, 0xDB, 0x01, 0x33, 0xDB, 0xB2, 0x03, 0x9A,
0x93, 0x42, 0x02, 0xDA, 0x62, 0x46, 0x5F, 0x01,
0xF5, 0xE7, 0x23, 0x4A, 0x2A, 0x49, 0x10, 0x7C,
0xD3, 0x7B, 0x56, 0x79, 0x95, 0x79, 0x9E, 0x19,
0x45, 0x19, 0x84, 0x46, 0x09, 0xE0, 0xB8, 0x18,
0x44, 0x5C, 0x01, 0x32, 0x0E, 0x3C, 0x44, 0x54,
0xD2, 0xB2, 0xAA, 0x42, 0xF7, 0xDB, 0x01, 0x33,
0xDB, 0xB2, 0xB3, 0x42, 0x02, 0xDA, 0x62, 0x46,
0x5F, 0x01, 0xF6, 0xE7, 0x1A, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x13, 0xD0, 0x05, 0x20, 0x1F, 0x49,
0x02, 0xF0, 0x10, 0xFB, 0x0E, 0xE0, 0x2B, 0x78,
0x00, 0x2B, 0x08, 0xD0, 0x18, 0x4B, 0x72, 0x01,
0xA1, 0x78, 0xD2, 0x18, 0x05, 0x20, 0x01, 0x23,
0x00, 0x93, 0x02, 0xF0, 0xAB, 0xFA, 0x01, 0x36,
0xF6, 0xB2, 0x02, 0xE0, 0x0A, 0x4C, 0x0E, 0x4D,
0x05, 0x9E, 0xE3, 0x78, 0xB3, 0x42, 0xEA, 0xD8,
0x00, 0x21, 0x01, 0x20, 0x0A, 0x1C, 0x40, 0x42,
0x02, 0x23, 0x02, 0xF0, 0x01, 0xF8, 0x01, 0x20,
0x40, 0x42, 0x01, 0x21, 0x00, 0x22, 0x02, 0x23,
0x01, 0xF0, 0xFA, 0xFF, 0xA4, 0x78, 0x25, 0xE0,
0x0A, 0x03, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x04, 0x02, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x84, 0x40, 0x00, 0x40,
0x00, 0x40, 0x00, 0x40, 0x64, 0x0E, 0x00, 0x20,
0xB3, 0x0A, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x00,
0x36, 0x75, 0x00, 0x00, 0x2E, 0x59, 0x00, 0x00,
0x01, 0x3C, 0x00, 0x21, 0xE4, 0xB2, 0x0A, 0x1C,
0x20, 0x1C, 0x01, 0x23, 0x01, 0xF0, 0xD8, 0xFF,
0x01, 0x21, 0x20, 0x1C, 0x00, 0x22, 0x0B, 0x1C,
0x01, 0xF0, 0xD2, 0xFF, 0x00, 0x2C, 0xEF, 0xD1,
0xFF, 0xF7, 0x30, 0xFE, 0x0D, 0xB0, 0xF0, 0xBD,
0x08, 0xB5, 0x03, 0xF0, 0xC5, 0xFD, 0x05, 0x4B,
0x01, 0x20, 0x1B, 0x68, 0x98, 0x47, 0x01, 0x20,
0x04, 0xF0, 0x22, 0xF9, 0x01, 0xF0, 0xD6, 0xFD,
0x08, 0xBD, 0xC0, 0x46, 0xF8, 0x01, 0x00, 0x20,
0xF7, 0xB5, 0x2C, 0x4A, 0x00, 0x20, 0x10, 0x60,
0x2B, 0x4A, 0x2C, 0x4E, 0x11, 0x8C, 0x2C, 0x4A,
0x11, 0x60, 0x72, 0x1D, 0xD2, 0x7F, 0xF1, 0x7D,
0x50, 0x1E, 0x44, 0x42, 0x60, 0x41, 0x29, 0x4C,
0x08, 0x1A, 0x00, 0x90, 0x20, 0x60, 0xB0, 0x1D,
0xC5, 0x7F, 0x37, 0x7E, 0x6B, 0x1E, 0x58, 0x42,
0x58, 0x41, 0x3B, 0x1A, 0x01, 0x93, 0x63, 0x60,
0x01, 0x2A, 0x02, 0xD1, 0x00, 0x20, 0x20, 0x81,
0x05, 0xE0, 0x26, 0x23, 0xF0, 0x5E, 0x49, 0x00,
0x03, 0xF0, 0xBA, 0xFE, 0x20, 0x81, 0x01, 0x2D,
0x02, 0xD1, 0x00, 0x23, 0x63, 0x81, 0x05, 0xE0,
0x28, 0x23, 0xF0, 0x5E, 0x79, 0x00, 0x03, 0xF0,
0xAF, 0xFE, 0x60, 0x81, 0x15, 0x4F, 0x01, 0x9B,
0x28, 0x20, 0x3E, 0x5E, 0x59, 0x00, 0x70, 0x00,
0x80, 0x19, 0x03, 0xF0, 0xA5, 0xFE, 0x40, 0x43,
0x12, 0x4C, 0x43, 0x00, 0x80, 0x00, 0xE3, 0x60,
0xC3, 0x18, 0x23, 0x61, 0x26, 0x20, 0x3D, 0x5E,
0x00, 0x9B, 0x68, 0x00, 0x59, 0x00, 0x40, 0x19,
0x03, 0xF0, 0x96, 0xFE, 0x2C, 0x37, 0x60, 0x61,
0xA0, 0x61, 0x3B, 0x78, 0x00, 0x2B, 0x02, 0xD1,
0xE6, 0x61, 0x25, 0x62, 0x01, 0xE0, 0xE5, 0x61,
0x26, 0x62, 0x07, 0x4B, 0x01, 0x22, 0x52, 0x42,
0x5A, 0x60, 0xF7, 0xBD, 0x9C, 0x0D, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x20, 0x02, 0x00, 0x20, 0x24, 0x09, 0x00, 0x20,
0xCC, 0x00, 0x00, 0x20, 0xF0, 0xB5, 0x24, 0x4B,
0x87, 0xB0, 0x1E, 0x7E, 0xDB, 0x7D, 0x72, 0x1C,
0xD9, 0x1C, 0x02, 0x33, 0x03, 0x93, 0x05, 0x92,
0x00, 0x23, 0x20, 0x4A, 0x04, 0x91, 0x18, 0x1C,
0x05, 0x9C, 0xE5, 0x1A, 0xEF, 0x01, 0x01, 0x97,
0xBC, 0x5A, 0xB8, 0x52, 0x04, 0x9C, 0xAD, 0x01,
0x29, 0x19, 0x4F, 0x00, 0xBC, 0x5A, 0x1A, 0x4C,
0xB8, 0x52, 0x00, 0x27, 0x2F, 0x55, 0x0F, 0x55,
0x01, 0x99, 0x18, 0x4F, 0x01, 0x33, 0xCF, 0x19,
0x02, 0x97, 0x39, 0x88, 0x38, 0x80, 0x03, 0x99,
0x6F, 0x18, 0x79, 0x00, 0x01, 0x91, 0x89, 0x5A,
0x01, 0x99, 0x88, 0x52, 0x12, 0x49, 0x6D, 0x18,
0x00, 0x21, 0x29, 0x70, 0x39, 0x55, 0xF7, 0x1A,
0x0C, 0x4D, 0x01, 0x37, 0xD8, 0xDA, 0x00, 0x22,
0x01, 0x36, 0x03, 0x9B, 0x11, 0x1C, 0xB6, 0x01,
0x58, 0x00, 0x2F, 0x5A, 0x2A, 0x52, 0xF0, 0x18,
0x47, 0x00, 0xEC, 0x5B, 0xEA, 0x53, 0x06, 0x4F,
0xF9, 0x54, 0x01, 0x3B, 0x39, 0x54, 0x01, 0x2B,
0xF2, 0xD1, 0x07, 0xB0, 0xF0, 0xBD, 0xC0, 0x46,
0xAE, 0x09, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40,
0x00, 0x20, 0x00, 0x40, 0x02, 0x40, 0x00, 0x40,
0x01, 0x20, 0x00, 0x40, 0xF7, 0xB5, 0x0D, 0x4B,
0x19, 0x7E, 0xDE, 0x7D, 0x48, 0x1C, 0x01, 0x36,
0x00, 0x23, 0x01, 0x90, 0x01, 0x9C, 0x32, 0x1C,
0xE7, 0x1A, 0xBF, 0x01, 0x95, 0x1C, 0xAC, 0x46,
0xBC, 0x44, 0x07, 0x4C, 0x00, 0x25, 0x60, 0x46,
0x01, 0x3A, 0x05, 0x55, 0x50, 0x1C, 0xF5, 0xDA,
0x01, 0x33, 0xCA, 0x1A, 0x01, 0x32, 0xED, 0xDA,
0xF7, 0xBD, 0xC0, 0x46, 0xAE, 0x09, 0x00, 0x20,
0x00, 0x20, 0x00, 0x40, 0x00, 0xB5, 0x0D, 0x4B,
0x08, 0x22, 0x9B, 0x5E, 0x0C, 0x4A, 0x11, 0x1C,
0x35, 0x31, 0x09, 0x78, 0x12, 0x7F, 0x4B, 0x43,
0x52, 0xB2, 0x9B, 0x11, 0x93, 0x42, 0x00, 0xDA,
0x13, 0x1C, 0x08, 0x4A, 0x13, 0x60, 0x80, 0x22,
0xD2, 0x05, 0x1B, 0x05, 0x19, 0x09, 0x90, 0x69,
0x05, 0x4B, 0x03, 0x40, 0x0B, 0x43, 0x93, 0x61,
0x00, 0xBD, 0xC0, 0x46, 0x70, 0x01, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x38, 0x0D, 0x00, 0x20,
0xFF, 0xFF, 0x00, 0xF0, 0xF0, 0xB5, 0xA9, 0x4A,
0xA9, 0x48, 0x11, 0x68, 0x07, 0x68, 0x93, 0xB0,
0x8C, 0x46, 0x0D, 0x22, 0x00, 0x21, 0x7F, 0x25,
0xFF, 0x24, 0x01, 0x97, 0x90, 0x00, 0x83, 0x18,
0xA4, 0x4E, 0x5B, 0x00, 0xF3, 0x18, 0x99, 0x87,
0x00, 0x27, 0x38, 0x33, 0x1F, 0x72, 0x67, 0x46,
0x39, 0x50, 0x01, 0x3A, 0x01, 0x9F, 0xD2, 0xB2,
0x39, 0x50, 0x00, 0x26, 0xDD, 0x72, 0x5D, 0x72,
0x1C, 0x73, 0x9C, 0x72, 0xD9, 0x80, 0xFF, 0x2A,
0xE8, 0xD1, 0x9B, 0x4A, 0x9B, 0x4B, 0x11, 0x7E,
0x98, 0x68, 0x9B, 0x4C, 0x97, 0x4D, 0x01, 0x39,
0x04, 0x90, 0xA6, 0x81, 0x2E, 0x60, 0x88, 0x42,
0x02, 0xDA, 0x01, 0x30, 0x04, 0x90, 0x98, 0x60,
0xDE, 0x68, 0x11, 0x96, 0x00, 0x2E, 0x02, 0xDD,
0x01, 0x3E, 0x11, 0x96, 0xDE, 0x60, 0xD1, 0x7D,
0x1A, 0x68, 0x01, 0x39, 0x8A, 0x42, 0x01, 0xDA,
0x01, 0x32, 0x1A, 0x60, 0x5A, 0x68, 0x00, 0x2A,
0x01, 0xDD, 0x01, 0x3A, 0x5A, 0x60, 0x04, 0x9F,
0x11, 0x98, 0x87, 0x42, 0x00, 0xDA, 0xA3, 0xE0,
0x19, 0x68, 0x5B, 0x68, 0x84, 0x4A, 0x06, 0x93,
0x88, 0x4B, 0x12, 0x68, 0x1B, 0x68, 0x86, 0x4C,
0x0D, 0x93, 0x80, 0x4B, 0x10, 0x91, 0x1B, 0x68,
0x09, 0x92, 0x0A, 0x93, 0xA4, 0x89, 0x84, 0x48,
0x0C, 0x94, 0x06, 0x9D, 0x10, 0x9E, 0xB5, 0x42,
0x00, 0xDD, 0x81, 0xE0, 0x04, 0x9A, 0x6F, 0x46,
0x10, 0x21, 0x01, 0x32, 0xCF, 0x5D, 0x92, 0x01,
0x33, 0x1C, 0x02, 0x92, 0x07, 0x97, 0x05, 0xE0,
0x00, 0x27, 0x2F, 0x54, 0x06, 0x9F, 0x01, 0x3B,
0x9F, 0x42, 0x71, 0xDC, 0x02, 0x99, 0x9C, 0x1C,
0x0D, 0x19, 0x2A, 0x5C, 0x77, 0x4E, 0x69, 0x00,
0x89, 0x5B, 0x0E, 0x2A, 0xF0, 0xD8, 0x0D, 0x9D,
0x49, 0x1B, 0x00, 0x2A, 0x00, 0xD1, 0x71, 0xE0,
0x01, 0x3A, 0xD4, 0xB2, 0x09, 0x9E, 0x04, 0x9F,
0xA2, 0x00, 0xB5, 0x18, 0x4F, 0x43, 0x2E, 0x68,
0xB4, 0x46, 0x67, 0x44, 0x2F, 0x60, 0x0A, 0x9D,
0x0E, 0x1C, 0xAF, 0x18, 0x3D, 0x68, 0x5E, 0x43,
0xAC, 0x46, 0x15, 0x19, 0x6D, 0x00, 0x01, 0x95,
0x62, 0x4D, 0x66, 0x44, 0xAC, 0x46, 0x01, 0x9D,
0x3E, 0x60, 0xAC, 0x44, 0x65, 0x46, 0xAF, 0x8F,
0x38, 0x35, 0x2E, 0x7A, 0xCF, 0x19, 0x03, 0x96,
0x09, 0x26, 0xAE, 0x57, 0xAF, 0x80, 0x01, 0x96,
0x0C, 0x9E, 0x6F, 0x46, 0xB4, 0x46, 0x01, 0x26,
0xB4, 0x44, 0x03, 0x9E, 0x01, 0x36, 0x03, 0x96,
0x66, 0x46, 0xB6, 0xB2, 0x0C, 0x96, 0x0C, 0x26,
0xF7, 0x5D, 0x04, 0x9E, 0x2F, 0x72, 0x01, 0x9F,
0xBE, 0x42, 0x00, 0xDA, 0x6E, 0x72, 0x51, 0x4E,
0x15, 0x19, 0x6D, 0x00, 0x75, 0x19, 0x38, 0x35,
0x0A, 0x26, 0xAE, 0x57, 0x04, 0x9F, 0xB7, 0x42,
0x00, 0xDD, 0xAF, 0x72, 0x4B, 0x4E, 0x15, 0x19,
0x6D, 0x00, 0x75, 0x19, 0x38, 0x35, 0x0B, 0x26,
0xAE, 0x57, 0xB3, 0x42, 0x00, 0xDA, 0xEB, 0x72,
0x15, 0x19, 0x46, 0x4F, 0x6D, 0x00, 0x7D, 0x19,
0x38, 0x35, 0x0C, 0x26, 0xAE, 0x57, 0xB3, 0x42,
0x00, 0xDD, 0x2B, 0x73, 0x12, 0x19, 0x41, 0x4C,
0x52, 0x00, 0xA2, 0x18, 0x3E, 0x25, 0x54, 0x5F,
0x38, 0x32, 0xA1, 0x42, 0x8E, 0xDD, 0x06, 0x9F,
0x01, 0x3B, 0xD1, 0x80, 0x9F, 0x42, 0x8D, 0xDD,
0x04, 0x99, 0x11, 0x9A, 0x01, 0x39, 0x04, 0x91,
0x91, 0x42, 0x00, 0xDB, 0x71, 0xE7, 0x6B, 0x46,
0x30, 0x24, 0xE4, 0x5A, 0x38, 0x4B, 0x9C, 0x81,
0x13, 0xB0, 0xF0, 0xBD, 0x02, 0x39, 0xCA, 0x43,
0xD2, 0x17, 0x11, 0x40, 0x03, 0x91, 0x04, 0x9E,
0x03, 0x9F, 0x71, 0x43, 0x5F, 0x43, 0x0E, 0x91,
0x00, 0x25, 0xD9, 0xB2, 0x0F, 0x97, 0x05, 0x91,
0x03, 0x22, 0x01, 0x95, 0x9C, 0x46, 0x08, 0x94,
0x31, 0x4E, 0x32, 0x4F, 0x07, 0x9C, 0xB1, 0x5C,
0x05, 0x9D, 0xBB, 0x5C, 0x61, 0x18, 0xEB, 0x18,
0x49, 0xB2, 0x01, 0x31, 0x5B, 0xB2, 0x89, 0x01,
0x02, 0x33, 0xCB, 0x18, 0x1C, 0x5C, 0x65, 0xB2,
0x69, 0x1E, 0x0D, 0x29, 0x27, 0xD8, 0x08, 0x9B,
0x02, 0x9F, 0x8E, 0x00, 0xFF, 0x18, 0x0B, 0x97,
0x09, 0x9F, 0x71, 0x18, 0xBB, 0x19, 0x0A, 0x9F,
0x49, 0x00, 0xBF, 0x19, 0x1B, 0x4E, 0x00, 0x97,
0x01, 0x9F, 0x71, 0x18, 0x38, 0x31, 0x00, 0x2F,
0x1A, 0xD1, 0xE4, 0xB2, 0x01, 0x94, 0x0B, 0x9D,
0x0E, 0x34, 0xE4, 0xB2, 0x2C, 0x54, 0x1C, 0x68,
0x0E, 0x9E, 0x00, 0x9F, 0xA4, 0x19, 0x1C, 0x60,
0x3B, 0x68, 0x0F, 0x9C, 0x03, 0x9D, 0x1B, 0x19,
0x3B, 0x60, 0x8C, 0x88, 0x0B, 0x7A, 0x2C, 0x19,
0x01, 0x33, 0x8C, 0x80, 0x0B, 0x72, 0x53, 0x1E,
0x00, 0x2A, 0x10, 0xD0, 0xDA, 0xB2, 0xBF, 0xE7,
0x02, 0x9E, 0x08, 0x99, 0x01, 0x9C, 0x73, 0x18,
0x1F, 0x2C, 0xF4, 0xD0, 0xAC, 0x42, 0xF2, 0xD0,
0x1F, 0x25, 0x1F, 0x26, 0x1D, 0x54, 0x01, 0x96,
0x53, 0x1E, 0x00, 0x2A, 0xEE, 0xD1, 0x63, 0x46,
0x18, 0xE7, 0xC0, 0x46, 0x44, 0x00, 0x00, 0x20,
0x48, 0x00, 0x00, 0x20, 0x24, 0x02, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xE4, 0x10, 0x00, 0x20,
0x70, 0x01, 0x00, 0x20, 0x38, 0x0D, 0x00, 0x20,
0x00, 0x20, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
0xF8, 0x59, 0x00, 0x00, 0xF4, 0x59, 0x00, 0x00,
0xF0, 0xB5, 0x89, 0xB0, 0x0F, 0x23, 0x46, 0x49,
0xFF, 0x22, 0x02, 0xE0, 0x58, 0x18, 0x01, 0x38,
0x02, 0x70, 0x01, 0x3B, 0x00, 0x2B, 0xF9, 0xD1,
0x42, 0x4B, 0xD8, 0x68, 0x19, 0x68, 0x9A, 0x68,
0x5B, 0x68, 0x01, 0x90, 0x03, 0x93, 0x40, 0x4B,
0x02, 0x91, 0x1B, 0x68, 0x04, 0x93, 0x3F, 0x4B,
0x5B, 0x7F, 0x06, 0x93, 0x68, 0xE0, 0x07, 0x9B,
0x88, 0x1C, 0x3D, 0x4A, 0x18, 0x18, 0x83, 0x5C,
0x5B, 0xB2, 0x1F, 0x2B, 0x5A, 0xD1, 0x3B, 0x4A,
0x40, 0x00, 0x82, 0x5A, 0x04, 0x9D, 0x04, 0x20,
0x52, 0x1B, 0x05, 0x92, 0x38, 0x4A, 0x01, 0x38,
0xC0, 0xB2, 0x14, 0x56, 0x37, 0x4A, 0x64, 0x44,
0x12, 0x56, 0x01, 0x34, 0x8A, 0x18, 0xA4, 0x01,
0x02, 0x32, 0x31, 0x4E, 0xA2, 0x18, 0xB4, 0x5C,
0x0E, 0x2C, 0x41, 0xD8, 0x1F, 0x2B, 0x3E, 0xD0,
0xA3, 0x42, 0x3D, 0xD0, 0x00, 0x2C, 0x3B, 0xD0,
0x0A, 0x27, 0x5D, 0x1E, 0x7D, 0x43, 0x2E, 0x4A,
0x2D, 0x4E, 0x55, 0x19, 0x62, 0x1E, 0x7A, 0x43,
0xB2, 0x18, 0x3E, 0x27, 0xEE, 0x5F, 0x3E, 0x27,
0xD5, 0x5F, 0x1A, 0x1C, 0xAE, 0x42, 0x00, 0xDD,
0x22, 0x1C, 0x0A, 0x25, 0x01, 0x3A, 0x6A, 0x43,
0x25, 0x4E, 0x06, 0x9D, 0xB2, 0x18, 0x3E, 0x27,
0xD2, 0x5F, 0x05, 0x9E, 0x6A, 0x43, 0x92, 0x11,
0x96, 0x42, 0x1D, 0xDD, 0x9C, 0x42, 0x02, 0xD9,
0x1A, 0x1C, 0x23, 0x1C, 0x14, 0x1C, 0x5E, 0x1E,
0x15, 0x4A, 0xF6, 0xB2, 0x97, 0x5D, 0x00, 0x25,
0x00, 0x97, 0x6F, 0x46, 0x7D, 0x57, 0x01, 0x3C,
0xE4, 0xB2, 0x6F, 0x1C, 0x09, 0xD0, 0xA5, 0x42,
0x03, 0xDA, 0x6D, 0x46, 0x2D, 0x78, 0x15, 0x55,
0x06, 0xE0, 0xA5, 0x42, 0x04, 0xDD, 0xE4, 0xB2,
0x54, 0x55, 0x94, 0x55, 0x00, 0xE0, 0x23, 0x1C,
0x00, 0x28, 0xAB, 0xD1, 0x01, 0x39, 0x03, 0x9E,
0xB1, 0x42, 0x98, 0xDA, 0x62, 0x46, 0x01, 0x3A,
0x01, 0x9F, 0xBA, 0x42, 0x05, 0xDB, 0x53, 0x1C,
0x9B, 0x01, 0x02, 0x99, 0x07, 0x93, 0x94, 0x46,
0xF1, 0xE7, 0x09, 0xB0, 0xF0, 0xBD, 0xC0, 0x46,
0xEC, 0x02, 0x00, 0x20, 0xE4, 0x10, 0x00, 0x20,
0x38, 0x0D, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x00, 0x20, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
0xF8, 0x59, 0x00, 0x00, 0xF4, 0x59, 0x00, 0x00,
0x24, 0x02, 0x00, 0x20, 0xF0, 0xB5, 0xD4, 0x4A,
0x8D, 0xB0, 0x11, 0x68, 0x00, 0x23, 0xD0, 0x18,
0xBE, 0x30, 0x00, 0x24, 0x00, 0x5F, 0x0A, 0x3B,
0x44, 0x1E, 0xA0, 0x41, 0x1D, 0x1C, 0x09, 0x18,
0x8C, 0x35, 0xF4, 0xD1, 0xCD, 0x4B, 0x11, 0x60,
0x1B, 0x68, 0xBE, 0x32, 0x03, 0x93, 0xCC, 0x4B,
0x0E, 0x24, 0x1B, 0x68, 0x05, 0x93, 0xCB, 0x4E,
0x01, 0x3C, 0x33, 0x57, 0x5F, 0x1C, 0x01, 0xD1,
0x73, 0xE0, 0x03, 0x1C, 0xC7, 0x4D, 0xE8, 0x56,
0x46, 0x1C, 0xFA, 0xD1, 0x2B, 0x55, 0x5F, 0x1C,
0x6B, 0xD0, 0x03, 0x98, 0x9D, 0x00, 0x46, 0x19,
0x37, 0x68, 0xA0, 0x00, 0xBC, 0x46, 0x03, 0x9F,
0x3F, 0x58, 0xBC, 0x44, 0x67, 0x46, 0x37, 0x60,
0x05, 0x9E, 0x05, 0x9F, 0x75, 0x19, 0x2E, 0x68,
0x38, 0x58, 0xB9, 0x4F, 0x30, 0x18, 0x0A, 0x26,
0x28, 0x60, 0x30, 0x1C, 0x58, 0x43, 0x38, 0x18,
0x38, 0x30, 0x09, 0x27, 0xC7, 0x57, 0x55, 0x79,
0xBC, 0x46, 0x6F, 0xB2, 0xBC, 0x45, 0x00, 0xDD,
0x45, 0x72, 0x5E, 0x43, 0xB0, 0x4D, 0x90, 0x79,
0xAE, 0x19, 0x38, 0x36, 0x0A, 0x27, 0xF7, 0x57,
0x45, 0xB2, 0xAF, 0x42, 0x00, 0xDA, 0xB0, 0x72,
0xD6, 0x79, 0xAB, 0x4F, 0x06, 0x96, 0x0A, 0x26,
0x30, 0x1C, 0x58, 0x43, 0x38, 0x18, 0x38, 0x30,
0x0B, 0x25, 0x45, 0x57, 0xAC, 0x46, 0x6D, 0x46,
0x18, 0x35, 0x2D, 0x78, 0x6D, 0xB2, 0xAC, 0x45,
0x03, 0xDD, 0x6F, 0x46, 0x18, 0x25, 0xEF, 0x5D,
0xC7, 0x72, 0x5E, 0x43, 0xA0, 0x4D, 0x10, 0x7A,
0xAF, 0x19, 0x38, 0x37, 0x0C, 0x26, 0xBE, 0x57,
0x45, 0xB2, 0xAE, 0x42, 0x00, 0xDA, 0x38, 0x73,
0x0A, 0x20, 0x58, 0x43, 0x56, 0x88, 0x9A, 0x4F,
0x06, 0x96, 0x38, 0x18, 0x3E, 0x26, 0x85, 0x5F,
0x18, 0x26, 0xAC, 0x46, 0x6D, 0x46, 0x75, 0x5F,
0x38, 0x30, 0x0A, 0x26, 0xAC, 0x45, 0x03, 0xDA,
0x6F, 0x46, 0x18, 0x25, 0xEF, 0x5B, 0xC7, 0x80,
0x5E, 0x43, 0x91, 0x48, 0x01, 0x39, 0x87, 0x19,
0xBB, 0x8F, 0x10, 0x88, 0xC3, 0x18, 0xBB, 0x87,
0x38, 0x37, 0x10, 0x79, 0x3B, 0x7A, 0xC3, 0x18,
0x3B, 0x72, 0x0A, 0x3A, 0x00, 0x2C, 0x00, 0xD0,
0x81, 0xE7, 0x89, 0x4F, 0x26, 0x1C, 0x3D, 0x1C,
0x3C, 0x35, 0x03, 0x95, 0x39, 0x60, 0x25, 0x1C,
0x88, 0x48, 0x00, 0x22, 0x33, 0x18, 0x9A, 0x56,
0x01, 0x32, 0x19, 0xD1, 0x1D, 0x70, 0xB5, 0x42,
0x12, 0xD0, 0x82, 0x4B, 0xB1, 0x00, 0x1A, 0x68,
0xAB, 0x00, 0x50, 0x58, 0xD0, 0x50, 0x80, 0x4A,
0x7D, 0x48, 0x12, 0x68, 0x51, 0x58, 0xD1, 0x50,
0x0A, 0x22, 0x13, 0x1C, 0x6B, 0x43, 0xC0, 0x18,
0x3C, 0x30, 0x03, 0x99, 0x03, 0xF0, 0x7E, 0xFB,
0x3B, 0x68, 0x01, 0x35, 0x9D, 0x42, 0x05, 0xDA,
0x03, 0x99, 0x01, 0x36, 0x0A, 0x31, 0x03, 0x91,
0x0E, 0x2E, 0xD9, 0xD1, 0x76, 0x4B, 0x1B, 0x68,
0xDA, 0x06, 0x3B, 0xD5, 0x75, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x04, 0x20, 0x74, 0x49,
0x01, 0xF0, 0xD4, 0xFE, 0x00, 0x25, 0x73, 0x4E,
0x2C, 0xE0, 0x69, 0x1C, 0x89, 0x01, 0x33, 0x68,
0x77, 0x68, 0x71, 0x4A, 0x03, 0x91, 0xA4, 0x46,
0x12, 0xE0, 0x03, 0x9C, 0x99, 0x1C, 0x61, 0x18,
0x88, 0x5C, 0x40, 0xB2, 0x44, 0x1E, 0x0D, 0x2C,
0x09, 0xD8, 0x66, 0x4C, 0x20, 0x18, 0x01, 0x38,
0x00, 0x78, 0x40, 0xB2, 0x44, 0x1C, 0x02, 0xD0,
0x01, 0x30, 0xC0, 0xB2, 0x88, 0x54, 0x01, 0x3B,
0xBB, 0x42, 0xEA, 0xDA, 0x61, 0x4B, 0x64, 0x46,
0x1B, 0x78, 0x00, 0x2B, 0x09, 0xD0, 0x63, 0x4B,
0x63, 0x4F, 0xAA, 0x01, 0xD9, 0x7D, 0xD2, 0x19,
0x01, 0x23, 0x04, 0x20, 0x00, 0x93, 0x01, 0xF0,
0x4D, 0xFE, 0x01, 0x35, 0x5D, 0x4F, 0x3B, 0x7E,
0x9D, 0x42, 0xCE, 0xDB, 0x5D, 0x4B, 0x1B, 0x68,
0x00, 0x2B, 0x10, 0xDD, 0x5C, 0x4B, 0x5D, 0x4A,
0x99, 0x89, 0x11, 0x80, 0x1B, 0x89, 0x53, 0x80,
0x52, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x02, 0x21, 0x00, 0x93, 0x17, 0x20,
0x0B, 0x1C, 0x01, 0xF0, 0x33, 0xFE, 0x48, 0x4B,
0x55, 0x48, 0x1D, 0x1C, 0x40, 0xCD, 0x4F, 0x49,
0x07, 0x96, 0x47, 0x89, 0x08, 0x97, 0x0A, 0x8D,
0x47, 0x68, 0x16, 0xB2, 0x05, 0x96, 0x86, 0x69,
0x09, 0x97, 0xB7, 0xB2, 0xD2, 0x1B, 0x04, 0x97,
0x92, 0xB2, 0x31, 0x31, 0x09, 0x78, 0x0A, 0x92,
0x3E, 0x4A, 0x00, 0x20, 0x06, 0x91, 0x17, 0x68,
0x03, 0x90, 0x2F, 0xE0, 0x03, 0x9A, 0x0A, 0x23,
0x53, 0x43, 0x01, 0xCF, 0x05, 0x99, 0x48, 0x43,
0x37, 0x49, 0xCB, 0x18, 0x3C, 0x22, 0x99, 0x5E,
0x09, 0x9B, 0x59, 0x43, 0x03, 0xF0, 0x94, 0xFA,
0x08, 0x99, 0x42, 0x4A, 0x08, 0x18, 0x13, 0x78,
0x80, 0xB2, 0x28, 0x80, 0x00, 0x2B, 0x15, 0xD1,
0x00, 0xB2, 0xB0, 0x42, 0x07, 0xDA, 0x06, 0x9B,
0x80, 0x1B, 0x58, 0x43, 0x04, 0x99, 0x80, 0x11,
0x08, 0x18, 0x28, 0x80, 0x0A, 0xE0, 0x05, 0x9A,
0x10, 0x1A, 0xB0, 0x42, 0x06, 0xDA, 0x06, 0x9B,
0x80, 0x1B, 0x58, 0x43, 0x0A, 0x99, 0x80, 0x11,
0x08, 0x1A, 0x28, 0x80, 0x03, 0x9A, 0x02, 0x35,
0x01, 0x32, 0x03, 0x92, 0x03, 0x9B, 0x07, 0x98,
0x83, 0x42, 0xCB, 0xDB, 0x20, 0x4D, 0x2E, 0x49,
0x2D, 0x68, 0x28, 0x4A, 0x05, 0x95, 0x0E, 0x89,
0x0D, 0x68, 0x07, 0x96, 0xD3, 0x8C, 0x08, 0x95,
0x4D, 0x69, 0x1F, 0xB2, 0xAE, 0xB2, 0x11, 0x1C,
0x04, 0x97, 0x06, 0x96, 0x2F, 0x31, 0x09, 0x78,
0x9B, 0x1B, 0x9B, 0xB2, 0x09, 0x91, 0x30, 0x32,
0x12, 0x78, 0x15, 0x4E, 0x0B, 0x93, 0x16, 0x4B,
0x00, 0x20, 0x0A, 0x92, 0x1F, 0x68, 0x20, 0x36,
0x03, 0x90, 0x50, 0xE0, 0x03, 0x9A, 0x0A, 0x23,
0x53, 0x43, 0x01, 0xCF, 0x04, 0x99, 0x48, 0x43,
0x0D, 0x49, 0x5B, 0x18, 0x3C, 0x22, 0x99, 0x5E,
0x08, 0x9B, 0x59, 0x43, 0x03, 0xF0, 0x40, 0xFA,
0x07, 0x99, 0x18, 0x4A, 0x08, 0x18, 0x13, 0x78,
0x80, 0xB2, 0x30, 0x80, 0x00, 0x2B, 0x36, 0xD1,
0x00, 0xB2, 0xA8, 0x42, 0x28, 0xDA, 0x09, 0x9B,
0x40, 0x1B, 0x58, 0x43, 0x06, 0x99, 0x80, 0x11,
0x08, 0x18, 0x30, 0x80, 0x2B, 0xE0, 0xC0, 0x46,
0x24, 0x02, 0x00, 0x20, 0x48, 0x00, 0x00, 0x20,
0x44, 0x00, 0x00, 0x20, 0xEC, 0x02, 0x00, 0x20,
0x58, 0x00, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0x64, 0x59, 0x00, 0x00, 0xE4, 0x10, 0x00, 0x20,
0x00, 0x20, 0x00, 0x40, 0xAE, 0x09, 0x00, 0x20,
0x42, 0x20, 0x00, 0x40, 0x9C, 0x0D, 0x00, 0x20,
0x70, 0x01, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0x24, 0x09, 0x00, 0x20, 0xDF, 0x01, 0x00, 0x20,
0x04, 0x9A, 0x10, 0x1A, 0xA8, 0x42, 0x06, 0xDA,
0x0A, 0x9B, 0x40, 0x1B, 0x58, 0x43, 0x0B, 0x99,
0x80, 0x11, 0x08, 0x1A, 0x30, 0x80, 0x03, 0x9A,
0x02, 0x36, 0x01, 0x32, 0x03, 0x92, 0x03, 0x9B,
0x05, 0x98, 0x83, 0x42, 0xAA, 0xDB, 0x1B, 0x4B,
0x1A, 0x1C, 0x2A, 0x32, 0x17, 0x78, 0x1A, 0x1C,
0x2B, 0x32, 0x12, 0x78, 0x28, 0x21, 0x5E, 0x5E,
0x03, 0x92, 0x26, 0x25, 0x5A, 0x5F, 0x2C, 0x33,
0x04, 0x92, 0x1B, 0x78, 0x14, 0x49, 0x06, 0x93,
0x00, 0x25, 0xB4, 0x46, 0x1D, 0xE0, 0x00, 0x26,
0x8B, 0x5F, 0x00, 0x2B, 0x16, 0xD0, 0x11, 0x4A,
0xA8, 0x18, 0x04, 0x23, 0xC2, 0x5E, 0x20, 0x26,
0x83, 0x5F, 0x00, 0x2F, 0x01, 0xD0, 0x66, 0x46,
0xB2, 0x1A, 0x03, 0x9E, 0x00, 0x2E, 0x01, 0xD0,
0x04, 0x9E, 0xF3, 0x1A, 0x06, 0x9E, 0x00, 0x2E,
0x02, 0xD0, 0x16, 0x1C, 0x1A, 0x1C, 0x33, 0x1C,
0x82, 0x80, 0x03, 0x84, 0x01, 0x34, 0x0A, 0x31,
0x02, 0x35, 0x05, 0x9E, 0xB4, 0x42, 0xDE, 0xDB,
0x0D, 0xB0, 0xF0, 0xBD, 0xAE, 0x09, 0x00, 0x20,
0x60, 0x02, 0x00, 0x20, 0x24, 0x02, 0x00, 0x20,
0x30, 0xB5, 0x0A, 0x4B, 0x00, 0x21, 0x04, 0x33,
0xDB, 0x7F, 0x09, 0x4A, 0x0A, 0x24, 0x08, 0x1C,
0x07, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0x25, 0x1C,
0x5D, 0x43, 0x55, 0x19, 0xA9, 0x87, 0x05, 0x4D,
0xE8, 0x54, 0x00, 0x2B, 0xF5, 0xD1, 0x13, 0x60,
0x30, 0xBD, 0xC0, 0x46, 0xAE, 0x09, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x64, 0x01, 0x00, 0x20,
0x00, 0xB5, 0x08, 0x4A, 0x01, 0x23, 0x5B, 0x42,
0x53, 0x60, 0x07, 0x4B, 0x00, 0x21, 0x11, 0x60,
0x1B, 0x78, 0x04, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x18, 0x1D, 0x40, 0x00, 0x81, 0x52, 0x00, 0x2B,
0xF8, 0xD1, 0x00, 0xBD, 0xE0, 0x00, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0x49, 0x43, 0x40, 0x43,
0x40, 0x18, 0x70, 0x47, 0x70, 0x47, 0xF0, 0xB5,
0x83, 0x4B, 0x00, 0x22, 0x04, 0x33, 0xD9, 0x7F,
0x87, 0xB0, 0x0B, 0x1C, 0x81, 0x48, 0x0A, 0x26,
0x15, 0x1C, 0x07, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x34, 0x1C, 0x5C, 0x43, 0x04, 0x19, 0xA2, 0x87,
0x38, 0x34, 0x25, 0x72, 0x04, 0x1C, 0x00, 0x2B,
0xF4, 0xD1, 0x7B, 0x4B, 0x1A, 0x68, 0x0B, 0x1C,
0x91, 0x42, 0x00, 0xDD, 0x13, 0x1C, 0x23, 0x60,
0x78, 0x48, 0x79, 0x4A, 0x79, 0x4B, 0x0E, 0x24,
0xFF, 0x21, 0x01, 0x3C, 0xE4, 0xB2, 0xA5, 0x00,
0x01, 0x55, 0xAB, 0x50, 0x00, 0x2C, 0xF8, 0xD1,
0x6F, 0x4B, 0x25, 0x1C, 0x04, 0x33, 0xDB, 0x7F,
0x26, 0x1C, 0x03, 0x93, 0x72, 0x4B, 0x1B, 0x69,
0x04, 0x93, 0x6D, 0x4B, 0x1B, 0x68, 0x05, 0x93,
0x47, 0xE0, 0x70, 0x4C, 0x63, 0x5D, 0x00, 0x2B,
0x42, 0xD0, 0x6F, 0x4C, 0xAB, 0x00, 0xE3, 0x58,
0x04, 0x9C, 0x1B, 0x01, 0x1B, 0x19, 0x01, 0x93,
0x6C, 0x4B, 0x6A, 0x00, 0x01, 0x27, 0xD3, 0x18,
0x00, 0x24, 0x7F, 0x42, 0x02, 0x93, 0x20, 0xE0,
0x0A, 0x23, 0x63, 0x43, 0x60, 0x48, 0xC3, 0x18,
0x3C, 0x21, 0x5B, 0x5E, 0x00, 0x2B, 0x16, 0xD0,
0x02, 0x9A, 0x63, 0x00, 0xC3, 0x18, 0x98, 0x88,
0x93, 0x88, 0x5B, 0x4A, 0xC0, 0x1A, 0x23, 0x1C,
0x10, 0x33, 0x5B, 0x00, 0x99, 0x5A, 0x02, 0x9A,
0x00, 0xB2, 0x13, 0x8B, 0xC9, 0x1A, 0x09, 0xB2,
0xFF, 0xF7, 0x98, 0xFF, 0x01, 0x9B, 0x98, 0x42,
0x01, 0xDA, 0x27, 0x1C, 0x01, 0x90, 0x01, 0x34,
0xE4, 0xB2, 0x05, 0x98, 0x84, 0x42, 0xDB, 0xDB,
0x79, 0x1C, 0x0D, 0xD0, 0x4F, 0x4B, 0x50, 0x49,
0xD8, 0x57, 0xBA, 0x00, 0x01, 0x30, 0x04, 0xD0,
0x88, 0x58, 0x01, 0x9C, 0xA0, 0x42, 0x03, 0xDD,
0x00, 0xE0, 0x01, 0x9C, 0x8C, 0x50, 0xDD, 0x55,
0x01, 0x35, 0x03, 0x9C, 0xEB, 0xB2, 0xA3, 0x42,
0xB3, 0xD3, 0x34, 0x1C, 0x00, 0x25, 0x44, 0x4E,
0x28, 0xE0, 0x44, 0x48, 0x47, 0x5D, 0x7B, 0xB2,
0x01, 0x33, 0x21, 0xD0, 0x69, 0x00, 0xFF, 0xB2,
0x3E, 0x4B, 0x71, 0x18, 0x89, 0x88, 0x7A, 0x00,
0x9A, 0x18, 0x91, 0x80, 0x29, 0x1C, 0x10, 0x31,
0x3A, 0x1C, 0x49, 0x00, 0x89, 0x5B, 0x10, 0x32,
0x52, 0x00, 0xD1, 0x52, 0x0A, 0x22, 0x10, 0x1C,
0x78, 0x43, 0x11, 0x1C, 0x69, 0x43, 0x1B, 0x18,
0x18, 0x1C, 0x71, 0x18, 0x3C, 0x30, 0x3C, 0x31,
0x03, 0xF0, 0x40, 0xF9, 0x34, 0x4B, 0xAA, 0x00,
0xD2, 0x58, 0x37, 0x4B, 0xBF, 0x00, 0xFA, 0x50,
0x01, 0x35, 0xED, 0xB2, 0x33, 0x68, 0x9D, 0x42,
0xD3, 0xDB, 0x3D, 0xE0, 0x2D, 0x4E, 0x33, 0x57,
0x01, 0x33, 0x36, 0xD1, 0x0A, 0x23, 0x63, 0x43,
0xEB, 0x18, 0x3C, 0x20, 0x1B, 0x5E, 0x00, 0x2B,
0x2F, 0xD0, 0x25, 0x4B, 0x2E, 0x4A, 0x04, 0x33,
0xDF, 0x7F, 0x00, 0x23, 0x26, 0xE0, 0x29, 0x4E,
0xF6, 0x5C, 0x00, 0x2E, 0x20, 0xD1, 0x00, 0x26,
0x90, 0x5F, 0x00, 0x28, 0x1C, 0xD1, 0x21, 0x4A,
0x67, 0x00, 0x11, 0x55, 0x1E, 0x49, 0x1D, 0x48,
0xCF, 0x19, 0xBF, 0x88, 0x5A, 0x00, 0x82, 0x18,
0x97, 0x80, 0x27, 0x1C, 0x10, 0x37, 0x1A, 0x1C,
0x7F, 0x00, 0x7F, 0x5A, 0x10, 0x32, 0x52, 0x00,
0x17, 0x52, 0x0A, 0x22, 0x53, 0x43, 0xC0, 0x18,
0x13, 0x1C, 0x63, 0x43, 0xC9, 0x18, 0x3C, 0x31,
0x3C, 0x30, 0x03, 0xF0, 0xFF, 0xF8, 0x04, 0xE0,
0x01, 0x33, 0x0A, 0x32, 0xD9, 0xB2, 0xB9, 0x42,
0xD5, 0xD3, 0x01, 0x34, 0xE4, 0xB2, 0x00, 0xE0,
0x0D, 0x4D, 0x2B, 0x68, 0x9C, 0x42, 0xBD, 0xDB,
0x09, 0x4B, 0x0C, 0x49, 0x04, 0x33, 0xDD, 0x7F,
0x12, 0x4B, 0xFF, 0x20, 0x1C, 0x1C, 0x0E, 0x34,
0x1A, 0x78, 0xAA, 0x42, 0x02, 0xD2, 0x8A, 0x5C,
0x1A, 0x70, 0x00, 0xE0, 0x18, 0x70, 0x01, 0x33,
0xA3, 0x42, 0xF5, 0xD1, 0x07, 0xB0, 0xF0, 0xBD,
0xAE, 0x09, 0x00, 0x20, 0x9C, 0x0D, 0x00, 0x20,
0x24, 0x02, 0x00, 0x20, 0xE8, 0x03, 0x00, 0x20,
0xF8, 0x10, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0x7F,
0x24, 0x09, 0x00, 0x20, 0xEC, 0x01, 0x00, 0x20,
0xF8, 0x00, 0x00, 0x20, 0x80, 0x09, 0x00, 0x20,
0xD8, 0x0D, 0x00, 0x20, 0xEC, 0x02, 0x00, 0x20,
0xF7, 0xB5, 0x42, 0x4B, 0x00, 0x21, 0x19, 0x60,
0x41, 0x4B, 0x0A, 0x24, 0x19, 0x60, 0x41, 0x4B,
0x08, 0x1C, 0x04, 0x33, 0xDB, 0x7F, 0x40, 0x4D,
0x1A, 0x1C, 0xA4, 0x46, 0x11, 0xE0, 0x01, 0x3A,
0xD2, 0xB2, 0x26, 0x1C, 0x56, 0x43, 0xAE, 0x19,
0x38, 0x36, 0x36, 0x7A, 0xB0, 0x42, 0x00, 0xDA,
0x30, 0x1C, 0x66, 0x46, 0x56, 0x43, 0xAE, 0x19,
0x3C, 0x27, 0xF6, 0x5F, 0xB1, 0x42, 0x00, 0xDA,
0x31, 0x1C, 0x00, 0x2A, 0xEB, 0xD1, 0x32, 0x4A,
0x50, 0x60, 0x11, 0x60, 0x2F, 0x4A, 0x0A, 0x20,
0x11, 0x68, 0x31, 0x4A, 0x07, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0x04, 0x1C, 0x5C, 0x43, 0x14, 0x19,
0x38, 0x34, 0x24, 0x7A, 0x09, 0x19, 0x14, 0x1C,
0x00, 0x2B, 0xF4, 0xD1, 0x27, 0x4B, 0x19, 0x60,
0x13, 0x68, 0x00, 0x2B, 0x0F, 0xDD, 0x26, 0x4B,
0x28, 0x4A, 0x5B, 0x68, 0x11, 0x80, 0x53, 0x80,
0x27, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x02, 0x21, 0x00, 0x93, 0x1D, 0x20,
0x0B, 0x1C, 0x01, 0xF0, 0x8F, 0xFB, 0x23, 0x68,
0x00, 0x2B, 0x19, 0xDD, 0x21, 0x4A, 0x08, 0x23,
0xD1, 0x5E, 0x21, 0x4B, 0x0C, 0x24, 0x12, 0x5F,
0x18, 0x1C, 0x3D, 0x33, 0x1B, 0x78, 0x3C, 0x30,
0x53, 0x43, 0x00, 0x78, 0x9B, 0x11, 0xC3, 0x18,
0x99, 0x42, 0x09, 0xDC, 0x18, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20, 0x19, 0x49,
0x01, 0xF0, 0xCC, 0xFB, 0xFF, 0xF7, 0x40, 0xFE,
0x11, 0x4B, 0x17, 0x4A, 0x1B, 0x68, 0x12, 0x78,
0x93, 0x42, 0x12, 0xDB, 0x0B, 0x4B, 0x12, 0x4A,
0x18, 0x68, 0xD1, 0x8E, 0x0A, 0x4B, 0x88, 0x42,
0x03, 0xDB, 0x11, 0x8F, 0x58, 0x68, 0x88, 0x42,
0x03, 0xDA, 0x52, 0x8F, 0x5B, 0x68, 0x93, 0x42,
0x07, 0xDB, 0x0E, 0x4B, 0x01, 0x22, 0x1A, 0x70,
0x03, 0xE0, 0x00, 0x2B, 0x01, 0xD1, 0x0B, 0x4A,
0x13, 0x70, 0xF7, 0xBD, 0x4C, 0x11, 0x00, 0x20,
0x0C, 0x02, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x70, 0x01, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x6C, 0x59, 0x00, 0x00,
0x40, 0x00, 0x00, 0x20, 0xF5, 0x00, 0x00, 0x20,
0x38, 0xB5, 0x04, 0x1C, 0x08, 0x1C, 0x00, 0x2A,
0x07, 0xD0, 0x54, 0x43, 0x58, 0x43, 0xD1, 0x18,
0x20, 0x18, 0x4D, 0x10, 0x40, 0x19, 0x02, 0xF0,
0xBB, 0xFF, 0x38, 0xBD, 0x10, 0xB5, 0x43, 0x1A,
0xDC, 0x17, 0x1B, 0x19, 0x63, 0x40, 0xFF, 0xF7,
0xEB, 0xFF, 0x10, 0xBD, 0xF0, 0xB5, 0xA9, 0x4B,
0x00, 0x25, 0x04, 0x33, 0x87, 0xB0, 0xDC, 0x7F,
0x2E, 0x1C, 0x46, 0xE0, 0x01, 0x3C, 0xE4, 0xB2,
0x0A, 0x22, 0x62, 0x43, 0x99, 0x18, 0x38, 0x31,
0x88, 0x88, 0x00, 0x28, 0x3D, 0xD0, 0xA2, 0x4F,
0x3F, 0x5D, 0x00, 0x2F, 0x2A, 0xD1, 0xA1, 0x49,
0x09, 0x78, 0x00, 0x29, 0x07, 0xD0, 0x9A, 0x18,
0x01, 0x21, 0x3C, 0x32, 0x1D, 0x20, 0x02, 0x23,
0x00, 0x91, 0x01, 0xF0, 0x07, 0xFB, 0x0A, 0x20,
0x60, 0x43, 0x9B, 0x4B, 0x9B, 0x49, 0x18, 0x18,
0x3C, 0x27, 0xC2, 0x5F, 0x38, 0x30, 0x94, 0x46,
0x26, 0x27, 0xCA, 0x5F, 0x1F, 0x1C, 0x94, 0x45,
0x08, 0xDB, 0x4E, 0x31, 0x0A, 0x78, 0x96, 0x49,
0x00, 0x7A, 0x49, 0x68, 0x4A, 0x43, 0x92, 0x11,
0x90, 0x42, 0x16, 0xDA, 0x0A, 0x22, 0x62, 0x43,
0xBA, 0x18, 0xD5, 0x87, 0x38, 0x32, 0x16, 0x72,
0x95, 0x80, 0x08, 0xE0, 0x8D, 0x4A, 0x00, 0xB2,
0x28, 0x27, 0xD2, 0x5F, 0x82, 0x42, 0x08, 0xDD,
0xCD, 0x80, 0x0E, 0x72, 0x8D, 0x80, 0x8B, 0x4A,
0xA1, 0x00, 0x8D, 0x50, 0x1A, 0x68, 0x01, 0x3A,
0x1A, 0x60, 0x85, 0x4B, 0x00, 0x2C, 0xB5, 0xD1,
0x1C, 0x60, 0x87, 0x4B, 0x9C, 0x73, 0x7F, 0x4B,
0x04, 0x33, 0xDC, 0x7F, 0xC6, 0xE0, 0x01, 0x3C,
0xE4, 0xB2, 0x0A, 0x23, 0x63, 0x43, 0xED, 0x18,
0xAA, 0x8F, 0x38, 0x35, 0x00, 0x2A, 0x00, 0xD1,
0x92, 0xE0, 0x7C, 0x4B, 0x12, 0xB2, 0x1B, 0x8D,
0x19, 0xB2, 0x52, 0x1A, 0x52, 0x10, 0x5B, 0x00,
0xD3, 0x18, 0xAB, 0x80, 0x7A, 0x4B, 0x9A, 0x7B,
0x00, 0x2A, 0x0D, 0xD1, 0x79, 0x4A, 0x12, 0x57,
0x00, 0x2A, 0x09, 0xD1, 0x78, 0x4A, 0x01, 0x21,
0x11, 0x70, 0x80, 0x22, 0xD2, 0x05, 0x50, 0x69,
0x00, 0x0E, 0x00, 0x06, 0x01, 0x43, 0x51, 0x61,
0x01, 0x22, 0x9A, 0x73, 0x73, 0x4E, 0x71, 0x4B,
0x1A, 0x57, 0x33, 0x78, 0x9A, 0x42, 0x6F, 0xDB,
0x6F, 0x4B, 0x1A, 0x78, 0x00, 0x2A, 0x01, 0xD0,
0x00, 0x22, 0x1A, 0x70, 0x66, 0x4D, 0x62, 0x00,
0x2B, 0x68, 0x01, 0x33, 0x2B, 0x60, 0xAB, 0x18,
0x04, 0x27, 0xD9, 0x5F, 0x6A, 0x4B, 0x9A, 0x18,
0x04, 0x26, 0x90, 0x5F, 0x22, 0x1C, 0x10, 0x32,
0x52, 0x00, 0x57, 0x5F, 0x03, 0x97, 0xD7, 0x5E,
0x0A, 0x1A, 0xD3, 0x17, 0x03, 0x9E, 0xD2, 0x18,
0x5A, 0x40, 0xF3, 0x1B, 0xDE, 0x17, 0x9B, 0x19,
0x73, 0x40, 0xD3, 0x18, 0x04, 0x93, 0x59, 0x4B,
0x2E, 0x22, 0x9E, 0x5E, 0x04, 0x9B, 0x32, 0x1C,
0x05, 0x96, 0xFF, 0xF7, 0x39, 0xFF, 0x03, 0x99,
0x05, 0x9A, 0x04, 0x9B, 0x06, 0x1C, 0x38, 0x1C,
0xFF, 0xF7, 0x32, 0xFF, 0x4D, 0x4A, 0x13, 0x1C,
0x2D, 0x33, 0x1B, 0x78, 0x11, 0x1C, 0x5B, 0xB2,
0x2A, 0x1C, 0x9E, 0x42, 0x06, 0xDD, 0x55, 0x4F,
0xFF, 0x69, 0xFB, 0x1A, 0x9E, 0x42, 0x02, 0xDB,
0x5E, 0x1C, 0x00, 0xE0, 0x1E, 0x1C, 0x0B, 0x1C,
0x2E, 0x33, 0x1B, 0x78, 0x5B, 0xB2, 0x98, 0x42,
0x06, 0xDD, 0x4E, 0x49, 0x09, 0x6A, 0xCB, 0x1A,
0x98, 0x42, 0x02, 0xDB, 0x58, 0x1C, 0x00, 0xE0,
0x18, 0x1C, 0x63, 0x00, 0xD3, 0x18, 0x9E, 0x80,
0x23, 0x1C, 0x10, 0x33, 0x5B, 0x00, 0xE8, 0x52,
0x0A, 0x25, 0x3E, 0x4B, 0x65, 0x43, 0x30, 0x26,
0x9F, 0x5F, 0x43, 0x4E, 0x76, 0x19, 0x55, 0x19,
0x3C, 0x21, 0x70, 0x5E, 0x3C, 0x22, 0xA9, 0x5E,
0x3A, 0x1C, 0xFF, 0xF7, 0x0B, 0xFF, 0x38, 0x36,
0xA8, 0x87, 0x38, 0x35, 0x30, 0x7A, 0x29, 0x7A,
0x3A, 0x1C, 0xFF, 0xF7, 0x03, 0xFF, 0x28, 0x72,
0x31, 0x4B, 0x62, 0x00, 0x99, 0x18, 0x38, 0x48,
0x89, 0x88, 0x82, 0x18, 0x91, 0x80, 0x22, 0x1C,
0x10, 0x32, 0x52, 0x00, 0xD1, 0x5A, 0x11, 0x52,
0x0A, 0x22, 0x11, 0x1C, 0x61, 0x43, 0x40, 0x18,
0x59, 0x18, 0x0D, 0x1C, 0x3C, 0x30, 0x3C, 0x31,
0x02, 0xF0, 0x08, 0xFF, 0x3C, 0x23, 0xEA, 0x5E,
0x38, 0x35, 0x2A, 0x4B, 0x00, 0x2A, 0x0C, 0xD0,
0x24, 0x49, 0x1A, 0x5D, 0x32, 0x31, 0x09, 0x78,
0x50, 0xB2, 0x88, 0x42, 0x06, 0xDA, 0x01, 0x32,
0x1A, 0x55, 0x01, 0x23, 0x5B, 0x42, 0xAB, 0x80,
0x00, 0xE0, 0x1A, 0x55, 0x1C, 0x4D, 0x00, 0x2C,
0x00, 0xD0, 0x34, 0xE7, 0x22, 0x4E, 0x29, 0x68,
0x32, 0x68, 0x23, 0x4B, 0x91, 0x42, 0x25, 0xDA,
0x19, 0x68, 0x18, 0x48, 0x01, 0x31, 0x19, 0x60,
0x3E, 0x30, 0x00, 0x78, 0x40, 0xB2, 0x81, 0x42,
0x1C, 0xDA, 0x10, 0x4B, 0x2A, 0x60, 0x04, 0x33,
0xDC, 0x7F, 0x14, 0xE0, 0x01, 0x3C, 0xE4, 0xB2,
0x63, 0x00, 0xF2, 0x18, 0x92, 0x88, 0xEB, 0x18,
0x9A, 0x80, 0x23, 0x1C, 0x10, 0x33, 0x5B, 0x00,
0x9A, 0x5B, 0x5A, 0x53, 0x0A, 0x22, 0x11, 0x1C,
0x61, 0x43, 0x68, 0x18, 0x71, 0x18, 0x3C, 0x30,
0x3C, 0x31, 0x02, 0xF0, 0xC7, 0xFE, 0x00, 0x2C,
0xE8, 0xD1, 0x00, 0xE0, 0x1C, 0x60, 0x07, 0xB0,
0xF0, 0xBD, 0xC0, 0x46, 0xAE, 0x09, 0x00, 0x20,
0xEC, 0x01, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x0C, 0x02, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x20,
0x70, 0x01, 0x00, 0x20, 0x3E, 0x11, 0x00, 0x20,
0xE2, 0x01, 0x00, 0x20, 0x7A, 0x0D, 0x00, 0x20,
0x20, 0x03, 0x00, 0x20, 0x24, 0x09, 0x00, 0x20,
0x60, 0x01, 0x00, 0x20, 0xF0, 0xB5, 0x31, 0x4B,
0x31, 0x4D, 0x1E, 0x78, 0x31, 0x4B, 0x00, 0x27,
0x1A, 0x1C, 0x2F, 0x60, 0x2B, 0x32, 0x12, 0x78,
0x89, 0xB0, 0x04, 0x92, 0x50, 0x00, 0x1A, 0x1C,
0x06, 0x90, 0x32, 0x32, 0x12, 0x78, 0x07, 0x92,
0x30, 0x22, 0x99, 0x5E, 0x6B, 0x68, 0x05, 0x91,
0x02, 0x93, 0x03, 0x97, 0x42, 0xE0, 0x01, 0x3E,
0xF6, 0xB2, 0x33, 0x1D, 0x5B, 0x00, 0x01, 0x93,
0xEB, 0x5A, 0x00, 0x2B, 0x34, 0xD0, 0x04, 0x98,
0x1B, 0xB2, 0x1B, 0x1A, 0x06, 0x99, 0x5B, 0x10,
0xCB, 0x18, 0x01, 0x9A, 0x20, 0x48, 0x9B, 0xB2,
0xAB, 0x52, 0xF2, 0x00, 0x81, 0x58, 0x84, 0x18,
0x07, 0x98, 0x1B, 0xB2, 0x81, 0x42, 0x07, 0xDA,
0x1B, 0x48, 0x01, 0x31, 0x81, 0x50, 0x01, 0x99,
0x00, 0x22, 0x63, 0x60, 0x6A, 0x52, 0x21, 0xE0,
0x60, 0x68, 0x01, 0x37, 0x1A, 0x1A, 0xD1, 0x17,
0x84, 0x46, 0x50, 0x18, 0x05, 0x9A, 0x48, 0x40,
0x11, 0x18, 0x00, 0x90, 0x60, 0x46, 0x42, 0x43,
0x94, 0x46, 0x00, 0x9A, 0x53, 0x43, 0x62, 0x46,
0xD0, 0x18, 0x4B, 0x10, 0xC0, 0x18, 0x02, 0xF0,
0xF3, 0xFD, 0x01, 0x9B, 0x03, 0x99, 0x60, 0x60,
0xE8, 0x52, 0x81, 0x42, 0x04, 0xDB, 0x05, 0xE0,
0x09, 0x48, 0xF2, 0x00, 0x83, 0x50, 0x01, 0xE0,
0x02, 0x96, 0x03, 0x90, 0x00, 0x2E, 0xBA, 0xD1,
0x02, 0x99, 0x09, 0xB0, 0x2F, 0x60, 0x69, 0x60,
0xF0, 0xBD, 0xC0, 0x46, 0x7C, 0x09, 0x00, 0x20,
0xE0, 0x00, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x48, 0x09, 0x00, 0x20, 0xF7, 0xB5, 0x27, 0x4B,
0x27, 0x49, 0x04, 0x33, 0xDB, 0x7F, 0x27, 0x4A,
0x27, 0x48, 0x42, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x1C, 0x1C, 0x14, 0x34, 0x64, 0x00, 0x04, 0x19,
0x04, 0x25, 0x64, 0x5F, 0x00, 0x2C, 0x27, 0xD0,
0x0A, 0x24, 0x5C, 0x43, 0x0C, 0x19, 0x3C, 0x26,
0xA4, 0x5F, 0x00, 0x2C, 0x20, 0xD0, 0x5C, 0x00,
0x0E, 0x19, 0xB6, 0x88, 0x05, 0x19, 0x37, 0xB2,
0xBC, 0x46, 0x04, 0x27, 0xEF, 0x5F, 0x65, 0x46,
0xED, 0x1B, 0x6F, 0x10, 0xBE, 0x19, 0x14, 0x19,
0xA6, 0x80, 0x1C, 0x1C, 0x10, 0x34, 0x64, 0x00,
0x0E, 0x5B, 0x1C, 0x1C, 0x0C, 0x34, 0x37, 0xB2,
0x64, 0x00, 0xBC, 0x46, 0x25, 0x5E, 0x67, 0x46,
0x7F, 0x1B, 0x7F, 0x10, 0xBE, 0x19, 0xA6, 0x52,
0x10, 0x4C, 0x01, 0x26, 0xE6, 0x54, 0x10, 0xE0,
0x0B, 0x4D, 0x5C, 0x00, 0x2E, 0x19, 0xB6, 0x88,
0x14, 0x19, 0xA6, 0x80, 0x1E, 0x1C, 0x10, 0x36,
0x1C, 0x1C, 0x76, 0x00, 0x76, 0x5B, 0x0C, 0x34,
0x64, 0x00, 0x16, 0x53, 0x07, 0x4C, 0x00, 0x26,
0xE6, 0x54, 0x00, 0x2B, 0xBA, 0xD1, 0x0B, 0x68,
0x13, 0x60, 0xF7, 0xBD, 0xAE, 0x09, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x80, 0x09, 0x00, 0x20,
0x20, 0x01, 0x00, 0x20, 0xEC, 0x01, 0x00, 0x20,
0xF7, 0xB5, 0x35, 0x4A, 0x35, 0x4B, 0x11, 0x1C,
0x33, 0x31, 0x34, 0x32, 0x0E, 0x78, 0x12, 0x78,
0x04, 0x33, 0xDB, 0x7F, 0x32, 0x49, 0x01, 0x92,
0xB4, 0x46, 0x32, 0x4A, 0x4B, 0xE0, 0x32, 0x48,
0x01, 0x3B, 0xDB, 0xB2, 0xC4, 0x5C, 0x01, 0x98,
0x00, 0x2C, 0x00, 0xD1, 0x60, 0x46, 0x5E, 0x00,
0x8D, 0x19, 0x96, 0x19, 0x04, 0x27, 0xF6, 0x5F,
0xAD, 0x88, 0x00, 0x96, 0x00, 0x9F, 0x2E, 0xB2,
0xBE, 0x1B, 0xF7, 0x17, 0xF6, 0x19, 0x7E, 0x40,
0x86, 0x42, 0x10, 0xDA, 0x1E, 0x1C, 0x0C, 0x36,
0x76, 0x00, 0xB6, 0x5E, 0x1F, 0x1C, 0x10, 0x37,
0x00, 0x96, 0x7F, 0x00, 0xCF, 0x5F, 0x00, 0x9E,
0xF7, 0x1B, 0xFE, 0x17, 0xBF, 0x19, 0x77, 0x40,
0x00, 0x97, 0x87, 0x42, 0x18, 0xDB, 0x58, 0x00,
0x10, 0x18, 0x1E, 0x1C, 0x85, 0x80, 0x10, 0x36,
0x19, 0x4D, 0x18, 0x1C, 0x76, 0x00, 0x0C, 0x30,
0x75, 0x5B, 0x40, 0x00, 0x15, 0x52, 0x18, 0x1C,
0x14, 0x30, 0x40, 0x00, 0x10, 0x18, 0x04, 0x27,
0xC0, 0x5F, 0x00, 0x28, 0x04, 0xDD, 0x00, 0x2C,
0x02, 0xD1, 0x13, 0x48, 0x01, 0x24, 0xC4, 0x54,
0x0A, 0x24, 0x5C, 0x43, 0x0E, 0x4D, 0x18, 0x1C,
0x2C, 0x19, 0x14, 0x30, 0x0D, 0x4D, 0x40, 0x00,
0xA4, 0x8F, 0x28, 0x18, 0x84, 0x80, 0x00, 0x2B,
0xB1, 0xD1, 0x0A, 0x68, 0x09, 0x4B, 0x0B, 0x49,
0x1A, 0x60, 0x0B, 0x4B, 0x1A, 0x78, 0x0B, 0x4B,
0x1A, 0x70, 0x0B, 0x4A, 0x0B, 0x1C, 0x31, 0xCA,
0x31, 0xC3, 0xC0, 0xCA, 0xC0, 0xC3, 0xF7, 0xBD,
0x48, 0x0D, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x9C, 0x0D, 0x00, 0x20, 0x20, 0x01, 0x00, 0x20,
0x64, 0x01, 0x00, 0x20, 0xCC, 0x00, 0x00, 0x20,
0xF5, 0x00, 0x00, 0x20, 0xF4, 0x00, 0x00, 0x20,
0xE0, 0x00, 0x00, 0x20, 0xF7, 0xB5, 0x19, 0x48,
0x01, 0x23, 0x5B, 0x42, 0x43, 0x60, 0x18, 0x4B,
0x1A, 0x78, 0x18, 0x4B, 0x19, 0x1C, 0x2B, 0x33,
0x1E, 0x78, 0x2A, 0x31, 0x0F, 0x78, 0x00, 0x23,
0xB4, 0x46, 0x1E, 0xE0, 0x01, 0x3A, 0xD2, 0xB2,
0x13, 0x4C, 0x51, 0x00, 0x61, 0x5A, 0x0E, 0xB2,
0xF6, 0x43, 0xF6, 0x17, 0x0E, 0x40, 0x11, 0x1D,
0x49, 0x00, 0xB5, 0xB2, 0x0E, 0x52, 0x00, 0x2D,
0x0F, 0xD0, 0x0E, 0x4E, 0x2D, 0xB2, 0x8E, 0x5F,
0x00, 0x2E, 0x04, 0xDC, 0xBD, 0x42, 0x07, 0xDA,
0x00, 0x25, 0x0D, 0x52, 0x05, 0xE0, 0x65, 0x45,
0x02, 0xDA, 0x00, 0x26, 0x0E, 0x52, 0x00, 0xE0,
0x01, 0x33, 0x00, 0x2A, 0xDE, 0xD1, 0x01, 0x4A,
0x13, 0x60, 0xF7, 0xBD, 0xE0, 0x00, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x3C, 0x0D, 0x00, 0x20, 0xCC, 0x00, 0x00, 0x20,
0xEF, 0xF3, 0x08, 0x80, 0x70, 0x47, 0x00, 0xBA,
0x70, 0x47, 0x40, 0xBA, 0x70, 0x47, 0xC0, 0xBA,
0x70, 0x47, 0x70, 0xB5, 0x00, 0x28, 0x16, 0xDA,
0xC0, 0xB2, 0x0F, 0x23, 0x03, 0x40, 0x08, 0x3B,
0x12, 0x4A, 0x9B, 0x08, 0x9B, 0x00, 0x9B, 0x18,
0x03, 0x22, 0x10, 0x40, 0x90, 0x40, 0xFF, 0x22,
0x5D, 0x68, 0x14, 0x1C, 0x84, 0x40, 0x89, 0x01,
0xA5, 0x43, 0x0A, 0x40, 0x82, 0x40, 0x28, 0x1C,
0x10, 0x43, 0x58, 0x60, 0x11, 0xE0, 0x03, 0x24,
0x82, 0x08, 0x09, 0x4B, 0x20, 0x40, 0xC0, 0x32,
0xA0, 0x40, 0x92, 0x00, 0xFF, 0x24, 0xD5, 0x58,
0x26, 0x1C, 0x86, 0x40, 0x89, 0x01, 0xB5, 0x43,
0x0C, 0x40, 0x84, 0x40, 0x28, 0x1C, 0x20, 0x43,
0xD0, 0x50, 0x70, 0xBD, 0x18, 0xED, 0x00, 0xE0,
0x00, 0xE1, 0x00, 0xE0, 0x08, 0x4B, 0x40, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x49, 0x06, 0x49, 0x0E,
0x11, 0x43, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x07, 0x4B, 0x3F, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x11, 0x40, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0x08, 0x4A, 0x19, 0x68, 0x18, 0x68,
0x89, 0x04, 0x89, 0x0E, 0x09, 0x02, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x08, 0x4B, 0x40, 0x22, 0x19, 0x68, 0x18, 0x68,
0x49, 0x04, 0x49, 0x0E, 0x11, 0x43, 0x06, 0x4A,
0x09, 0x02, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x08, 0x4B, 0x20, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x49, 0x06, 0x49, 0x0E,
0x11, 0x43, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x07, 0x4B, 0x5F, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x11, 0x40, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0xBE, 0x21, 0x1A, 0x68, 0xC9, 0x01,
0x18, 0x68, 0x11, 0x40, 0x05, 0x4A, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x08, 0x4B, 0x20, 0x22, 0x19, 0x68, 0x18, 0x68,
0x49, 0x04, 0x49, 0x0E, 0x11, 0x43, 0x06, 0x4A,
0x09, 0x02, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x80, 0x23, 0xDB, 0x05,
0x18, 0x6C, 0x80, 0x00, 0xC0, 0x0F, 0x70, 0x47,
0x08, 0x4B, 0x10, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x49, 0x06, 0x49, 0x0E, 0x11, 0x43, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0x6F, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x11, 0x40, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x00, 0xB5, 0x0B, 0x4B,
0x19, 0x68, 0x00, 0x28, 0x04, 0xD0, 0x49, 0x06,
0x49, 0x0E, 0x10, 0x22, 0x11, 0x43, 0x01, 0xE0,
0x6F, 0x22, 0x11, 0x40, 0x1A, 0x68, 0x7F, 0x20,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x00, 0xBD, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0xDE, 0x21, 0x1A, 0x68, 0xC9, 0x01,
0x18, 0x68, 0x11, 0x40, 0x05, 0x4A, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x08, 0x4B, 0x10, 0x22, 0x19, 0x68, 0x18, 0x68,
0x49, 0x04, 0x49, 0x0E, 0x11, 0x43, 0x06, 0x4A,
0x09, 0x02, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x80, 0x23, 0xDB, 0x05,
0x18, 0x6C, 0xC0, 0x00, 0xC0, 0x0F, 0x70, 0x47,
0x08, 0x4B, 0x01, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x49, 0x06, 0x49, 0x0E, 0x11, 0x43, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0x7E, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x11, 0x40, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x07, 0x4B, 0xFC, 0x21,
0x1A, 0x68, 0xC9, 0x01, 0x18, 0x68, 0x11, 0x40,
0x05, 0x4A, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x08, 0x4B, 0x01, 0x22,
0x19, 0x68, 0x18, 0x68, 0x49, 0x04, 0x49, 0x0E,
0x11, 0x43, 0x06, 0x4A, 0x09, 0x02, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x80, 0x23, 0xDB, 0x05, 0x18, 0x6C, 0xC0, 0x01,
0xC0, 0x0F, 0x70, 0x47, 0x08, 0x4B, 0x02, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x49, 0x06, 0x49, 0x0E,
0x11, 0x43, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x07, 0x4B, 0x7D, 0x22,
0x19, 0x68, 0x7F, 0x20, 0x11, 0x40, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0xFA, 0x21, 0x1A, 0x68, 0xC9, 0x01,
0x18, 0x68, 0x11, 0x40, 0x05, 0x4A, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x08, 0x4B, 0x02, 0x22, 0x19, 0x68, 0x18, 0x68,
0x49, 0x04, 0x49, 0x0E, 0x11, 0x43, 0x06, 0x4A,
0x09, 0x02, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x80, 0x23, 0xDB, 0x05,
0x18, 0x6C, 0x80, 0x01, 0xC0, 0x0F, 0x70, 0x47,
0x08, 0x4B, 0x04, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x49, 0x06, 0x49, 0x0E, 0x11, 0x43, 0x1A, 0x68,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0x7B, 0x22, 0x19, 0x68, 0x7F, 0x20,
0x11, 0x40, 0x1A, 0x68, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x70, 0x47, 0xC0, 0x46,
0x08, 0x00, 0x00, 0x20, 0x00, 0xB5, 0x0B, 0x4B,
0x19, 0x68, 0x00, 0x28, 0x04, 0xD0, 0x49, 0x06,
0x49, 0x0E, 0x04, 0x22, 0x11, 0x43, 0x01, 0xE0,
0x7B, 0x22, 0x11, 0x40, 0x1A, 0x68, 0x7F, 0x20,
0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61,
0x00, 0xBD, 0xC0, 0x46, 0x08, 0x00, 0x00, 0x20,
0x07, 0x4B, 0xF6, 0x21, 0x1A, 0x68, 0xC9, 0x01,
0x18, 0x68, 0x11, 0x40, 0x05, 0x4A, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x69, 0x1A, 0x61, 0x70, 0x47,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x08, 0x4B, 0x04, 0x22, 0x19, 0x68, 0x18, 0x68,
0x49, 0x04, 0x49, 0x0E, 0x11, 0x43, 0x06, 0x4A,
0x09, 0x02, 0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x70, 0x47, 0x08, 0x00, 0x00, 0x20,
0xFF, 0x80, 0xFF, 0xFF, 0x80, 0x23, 0xDB, 0x05,
0x18, 0x6C, 0x40, 0x01, 0xC0, 0x0F, 0x70, 0x47,
0x10, 0xB5, 0x80, 0x23, 0xDB, 0x05, 0x04, 0x1D,
0x98, 0x69, 0x3F, 0x22, 0x14, 0x40, 0x90, 0x43,
0x20, 0x43, 0x01, 0x24, 0x98, 0x61, 0x88, 0x1C,
0x21, 0x40, 0x41, 0x18, 0x0A, 0x40, 0x11, 0x02,
0x98, 0x69, 0x02, 0x4A, 0x02, 0x40, 0x0A, 0x43,
0x9A, 0x61, 0x10, 0xBD, 0xFF, 0xC0, 0xFF, 0xFF,
0x06, 0x4B, 0x7F, 0x22, 0x19, 0x68, 0x80, 0x23,
0xDB, 0x05, 0x18, 0x6C, 0x01, 0x39, 0x90, 0x43,
0x11, 0x40, 0x02, 0x1C, 0x0A, 0x43, 0x1A, 0x64,
0x70, 0x47, 0xC0, 0x46, 0x18, 0x09, 0x00, 0x20,
0x80, 0x23, 0xDB, 0x05, 0x1A, 0x6C, 0x7F, 0x21,
0x8A, 0x43, 0x01, 0x21, 0x0A, 0x43, 0x1A, 0x64,
0x70, 0x47, 0x80, 0x23, 0xDB, 0x05, 0xDA, 0x69,
0x0F, 0x21, 0x8A, 0x43, 0x02, 0x21, 0x0A, 0x43,
0xDA, 0x61, 0xDA, 0x69, 0xF0, 0x21, 0x8A, 0x43,
0x30, 0x21, 0x0A, 0x43, 0xDA, 0x61, 0x0C, 0x4A,
0x11, 0x79, 0x01, 0x39, 0xC9, 0xB2, 0x59, 0x77,
0xD8, 0x69, 0x0A, 0x49, 0x01, 0x40, 0x80, 0x20,
0xC0, 0x02, 0x01, 0x43, 0xD9, 0x61, 0xD8, 0x69,
0x07, 0x49, 0x01, 0x40, 0xA0, 0x20, 0xC0, 0x03,
0x01, 0x43, 0xD9, 0x61, 0x92, 0x79, 0x01, 0x3A,
0xD2, 0xB2, 0xDA, 0x77, 0x70, 0x47, 0xC0, 0x46,
0x04, 0x02, 0x00, 0x20, 0xFF, 0xFF, 0xF0, 0xFF,
0xFF, 0xFF, 0x0F, 0xFF, 0x30, 0xB5, 0x1A, 0x4A,
0x1A, 0x4B, 0x11, 0x88, 0x1A, 0x4C, 0xC9, 0x18,
0x80, 0x23, 0xDB, 0x05, 0x89, 0xB2, 0x18, 0x8C,
0x19, 0x84, 0x59, 0x8C, 0x00, 0x21, 0x59, 0x84,
0x50, 0x88, 0x16, 0x4D, 0x01, 0x19, 0x89, 0xB2,
0x9A, 0x8C, 0x99, 0x84, 0x42, 0x1E, 0xDC, 0x8C,
0x92, 0xB2, 0x44, 0x19, 0xDA, 0x84, 0xA4, 0xB2,
0x1D, 0x8D, 0x1C, 0x85, 0x10, 0x4C, 0x00, 0x19,
0x80, 0xB2, 0x5C, 0x8D, 0x58, 0x85, 0x98, 0x8D,
0x99, 0x85, 0xD8, 0x8D, 0xDA, 0x85, 0x18, 0x8E,
0x19, 0x86, 0x58, 0x8E, 0x5A, 0x86, 0x98, 0x8E,
0x99, 0x86, 0xD8, 0x8E, 0xDA, 0x86, 0x18, 0x8F,
0x19, 0x87, 0x58, 0x8F, 0x5A, 0x87, 0x98, 0x8F,
0x99, 0x87, 0xD9, 0x8F, 0xDA, 0x87, 0x30, 0xBD,
0x04, 0x02, 0x00, 0x20, 0xFF, 0x07, 0x00, 0x00,
0xFF, 0x03, 0x00, 0x00, 0xFF, 0x05, 0x00, 0x00,
0xFF, 0x01, 0x00, 0x00, 0x30, 0xB5, 0x22, 0x4B,
0xEE, 0x24, 0x1A, 0x68, 0xE4, 0x01, 0x14, 0x40,
0x20, 0x48, 0x1A, 0x68, 0x7F, 0x21, 0x02, 0x40,
0x22, 0x43, 0x1A, 0x60, 0x1C, 0x68, 0x80, 0x22,
0xD2, 0x05, 0x15, 0x69, 0x14, 0x61, 0x1C, 0x4C,
0xA4, 0x7C, 0x00, 0x2C, 0x16, 0xD0, 0x1C, 0x68,
0x04, 0x25, 0x64, 0x04, 0x64, 0x0E, 0x2C, 0x43,
0x1D, 0x68, 0x0C, 0x40, 0x24, 0x02, 0x28, 0x40,
0x20, 0x43, 0x18, 0x60, 0x18, 0x68, 0x14, 0x69,
0x10, 0x61, 0x1C, 0x68, 0x7B, 0x20, 0x20, 0x40,
0x1C, 0x68, 0x8C, 0x43, 0x21, 0x1C, 0x01, 0x43,
0x19, 0x60, 0x15, 0xE0, 0x1C, 0x68, 0x04, 0x25,
0x64, 0x06, 0x64, 0x0E, 0x2C, 0x43, 0x1D, 0x68,
0x0C, 0x40, 0x8D, 0x43, 0x29, 0x1C, 0x21, 0x43,
0x19, 0x60, 0x19, 0x68, 0x14, 0x69, 0x11, 0x61,
0x1C, 0x68, 0xF6, 0x21, 0xC9, 0x01, 0x21, 0x40,
0x1C, 0x68, 0x20, 0x40, 0x08, 0x43, 0x18, 0x60,
0x1B, 0x68, 0x11, 0x69, 0x13, 0x61, 0x30, 0xBD,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0xAE, 0x09, 0x00, 0x20, 0x00, 0xB5, 0x72, 0xB6,
0x0F, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x0F, 0x4B,
0x9A, 0x7C, 0x0F, 0x4B, 0x00, 0x2A, 0x07, 0xD0,
0x1A, 0x68, 0xF6, 0x21, 0xC9, 0x01, 0x11, 0x40,
0x18, 0x68, 0x0C, 0x4A, 0x02, 0x40, 0x05, 0xE0,
0x19, 0x68, 0x7B, 0x22, 0x11, 0x40, 0x1A, 0x68,
0x7F, 0x20, 0x82, 0x43, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x19, 0x69,
0x1A, 0x61, 0x62, 0xB6, 0x00, 0xBD, 0xC0, 0x46,
0x64, 0x00, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x00, 0xB5, 0x72, 0xB6, 0x10, 0x4B, 0x00, 0x22,
0x1A, 0x70, 0x10, 0x4B, 0x9A, 0x7C, 0x10, 0x4B,
0x19, 0x68, 0x00, 0x2A, 0x08, 0xD0, 0x49, 0x04,
0x04, 0x22, 0x49, 0x0E, 0x11, 0x43, 0x18, 0x68,
0x0C, 0x4A, 0x09, 0x02, 0x02, 0x40, 0x06, 0xE0,
0x49, 0x06, 0x04, 0x22, 0x49, 0x0E, 0x11, 0x43,
0x1A, 0x68, 0x7F, 0x20, 0x82, 0x43, 0x0A, 0x43,
0x1A, 0x60, 0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x69, 0x1A, 0x61, 0x62, 0xB6, 0x00, 0xBD,
0x64, 0x00, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x08, 0x00, 0x00, 0x20, 0xFF, 0x80, 0xFF, 0xFF,
0x01, 0x4B, 0x18, 0x78, 0x70, 0x47, 0xC0, 0x46,
0x64, 0x00, 0x00, 0x20, 0x00, 0xB5, 0x80, 0x23,
0xDB, 0x05, 0x19, 0x6C, 0x80, 0x22, 0xD2, 0x01,
0x0A, 0x43, 0x1A, 0x64, 0x23, 0x4A, 0x80, 0x21,
0x10, 0x68, 0x49, 0x00, 0x01, 0x43, 0x11, 0x60,
0x12, 0x68, 0x99, 0x68, 0x9A, 0x60, 0x19, 0x6C,
0x80, 0x22, 0x12, 0x02, 0x0A, 0x43, 0x1A, 0x64,
0x19, 0x6C, 0x1D, 0x4A, 0x0A, 0x40, 0x1A, 0x64,
0x1C, 0x4B, 0x7F, 0x22, 0x59, 0x7B, 0x1C, 0x4B,
0x11, 0x40, 0x18, 0x68, 0x1B, 0x4A, 0x09, 0x04,
0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60, 0x19, 0x68,
0xA0, 0x22, 0xD2, 0x05, 0x90, 0x68, 0x91, 0x60,
0x18, 0x68, 0x17, 0x49, 0x01, 0x40, 0x84, 0x20,
0xC0, 0x05, 0x01, 0x43, 0x19, 0x60, 0x19, 0x68,
0x90, 0x68, 0x91, 0x60, 0x13, 0x49, 0x09, 0x78,
0x49, 0xB2, 0x00, 0x29, 0x02, 0xD0, 0x01, 0x29,
0x0C, 0xD1, 0x03, 0xE0, 0x18, 0x68, 0x10, 0x49,
0x01, 0x40, 0x03, 0xE0, 0x18, 0x68, 0x80, 0x21,
0x09, 0x04, 0x01, 0x43, 0x19, 0x60, 0x1B, 0x68,
0x91, 0x68, 0x93, 0x60, 0x80, 0x23, 0xDB, 0x05,
0x19, 0x6C, 0x0A, 0x4A, 0x0A, 0x40, 0x1A, 0x64,
0x00, 0xBD, 0xC0, 0x46, 0x14, 0x00, 0x00, 0x20,
0xFF, 0x7F, 0xFF, 0xFF, 0xAE, 0x09, 0x00, 0x20,
0x0C, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0x80, 0xFF,
0xFF, 0xFF, 0xFF, 0x80, 0xFA, 0x02, 0x00, 0x20,
0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF,
0x04, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x80, 0x23,
0xDB, 0x05, 0x99, 0x6C, 0x91, 0x43, 0x99, 0x64,
0x1A, 0x70, 0x70, 0x47, 0x00, 0x00, 0x00, 0x20,
0x03, 0x4A, 0x01, 0x23, 0x13, 0x70, 0x80, 0x22,
0xD2, 0x05, 0x53, 0x70, 0x70, 0x47, 0xC0, 0x46,
0x02, 0x00, 0x00, 0x20, 0x00, 0xB5, 0x06, 0x4B,
0x72, 0xB6, 0x1A, 0x78, 0x00, 0x2A, 0x04, 0xD0,
0xC0, 0x46, 0xC0, 0x46, 0x62, 0xB6, 0x30, 0xBF,
0xF6, 0xE7, 0x62, 0xB6, 0x00, 0xBD, 0xC0, 0x46,
0x02, 0x00, 0x00, 0x20, 0x38, 0xB5, 0x09, 0x4B,
0x09, 0x49, 0x9A, 0x78, 0x1C, 0x79, 0x51, 0x43,
0x08, 0x4B, 0x05, 0x1C, 0xC9, 0x18, 0x08, 0x48,
0x02, 0xF0, 0x7A, 0xF8, 0x06, 0x4B, 0x29, 0x1C,
0x01, 0x34, 0x58, 0x43, 0xA1, 0x40, 0x02, 0xF0,
0x73, 0xF8, 0x38, 0xBD, 0xAA, 0x0A, 0x00, 0x20,
0x44, 0xFE, 0xFF, 0xFF, 0xFE, 0x24, 0x02, 0x00,
0x40, 0x42, 0x0F, 0x00, 0x05, 0x4B, 0x19, 0x68,
0x80, 0x23, 0xDB, 0x05, 0x5A, 0x69, 0x09, 0x02,
0x12, 0x0E, 0x09, 0x0A, 0x12, 0x06, 0x0A, 0x43,
0x5A, 0x61, 0x70, 0x47, 0x04, 0x00, 0x00, 0x20,
0x01, 0x4B, 0x18, 0x60, 0x70, 0x47, 0xC0, 0x46,
0x04, 0x00, 0x00, 0x20, 0x05, 0x4B, 0x01, 0x22,
0x1A, 0x70, 0x80, 0x23, 0xDB, 0x05, 0x59, 0x69,
0x80, 0x22, 0x52, 0x04, 0x0A, 0x43, 0x5A, 0x61,
0x70, 0x47, 0xC0, 0x46, 0x01, 0x00, 0x00, 0x20,
0x00, 0xB5, 0x05, 0x4B, 0x72, 0xB6, 0x1A, 0x78,
0x00, 0x2A, 0x03, 0xD0, 0xC0, 0x46, 0xC0, 0x46,
0x62, 0xB6, 0xF7, 0xE7, 0x62, 0xB6, 0x00, 0xBD,
0x00, 0x00, 0x00, 0x20, 0x00, 0xB5, 0x10, 0x4B,
0x1B, 0x68, 0x9A, 0x05, 0x0C, 0xD5, 0x0F, 0x4A,
0x0F, 0x4B, 0x72, 0xB6, 0x11, 0x78, 0x00, 0x29,
0x02, 0xD1, 0x19, 0x78, 0x00, 0x29, 0x11, 0xD0,
0xC0, 0x46, 0xC0, 0x46, 0x62, 0xB6, 0xF4, 0xE7,
0x08, 0x4A, 0x09, 0x4B, 0x72, 0xB6, 0x11, 0x78,
0x00, 0x29, 0x02, 0xD1, 0x19, 0x78, 0x00, 0x29,
0x04, 0xD0, 0xC0, 0x46, 0xC0, 0x46, 0x62, 0xB6,
0x30, 0xBF, 0xF3, 0xE7, 0x62, 0xB6, 0x00, 0xBD,
0x58, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x20, 0x70, 0xB5, 0x13, 0x49,
0x13, 0x4B, 0x04, 0x24, 0x19, 0x60, 0x13, 0x4B,
0x13, 0x4D, 0x1A, 0x68, 0x22, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x02, 0x24, 0xA2, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x01, 0x24, 0x22, 0x43, 0x0F, 0x4C,
0x1A, 0x60, 0x00, 0x22, 0x22, 0x60, 0x0E, 0x4A,
0x11, 0x60, 0x2E, 0x78, 0x2D, 0x79, 0x70, 0x43,
0x01, 0x35, 0xE8, 0x40, 0x09, 0x1A, 0x11, 0x60,
0x20, 0x68, 0x11, 0x68, 0x88, 0x42, 0xFB, 0xD2,
0x1A, 0x68, 0x01, 0x21, 0x8A, 0x43, 0x1A, 0x60,
0x70, 0xBD, 0xC0, 0x46, 0xFF, 0xFF, 0xFF, 0x00,
0x14, 0xE0, 0x00, 0xE0, 0x10, 0xE0, 0x00, 0xE0,
0xAA, 0x0A, 0x00, 0x20, 0x18, 0xE0, 0x00, 0xE0,
0xFC, 0x01, 0x00, 0x20, 0x00, 0xB5, 0x00, 0x23,
0x06, 0x4A, 0x98, 0x42, 0x02, 0xDB, 0xD3, 0x1C,
0xDB, 0x7F, 0x43, 0x43, 0x02, 0x32, 0xD2, 0x7F,
0x01, 0x30, 0x52, 0xB2, 0x90, 0x40, 0x18, 0x18,
0x40, 0x18, 0x00, 0xBD, 0xAE, 0x09, 0x00, 0x20,
0xF0, 0xB5, 0x85, 0xB0, 0x05, 0x1C, 0x0C, 0x1C,
0x16, 0x1C, 0x00, 0x29, 0x05, 0xD0, 0x2B, 0x4B,
0x02, 0x33, 0xDB, 0x7F, 0x5B, 0xB2, 0x00, 0x2B,
0x4E, 0xD0, 0x21, 0x1C, 0x28, 0x1C, 0xFF, 0xF7,
0xDD, 0xFF, 0x27, 0x49, 0x27, 0x4F, 0x4A, 0x7A,
0x09, 0x7A, 0x13, 0x19, 0x51, 0x18, 0x02, 0x91,
0x41, 0x01, 0xCF, 0x19, 0x00, 0x22, 0x03, 0x97,
0x84, 0x46, 0x13, 0xE0, 0x22, 0x48, 0xC1, 0x56,
0x58, 0x1C, 0xC0, 0xB2, 0xCF, 0x0F, 0x01, 0x90,
0x7F, 0x18, 0x03, 0x98, 0x7F, 0x10, 0xC7, 0x19,
0x08, 0x37, 0x00, 0x97, 0x6F, 0x46, 0x38, 0x79,
0x00, 0x9F, 0x02, 0x33, 0xB8, 0x70, 0x01, 0x27,
0x8F, 0x40, 0x3A, 0x43, 0x02, 0x98, 0x83, 0x42,
0xE8, 0xDB, 0x15, 0x4B, 0x60, 0x46, 0xDF, 0x79,
0x61, 0x42, 0x61, 0x41, 0x5B, 0x7C, 0x79, 0x18,
0x1C, 0x19, 0x49, 0x10, 0x01, 0x39, 0x01, 0x34,
0x89, 0x06, 0x24, 0x05, 0x0C, 0x43, 0x22, 0x43,
0x0E, 0x49, 0x10, 0x4C, 0x40, 0x01, 0x43, 0x18,
0x0F, 0x4F, 0x01, 0x19, 0x4C, 0x68, 0x4A, 0x60,
0xAA, 0x1C, 0xD2, 0xB2, 0xC0, 0x19, 0x02, 0x71,
0x00, 0x2E, 0x07, 0xD0, 0x0B, 0x4A, 0x01, 0x21,
0x52, 0x57, 0x91, 0x40, 0x0A, 0x1C, 0x99, 0x69,
0x9A, 0x61, 0x01, 0xE0, 0x9A, 0x69, 0x9E, 0x61,
0x05, 0xB0, 0xF0, 0xBD, 0xAE, 0x09, 0x00, 0x20,
0x0A, 0x03, 0x00, 0x20, 0x00, 0x10, 0x00, 0x40,
0x10, 0x75, 0x00, 0x00, 0x18, 0x10, 0x00, 0x40,
0x10, 0x10, 0x00, 0x40, 0xEA, 0x74, 0x00, 0x00,
0x10, 0xB5, 0x08, 0x4B, 0x00, 0x21, 0x1B, 0x68,
0x01, 0x3B, 0x08, 0xE0, 0x06, 0x4C, 0x58, 0x01,
0x09, 0x22, 0x00, 0x19, 0x84, 0x18, 0xA1, 0x72,
0x01, 0x3A, 0xFB, 0xD2, 0x01, 0x3B, 0x00, 0x2B,
0xF4, 0xDA, 0x10, 0xBD, 0x18, 0x09, 0x00, 0x20,
0x00, 0x10, 0x00, 0x40, 0x38, 0xB5, 0xFF, 0xF7,
0xE7, 0xFF, 0x00, 0x21, 0x01, 0x20, 0x0A, 0x1C,
0x40, 0x42, 0xFF, 0xF7, 0x75, 0xFF, 0x01, 0x20,
0x40, 0x42, 0x01, 0x21, 0x00, 0x22, 0xFF, 0xF7,
0x6F, 0xFF, 0x0A, 0x4D, 0xAC, 0x7B, 0x0B, 0xE0,
0x20, 0x1C, 0x00, 0x21, 0x01, 0x22, 0xFF, 0xF7,
0x67, 0xFF, 0x01, 0x21, 0x20, 0x1C, 0x0A, 0x1C,
0xFF, 0xF7, 0x62, 0xFF, 0x01, 0x34, 0xE4, 0xB2,
0xAA, 0x7B, 0x2B, 0x79, 0xD3, 0x18, 0x9C, 0x42,
0xEE, 0xDB, 0x38, 0xBD, 0x0A, 0x03, 0x00, 0x20,
0xF0, 0xB5, 0x85, 0xB0, 0x05, 0x1C, 0x0E, 0x1C,
0x02, 0x92, 0x1F, 0x1C, 0x00, 0x29, 0x05, 0xD0,
0x21, 0x4B, 0x02, 0x33, 0xDB, 0x7F, 0x5B, 0xB2,
0x00, 0x2B, 0x3B, 0xD0, 0x31, 0x1C, 0x28, 0x1C,
0xFF, 0xF7, 0x34, 0xFF, 0x1D, 0x4A, 0xC0, 0xB2,
0x01, 0x90, 0x53, 0x7A, 0x12, 0x7A, 0xF6, 0x18,
0x9A, 0x18, 0x1B, 0x4B, 0xB9, 0x1E, 0x1B, 0x7C,
0x48, 0x1E, 0x81, 0x41, 0x49, 0x42, 0xF6, 0xB2,
0x03, 0x91, 0x9C, 0x46, 0x24, 0xE0, 0x00, 0x2F,
0x07, 0xD1, 0x26, 0x21, 0x71, 0x43, 0x15, 0x4B,
0x49, 0x19, 0xCC, 0x5C, 0x64, 0x44, 0xE4, 0xB2,
0x08, 0xE0, 0x01, 0x2F, 0x04, 0xD1, 0x73, 0x01,
0x11, 0x49, 0x5B, 0x19, 0x5C, 0x5C, 0x01, 0xE0,
0x03, 0x9B, 0x1C, 0x40, 0x0F, 0x4B, 0x02, 0x99,
0x9B, 0x57, 0x02, 0x36, 0xD8, 0x0F, 0xC0, 0x18,
0x63, 0x18, 0xDB, 0xB2, 0x00, 0x93, 0x01, 0x9B,
0x40, 0x10, 0x59, 0x01, 0x6B, 0x46, 0x08, 0x18,
0x1B, 0x78, 0x09, 0x49, 0xF6, 0xB2, 0x43, 0x54,
0x96, 0x42, 0xD8, 0xDB, 0x05, 0xB0, 0xF0, 0xBD,
0xAE, 0x09, 0x00, 0x20, 0x0A, 0x03, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x36, 0x75, 0x00, 0x00,
0xB3, 0x0A, 0x00, 0x20, 0x10, 0x75, 0x00, 0x00,
0x00, 0x10, 0x00, 0x40, 0x70, 0xB5, 0x2A, 0x4B,
0x2A, 0x4A, 0x19, 0x68, 0x80, 0x24, 0x0A, 0x40,
0x1A, 0x60, 0x1A, 0x68, 0xE4, 0x05, 0x28, 0x4D,
0xA1, 0x68, 0xA2, 0x60, 0x69, 0x7A, 0x03, 0x22,
0x18, 0x68, 0x11, 0x40, 0x25, 0x4A, 0x89, 0x04,
0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0xA1, 0x68, 0xA2, 0x60, 0x19, 0x68, 0x80, 0x22,
0x52, 0x03, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0xA1, 0x68, 0xA2, 0x60, 0x29, 0x7A, 0x18, 0x68,
0x07, 0x26, 0x1D, 0x4A, 0x31, 0x40, 0x49, 0x05,
0x02, 0x40, 0x0A, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0xA1, 0x68, 0xA2, 0x60, 0xA9, 0x7B, 0x0F, 0x29,
0x25, 0xD8, 0xEA, 0x7B, 0x0F, 0x2A, 0x22, 0xD8,
0x18, 0x68, 0x09, 0x07, 0x00, 0x01, 0x00, 0x09,
0x01, 0x43, 0x19, 0x60, 0x0F, 0x21, 0x0A, 0x40,
0x18, 0x68, 0x11, 0x06, 0x11, 0x4A, 0x02, 0x40,
0x0A, 0x43, 0x1A, 0x60, 0x1B, 0x68, 0xA2, 0x68,
0xA3, 0x60, 0xFF, 0xF7, 0x49, 0xFC, 0x0E, 0x4A,
0x63, 0x6C, 0x13, 0x43, 0x63, 0x64, 0xFF, 0xF7,
0x5C, 0xFC, 0xFF, 0xF7, 0x87, 0xFC, 0xEB, 0x79,
0x0A, 0x4A, 0x1E, 0x40, 0x33, 0x02, 0x26, 0x6C,
0x16, 0x40, 0x1E, 0x43, 0x26, 0x64, 0x70, 0xBD,
0x14, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0xFC, 0xFF,
0x48, 0x0D, 0x00, 0x20, 0xFF, 0xFF, 0xF3, 0xFF,
0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xF8, 0xFF, 0xFF,
0x00, 0xB5, 0x80, 0x21, 0xC9, 0x05, 0x0B, 0x79,
0x5A, 0x1E, 0xD2, 0xB2, 0x98, 0x42, 0x09, 0xDD,
0x00, 0xE0, 0x0B, 0x71, 0x01, 0x33, 0xDB, 0xB2,
0x83, 0x42, 0xFA, 0xDD, 0x04, 0xE0, 0x0A, 0x71,
0x01, 0x3A, 0xD2, 0xB2, 0x82, 0x42, 0xFA, 0xDA,
0x00, 0xBD, 0x38, 0xB5, 0x17, 0x4C, 0xA0, 0x78,
0xFF, 0xF7, 0xE6, 0xFF, 0x80, 0x23, 0xDB, 0x05,
0x21, 0x79, 0x5A, 0x68, 0xC9, 0x07, 0x52, 0x00,
0x52, 0x08, 0x0A, 0x43, 0x5A, 0x60, 0x60, 0x79,
0x03, 0x22, 0x5D, 0x68, 0x10, 0x49, 0x10, 0x40,
0x80, 0x03, 0x29, 0x40, 0x01, 0x43, 0x59, 0x60,
0xA0, 0x79, 0x0E, 0x49, 0x5D, 0x68, 0x10, 0x40,
0x00, 0x03, 0x29, 0x40, 0x01, 0x43, 0x59, 0x60,
0xE0, 0x79, 0x0B, 0x49, 0x5D, 0x68, 0x10, 0x40,
0x29, 0x40, 0x80, 0x02, 0x01, 0x43, 0x59, 0x60,
0x21, 0x7A, 0x58, 0x68, 0x0A, 0x40, 0x11, 0x02,
0x06, 0x4A, 0x02, 0x40, 0x0A, 0x43, 0x5A, 0x60,
0x38, 0xBD, 0xC0, 0x46, 0xAA, 0x0A, 0x00, 0x20,
0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF,
0xFF, 0xF3, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF,
0xF8, 0xB5, 0x80, 0x23, 0xDB, 0x05, 0x1A, 0x68,
0x7A, 0x4A, 0x00, 0x21, 0x08, 0x20, 0x19, 0x60,
0x10, 0x60, 0x14, 0x68, 0x9D, 0x68, 0x9C, 0x60,
0x77, 0x4C, 0x21, 0x60, 0x24, 0x68, 0xDD, 0x68,
0xDC, 0x60, 0xFE, 0x25, 0x75, 0x4C, 0xED, 0x01,
0x25, 0x60, 0x24, 0x68, 0x1D, 0x69, 0x1C, 0x61,
0x5C, 0x69, 0x59, 0x61, 0x9C, 0x69, 0x99, 0x61,
0xDC, 0x69, 0xD9, 0x61, 0x1C, 0x6C, 0x80, 0x24,
0xE4, 0x01, 0x1C, 0x64, 0x5C, 0x6C, 0x59, 0x64,
0x9C, 0x6C, 0x6D, 0x4C, 0x99, 0x64, 0x21, 0x60,
0xA0, 0x24, 0xE4, 0x05, 0xA5, 0x68, 0xA1, 0x60,
0x1C, 0x6C, 0x6A, 0x49, 0x21, 0x40, 0x19, 0x64,
0x1C, 0x68, 0x80, 0x21, 0x49, 0x05, 0x21, 0x43,
0x19, 0x60, 0x67, 0x49, 0x01, 0x31, 0xC9, 0x7F,
0x00, 0x29, 0x03, 0xD0, 0x11, 0x68, 0x08, 0x43,
0x10, 0x60, 0x02, 0xE0, 0x11, 0x68, 0x81, 0x43,
0x11, 0x60, 0x11, 0x68, 0x98, 0x68, 0x99, 0x60,
0x13, 0x68, 0x04, 0x26, 0x33, 0x43, 0x13, 0x60,
0x13, 0x68, 0x80, 0x25, 0xED, 0x05, 0xA9, 0x68,
0xAB, 0x60, 0x13, 0x68, 0x02, 0x27, 0x3B, 0x43,
0x13, 0x60, 0x13, 0x68, 0xA9, 0x68, 0xAB, 0x60,
0x13, 0x68, 0x01, 0x20, 0x83, 0x43, 0x13, 0x60,
0x13, 0x68, 0xAA, 0x68, 0xAB, 0x60, 0xFF, 0xF7,
0xED, 0xFE, 0x54, 0x4B, 0x1C, 0x22, 0x9A, 0x56,
0xA9, 0x69, 0x53, 0x4B, 0x12, 0x05, 0xF2, 0x40,
0x0B, 0x40, 0x13, 0x43, 0xAB, 0x61, 0xFF, 0xF7,
0x61, 0xFE, 0x50, 0x4A, 0x50, 0x4B, 0x01, 0x21,
0x1A, 0x60, 0x50, 0x4B, 0x08, 0x24, 0x1A, 0x68,
0x10, 0x20, 0x32, 0x43, 0x1A, 0x60, 0x1A, 0x68,
0xBA, 0x43, 0x1A, 0x60, 0x4C, 0x4B, 0xC0, 0x22,
0x52, 0x00, 0x99, 0x50, 0x20, 0x21, 0x9F, 0x50,
0x9E, 0x50, 0x9C, 0x50, 0x98, 0x50, 0x99, 0x50,
0x40, 0x21, 0x99, 0x50, 0xC0, 0x22, 0xBA, 0x40,
0x98, 0x58, 0xFF, 0x24, 0xA0, 0x43, 0xC0, 0x24,
0x20, 0x43, 0x98, 0x50, 0x9C, 0x58, 0x43, 0x48,
0x04, 0x40, 0x9C, 0x50, 0x9C, 0x58, 0x42, 0x48,
0x20, 0x40, 0x80, 0x24, 0x24, 0x04, 0x04, 0x43,
0x9C, 0x50, 0x9C, 0x58, 0x24, 0x02, 0x24, 0x0A,
0x2C, 0x43, 0x9C, 0x50, 0xC1, 0x22, 0xBA, 0x40,
0x98, 0x58, 0x04, 0x1C, 0xFF, 0x20, 0x84, 0x43,
0x0C, 0x43, 0x9C, 0x50, 0x9C, 0x58, 0x37, 0x48,
0x20, 0x40, 0x80, 0x24, 0x24, 0x02, 0x20, 0x43,
0x98, 0x50, 0x98, 0x58, 0x34, 0x4C, 0x20, 0x40,
0x98, 0x50, 0x34, 0x4A, 0x10, 0x69, 0x30, 0x43,
0x10, 0x61, 0x62, 0xB6, 0x08, 0x22, 0x01, 0x20,
0x1E, 0x60, 0x18, 0x60, 0x1F, 0x60, 0x1A, 0x60,
0x2F, 0x4B, 0x20, 0x20, 0x10, 0x24, 0xDC, 0x67,
0xD8, 0x67, 0xD9, 0x67, 0xFF, 0xF7, 0x46, 0xFC,
0x21, 0x4C, 0xE0, 0x7D, 0x21, 0x7E, 0xFF, 0xF7,
0xFB, 0xFA, 0xE3, 0x7C, 0x00, 0x2B, 0x26, 0xD0,
0x1A, 0x4B, 0x01, 0x21, 0x18, 0x68, 0x27, 0x4A,
0x40, 0x00, 0x40, 0x0E, 0x08, 0x43, 0x19, 0x68,
0x00, 0x06, 0x11, 0x40, 0x01, 0x43, 0x19, 0x60,
0x19, 0x68, 0x28, 0x69, 0x29, 0x61, 0x19, 0x68,
0x49, 0x00, 0x49, 0x0E, 0x0F, 0x43, 0x39, 0x06,
0x1F, 0x68, 0x17, 0x40, 0x0F, 0x43, 0x1F, 0x60,
0x19, 0x68, 0x28, 0x69, 0x29, 0x61, 0x19, 0x68,
0x49, 0x00, 0x49, 0x0E, 0x0E, 0x43, 0x19, 0x68,
0x36, 0x06, 0x0A, 0x40, 0x32, 0x43, 0x1A, 0x60,
0x1B, 0x68, 0x2A, 0x69, 0x2B, 0x61, 0xFF, 0xF7,
0xD4, 0xFE, 0xFF, 0xF7, 0xC1, 0xF8, 0xFF, 0xF7,
0x0F, 0xF9, 0xFF, 0xF7, 0x7D, 0xF9, 0xFF, 0xF7,
0x65, 0xFB, 0xF8, 0xBD, 0x14, 0x00, 0x00, 0x20,
0x10, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x20,
0x0C, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0x7F, 0xFF,
0xAE, 0x09, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0x00,
0x14, 0xE0, 0x00, 0xE0, 0x10, 0xE0, 0x00, 0xE0,
0x00, 0xE1, 0x00, 0xE0, 0xFF, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0x00, 0xFF, 0x00, 0xED, 0x00, 0xE0,
0x04, 0xE1, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x80,
0x08, 0xB5, 0x0C, 0x4A, 0x0C, 0x4B, 0x0D, 0x49,
0x01, 0xE0, 0x01, 0xCA, 0x01, 0xC3, 0x8B, 0x42,
0xFB, 0xD3, 0x0B, 0x4B, 0x0B, 0x49, 0x00, 0x22,
0x00, 0xE0, 0x04, 0xC3, 0x8B, 0x42, 0xFC, 0xD3,
0xFF, 0xF7, 0x26, 0xF8, 0x08, 0x4B, 0x00, 0x22,
0x00, 0xE0, 0x04, 0xC3, 0x83, 0x42, 0xFC, 0xD3,
0x08, 0xBD, 0xC0, 0x46, 0xFC, 0x59, 0x00, 0x00,
0x3C, 0x00, 0x00, 0x20, 0x5C, 0x00, 0x00, 0x20,
0x5C, 0x00, 0x00, 0x20, 0xEC, 0x11, 0x00, 0x20,
0x0C, 0x1E, 0x00, 0x20, 0x00, 0xB5, 0x13, 0x4B,
0x1B, 0x68, 0x01, 0x2B, 0x02, 0xD0, 0x08, 0x2B,
0x1E, 0xD1, 0x0F, 0xE0, 0x10, 0x4B, 0x11, 0x4A,
0x1A, 0x60, 0x11, 0x4A, 0x5A, 0x60, 0x11, 0x4A,
0x11, 0x4B, 0x1A, 0x60, 0x11, 0x4B, 0x12, 0x4A,
0x1A, 0x60, 0x12, 0x4A, 0x5A, 0x60, 0x12, 0x4A,
0x9A, 0x60, 0x0D, 0xE0, 0x09, 0x4B, 0x08, 0x4A,
0x09, 0x49, 0x13, 0x60, 0x51, 0x60, 0x0A, 0x4A,
0x13, 0x60, 0x0A, 0x4A, 0x13, 0x60, 0x53, 0x60,
0x93, 0x60, 0x0C, 0x4B, 0x01, 0x22, 0x1A, 0x70,
0x00, 0xBD, 0xC0, 0x46, 0x50, 0x11, 0x00, 0x20,
0x68, 0x00, 0x00, 0x20, 0xF9, 0x03, 0x00, 0x00,
0x7D, 0x3F, 0x00, 0x00, 0xB5, 0x3F, 0x00, 0x00,
0x00, 0x02, 0x00, 0x20, 0x18, 0x00, 0x00, 0x20,
0xC1, 0x40, 0x00, 0x00, 0xA9, 0x42, 0x00, 0x00,
0x0D, 0x44, 0x00, 0x00, 0xE4, 0x01, 0x00, 0x20,
0x00, 0xB5, 0x00, 0x23, 0xC2, 0x5C, 0x01, 0x33,
0x00, 0x2A, 0xFB, 0xD1, 0x01, 0x3B, 0xD8, 0xB2,
0x00, 0xBD, 0xC0, 0x46, 0xF7, 0xB5, 0x1C, 0x1C,
0x08, 0xAB, 0x1F, 0x78, 0x26, 0x4B, 0x0E, 0x1C,
0x1B, 0x68, 0x01, 0x21, 0x81, 0x40, 0x0B, 0x42,
0x44, 0xD0, 0x00, 0x2F, 0x07, 0xD0, 0x04, 0x2C,
0x32, 0xD8, 0x22, 0x4B, 0x19, 0x5D, 0x05, 0x33,
0x00, 0x91, 0x1F, 0x5D, 0x08, 0xE0, 0x04, 0x2C,
0x2E, 0xD8, 0x1E, 0x4B, 0x19, 0x1C, 0x0A, 0x31,
0x09, 0x5D, 0x0F, 0x33, 0x1F, 0x5D, 0x00, 0x91,
0x03, 0x2C, 0x28, 0xD0, 0x00, 0x2C, 0x28, 0xD0,
0x28, 0xE0, 0x3A, 0x20, 0x21, 0x1C, 0x01, 0xF0,
0x63, 0xFC, 0x86, 0x42, 0x05, 0xDD, 0x6B, 0x46,
0x1B, 0x78, 0xC0, 0xB2, 0x2B, 0x70, 0x68, 0x70,
0x02, 0xE0, 0x2F, 0x70, 0x30, 0x1C, 0x6E, 0x70,
0x36, 0x1A, 0x60, 0x43, 0x01, 0x99, 0x00, 0x23,
0x69, 0x60, 0xAB, 0x60, 0x09, 0x18, 0xF6, 0xB2,
0x01, 0x91, 0xFF, 0xF7, 0xE3, 0xFA, 0xFF, 0xF7,
0x37, 0xFB, 0x00, 0x28, 0xFB, 0xD1, 0x0B, 0xE0,
0x0F, 0x23, 0x00, 0x27, 0x00, 0x93, 0x05, 0xE0,
0x0F, 0x21, 0x00, 0x91, 0x02, 0xE0, 0x02, 0x24,
0x00, 0xE0, 0x01, 0x24, 0x04, 0x4D, 0x01, 0x92,
0x00, 0x2E, 0xD2, 0xD1, 0xF7, 0xBD, 0xC0, 0x46,
0x58, 0x00, 0x00, 0x20, 0x73, 0x59, 0x00, 0x00,
0x70, 0x00, 0x00, 0x20, 0x38, 0xB5, 0x11, 0x4B,
0x01, 0x22, 0x1B, 0x68, 0x82, 0x40, 0x0D, 0x1C,
0x13, 0x42, 0x19, 0xD0, 0x0E, 0x4C, 0x0B, 0x23,
0x23, 0x70, 0x08, 0x1C, 0xFF, 0xF7, 0x90, 0xFF,
0x60, 0x70, 0x63, 0x78, 0x07, 0x22, 0x02, 0x33,
0x13, 0x40, 0x93, 0x42, 0x03, 0xD1, 0x63, 0x78,
0x01, 0x3B, 0xDB, 0xB2, 0x63, 0x70, 0x00, 0x23,
0x65, 0x60, 0xA3, 0x60, 0xFF, 0xF7, 0xAA, 0xFA,
0xFF, 0xF7, 0xFE, 0xFA, 0x00, 0x28, 0xFB, 0xD1,
0x38, 0xBD, 0xC0, 0x46, 0x58, 0x00, 0x00, 0x20,
0x70, 0x00, 0x00, 0x20, 0x1F, 0xB5, 0x0B, 0x4C,
0x6B, 0x46, 0xD8, 0x73, 0x23, 0x78, 0x00, 0x2B,
0x03, 0xD0, 0x00, 0x20, 0x08, 0x49, 0xFF, 0xF7,
0xCD, 0xFF, 0x23, 0x78, 0x00, 0x2B, 0x07, 0xD0,
0x6A, 0x46, 0x01, 0x21, 0x00, 0x20, 0x0F, 0x32,
0x04, 0x23, 0x00, 0x91, 0xFF, 0xF7, 0x6A, 0xFF,
0x1F, 0xBD, 0xC0, 0x46, 0xEB, 0x01, 0x00, 0x20,
0x87, 0x59, 0x00, 0x00, 0xF8, 0xB5, 0xFF, 0xF7,
0xD7, 0xFA, 0x00, 0x28, 0x70, 0xD1, 0x39, 0x4B,
0x1A, 0x68, 0x00, 0x2A, 0x03, 0xDC, 0x38, 0x4B,
0x1B, 0x68, 0x00, 0x2B, 0x3E, 0xDD, 0x37, 0x49,
0x03, 0x23, 0x0B, 0x70, 0x36, 0x4B, 0x04, 0x33,
0xDB, 0x7F, 0x1C, 0x1C, 0x9A, 0x42, 0x00, 0xDA,
0xD3, 0xB2, 0x4B, 0x70, 0x0A, 0x21, 0x8C, 0x46,
0x32, 0x4A, 0x00, 0x23, 0x2D, 0x49, 0x1F, 0xE0,
0x01, 0x33, 0x03, 0xE0, 0x66, 0x46, 0x5E, 0x43,
0x00, 0x20, 0x76, 0x18, 0x0A, 0x30, 0x37, 0x18,
0x32, 0x25, 0x7F, 0x5F, 0x00, 0x2F, 0xF3, 0xD0,
0xA3, 0x42, 0x13, 0xDA, 0x58, 0x00, 0x08, 0x18,
0x80, 0x88, 0xDE, 0x00, 0x10, 0x70, 0x00, 0xB2,
0x00, 0x12, 0x80, 0x19, 0x50, 0x70, 0x18, 0x1C,
0x10, 0x30, 0x40, 0x00, 0x08, 0x5A, 0x01, 0x33,
0x90, 0x70, 0x00, 0x0A, 0xD0, 0x70, 0x04, 0x32,
0xA3, 0x42, 0xDF, 0xDB, 0x1D, 0x4B, 0x1F, 0x4A,
0x5A, 0x60, 0x00, 0x22, 0x9A, 0x60, 0xFF, 0xF7,
0x3D, 0xFA, 0xFF, 0xF7, 0x91, 0xFA, 0x00, 0x28,
0xFB, 0xD1, 0x29, 0xE0, 0x1A, 0x4A, 0x53, 0x68,
0x01, 0x33, 0x25, 0xD0, 0x15, 0x4B, 0x13, 0x21,
0x19, 0x70, 0x11, 0x68, 0x94, 0x46, 0x59, 0x70,
0x16, 0x4B, 0x14, 0x49, 0x1D, 0x78, 0x03, 0x1C,
0x0D, 0xE0, 0x23, 0x1C, 0x01, 0xE0, 0x5E, 0x00,
0x66, 0x44, 0x02, 0x30, 0x34, 0x18, 0x06, 0x22,
0xA7, 0x5E, 0x5C, 0x1C, 0x00, 0x2F, 0xF4, 0xD0,
0x0B, 0x70, 0x23, 0x1C, 0x01, 0x31, 0x00, 0x20,
0xAB, 0x42, 0xF0, 0xDB, 0x07, 0x4B, 0x09, 0x4A,
0x98, 0x60, 0x5A, 0x60, 0xFF, 0xF7, 0x12, 0xFA,
0xFF, 0xF7, 0x66, 0xFA, 0x00, 0x28, 0xFB, 0xD1,
0xF8, 0xBD, 0xC0, 0x46, 0x9C, 0x0D, 0x00, 0x20,
0x20, 0x01, 0x00, 0x20, 0x70, 0x00, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xF0, 0x09, 0x00, 0x20,
0xE0, 0x00, 0x00, 0x20, 0x7C, 0x09, 0x00, 0x20,
0x08, 0xB5, 0x64, 0x4B, 0x1B, 0x88, 0x1D, 0x2B,
0x47, 0xD0, 0x1A, 0xD8, 0x05, 0x2B, 0x00, 0xD1,
0x96, 0xE0, 0x0D, 0xD8, 0x02, 0x2B, 0x63, 0xD0,
0x03, 0xD8, 0x01, 0x2B, 0x00, 0xD0, 0xB7, 0xE0,
0x57, 0xE0, 0x03, 0x2B, 0x00, 0xD1, 0x87, 0xE0,
0x04, 0x2B, 0x00, 0xD0, 0xB0, 0xE0, 0x8F, 0xE0,
0x07, 0x2B, 0x65, 0xD0, 0x5C, 0xD3, 0x1B, 0x2B,
0x1C, 0xD0, 0x1C, 0x2B, 0x00, 0xD0, 0xA7, 0xE0,
0x22, 0xE0, 0x22, 0x2B, 0x40, 0xD0, 0x08, 0xD8,
0x1F, 0x2B, 0x5D, 0xD0, 0x2A, 0xD3, 0x20, 0x2B,
0x5E, 0xD0, 0x21, 0x2B, 0x00, 0xD0, 0x9B, 0xE0,
0x5E, 0xE0, 0x41, 0x2B, 0x64, 0xD0, 0x03, 0xD8,
0x40, 0x2B, 0x00, 0xD0, 0x94, 0xE0, 0x5B, 0xE0,
0x42, 0x2B, 0x61, 0xD0, 0x60, 0x2B, 0x00, 0xD0,
0x8E, 0xE0, 0x72, 0xE0, 0x48, 0x4A, 0x49, 0x4B,
0x12, 0x78, 0x01, 0x20, 0x19, 0x68, 0x90, 0x40,
0x02, 0x1C, 0x0A, 0x43, 0x1A, 0x60, 0x83, 0xE0,
0x43, 0x49, 0x44, 0x4B, 0x09, 0x78, 0x1A, 0x68,
0x01, 0x20, 0x88, 0x40, 0x82, 0x43, 0x1A, 0x60,
0x7A, 0xE0, 0x3F, 0x4B, 0x1A, 0x78, 0x40, 0x4B,
0x1A, 0x70, 0x75, 0xE0, 0x3C, 0x4B, 0x0D, 0x21,
0x1A, 0x78, 0x3E, 0x4B, 0x1A, 0x70, 0x3C, 0x4A,
0x11, 0x70, 0x1A, 0x78, 0x3C, 0x4B, 0x00, 0x2A,
0x02, 0xD0, 0x00, 0x22, 0x5A, 0x70, 0x67, 0xE0,
0x3A, 0x4A, 0x52, 0x78, 0x5A, 0x70, 0x63, 0xE0,
0x33, 0x4B, 0x1A, 0x78, 0x38, 0x4B, 0x1A, 0x70,
0x5E, 0xE0, 0x31, 0x4B, 0x1A, 0x78, 0x37, 0x4B,
0x1A, 0x60, 0xFD, 0xF7, 0x09, 0xFC, 0x57, 0xE0,
0x2D, 0x4B, 0x1A, 0x78, 0x34, 0x4B, 0x9A, 0x70,
0x98, 0x78, 0xFF, 0xF7, 0x8D, 0xFC, 0x4F, 0xE0,
0x29, 0x4B, 0x1A, 0x78, 0x30, 0x4B, 0x9A, 0x70,
0x29, 0x4B, 0x0F, 0x22, 0x1A, 0x70, 0x47, 0xE0,
0x2E, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x43, 0xE0,
0x2D, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x3F, 0xE0,
0x0C, 0x20, 0xFD, 0xF7, 0x85, 0xF9, 0x3B, 0xE0,
0x0D, 0x20, 0xFD, 0xF7, 0x81, 0xF9, 0x37, 0xE0,
0x28, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x33, 0xE0,
0x27, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x2F, 0xE0,
0x26, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x2B, 0xE0,
0x25, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x27, 0xE0,
0x24, 0x4B, 0x01, 0x22, 0x1A, 0x70, 0x14, 0x4B,
0x1A, 0x78, 0x23, 0x4B, 0x1A, 0x70, 0x1F, 0xE0,
0x11, 0x4B, 0x1A, 0x78, 0x1E, 0x4B, 0x9A, 0x70,
0x1A, 0xE0, 0x0F, 0x4B, 0x1A, 0x78, 0x1F, 0x4B,
0x1A, 0x70, 0x1A, 0x78, 0x10, 0x4B, 0x01, 0x3A,
0x01, 0x2A, 0x03, 0xD8, 0x40, 0x33, 0x0F, 0x22,
0x1A, 0x70, 0x0D, 0xE0, 0x1A, 0x4A, 0x40, 0x33,
0x12, 0x78, 0x00, 0x2A, 0x04, 0xD0, 0x19, 0x4A,
0x40, 0x32, 0x12, 0x78, 0x1A, 0x70, 0x03, 0xE0,
0x08, 0x4A, 0x40, 0x32, 0x12, 0x78, 0x1A, 0x70,
0x08, 0xBD, 0xC0, 0x46, 0x28, 0x00, 0x00, 0x20,
0x0C, 0x00, 0x00, 0x50, 0x58, 0x00, 0x00, 0x20,
0x1D, 0x03, 0x00, 0x20, 0xE3, 0x01, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x4A, 0x74, 0x00, 0x00,
0xDE, 0x01, 0x00, 0x20, 0x50, 0x11, 0x00, 0x20,
0xAA, 0x0A, 0x00, 0x20, 0xE4, 0x01, 0x00, 0x20,
0xDC, 0x01, 0x00, 0x20, 0xE8, 0x01, 0x00, 0x20,
0xE7, 0x01, 0x00, 0x20, 0xE5, 0x01, 0x00, 0x20,
0x8B, 0x01, 0x00, 0x20, 0xE6, 0x01, 0x00, 0x20,
0x92, 0x01, 0x00, 0x20, 0xE0, 0x01, 0x00, 0x20,
0xDD, 0x01, 0x00, 0x20, 0x9A, 0x74, 0x00, 0x00,
0x30, 0xB5, 0x4A, 0x4B, 0x1B, 0x88, 0x34, 0x2B,
0x47, 0xD0, 0x0C, 0xD8, 0x2E, 0x2B, 0x4F, 0xD0,
0x04, 0xD8, 0x00, 0x2B, 0x14, 0xD0, 0x1D, 0x2B,
0x78, 0xD1, 0x16, 0xE0, 0x2F, 0x2B, 0x51, 0xD0,
0x30, 0x2B, 0x73, 0xD1, 0x56, 0xE0, 0x38, 0x2B,
0x66, 0xD0, 0x04, 0xD8, 0x35, 0x2B, 0x39, 0xD0,
0x37, 0x2B, 0x6B, 0xD1, 0x5B, 0xE0, 0x39, 0x2B,
0x63, 0xD0, 0x86, 0x2B, 0x66, 0xD1, 0x09, 0xE0,
0x3B, 0x4B, 0x5A, 0x7B, 0x3B, 0x4B, 0x1A, 0x70,
0x6F, 0xE0, 0x3B, 0x4B, 0x1A, 0x78, 0x39, 0x4B,
0x1A, 0x70, 0x6A, 0xE0, 0x39, 0x49, 0x3A, 0x4A,
0x0B, 0x78, 0x00, 0x2B, 0x0F, 0xD1, 0x10, 0x78,
0x34, 0x49, 0x08, 0x70, 0x50, 0x78, 0x37, 0x49,
0x08, 0x70, 0x52, 0x68, 0xD1, 0x18, 0x36, 0x4C,
0x08, 0x78, 0x19, 0x19, 0x01, 0x33, 0x08, 0x70,
0x06, 0x2B, 0xF7, 0xD1, 0x55, 0xE0, 0x52, 0x68,
0x00, 0x23, 0x08, 0x78, 0x2B, 0x4D, 0xC0, 0x18,
0x02, 0x38, 0x10, 0x18, 0x04, 0x78, 0x58, 0x19,
0x01, 0x33, 0x04, 0x70, 0x08, 0x2B, 0xF4, 0xD1,
0x47, 0xE0, 0x2C, 0x4B, 0x1A, 0x68, 0x25, 0x4B,
0x1A, 0x60, 0x42, 0xE0, 0x80, 0x23, 0xDB, 0x05,
0x1A, 0x79, 0x22, 0x4B, 0x1A, 0x70, 0x3C, 0xE0,
0x22, 0x4B, 0x27, 0x4A, 0x1B, 0x78, 0x1F, 0x49,
0xD3, 0x18, 0x1A, 0x68, 0x5B, 0x68, 0x0A, 0x60,
0x4B, 0x60, 0x32, 0xE0, 0x1A, 0x4B, 0x1A, 0x1C,
0x2C, 0x32, 0x11, 0x78, 0x19, 0x4A, 0x00, 0x29,
0x07, 0xD1, 0x09, 0xE0, 0x16, 0x4B, 0x1A, 0x1C,
0x2C, 0x32, 0x11, 0x78, 0x15, 0x4A, 0x00, 0x29,
0x02, 0xD1, 0xDB, 0x8C, 0x13, 0x80, 0x20, 0xE0,
0x1B, 0x8D, 0x13, 0x80, 0x1D, 0xE0, 0x19, 0x4B,
0x1A, 0x78, 0x10, 0x4B, 0x1A, 0x70, 0x18, 0xE0,
0x17, 0x4B, 0x1A, 0x78, 0x0D, 0x4B, 0x1A, 0x70,
0x13, 0xE0, 0x16, 0x4B, 0x1A, 0x78, 0x0B, 0x4B,
0x1A, 0x70, 0x0E, 0xE0, 0x90, 0x3B, 0x9A, 0xB2,
0x13, 0x2A, 0x0A, 0xD8, 0x09, 0x4A, 0x5B, 0x01,
0x12, 0x78, 0x06, 0x49, 0x9B, 0x18, 0x10, 0x4A,
0x9B, 0x18, 0x1A, 0x68, 0x5B, 0x68, 0x0A, 0x60,
0x4B, 0x60, 0x30, 0xBD, 0x28, 0x00, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x50,
0x1D, 0x03, 0x00, 0x20, 0x2A, 0x00, 0x00, 0x20,
0x70, 0x00, 0x00, 0x20, 0x0D, 0x00, 0x00, 0x50,
0x0E, 0x00, 0x00, 0x50, 0x1C, 0x09, 0x00, 0x20,
0xB1, 0x09, 0x00, 0x20, 0xFF, 0x5B, 0x00, 0x00,
0xFF, 0x73, 0x00, 0x00, 0xFF, 0x7B, 0x00, 0x00,
0xB3, 0x0A, 0x00, 0x20, 0x08, 0xB5, 0x08, 0x4B,
0x1B, 0x88, 0x86, 0x2B, 0x0B, 0xD1, 0x07, 0x4B,
0x9A, 0x68, 0x01, 0x2A, 0x02, 0xDC, 0x9A, 0x68,
0x01, 0x32, 0x9A, 0x60, 0x9B, 0x68, 0x02, 0x2B,
0x01, 0xD1, 0xFF, 0xF7, 0x71, 0xF8, 0x08, 0xBD,
0x28, 0x00, 0x00, 0x20, 0x70, 0x00, 0x00, 0x20,
0x7F, 0xB5, 0x31, 0x4C, 0x03, 0x90, 0x23, 0x78,
0x0D, 0x1C, 0x16, 0x1C, 0x00, 0x2B, 0x03, 0xD0,
0x01, 0x20, 0x2E, 0x49, 0xFF, 0xF7, 0x6E, 0xFD,
0x23, 0x78, 0x00, 0x2B, 0x06, 0xD0, 0x01, 0x21,
0x08, 0x1C, 0x03, 0xAA, 0x04, 0x23, 0x00, 0x91,
0xFF, 0xF7, 0x0C, 0xFD, 0x28, 0x4B, 0x03, 0x99,
0x1B, 0x78, 0x28, 0x4A, 0x00, 0x2B, 0x15, 0xD1,
0x13, 0x1C, 0x4A, 0x33, 0x00, 0x20, 0x1B, 0x5E,
0x8E, 0x1B, 0x9E, 0x42, 0x05, 0xDC, 0x13, 0x1C,
0x4C, 0x33, 0x00, 0x20, 0x1B, 0x5E, 0x9E, 0x42,
0x08, 0xDA, 0x21, 0x48, 0x01, 0x23, 0x03, 0x70,
0x20, 0x48, 0x03, 0x70, 0x20, 0x48, 0x03, 0x70,
0x20, 0x48, 0x03, 0x70, 0x53, 0x78, 0x00, 0x2B,
0x04, 0xD0, 0x1F, 0x4B, 0x5B, 0x5D, 0x59, 0x43,
0x89, 0x11, 0x03, 0x91, 0x1D, 0x4B, 0x6A, 0x00,
0xD0, 0x5A, 0x1D, 0x4B, 0x03, 0x99, 0xD4, 0x5E,
0xC0, 0x08, 0x14, 0x4A, 0x89, 0xB2, 0x04, 0x1B,
0x64, 0x1A, 0x56, 0x7C, 0x24, 0xB2, 0x19, 0x4B,
0xB4, 0x42, 0x02, 0xDC, 0x76, 0x42, 0xB4, 0x42,
0x02, 0xDA, 0x00, 0x24, 0x5C, 0x55, 0x05, 0xE0,
0x5C, 0x5D, 0x96, 0x7C, 0xA6, 0x42, 0x01, 0xD0,
0x01, 0x34, 0x5C, 0x55, 0x43, 0x1A, 0x9B, 0xB2,
0x92, 0x7E, 0x19, 0xB2, 0x91, 0x42, 0x02, 0xDB,
0x09, 0x4A, 0x01, 0x21, 0x11, 0x70, 0x0C, 0x4A,
0x6D, 0x00, 0xAB, 0x52, 0x7F, 0xBD, 0xC0, 0x46,
0xEB, 0x01, 0x00, 0x20, 0x8B, 0x59, 0x00, 0x00,
0xE4, 0x01, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x48, 0x11, 0x00, 0x20, 0x14, 0x09, 0x00, 0x20,
0x30, 0x11, 0x00, 0x20, 0xC4, 0x01, 0x00, 0x20,
0x92, 0x7B, 0x00, 0x00, 0x14, 0x02, 0x00, 0x20,
0x3C, 0x0D, 0x00, 0x20, 0xA4, 0x0A, 0x00, 0x20,
0xF0, 0xB5, 0x48, 0x4B, 0x89, 0xB0, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20, 0x46, 0x49,
0xFF, 0xF7, 0xF4, 0xFC, 0x45, 0x4A, 0x00, 0x23,
0x13, 0x70, 0x45, 0x4A, 0x0C, 0x20, 0x01, 0x38,
0xC0, 0xB2, 0x81, 0x00, 0x8B, 0x50, 0x00, 0x28,
0xF9, 0xD1, 0x42, 0x4B, 0x42, 0x4A, 0x18, 0x70,
0x01, 0x23, 0x13, 0x70, 0x41, 0x4A, 0x13, 0x70,
0x41, 0x4B, 0x19, 0x7E, 0x04, 0x91, 0xDA, 0x7D,
0x05, 0x92, 0x1B, 0x7D, 0x06, 0x93, 0x0B, 0x1C,
0x2D, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0x5D, 0x1C,
0x3C, 0x4C, 0xEA, 0x01, 0x12, 0x19, 0x16, 0x88,
0x3B, 0x49, 0x5A, 0x00, 0x5C, 0x01, 0x56, 0x52,
0xAD, 0x01, 0x05, 0x9A, 0x07, 0x94, 0x9C, 0x46,
0x1A, 0xE0, 0x01, 0x3A, 0xD2, 0xB2, 0x93, 0x1C,
0xEB, 0x18, 0x36, 0x4C, 0x5B, 0x00, 0x19, 0x5B,
0x06, 0x9B, 0x00, 0x2B, 0x05, 0xD0, 0xD3, 0x1C,
0xEB, 0x18, 0x5B, 0x00, 0x1B, 0x5B, 0xC9, 0x18,
0x49, 0x10, 0x07, 0x9C, 0xA7, 0x18, 0x7B, 0x00,
0x1C, 0x1C, 0x2F, 0x4B, 0xE1, 0x52, 0x2F, 0x4C,
0x01, 0x23, 0x89, 0x1B, 0x3B, 0x55, 0x40, 0x18,
0x00, 0x2A, 0xE2, 0xD1, 0x63, 0x46, 0x00, 0x2B,
0xCF, 0xD1, 0x25, 0x4B, 0x04, 0x9C, 0xD9, 0x7D,
0x61, 0x43, 0x01, 0xF0, 0xD5, 0xF8, 0x28, 0x4B,
0x05, 0x1C, 0x58, 0x8C, 0x27, 0x4C, 0x00, 0x28,
0x02, 0xD1, 0x40, 0x23, 0x23, 0x60, 0x07, 0xE0,
0x80, 0x01, 0x29, 0x1C, 0x01, 0xF0, 0xC8, 0xF8,
0x6E, 0x28, 0x00, 0xDD, 0x6E, 0x20, 0x20, 0x60,
0x12, 0x4C, 0x23, 0x78, 0x00, 0x2B, 0x03, 0xD0,
0x00, 0x20, 0x1F, 0x49, 0xFF, 0xF7, 0x8A, 0xFC,
0x1B, 0x4B, 0x1E, 0x4A, 0x5B, 0x8C, 0x55, 0x80,
0x13, 0x80, 0x23, 0x78, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x02, 0x21, 0x00, 0x93, 0x00, 0x20,
0x0B, 0x1C, 0xFF, 0xF7, 0x23, 0xFC, 0x18, 0x4B,
0x18, 0x48, 0x1B, 0x78, 0x00, 0x22, 0x18, 0x49,
0x04, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0x5C, 0x00,
0xC2, 0x54, 0x62, 0x52, 0x00, 0x2B, 0xF8, 0xD1,
0x09, 0xB0, 0xF0, 0xBD, 0xEB, 0x01, 0x00, 0x20,
0x91, 0x59, 0x00, 0x00, 0x1C, 0x03, 0x00, 0x20,
0xBC, 0x11, 0x00, 0x20, 0xF4, 0x10, 0x00, 0x20,
0x20, 0x09, 0x00, 0x20, 0x3C, 0x11, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x02, 0x40, 0x00, 0x40,
0x94, 0x11, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40,
0xF8, 0x03, 0x00, 0x20, 0xB3, 0x0A, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x78, 0x09, 0x00, 0x20,
0x9A, 0x59, 0x00, 0x00, 0x54, 0x11, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0xA4, 0x0A, 0x00, 0x20,
0x14, 0x02, 0x00, 0x20, 0xF0, 0xB5, 0xA0, 0x4A,
0x00, 0x23, 0x13, 0x70, 0x9F, 0x4A, 0x85, 0xB0,
0x13, 0x70, 0x9F, 0x4A, 0x13, 0x70, 0x9F, 0x4A,
0x13, 0x70, 0x9F, 0x4B, 0x1B, 0x78, 0x00, 0x2B,
0x03, 0xD0, 0x01, 0x20, 0x9D, 0x49, 0xFF, 0xF7,
0x31, 0xFC, 0x00, 0x24, 0x9C, 0x4D, 0x9A, 0x4E,
0x11, 0xE0, 0x33, 0x78, 0x00, 0x2B, 0x0C, 0xD0,
0xEB, 0x7D, 0x29, 0x7D, 0x99, 0x48, 0xC9, 0x18,
0xE2, 0x01, 0x00, 0x23, 0x12, 0x18, 0x00, 0x93,
0xC9, 0xB2, 0x01, 0x20, 0x02, 0x23, 0xFF, 0xF7,
0xC5, 0xFB, 0x01, 0x34, 0xE4, 0xB2, 0x29, 0x7E,
0x8C, 0x42, 0xEA, 0xD3, 0x92, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x00, 0xD1, 0x0D, 0xE1, 0x91, 0x4B,
0x1A, 0x78, 0x00, 0x2A, 0x1F, 0xD1, 0x90, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x1B, 0xD0, 0xEB, 0x7D,
0x8E, 0x4C, 0x07, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x5D, 0x01, 0x2D, 0x18, 0x2A, 0x55, 0x00, 0x2B,
0xF8, 0xD1, 0x03, 0x1C, 0x58, 0x1E, 0xC0, 0xB2,
0x00, 0x2B, 0x01, 0xD0, 0x0B, 0x1C, 0xF6, 0xE7,
0x87, 0x4A, 0x86, 0x48, 0x12, 0x78, 0x49, 0x01,
0x03, 0xE0, 0x01, 0x3A, 0xD2, 0xB2, 0x8C, 0x18,
0x23, 0x54, 0x00, 0x2A, 0xF9, 0xD1, 0x80, 0x4B,
0x7E, 0x4A, 0x19, 0x78, 0x1B, 0x78, 0x11, 0x70,
0x00, 0x2B, 0x70, 0xD0, 0x78, 0x4B, 0x1A, 0x7E,
0xD9, 0x7D, 0x02, 0x92, 0x1B, 0x7D, 0x03, 0x93,
0x22, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0x59, 0x1C,
0x89, 0x01, 0xC8, 0x19, 0x79, 0x4C, 0x03, 0x9D,
0x40, 0x00, 0x00, 0x5B, 0x00, 0x2D, 0x04, 0xD0,
0x89, 0x19, 0x49, 0x00, 0x09, 0x5B, 0x40, 0x18,
0x40, 0x10, 0x59, 0x01, 0x89, 0x18, 0x74, 0x4D,
0x4C, 0x00, 0x65, 0x5B, 0x6F, 0x4C, 0xED, 0x08,
0x0C, 0x5D, 0x28, 0x1A, 0x84, 0x42, 0x04, 0xDA,
0xFF, 0x28, 0x00, 0xDD, 0xFF, 0x20, 0x6B, 0x4D,
0x68, 0x54, 0x00, 0x2B, 0xDD, 0xD1, 0x11, 0x1C,
0x4A, 0x1E, 0xD2, 0xB2, 0x00, 0x29, 0x03, 0xD0,
0x02, 0x9B, 0x97, 0x1C, 0xD6, 0x1C, 0xF4, 0xE7,
0x5F, 0x4A, 0x65, 0x4B, 0x17, 0x7E, 0x1B, 0x78,
0x62, 0x49, 0x7F, 0x01, 0x10, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0x64, 0x4E, 0x5A, 0x00, 0x94, 0x5B,
0xF8, 0x18, 0x45, 0x56, 0x26, 0xB2, 0x2A, 0x1C,
0xB5, 0x42, 0x00, 0xDA, 0x22, 0x1C, 0x12, 0xB2,
0xFF, 0x2A, 0x00, 0xDD, 0xFF, 0x22, 0x42, 0x54,
0x00, 0x2B, 0xEC, 0xD1, 0x50, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x03, 0x20, 0x5A, 0x49,
0xFF, 0xF7, 0x94, 0xFB, 0x00, 0x24, 0x4E, 0x4D,
0x4B, 0x4E, 0x0E, 0xE0, 0x33, 0x78, 0x00, 0x2B,
0x09, 0xD0, 0x50, 0x4B, 0x62, 0x01, 0xD2, 0x18,
0x00, 0x23, 0xE9, 0x7D, 0x03, 0x20, 0x00, 0x93,
0x01, 0x23, 0xFF, 0xF7, 0x2B, 0xFB, 0x01, 0x34,
0xE4, 0xB2, 0x2B, 0x7E, 0xA3, 0x42, 0xED, 0xD8,
0x40, 0x4A, 0x01, 0x23, 0x13, 0x70, 0x3D, 0x4A,
0x13, 0x70, 0x3B, 0x4A, 0x13, 0x70, 0x3E, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x6D, 0xD0, 0x49, 0x4B,
0x1B, 0x68, 0x58, 0x02, 0x69, 0xD5, 0x3C, 0x4A,
0x80, 0x24, 0x16, 0x7D, 0x13, 0x7E, 0xD2, 0x7D,
0x45, 0x4D, 0xB6, 0x18, 0xF6, 0xB2, 0x24, 0x06,
0xB4, 0x46, 0x18, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x42, 0x49, 0x5A, 0x00, 0x5F, 0x1C, 0x56, 0x5A,
0xBF, 0x01, 0x62, 0x46, 0x0D, 0xE0, 0x01, 0x3A,
0xD2, 0xB2, 0x91, 0x1C, 0x79, 0x18, 0x37, 0x48,
0x49, 0x00, 0x09, 0x5A, 0x89, 0x1B, 0x8C, 0x42,
0x00, 0xDA, 0x0C, 0x1C, 0x8D, 0x42, 0x00, 0xDD,
0x0D, 0x1C, 0x00, 0x2A, 0xEF, 0xD1, 0x00, 0x2B,
0xE4, 0xD1, 0x16, 0x20, 0x36, 0x49, 0xFF, 0xF7,
0x45, 0xFB, 0x25, 0x4B, 0x35, 0x4A, 0x1B, 0x78,
0x14, 0x80, 0x55, 0x80, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x02, 0x21, 0x00, 0x93, 0x16, 0x20,
0x0B, 0x1C, 0xFF, 0xF7, 0xDF, 0xFA, 0x26, 0x4B,
0x80, 0x20, 0x1B, 0x78, 0x2A, 0x49, 0x00, 0x06,
0x2D, 0x4E, 0x2E, 0x4D, 0x19, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0xF7, 0x5C, 0x7A, 0x1C, 0x94, 0x46,
0x64, 0x46, 0xEA, 0x5C, 0xA4, 0x01, 0xA4, 0x46,
0x02, 0x32, 0x62, 0x44, 0x1D, 0x4C, 0x52, 0x00,
0x12, 0x5B, 0x22, 0x4C, 0x7F, 0x00, 0x94, 0x46,
0x3A, 0x5B, 0x64, 0x46, 0xA2, 0x1A, 0x90, 0x42,
0x00, 0xDA, 0x10, 0x1C, 0x91, 0x42, 0x00, 0xDD,
0x11, 0x1C, 0x00, 0x2B, 0xE3, 0xD1, 0x0C, 0x4B,
0x1C, 0x4A, 0x1B, 0x78, 0x10, 0x80, 0x51, 0x80,
0x00, 0x2B, 0x06, 0xD0, 0x01, 0x23, 0x02, 0x21,
0x00, 0x93, 0x16, 0x20, 0x0B, 0x1C, 0xFF, 0xF7,
0xAD, 0xFA, 0x05, 0xB0, 0xF0, 0xBD, 0xC0, 0x46,
0xAC, 0x09, 0x00, 0x20, 0x14, 0x09, 0x00, 0x20,
0x30, 0x11, 0x00, 0x20, 0x48, 0x11, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0xAB, 0x59, 0x00, 0x00,
0xAE, 0x09, 0x00, 0x20, 0x84, 0x40, 0x00, 0x40,
0x1C, 0x03, 0x00, 0x20, 0xE1, 0x01, 0x00, 0x20,
0xE3, 0x01, 0x00, 0x20, 0x64, 0x0E, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40,
0xF8, 0x03, 0x00, 0x20, 0x3C, 0x0D, 0x00, 0x20,
0xAF, 0x59, 0x00, 0x00, 0x58, 0x00, 0x00, 0x20,
0xFF, 0xFF, 0xFF, 0x7F, 0x94, 0x11, 0x00, 0x20,
0xB5, 0x59, 0x00, 0x00, 0x54, 0x11, 0x00, 0x20,
0x30, 0x75, 0x00, 0x00, 0x2A, 0x75, 0x00, 0x00,
0xF0, 0xB5, 0xB3, 0x4B, 0xA5, 0xB0, 0x1B, 0x78,
0x00, 0x2B, 0x00, 0xD0, 0x01, 0xE2, 0xB1, 0x4A,
0xB1, 0x4C, 0x12, 0x78, 0xB1, 0x4D, 0xB2, 0x4E,
0x64, 0x7C, 0x52, 0xB2, 0x6B, 0x60, 0x2B, 0x60,
0x6B, 0x82, 0x6B, 0x81, 0x2B, 0x82, 0x2B, 0x81,
0x33, 0x60, 0xB3, 0x60, 0x1B, 0x92, 0xAD, 0x4F,
0xFF, 0x22, 0xAD, 0x4B, 0x72, 0x60, 0xF2, 0x60,
0x11, 0x94, 0x3F, 0x7E, 0x1B, 0x78, 0xA9, 0x4C,
0x09, 0x97, 0x0B, 0x93, 0xE4, 0x7D, 0xA4, 0x4D,
0x08, 0x94, 0x46, 0x23, 0xED, 0x5E, 0xA2, 0x4F,
0x0E, 0x95, 0x48, 0x23, 0xFF, 0x5E, 0xA3, 0x4C,
0x0F, 0x97, 0x24, 0x7D, 0x2D, 0x23, 0x0C, 0x94,
0x9D, 0x4D, 0xA2, 0x4E, 0x11, 0x9F, 0x6D, 0x78,
0x36, 0x68, 0x7F, 0x42, 0x9A, 0x4C, 0x0D, 0x95,
0x12, 0x96, 0x1D, 0x97, 0xA4, 0x7C, 0x98, 0x4D,
0x22, 0x94, 0xEB, 0x5C, 0x1B, 0x9E, 0x13, 0x93,
0x10, 0x23, 0x9B, 0x1B, 0x1E, 0x93, 0x18, 0x27,
0xEF, 0x57, 0x1C, 0x20, 0x14, 0x97, 0x28, 0x56,
0x19, 0x21, 0x18, 0x90, 0x69, 0x56, 0x00, 0x23,
0x00, 0x22, 0x00, 0x24, 0x23, 0x91, 0x05, 0x93,
0x00, 0x25, 0x00, 0x26, 0x00, 0x27, 0xFF, 0x20,
0x00, 0x21, 0xFF, 0x23, 0x06, 0x92, 0x17, 0x94,
0x10, 0x95, 0x1A, 0x96, 0x15, 0x97, 0x19, 0x90,
0x21, 0x91, 0x1F, 0x92, 0x16, 0x93, 0x1C, 0x94,
0x09, 0x9C, 0x00, 0x2C, 0x00, 0xD1, 0x27, 0xE1,
0x09, 0x9B, 0x89, 0x4D, 0x01, 0x3B, 0xDB, 0xB2,
0x09, 0x93, 0x5B, 0x00, 0x5B, 0x5B, 0x08, 0x9E,
0x0A, 0x93, 0x00, 0x2E, 0xF0, 0xD0, 0x09, 0x9F,
0x84, 0x48, 0x01, 0x37, 0xFB, 0x01, 0x1B, 0x18,
0x1B, 0x88, 0x0A, 0x99, 0x0E, 0x9C, 0x5A, 0x1A,
0x94, 0x42, 0x00, 0xDA, 0x92, 0xE1, 0x0F, 0x9D,
0x95, 0x42, 0x00, 0xDD, 0x8B, 0xE1, 0x09, 0x9E,
0xBF, 0x01, 0x01, 0x21, 0x02, 0x25, 0x00, 0x22,
0x70, 0x01, 0x03, 0x97, 0x2C, 0xE0, 0x7A, 0x4D,
0x84, 0x18, 0x64, 0x00, 0x6E, 0x46, 0x18, 0x27,
0x2C, 0x5B, 0xBD, 0x5F, 0xE4, 0x1A, 0xAC, 0x42,
0x01, 0xDD, 0xA7, 0xB2, 0x06, 0x97, 0x6E, 0x46,
0x14, 0x27, 0xBD, 0x5F, 0xAC, 0x42, 0x01, 0xDA,
0xA4, 0xB2, 0x05, 0x94, 0x82, 0x18, 0x70, 0x4F,
0x52, 0x00, 0xBB, 0x52, 0x08, 0x9A, 0xCB, 0xB2,
0x9A, 0x42, 0xBD, 0xD9, 0x03, 0x9A, 0x8D, 0x1C,
0x53, 0x19, 0x6C, 0x4C, 0x5B, 0x00, 0x1B, 0x5B,
0x0A, 0x9E, 0x0E, 0x9F, 0x0A, 0x1C, 0x9C, 0x1B,
0xBC, 0x42, 0x00, 0xDD, 0x38, 0xE1, 0x0F, 0x9E,
0x01, 0x31, 0xB4, 0x42, 0x00, 0xDA, 0xD1, 0xE0,
0x0C, 0x9F, 0x00, 0x2F, 0x07, 0xD0, 0x03, 0x9E,
0xD4, 0x1C, 0x34, 0x19, 0x61, 0x4F, 0x64, 0x00,
0xE4, 0x5B, 0xE3, 0x18, 0x5B, 0x10, 0x0D, 0x9C,
0x00, 0x2C, 0x06, 0xD0, 0x5E, 0x4E, 0x84, 0x18,
0xA4, 0x5D, 0x12, 0x9F, 0x63, 0x43, 0x7B, 0x43,
0x1B, 0x13, 0x0B, 0x9C, 0x00, 0x2C, 0xBA, 0xD0,
0x86, 0x18, 0x57, 0x4F, 0x74, 0x00, 0x3F, 0x5B,
0xBC, 0x46, 0x58, 0x4F, 0xBC, 0x57, 0x66, 0x46,
0xF6, 0x08, 0x34, 0x1B, 0x07, 0x94, 0x6F, 0x46,
0x18, 0x24, 0x04, 0x96, 0xE7, 0x5F, 0x07, 0x9E,
0xF4, 0x1A, 0xBC, 0x42, 0x01, 0xDD, 0xA7, 0xB2,
0x06, 0x97, 0x6E, 0x46, 0x14, 0x27, 0xBE, 0x5F,
0xB4, 0x42, 0x01, 0xDA, 0xA6, 0xB2, 0x05, 0x96,
0x11, 0x9F, 0xBC, 0x42, 0x5D, 0xDD, 0x84, 0x18,
0xA4, 0x46, 0x4B, 0x4C, 0x00, 0x27, 0x66, 0x46,
0x37, 0x55, 0x04, 0x9F, 0x13, 0x9E, 0xFC, 0x1A,
0x00, 0x2E, 0x08, 0xD0, 0x1B, 0x9F, 0x07, 0x9C,
0x1E, 0x9E, 0x7B, 0x43, 0x74, 0x43, 0x04, 0x9F,
0x1C, 0x19, 0x24, 0x11, 0x3C, 0x1B, 0x23, 0x1C,
0x7F, 0x33, 0x17, 0xDA, 0x3F, 0x4E, 0x82, 0x18,
0x80, 0x23, 0xB3, 0x54, 0x23, 0x9A, 0x21, 0x9E,
0xA3, 0x1A, 0xF6, 0x18, 0x21, 0x96, 0x1F, 0xAF,
0x00, 0x23, 0xFB, 0x5E, 0x9C, 0x42, 0x01, 0xDC,
0xA4, 0xB2, 0x1F, 0x94, 0x03, 0x9A, 0x35, 0x4C,
0x55, 0x19, 0x6D, 0x00, 0x00, 0x27, 0x2B, 0x5B,
0x2F, 0x53, 0x83, 0xE7, 0x83, 0x18, 0x7E, 0x2C,
0x36, 0xDD, 0x32, 0x4E, 0x7F, 0x27, 0xF7, 0x54,
0x14, 0x9F, 0xBC, 0x42, 0x03, 0xDB, 0x17, 0x9E,
0xE3, 0x1B, 0xF6, 0x18, 0x17, 0x96, 0x10, 0xAF,
0x00, 0x23, 0xFB, 0x5E, 0x9C, 0x42, 0x24, 0xDC,
0xA3, 0xB2, 0x18, 0x9E, 0xB4, 0x42, 0x11, 0xDB,
0x1A, 0x9F, 0x09, 0x9C, 0xA7, 0x42, 0x00, 0xDA,
0x1A, 0x94, 0x16, 0x9E, 0x09, 0x9C, 0xA6, 0x42,
0x00, 0xDD, 0x16, 0x94, 0x15, 0x9E, 0x96, 0x42,
0x00, 0xDA, 0x15, 0x92, 0x19, 0x9F, 0xBA, 0x42,
0x00, 0xDA, 0x19, 0x92, 0x03, 0x9A, 0x1D, 0x4C,
0x55, 0x19, 0x6D, 0x00, 0x2A, 0x5B, 0x2B, 0x53,
0x54, 0xE7, 0x1D, 0x9E, 0x87, 0x18, 0xB4, 0x42,
0x0E, 0xDA, 0x1B, 0x4C, 0x00, 0x26, 0x3E, 0x55,
0x9F, 0xE7, 0xA3, 0xB2, 0x10, 0x93, 0xD8, 0xE7,
0x16, 0x4E, 0xF4, 0x54, 0x00, 0x2C, 0xC7, 0xDA,
0x23, 0x9F, 0xBC, 0x42, 0xAF, 0xDC, 0xA9, 0xE7,
0x13, 0x4E, 0x20, 0x97, 0xBC, 0x5D, 0x22, 0x9E,
0x67, 0xB2, 0xB7, 0x42, 0x8D, 0xD0, 0x20, 0x9F,
0x0F, 0x4E, 0x01, 0x34, 0xBC, 0x55, 0x88, 0xE7,
0xAC, 0x09, 0x00, 0x20, 0x4C, 0x00, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x70, 0x01, 0x00, 0x20,
0xE4, 0x10, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x1C, 0x03, 0x00, 0x20, 0x78, 0x09, 0x00, 0x20,
0x94, 0x11, 0x00, 0x20, 0x04, 0x40, 0x00, 0x40,
0xF8, 0x03, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40,
0x12, 0x79, 0x00, 0x00, 0x64, 0x0E, 0x00, 0x20,
0xB3, 0x0A, 0x00, 0x20, 0x09, 0x9C, 0x01, 0x27,
0x1C, 0x97, 0x00, 0x2C, 0x00, 0xD0, 0xD7, 0xE6,
0x6D, 0x46, 0x6F, 0x46, 0x18, 0x26, 0x14, 0x20,
0x76, 0x5B, 0xC0, 0x5B, 0x41, 0x4D, 0x17, 0x99,
0x10, 0xAC, 0x2F, 0x1C, 0x2E, 0x82, 0x68, 0x82,
0x29, 0x60, 0x25, 0x88, 0x21, 0x9B, 0x3C, 0x1C,
0x3D, 0x81, 0x1A, 0x9E, 0x3C, 0x4F, 0x63, 0x60,
0x1F, 0xAC, 0x25, 0x88, 0xBE, 0x60, 0x16, 0x98,
0x15, 0x99, 0x19, 0x9A, 0x37, 0x4C, 0x0B, 0x9E,
0xF8, 0x60, 0x39, 0x60, 0x7A, 0x60, 0x65, 0x81,
0x00, 0x2E, 0x24, 0xD0, 0x35, 0x4B, 0x1B, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x34, 0x4B, 0x1B, 0x68,
0x00, 0x2B, 0x1C, 0xDD, 0x33, 0x4C, 0x23, 0x78,
0x00, 0x2B, 0x56, 0xD1, 0x32, 0x4F, 0x3B, 0x7E,
0x00, 0x2B, 0x14, 0xD0, 0x31, 0x4D, 0x09, 0x9F,
0x01, 0x26, 0x23, 0x78, 0x00, 0x2B, 0x08, 0xD0,
0x2D, 0x48, 0x7A, 0x01, 0xC1, 0x7D, 0x52, 0x19,
0x03, 0x20, 0x01, 0x23, 0x00, 0x96, 0xFF, 0xF7,
0xAD, 0xF8, 0x29, 0x49, 0x01, 0x37, 0x0B, 0x7E,
0xFF, 0xB2, 0xBB, 0x42, 0xED, 0xD8, 0x26, 0x4C,
0x23, 0x7D, 0x00, 0x2B, 0x13, 0xD0, 0x22, 0x7E,
0xE4, 0x7D, 0x01, 0x3A, 0x24, 0x49, 0xD2, 0xB2,
0x02, 0x34, 0x00, 0x20, 0x53, 0x1C, 0x9B, 0x01,
0x1B, 0x19, 0x5B, 0x00, 0x01, 0x3A, 0x5D, 0x5A,
0xD2, 0xB2, 0x5D, 0x5A, 0x58, 0x52, 0xF5, 0xE7,
0x01, 0x26, 0x1C, 0x96, 0x74, 0xE6, 0x1D, 0x4D,
0x1D, 0x4E, 0xAB, 0x7E, 0x32, 0x68, 0x13, 0x4F,
0x53, 0x43, 0x08, 0x21, 0x79, 0x5E, 0x1B, 0x48,
0x9B, 0x11, 0x1B, 0x4A, 0xCD, 0x17, 0xDC, 0x0F,
0x00, 0x78, 0x99, 0x42, 0x65, 0x41, 0x15, 0x70,
0x00, 0x28, 0x0A, 0xD1, 0x1C, 0x9C, 0x00, 0x2C,
0x07, 0xD0, 0x01, 0x23, 0x13, 0x70, 0x15, 0x4A,
0x15, 0x49, 0x13, 0x70, 0x15, 0x4A, 0x0B, 0x70,
0x13, 0x70, 0x25, 0xB0, 0xF0, 0xBD, 0x01, 0x25,
0x1C, 0x95, 0x51, 0xE6, 0x01, 0x24, 0x1C, 0x94,
0x4E, 0xE6, 0x03, 0x20, 0x10, 0x49, 0xFF, 0xF7,
0xBD, 0xF8, 0xA3, 0xE7, 0x70, 0x01, 0x00, 0x20,
0xE4, 0x10, 0x00, 0x20, 0xDE, 0x01, 0x00, 0x20,
0x20, 0x01, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x64, 0x0E, 0x00, 0x20,
0x00, 0x40, 0x00, 0x40, 0x48, 0x0D, 0x00, 0x20,
0x78, 0x09, 0x00, 0x20, 0xE4, 0x01, 0x00, 0x20,
0x14, 0x09, 0x00, 0x20, 0x30, 0x11, 0x00, 0x20,
0x48, 0x11, 0x00, 0x20, 0xC4, 0x01, 0x00, 0x20,
0xF0, 0x59, 0x00, 0x00, 0xF0, 0xB5, 0x2F, 0x4B,
0x85, 0xB0, 0x1C, 0x78, 0x2E, 0x4D, 0x2F, 0x4E,
0x10, 0xE0, 0x01, 0x3C, 0xE4, 0xB2, 0x2B, 0x57,
0x32, 0x57, 0x59, 0x1C, 0x02, 0x32, 0x89, 0x01,
0x89, 0x18, 0x2B, 0x4A, 0x49, 0x00, 0x88, 0x5A,
0x2A, 0x4A, 0x5B, 0x00, 0x9A, 0x5A, 0x21, 0x1C,
0xFF, 0xF7, 0x0A, 0xFB, 0x00, 0x2C, 0xEC, 0xD1,
0x27, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x08, 0xD0,
0x20, 0x4B, 0x03, 0x20, 0x19, 0x78, 0x01, 0x23,
0x00, 0x93, 0x24, 0x4A, 0x02, 0x23, 0xFF, 0xF7,
0x1D, 0xF8, 0x23, 0x4B, 0x1E, 0x49, 0x18, 0x78,
0x9A, 0x78, 0x84, 0x1C, 0x03, 0x92, 0xDE, 0x78,
0x00, 0x23, 0x02, 0x94, 0x0D, 0xE0, 0xA4, 0x01,
0xE4, 0x19, 0x64, 0x00, 0x65, 0x5A, 0x00, 0x25,
0x65, 0x52, 0x01, 0x32, 0x02, 0xE0, 0x02, 0x9C,
0x00, 0x22, 0xE7, 0x18, 0xB4, 0x1A, 0xF2, 0xD1,
0x01, 0x33, 0x03, 0x9D, 0x1A, 0x18, 0xAA, 0x42,
0xF5, 0xDB, 0x15, 0x4B, 0x10, 0x49, 0x58, 0x78,
0xDE, 0x78, 0x42, 0x1C, 0x01, 0x23, 0x5B, 0x42,
0x02, 0x92, 0x00, 0x22, 0x9F, 0x1C, 0x08, 0xE0,
0x02, 0x9D, 0xAC, 0x18, 0xA4, 0x01, 0xE4, 0x19,
0x64, 0x00, 0x65, 0x5A, 0x00, 0x25, 0x65, 0x52,
0x01, 0x32, 0x14, 0x18, 0xB4, 0x42, 0xF3, 0xDB,
0x03, 0x9A, 0x01, 0x33, 0x93, 0x42, 0xEC, 0xDB,
0x05, 0xB0, 0xF0, 0xBD, 0x7C, 0x09, 0x00, 0x20,
0x30, 0x75, 0x00, 0x00, 0x2A, 0x75, 0x00, 0x00,
0x00, 0x40, 0x00, 0x40, 0x94, 0x11, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x3C, 0x0D, 0x00, 0x20,
0x0A, 0x03, 0x00, 0x20, 0x30, 0xB5, 0x0C, 0x4B,
0x0C, 0x4C, 0xDB, 0x78, 0x0C, 0x49, 0x10, 0xE0,
0x01, 0x3B, 0xDB, 0xB2, 0x5A, 0x1C, 0x0B, 0x4D,
0xD2, 0x01, 0x52, 0x19, 0x45, 0x1C, 0x03, 0xD1,
0x15, 0x88, 0x5A, 0x00, 0x55, 0x52, 0x04, 0xE0,
0x15, 0x88, 0x5A, 0x01, 0x12, 0x18, 0x52, 0x00,
0x15, 0x53, 0x00, 0x2B, 0xEC, 0xD1, 0x30, 0xBD,
0x0A, 0x03, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x20,
0x94, 0x11, 0x00, 0x20, 0x02, 0x40, 0x00, 0x40,
0xF0, 0xB5, 0x8D, 0xB0, 0x0A, 0x91, 0x0B, 0x92,
0x63, 0x4B, 0x41, 0x1C, 0x0C, 0xD1, 0x63, 0x4A,
0x63, 0x49, 0x12, 0x7E, 0x01, 0x3A, 0x03, 0x92,
0xDA, 0x78, 0x5E, 0x78, 0x54, 0x00, 0x00, 0x23,
0x55, 0x1C, 0x64, 0x18, 0x94, 0x46, 0x0E, 0xE0,
0xDC, 0x7B, 0x5A, 0x79, 0xA2, 0x18, 0x01, 0x3A,
0x10, 0xE0, 0x5C, 0x4A, 0xE9, 0x18, 0xC9, 0x01,
0x89, 0x18, 0x0A, 0x88, 0x5F, 0x00, 0xE2, 0x53,
0x0A, 0x88, 0x00, 0x22, 0x0A, 0x80, 0x01, 0x3B,
0x67, 0x46, 0xDA, 0x19, 0xB2, 0x42, 0xF0, 0xDA,
0x03, 0x9A, 0x00, 0x24, 0x56, 0x01, 0x54, 0x4D,
0x36, 0x18, 0x00, 0x23, 0x76, 0x00, 0x11, 0x1C,
0x08, 0x93, 0x07, 0x93, 0x06, 0x93, 0x05, 0x93,
0x03, 0x95, 0x09, 0x96, 0xA4, 0x46, 0x55, 0xE0,
0x44, 0x1C, 0x04, 0xD1, 0x4A, 0x4C, 0x56, 0x00,
0x34, 0x19, 0xE4, 0x5A, 0x04, 0xE0, 0x4B, 0x4C,
0x09, 0x9F, 0x3E, 0x19, 0x5C, 0x01, 0x34, 0x5B,
0x4E, 0x1C, 0x46, 0x4F, 0x04, 0x96, 0xF6, 0x01,
0xF6, 0x19, 0x37, 0x88, 0x24, 0xB2, 0x3E, 0xB2,
0x45, 0x4F, 0xA6, 0x1B, 0x54, 0x00, 0xE7, 0x19,
0xF4, 0x17, 0xFE, 0x52, 0x36, 0x19, 0x66, 0x40,
0x0F, 0x1C, 0x01, 0x24, 0xA7, 0x43, 0xB9, 0x42,
0x09, 0xD1, 0x07, 0x9C, 0xA4, 0x19, 0x07, 0x94,
0xB5, 0x42, 0x00, 0xDD, 0x35, 0x1C, 0x06, 0x9F,
0xB7, 0x42, 0x0B, 0xDB, 0x0D, 0xE0, 0x08, 0x9C,
0x03, 0x9F, 0xA4, 0x19, 0x08, 0x94, 0xB7, 0x42,
0x00, 0xDD, 0x03, 0x96, 0x05, 0x9C, 0xB4, 0x42,
0x02, 0xDB, 0x02, 0xE0, 0x06, 0x96, 0x00, 0xE0,
0x05, 0x96, 0x04, 0x9E, 0xF4, 0x01, 0x2F, 0x4E,
0xA4, 0x19, 0x47, 0x1C, 0x0E, 0xD1, 0x27, 0x88,
0x2B, 0x4E, 0x04, 0x97, 0x57, 0x00, 0xBE, 0x19,
0x02, 0x96, 0x10, 0x27, 0x6E, 0x46, 0xBF, 0x5B,
0x02, 0x9E, 0xF7, 0x52, 0x26, 0x88, 0x00, 0x26,
0x26, 0x80, 0x05, 0xE0, 0x27, 0x88, 0x27, 0x4E,
0x09, 0x9C, 0xA6, 0x19, 0x5C, 0x01, 0x37, 0x53,
0x01, 0x39, 0x02, 0x3B, 0x61, 0x45, 0xA7, 0xDA,
0x01, 0x30, 0x13, 0xD1, 0x23, 0x4C, 0x23, 0x78,
0x00, 0x2B, 0x03, 0xD0, 0x01, 0x20, 0x22, 0x49,
0xFE, 0xF7, 0x70, 0xFF, 0x23, 0x78, 0x00, 0x2B,
0x08, 0xD0, 0x17, 0x4B, 0x01, 0x20, 0xD9, 0x78,
0x00, 0x23, 0x00, 0x93, 0x16, 0x4A, 0x02, 0x23,
0xFE, 0xF7, 0x0C, 0xFF, 0x07, 0x9E, 0x08, 0x9F,
0x0A, 0x9C, 0xF3, 0x19, 0x23, 0x60, 0x05, 0x9E,
0x03, 0x9F, 0x06, 0x9C, 0xF3, 0x1B, 0x65, 0x1B,
0x9D, 0x42, 0x00, 0xDA, 0x1D, 0x1C, 0x0B, 0x9E,
0x12, 0x4C, 0x35, 0x60, 0x23, 0x78, 0x00, 0x2B,
0x03, 0xD0, 0x0B, 0x20, 0x11, 0x49, 0xFE, 0xF7,
0x4D, 0xFF, 0x23, 0x78, 0x00, 0x2B, 0x08, 0xD0,
0x06, 0x4B, 0x0B, 0x20, 0x19, 0x7E, 0x01, 0x23,
0x00, 0x93, 0x09, 0x4A, 0x02, 0x23, 0xFE, 0xF7,
0xE9, 0xFE, 0x0D, 0xB0, 0xF0, 0xBD, 0xC0, 0x46,
0x0A, 0x03, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x94, 0x11, 0x00, 0x20, 0x02, 0x40, 0x00, 0x40,
0xFF, 0xFF, 0x00, 0x00, 0xF8, 0x03, 0x00, 0x20,
0x54, 0x11, 0x00, 0x20, 0xEB, 0x01, 0x00, 0x20,
0xC6, 0x59, 0x00, 0x00, 0xCD, 0x59, 0x00, 0x00,
0xF0, 0xB5, 0xA6, 0x4B, 0x85, 0xB0, 0x1D, 0x78,
0x00, 0x2D, 0x29, 0xD0, 0xA4, 0x4B, 0xA5, 0x4C,
0x18, 0x78, 0xA5, 0x4B, 0x46, 0xB2, 0x19, 0x68,
0x5B, 0x68, 0xB2, 0x00, 0xCB, 0x18, 0x13, 0x51,
0x82, 0x1D, 0xD2, 0xB2, 0x00, 0x25, 0x06, 0x23,
0x01, 0x3B, 0xDB, 0xB2, 0xF1, 0x1A, 0x00, 0xD5,
0x0C, 0x31, 0x89, 0x00, 0x09, 0x59, 0x6D, 0x18,
0x11, 0x1C, 0x0B, 0x2A, 0x01, 0xD9, 0x0C, 0x39,
0xC9, 0xB2, 0x89, 0x00, 0x61, 0x58, 0x01, 0x3A,
0x6D, 0x1A, 0xD2, 0xB2, 0x00, 0x2B, 0xEB, 0xD1,
0x01, 0x30, 0x93, 0x4A, 0xC0, 0xB2, 0x10, 0x70,
0x40, 0xB2, 0x0B, 0x28, 0x00, 0xDD, 0x13, 0x70,
0x92, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x00, 0xD0,
0x15, 0xE1, 0x91, 0x4B, 0x14, 0x21, 0x5B, 0x5E,
0x9D, 0x42, 0x02, 0xDA, 0x8F, 0x4B, 0x01, 0x22,
0x1A, 0x70, 0x8B, 0x4B, 0x10, 0x22, 0x9E, 0x5E,
0x12, 0x24, 0x1B, 0x5F, 0xF6, 0x1A, 0x85, 0x4B,
0x18, 0x78, 0x00, 0x28, 0x16, 0xD1, 0x8A, 0x4B,
0x8A, 0x4F, 0x1B, 0x68, 0x8A, 0x4C, 0xBB, 0x80,
0x23, 0x78, 0x3E, 0x80, 0x00, 0x2B, 0x02, 0xD0,
0x88, 0x49, 0xFE, 0xF7, 0xD7, 0xFE, 0x23, 0x78,
0x00, 0x2B, 0x07, 0xD0, 0x01, 0x23, 0x02, 0x21,
0x00, 0x93, 0x00, 0x20, 0x3A, 0x1C, 0x0B, 0x1C,
0xFE, 0xF7, 0x74, 0xFE, 0x7C, 0x4B, 0x9A, 0x7D,
0x96, 0x42, 0x07, 0xDC, 0x80, 0x4B, 0x1A, 0x78,
0x51, 0xB2, 0x02, 0x29, 0x08, 0xDC, 0x01, 0x32,
0x1A, 0x70, 0x05, 0xE0, 0xDB, 0x7D, 0x9E, 0x42,
0x02, 0xDB, 0x7B, 0x4B, 0x00, 0x22, 0x1A, 0x70,
0x71, 0x4B, 0x76, 0x4A, 0x59, 0x68, 0x1B, 0x68,
0x15, 0x80, 0xCB, 0x18, 0x53, 0x80, 0x74, 0x4B,
0x96, 0x80, 0x1B, 0x78, 0x00, 0x2B, 0x06, 0xD0,
0x01, 0x23, 0x00, 0x93, 0x19, 0x20, 0x03, 0x21,
0x02, 0x23, 0xFE, 0xF7, 0x4F, 0xFE, 0x6B, 0x4B,
0x64, 0x4C, 0x1B, 0x78, 0x00, 0x2B, 0x61, 0xD0,
0x6B, 0x4D, 0x2B, 0x78, 0x00, 0x2B, 0x03, 0xD0,
0x19, 0x20, 0x6C, 0x49, 0xFE, 0xF7, 0x9A, 0xFE,
0x69, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x05, 0xD1,
0x22, 0x78, 0x00, 0x2A, 0x52, 0xD0, 0x61, 0x4A,
0x13, 0x70, 0x4F, 0xE0, 0x03, 0x2B, 0x4D, 0xD1,
0x2B, 0x78, 0x00, 0x2B, 0x03, 0xD0, 0x00, 0x20,
0x63, 0x49, 0xFE, 0xF7, 0x87, 0xFE, 0x55, 0x4B,
0x62, 0x4A, 0x19, 0x78, 0x00, 0x29, 0x1A, 0xD1,
0x01, 0x20, 0x18, 0x70, 0x13, 0x7E, 0xD6, 0x7D,
0x5F, 0x4D, 0x60, 0x4A, 0x0B, 0xE0, 0x01, 0x3B,
0xDB, 0xB2, 0xF8, 0x18, 0x44, 0x00, 0xA1, 0x5A,
0xC9, 0x00, 0xA1, 0x52, 0x00, 0x21, 0x41, 0x55,
0x00, 0x2B, 0xF4, 0xD1, 0x63, 0x46, 0x59, 0x1E,
0xC9, 0xB2, 0x00, 0x2B, 0x23, 0xD0, 0x33, 0x1C,
0x4F, 0x01, 0x8C, 0x46, 0xF4, 0xE7, 0x13, 0x7E,
0xD6, 0x7D, 0x54, 0x4A, 0x0E, 0xE0, 0x01, 0x3B,
0x51, 0x4D, 0xDB, 0xB2, 0xFC, 0x18, 0x60, 0x00,
0x64, 0x57, 0xE4, 0x00, 0x02, 0x94, 0x84, 0x5A,
0x02, 0x9D, 0x64, 0x1B, 0x84, 0x52, 0x00, 0x2B,
0xF1, 0xD1, 0x0B, 0x1C, 0x59, 0x1E, 0xC9, 0xB2,
0x00, 0x2B, 0x02, 0xD0, 0x33, 0x1C, 0x4F, 0x01,
0xF5, 0xE7, 0x3A, 0x4A, 0x11, 0x1C, 0x30, 0x31,
0x08, 0xC2, 0x8A, 0x42, 0xFC, 0xD1, 0x3B, 0x4B,
0x00, 0x22, 0x1A, 0x70, 0x44, 0x4B, 0x01, 0x22,
0x1A, 0x70, 0x60, 0xE0, 0x22, 0x78, 0x43, 0x4B,
0x00, 0x2A, 0x06, 0xD1, 0x40, 0x4A, 0x01, 0x21,
0x11, 0x70, 0x1A, 0x68, 0x52, 0x18, 0x1A, 0x60,
0x55, 0xE0, 0x00, 0x22, 0x1A, 0x60, 0x39, 0x4B,
0x3D, 0x48, 0x1C, 0x7E, 0xDB, 0x7D, 0x39, 0x49,
0x02, 0x93, 0x2D, 0x4B, 0x9B, 0x7C, 0x03, 0x93,
0x11, 0xE0, 0x01, 0x3B, 0xDB, 0xB2, 0xF2, 0x18,
0x14, 0x56, 0x03, 0x9D, 0xAC, 0x42, 0x07, 0xD1,
0x31, 0x4D, 0x54, 0x00, 0x57, 0x57, 0x65, 0x5A,
0xEF, 0x1B, 0x67, 0x52, 0x00, 0x24, 0x14, 0x54,
0x00, 0x2B, 0xEE, 0xD1, 0x64, 0x46, 0x65, 0x1E,
0xED, 0xB2, 0x00, 0x2C, 0x03, 0xD0, 0x02, 0x9B,
0x6E, 0x01, 0xAC, 0x46, 0xF4, 0xE7, 0x2D, 0x4B,
0x1B, 0x68, 0x5D, 0x07, 0x2B, 0xD5, 0x20, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x22, 0xD0, 0x02, 0x20,
0x29, 0x49, 0xFE, 0xF7, 0x03, 0xFE, 0x1D, 0xE0,
0xE9, 0x7D, 0x62, 0x01, 0x0B, 0x1C, 0x21, 0x48,
0x02, 0x92, 0x08, 0xE0, 0x01, 0x3B, 0x02, 0x9A,
0xDB, 0xB2, 0xD2, 0x18, 0x52, 0x00, 0x12, 0x5A,
0x5F, 0x00, 0xD2, 0x08, 0xBA, 0x53, 0x00, 0x2B,
0xF4, 0xD1, 0x13, 0x4A, 0x12, 0x78, 0x00, 0x2A,
0x05, 0xD0, 0x02, 0x20, 0x00, 0x93, 0x0F, 0x4A,
0x03, 0x1C, 0xFE, 0xF7, 0x8F, 0xFD, 0x01, 0x34,
0xE4, 0xB2, 0x01, 0xE0, 0x11, 0x4D, 0x0B, 0x4E,
0x2B, 0x7E, 0xA3, 0x42, 0xDC, 0xD8, 0x05, 0xB0,
0xF0, 0xBD, 0xC0, 0x46, 0x1C, 0x03, 0x00, 0x20,
0xF4, 0x10, 0x00, 0x20, 0xBC, 0x11, 0x00, 0x20,
0x70, 0x01, 0x00, 0x20, 0x14, 0x09, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x3C, 0x11, 0x00, 0x20,
0x34, 0x11, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0xD2, 0x59, 0x00, 0x00,
0x20, 0x09, 0x00, 0x20, 0xD9, 0x59, 0x00, 0x00,
0xE2, 0x59, 0x00, 0x00, 0xAE, 0x09, 0x00, 0x20,
0x64, 0x0E, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x20,
0x48, 0x11, 0x00, 0x20, 0xBC, 0x01, 0x00, 0x20,
0xB3, 0x0A, 0x00, 0x20, 0x58, 0x00, 0x00, 0x20,
0xEB, 0x59, 0x00, 0x00, 0xF0, 0xB5, 0x25, 0x4B,
0x87, 0xB0, 0x1B, 0x78, 0x00, 0x2B, 0x2B, 0xD1,
0x23, 0x4A, 0x24, 0x4B, 0x90, 0x7C, 0x1B, 0x78,
0x04, 0x90, 0xD2, 0x7E, 0x22, 0x4D, 0x52, 0xB2,
0x92, 0xB2, 0x05, 0x92, 0x21, 0x4A, 0x1D, 0xE0,
0x01, 0x3B, 0x21, 0x4C, 0xDB, 0xB2, 0xE1, 0x5C,
0x04, 0x9F, 0xB9, 0x42, 0x16, 0xD1, 0x59, 0x00,
0x88, 0x5A, 0x00, 0x28, 0x07, 0xD0, 0x6E, 0x5A,
0x6F, 0x46, 0x34, 0xB2, 0xA4, 0x46, 0x14, 0x24,
0xE7, 0x5F, 0xBC, 0x45, 0x05, 0xDA, 0x59, 0x00,
0x6E, 0x5A, 0xF6, 0x00, 0x80, 0x1B, 0x50, 0x52,
0x01, 0xE0, 0x80, 0x1B, 0x88, 0x52, 0x14, 0x4F,
0x00, 0x21, 0xF9, 0x54, 0x00, 0x2B, 0xDF, 0xD1,
0x0E, 0x4B, 0x12, 0x4C, 0x19, 0x78, 0x0F, 0x48,
0x0B, 0x1C, 0x05, 0xE0, 0x01, 0x3B, 0xDB, 0xB2,
0x5A, 0x00, 0x15, 0x5A, 0xED, 0x08, 0x15, 0x53,
0x00, 0x2B, 0xF7, 0xD1, 0x0C, 0x4A, 0x12, 0x78,
0x00, 0x2A, 0x05, 0xD0, 0x02, 0x20, 0x00, 0x93,
0x08, 0x4A, 0x03, 0x1C, 0xFE, 0xF7, 0x0E, 0xFD,
0x07, 0xB0, 0xF0, 0xBD, 0x30, 0x11, 0x00, 0x20,
0x48, 0x0D, 0x00, 0x20, 0x7C, 0x09, 0x00, 0x20,
0x3C, 0x0D, 0x00, 0x20, 0x14, 0x02, 0x00, 0x20,
0xA4, 0x0A, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x10, 0xB5, 0x09, 0x49,
0x50, 0x22, 0x09, 0x48, 0x00, 0xF0, 0xE2, 0xF9,
0x08, 0x4C, 0x09, 0x49, 0x20, 0x1C, 0x42, 0x22,
0x00, 0xF0, 0xDC, 0xF9, 0x07, 0x4B, 0xA2, 0x7B,
0x1A, 0x60, 0xE3, 0x7D, 0xE3, 0x76, 0x23, 0x7E,
0x23, 0x77, 0x10, 0xBD, 0x4A, 0x74, 0x00, 0x00,
0x48, 0x0D, 0x00, 0x20, 0xAE, 0x09, 0x00, 0x20,
0x08, 0x74, 0x00, 0x00, 0x50, 0x11, 0x00, 0x20,
0x08, 0xB5, 0x04, 0x49, 0x04, 0x4B, 0x41, 0x43,
0x04, 0x48, 0xC9, 0x18, 0x00, 0xF0, 0x60, 0xF9,
0xC0, 0xB2, 0x08, 0xBD, 0x44, 0xFE, 0xFF, 0xFF,
0xFE, 0x24, 0x02, 0x00, 0x40, 0x42, 0x0F, 0x00,
0x10, 0xB5, 0x15, 0x4C, 0x00, 0x23, 0x23, 0x71,
0x03, 0x23, 0x63, 0x71, 0x02, 0x23, 0x23, 0x72,
0x12, 0x4B, 0x98, 0x78, 0x02, 0x38, 0x03, 0x28,
0x1D, 0xD8, 0x00, 0xF0, 0xE7, 0xF8, 0x0B, 0x04,
0x02, 0x14, 0xC7, 0x20, 0x00, 0xE0, 0xD7, 0x20,
0xE0, 0x70, 0xFF, 0xF7, 0xD9, 0xFF, 0x02, 0x23,
0x20, 0x70, 0x0E, 0xE0, 0xF4, 0x20, 0xE0, 0x70,
0xFF, 0xF7, 0xD2, 0xFF, 0x02, 0x23, 0x20, 0x70,
0xA3, 0x71, 0x01, 0x23, 0x06, 0xE0, 0xF4, 0x20,
0xE0, 0x70, 0xFF, 0xF7, 0xC9, 0xFF, 0x01, 0x23,
0x20, 0x70, 0xA3, 0x71, 0xE3, 0x71, 0x10, 0xBD,
0xAA, 0x0A, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0xF0, 0xB5, 0x59, 0x4B, 0x87, 0xB0, 0x1A, 0x68,
0x58, 0x4B, 0x08, 0x2A, 0x01, 0xD1, 0x01, 0x22,
0x00, 0xE0, 0x00, 0x22, 0x1A, 0x70, 0x56, 0x4B,
0x56, 0x4C, 0x01, 0x33, 0xDB, 0x7F, 0x00, 0x2B,
0x00, 0xD1, 0xE3, 0x71, 0x23, 0x78, 0x01, 0x25,
0xA2, 0x79, 0x28, 0x1C, 0xD9, 0x00, 0x90, 0x40,
0x82, 0xB2, 0xCB, 0x1A, 0x53, 0x43, 0x50, 0x4E,
0xDB, 0x10, 0xDB, 0xB2, 0x33, 0x80, 0x22, 0x78,
0xFA, 0x23, 0xA0, 0x79, 0x9B, 0x00, 0x53, 0x43,
0x4C, 0x4F, 0x29, 0x1C, 0x81, 0x40, 0x88, 0xB2,
0xB9, 0x88, 0x58, 0x43, 0x09, 0x01, 0x00, 0xF0,
0xFB, 0xF8, 0xC1, 0xB2, 0x71, 0x80, 0x23, 0x78,
0x2D, 0x22, 0xA0, 0x79, 0x53, 0x43, 0x2A, 0x1C,
0x82, 0x40, 0x90, 0xB2, 0x58, 0x43, 0x6B, 0x46,
0x19, 0x81, 0x09, 0x01, 0x00, 0xF0, 0xEC, 0xF8,
0xC0, 0xB2, 0xB0, 0x80, 0x23, 0x7A, 0xB9, 0x79,
0xD8, 0x00, 0x18, 0x1A, 0xA9, 0x40, 0xC0, 0x00,
0x49, 0x19, 0xE0, 0x30, 0x48, 0x43, 0xA2, 0x79,
0x6C, 0x46, 0x08, 0x21, 0x61, 0x5E, 0x90, 0x40,
0x49, 0x01, 0x00, 0xF0, 0x8B, 0xF8, 0x34, 0x4A,
0xF0, 0x80, 0x11, 0x7D, 0xD0, 0x7D, 0x36, 0x4B,
0x08, 0x18, 0xC0, 0xB2, 0x18, 0x70, 0x17, 0x7E,
0x5F, 0x70, 0x56, 0x7E, 0x01, 0x96, 0x96, 0x7F,
0x01, 0x9C, 0x66, 0x43, 0xF4, 0xB2, 0x20, 0x18,
0xC0, 0xB2, 0x98, 0x70, 0x02, 0x90, 0x96, 0x7E,
0x03, 0x96, 0x03, 0x98, 0xD6, 0x7F, 0x46, 0x43,
0xF0, 0xB2, 0xC7, 0x19, 0xFF, 0xB2, 0xDF, 0x70,
0xD6, 0x7E, 0xB4, 0x46, 0x61, 0x44, 0x61, 0x18,
0xC9, 0xB2, 0x19, 0x71, 0x16, 0x7F, 0x80, 0x19,
0x02, 0x9E, 0xC0, 0xB2, 0x74, 0x1A, 0x3F, 0x1A,
0xE6, 0xB2, 0xFF, 0xB2, 0x58, 0x71, 0x9E, 0x71,
0xDF, 0x71, 0xBC, 0x46, 0x57, 0x7D, 0xEC, 0x1B,
0x04, 0x97, 0x27, 0x1C, 0x77, 0x43, 0xFF, 0xB2,
0x05, 0x97, 0x9F, 0x73, 0x97, 0x7D, 0x64, 0x46,
0xED, 0x1B, 0x65, 0x43, 0x47, 0x43, 0x04, 0x9C,
0x5F, 0x74, 0x4C, 0x43, 0x18, 0x72, 0x6F, 0x46,
0x14, 0x20, 0xC7, 0x5D, 0xED, 0xB2, 0xE4, 0xB2,
0xDD, 0x73, 0x1C, 0x74, 0x5D, 0x72, 0x99, 0x72,
0xDF, 0x72, 0x1E, 0x73, 0x5C, 0x73, 0x51, 0x7F,
0x12, 0x4B, 0x00, 0x29, 0x03, 0xD0, 0x69, 0x46,
0x09, 0x79, 0x19, 0x70, 0x03, 0xE0, 0x01, 0x9C,
0x03, 0x9E, 0x74, 0x43, 0x1C, 0x70, 0x93, 0x1C,
0x03, 0x32, 0x02, 0x9F, 0xD2, 0x7F, 0xDB, 0x7F,
0xBA, 0x18, 0x5B, 0xB2, 0x01, 0x32, 0x9A, 0x40,
0x09, 0x4B, 0x07, 0xB0, 0x1A, 0x60, 0xF0, 0xBD,
0x50, 0x11, 0x00, 0x20, 0xFA, 0x02, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xAA, 0x0A, 0x00, 0x20,
0x04, 0x02, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x0A, 0x03, 0x00, 0x20, 0x7C, 0x09, 0x00, 0x20,
0x18, 0x09, 0x00, 0x20, 0x02, 0xB4, 0x71, 0x46,
0x49, 0x08, 0x49, 0x00, 0x09, 0x5C, 0x49, 0x00,
0x8E, 0x44, 0x02, 0xBC, 0x70, 0x47, 0xC0, 0x46,
0x03, 0xB4, 0x71, 0x46, 0x49, 0x08, 0x40, 0x00,
0x49, 0x00, 0x09, 0x5A, 0x49, 0x00, 0x8E, 0x44,
0x03, 0xBC, 0x70, 0x47, 0x00, 0x29, 0x34, 0xD0,
0x01, 0x23, 0x00, 0x22, 0x10, 0xB4, 0x88, 0x42,
0x2C, 0xD3, 0x01, 0x24, 0x24, 0x07, 0xA1, 0x42,
0x04, 0xD2, 0x81, 0x42, 0x02, 0xD2, 0x09, 0x01,
0x1B, 0x01, 0xF8, 0xE7, 0xE4, 0x00, 0xA1, 0x42,
0x04, 0xD2, 0x81, 0x42, 0x02, 0xD2, 0x49, 0x00,
0x5B, 0x00, 0xF8, 0xE7, 0x88, 0x42, 0x01, 0xD3,
0x40, 0x1A, 0x1A, 0x43, 0x4C, 0x08, 0xA0, 0x42,
0x02, 0xD3, 0x00, 0x1B, 0x5C, 0x08, 0x22, 0x43,
0x8C, 0x08, 0xA0, 0x42, 0x02, 0xD3, 0x00, 0x1B,
0x9C, 0x08, 0x22, 0x43, 0xCC, 0x08, 0xA0, 0x42,
0x02, 0xD3, 0x00, 0x1B, 0xDC, 0x08, 0x22, 0x43,
0x00, 0x28, 0x03, 0xD0, 0x1B, 0x09, 0x01, 0xD0,
0x09, 0x09, 0xE3, 0xE7, 0x10, 0x1C, 0x10, 0xBC,
0x70, 0x47, 0x00, 0x28, 0x01, 0xD0, 0x00, 0x20,
0xC0, 0x43, 0x07, 0xB4, 0x02, 0x48, 0x02, 0xA1,
0x40, 0x18, 0x02, 0x90, 0x03, 0xBD, 0xC0, 0x46,
0xD9, 0x00, 0x00, 0x00, 0x00, 0x29, 0xF0, 0xD0,
0x03, 0xB5, 0xFF, 0xF7, 0xB9, 0xFF, 0x0E, 0xBC,
0x42, 0x43, 0x89, 0x1A, 0x18, 0x47, 0xC0, 0x46,
0x00, 0x29, 0x41, 0xD0, 0x10, 0xB4, 0x04, 0x1C,
0x4C, 0x40, 0xA4, 0x46, 0x01, 0x23, 0x00, 0x22,
0x00, 0x29, 0x00, 0xD5, 0x49, 0x42, 0x00, 0x28,
0x00, 0xD5, 0x40, 0x42, 0x88, 0x42, 0x2C, 0xD3,
0x01, 0x24, 0x24, 0x07, 0xA1, 0x42, 0x04, 0xD2,
0x81, 0x42, 0x02, 0xD2, 0x09, 0x01, 0x1B, 0x01,
0xF8, 0xE7, 0xE4, 0x00, 0xA1, 0x42, 0x04, 0xD2,
0x81, 0x42, 0x02, 0xD2, 0x49, 0x00, 0x5B, 0x00,
0xF8, 0xE7, 0x88, 0x42, 0x01, 0xD3, 0x40, 0x1A,
0x1A, 0x43, 0x4C, 0x08, 0xA0, 0x42, 0x02, 0xD3,
0x00, 0x1B, 0x5C, 0x08, 0x22, 0x43, 0x8C, 0x08,
0xA0, 0x42, 0x02, 0xD3, 0x00, 0x1B, 0x9C, 0x08,
0x22, 0x43, 0xCC, 0x08, 0xA0, 0x42, 0x02, 0xD3,
0x00, 0x1B, 0xDC, 0x08, 0x22, 0x43, 0x00, 0x28,
0x03, 0xD0, 0x1B, 0x09, 0x01, 0xD0, 0x09, 0x09,
0xE3, 0xE7, 0x10, 0x1C, 0x64, 0x46, 0x00, 0x2C,
0x00, 0xD5, 0x40, 0x42, 0x10, 0xBC, 0x70, 0x47,
0x00, 0x28, 0x06, 0xD0, 0x03, 0xDB, 0x00, 0x20,
0xC0, 0x43, 0x40, 0x08, 0x01, 0xE0, 0x80, 0x20,
0x00, 0x06, 0x07, 0xB4, 0x02, 0x48, 0x02, 0xA1,
0x40, 0x18, 0x02, 0x90, 0x03, 0xBD, 0xC0, 0x46,
0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xEB, 0xD0,
0x03, 0xB5, 0xFF, 0xF7, 0xA7, 0xFF, 0x0E, 0xBC,
0x42, 0x43, 0x89, 0x1A, 0x18, 0x47, 0xC0, 0x46,
0x70, 0x47, 0xC0, 0x46, 0xF0, 0xB5, 0x05, 0x1C,
0x0F, 0x2A, 0x2F, 0xD9, 0x0B, 0x1C, 0x03, 0x43,
0x05, 0x1C, 0x9C, 0x07, 0x2C, 0xD1, 0x0C, 0x1C,
0x03, 0x1C, 0x15, 0x1C, 0x26, 0x68, 0x10, 0x3D,
0x1E, 0x60, 0x66, 0x68, 0x5E, 0x60, 0xA6, 0x68,
0x9E, 0x60, 0xE6, 0x68, 0x10, 0x34, 0xDE, 0x60,
0x10, 0x33, 0x0F, 0x2D, 0xF2, 0xD8, 0x13, 0x1C,
0x10, 0x3B, 0x1B, 0x09, 0x01, 0x33, 0x1B, 0x01,
0xC5, 0x18, 0xC9, 0x18, 0x0F, 0x23, 0x1A, 0x40,
0x03, 0x2A, 0x0F, 0xD9, 0x0E, 0x1C, 0x2C, 0x1C,
0x13, 0x1C, 0x80, 0xCE, 0x04, 0x3B, 0x80, 0xC4,
0x03, 0x2B, 0xFA, 0xD8, 0x13, 0x1F, 0x9B, 0x08,
0x01, 0x33, 0x9B, 0x00, 0x03, 0x24, 0x22, 0x40,
0xC9, 0x18, 0xED, 0x18, 0x00, 0x2A, 0x05, 0xD0,
0x00, 0x23, 0xCC, 0x5C, 0xEC, 0x54, 0x01, 0x33,
0x93, 0x42, 0xFA, 0xD1, 0xF0, 0xBD, 0xC0, 0x46,
0x50, 0x61, 0x6C, 0x6D, 0x20, 0x49, 0x6E, 0x69,
0x74, 0x00, 0x27, 0x45, 0x6E, 0x74, 0x65, 0x72,
0x27, 0x20, 0x4E, 0x00, 0x4E, 0x2D, 0x6C, 0x65,
0x73, 0x73, 0x21, 0x00, 0x27, 0x45, 0x78, 0x69,
0x74, 0x27, 0x20, 0x4E, 0x00, 0x4E, 0x20, 0x53,
0x2F, 0x50, 0x00, 0x53, 0x6C, 0x65, 0x65, 0x70,
0x00, 0x53, 0x2D, 0x72, 0x65, 0x73, 0x65, 0x74,
0x00, 0x46, 0x41, 0x53, 0x54, 0x00, 0x49, 0x64,
0x6C, 0x65, 0x00, 0x41, 0x63, 0x74, 0x69, 0x76,
0x65, 0x00, 0x53, 0x70, 0x65, 0x63, 0x74, 0x00,
0x53, 0x74, 0x61, 0x63, 0x6B, 0x21, 0x00, 0x52,
0x45, 0x47, 0x56, 0x41, 0x4C, 0x00, 0x44, 0x65,
0x6C, 0x61, 0x79, 0x00, 0x4F, 0x53, 0x43, 0x00,
0x4E, 0x4F, 0x49, 0x53, 0x45, 0x00, 0x54, 0x6F,
0x75, 0x63, 0x68, 0x20, 0x4F, 0x6E, 0x00, 0x54,
0x6F, 0x75, 0x63, 0x68, 0x20, 0x4F, 0x46, 0x46,
0x00, 0x4C, 0x54, 0x5F, 0x50, 0x52, 0x4F, 0x46,
0x49, 0x4C, 0x49, 0x4E, 0x47, 0x00, 0x46, 0x69,
0x78, 0x65, 0x64, 0x00, 0x47, 0x2D, 0x41, 0x66,
0x74, 0x65, 0x72, 0x00, 0x3D, 0x48, 0x6F, 0x76,
0x6F, 0x72, 0x00, 0x12, 0x0E, 0x07, 0x0D, 0x0A,
0x12, 0x04, 0x06, 0x0C, 0x09, 0x12, 0x0F, 0x05,
0x11, 0x08, 0x12, 0x00, 0x01, 0x10, 0x02, 0x45,
0x72, 0x72, 0x00, 0x4B, 0x65, 0x79, 0x20, 0x52,
0x00, 0x52, 0x45, 0x46, 0x20, 0x49, 0x4E, 0x49,
0x54, 0x00, 0x43, 0x6D, 0x44, 0x65, 0x6C, 0x74,
0x61, 0x20, 0x52, 0x65, 0x66, 0x2F, 0x52, 0x65,
0x61, 0x6C, 0x00, 0x52, 0x61, 0x77, 0x00, 0x4D,
0x41, 0x58, 0x20, 0x49, 0x00, 0x43, 0x4D, 0x5F,
0x44, 0x45, 0x4C, 0x54, 0x41, 0x5F, 0x4D, 0x41,
0x58, 0x5F, 0x4D, 0x49, 0x4E, 0x00, 0x54, 0x78,
0x6C, 0x65, 0x73, 0x73, 0x00, 0x44, 0x69, 0x66,
0x66, 0x00, 0x44, 0x49, 0x46, 0x46, 0x2F, 0x4E,
0x00, 0x42, 0x69, 0x67, 0x20, 0x47, 0x72, 0x61,
0x64, 0x00, 0x4E, 0x65, 0x67, 0x2D, 0x45, 0x64,
0x67, 0x65, 0x00, 0x52, 0x65, 0x66, 0x00, 0x00,
0x2D, 0x49, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x01,
0x00, 0xFF, 0x01, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0xA0, 0x0D, 0x00, 0x20,
0x28, 0x02, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00,
0x54, 0x11, 0x00, 0x20, 0x01, 0x02, 0xFF, 0x00,
0x01, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x45,
0x4D, 0x31, 0x48, 0x30, 0x50, 0x52, 0x34, 0x35,
0x08, 0xB5, 0x00, 0x28, 0x02, 0xD0, 0x01, 0x28,
0x20, 0xD1, 0x03, 0xE0, 0x10, 0x4A, 0x11, 0x4B,
0x1A, 0x60, 0x1B, 0xE0, 0x10, 0x4B, 0x1B, 0x68,
0x0C, 0x2B, 0x15, 0xD1, 0x0F, 0x4A, 0x10, 0x4B,
0x1A, 0x60, 0x10, 0x4A, 0x10, 0x4B, 0x1A, 0x60,
0x10, 0x4A, 0x11, 0x4B, 0x1A, 0x60, 0x11, 0x4A,
0x11, 0x4B, 0x1A, 0x60, 0x11, 0x4A, 0x12, 0x4B,
0x1A, 0x60, 0x12, 0x4A, 0x12, 0x4B, 0x1A, 0x60,
0x12, 0x4A, 0x13, 0x4B, 0x1A, 0x60, 0x01, 0xE0,
0xFE, 0xF7, 0xCC, 0xF8, 0x08, 0xBD, 0xC0, 0x46,
0xF9, 0x62, 0x00, 0x00, 0xF8, 0x01, 0x00, 0x20,
0x50, 0x11, 0x00, 0x20, 0x29, 0x5E, 0x00, 0x00,
0x68, 0x00, 0x00, 0x20, 0xD9, 0x62, 0x00, 0x00,
0x6C, 0x00, 0x00, 0x20, 0x41, 0x65, 0x00, 0x00,
0x00, 0x02, 0x00, 0x20, 0x85, 0x69, 0x00, 0x00,
0x18, 0x00, 0x00, 0x20, 0x75, 0x5E, 0x00, 0x00,
0x1C, 0x00, 0x00, 0x20, 0xB9, 0x5D, 0x00, 0x00,
0x20, 0x00, 0x00, 0x20, 0xF1, 0x5C, 0x00, 0x00,
0x24, 0x00, 0x00, 0x20, 0x70, 0xB5, 0x10, 0x4B,
0x10, 0x4A, 0x1C, 0x68, 0x11, 0x68, 0x8C, 0x42,
0x17, 0xD0, 0x1B, 0x68, 0x16, 0x68, 0x0E, 0x4C,
0xDB, 0xB2, 0xF6, 0xB2, 0x06, 0x25, 0x0F, 0x21,
0x01, 0x30, 0x2A, 0x1C, 0x5A, 0x43, 0x12, 0x19,
0x12, 0x78, 0x0A, 0x40, 0x82, 0x42, 0x09, 0xD0,
0x5A, 0x1C, 0xD2, 0xB2, 0x1D, 0x3B, 0xDB, 0xB2,
0x1D, 0x2A, 0x00, 0xD8, 0x13, 0x1C, 0xB3, 0x42,
0xEF, 0xD1, 0x04, 0x4B, 0x18, 0xB2, 0x70, 0xBD,
0x84, 0x00, 0x00, 0x20, 0x80, 0x00, 0x00, 0x20,
0xF0, 0x09, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x00,
0xA0, 0x23, 0xDB, 0x05, 0x01, 0x22, 0x1A, 0x72,
0x08, 0x49, 0x10, 0x22, 0x1A, 0x72, 0x00, 0x22,
0x0A, 0x70, 0x1A, 0x72, 0x06, 0x4B, 0x80, 0x22,
0x19, 0x68, 0x52, 0x00, 0x0A, 0x43, 0x1A, 0x60,
0x1A, 0x68, 0x80, 0x23, 0xDB, 0x05, 0x99, 0x68,
0x9A, 0x60, 0x70, 0x47, 0x0C, 0x00, 0x00, 0x20,
0x14, 0x00, 0x00, 0x20, 0x08, 0xB5, 0x03, 0x1C,
0x50, 0x1E, 0x06, 0x28, 0x35, 0xD8, 0xFF, 0xF7,
0xCD, 0xFC, 0x04, 0x0A, 0x2A, 0x1B, 0x15, 0x2A,
0x2A, 0x00, 0x18, 0x4A, 0x01, 0x23, 0x13, 0x70,
0x17, 0x4A, 0x13, 0x70, 0x29, 0xE0, 0x16, 0x4A,
0x9B, 0x01, 0x59, 0x18, 0x02, 0x20, 0x15, 0x4B,
0x10, 0x70, 0x49, 0x00, 0x14, 0x4A, 0xC9, 0x18,
0x11, 0x60, 0x1E, 0xE0, 0xFD, 0xF7, 0xD8, 0xFB,
0x0E, 0x4B, 0x00, 0x22, 0x1A, 0x70, 0x18, 0xE0,
0x0D, 0x4A, 0x5B, 0x01, 0x59, 0x18, 0x01, 0x20,
0x0E, 0x4B, 0x10, 0x70, 0x5A, 0x56, 0x0E, 0x4B,
0x00, 0x2A, 0x00, 0xDC, 0x00, 0x22, 0x1A, 0x80,
0x09, 0x4A, 0x13, 0x60, 0x09, 0xE0, 0x06, 0x4A,
0x02, 0x20, 0x5B, 0x01, 0x10, 0x70, 0xC9, 0x18,
0x08, 0x4A, 0x49, 0x00, 0x89, 0x18, 0x04, 0x4A,
0x11, 0x60, 0x08, 0xBD, 0xE5, 0x01, 0x00, 0x20,
0xF6, 0x03, 0x00, 0x20, 0x84, 0x40, 0x00, 0x40,
0x34, 0x0D, 0x00, 0x20, 0x64, 0x0E, 0x00, 0x20,
0x08, 0x03, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x20,
0x08, 0xB5, 0x11, 0x4B, 0x1B, 0x88, 0xDB, 0xB2,
0x10, 0x2B, 0x02, 0xD0, 0xAF, 0x2B, 0x19, 0xD1,
0x16, 0xE0, 0xFD, 0xF7, 0xA1, 0xFB, 0x0D, 0x4A,
0x00, 0x23, 0x13, 0x70, 0x0C, 0x4A, 0x11, 0x68,
0x0C, 0x4A, 0x12, 0x68, 0x91, 0x42, 0x08, 0xD0,
0xFA, 0x23, 0x9B, 0x00, 0xC0, 0x46, 0x01, 0x3B,
0x00, 0x2B, 0xFB, 0xD1, 0xFD, 0xF7, 0x66, 0xFB,
0x04, 0xE0, 0x07, 0x4A, 0x13, 0x60, 0x01, 0xE0,
0xFD, 0xF7, 0x8A, 0xFB, 0x08, 0xBD, 0xC0, 0x46,
0x28, 0x00, 0x00, 0x20, 0x2A, 0x00, 0x00, 0x20,
0x84, 0x00, 0x00, 0x20, 0x80, 0x00, 0x00, 0x20,
0x98, 0x0D, 0x00, 0x20, 0x02, 0x4B, 0x1A, 0x68,
0x02, 0x4B, 0x1A, 0x60, 0x70, 0x47, 0xC0, 0x46,
0x80, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x20,
0x08, 0xB5, 0xFF, 0xF7, 0xF3, 0xFF, 0x08, 0xBD,
0x00, 0xB5, 0x07, 0x4A, 0x07, 0x4B, 0x10, 0x68,
0x19, 0x68, 0x88, 0x42, 0x03, 0xDB, 0x10, 0x68,
0x1B, 0x68, 0xC0, 0x1A, 0x03, 0xE0, 0x10, 0x68,
0x1B, 0x68, 0x1E, 0x30, 0xC0, 0x1A, 0x00, 0xBD,
0x80, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x20,
0x00, 0xB5, 0x05, 0x4B, 0x1A, 0x68, 0x01, 0x32,
0x1A, 0x60, 0x1A, 0x68, 0x1D, 0x2A, 0x02, 0xDD,
0x1A, 0x68, 0x1E, 0x3A, 0x1A, 0x60, 0x00, 0xBD,
0x84, 0x00, 0x00, 0x20, 0xF7, 0xB5, 0xA7, 0x4A,
0x13, 0x88, 0x1B, 0xB2, 0xAE, 0x2B, 0x00, 0xD1,
0xB2, 0xE1, 0x3B, 0xDC, 0x0A, 0x2B, 0x00, 0xD1,
0xED, 0xE0, 0x18, 0xDC, 0x05, 0x2B, 0x00, 0xD1,
0xCE, 0xE0, 0x08, 0xDC, 0x03, 0x2B, 0x00, 0xD1,
0xB7, 0xE0, 0x00, 0xDD, 0xBE, 0xE0, 0x02, 0x2B,
0x00, 0xD0, 0xE2, 0xE1, 0xA4, 0xE0, 0x07, 0x2B,
0x00, 0xD1, 0xCC, 0xE0, 0x00, 0xDA, 0xC4, 0xE0,
0x08, 0x2B, 0x00, 0xD1, 0xF7, 0xE0, 0x09, 0x2B,
0x00, 0xD0, 0xD6, 0xE1, 0xC8, 0xE0, 0x10, 0x2B,
0x00, 0xD1, 0x7F, 0xE0, 0x0B, 0xDC, 0x0C, 0x2B,
0x00, 0xD1, 0xD9, 0xE0, 0x00, 0xDA, 0xCF, 0xE0,
0x0D, 0x2B, 0x00, 0xD1, 0xDD, 0xE0, 0x0F, 0x2B,
0x00, 0xD0, 0xC6, 0xE1, 0x48, 0xE0, 0x62, 0x2B,
0x00, 0xD1, 0xBE, 0xE1, 0x03, 0xDC, 0x61, 0x2B,
0x00, 0xD0, 0xBE, 0xE1, 0xB4, 0xE1, 0x64, 0x2B,
0x00, 0xD1, 0xAC, 0xE1, 0xA8, 0x2B, 0x00, 0xD0,
0xB7, 0xE1, 0x98, 0xE1, 0xF4, 0x2B, 0x00, 0xD1,
0xF4, 0xE0, 0x19, 0xDC, 0xEF, 0x2B, 0x00, 0xD1,
0x87, 0xE1, 0x09, 0xDC, 0xBF, 0x2B, 0x00, 0xD1,
0x8D, 0xE1, 0xEE, 0x2B, 0x00, 0xD1, 0x7C, 0xE1,
0xAF, 0x2B, 0x00, 0xD0, 0xA5, 0xE1, 0x6A, 0xE1,
0xF1, 0x2B, 0x00, 0xD1, 0xC8, 0xE0, 0x00, 0xDA,
0xC2, 0xE0, 0xF2, 0x2B, 0x00, 0xD1, 0xCB, 0xE0,
0xF3, 0x2B, 0x00, 0xD0, 0x99, 0xE1, 0xD0, 0xE0,
0xF9, 0x2B, 0x00, 0xD1, 0x26, 0xE1, 0x0B, 0xDC,
0xF6, 0x2B, 0x00, 0xD1, 0x06, 0xE1, 0x00, 0xDA,
0xD9, 0xE0, 0xF7, 0x2B, 0x00, 0xD1, 0x08, 0xE1,
0xF8, 0x2B, 0x00, 0xD0, 0x89, 0xE1, 0x10, 0xE1,
0xFB, 0x2B, 0x00, 0xD1, 0x28, 0xE1, 0x00, 0xDA,
0x1D, 0xE1, 0xFC, 0x2B, 0x00, 0xD1, 0x2C, 0xE1,
0xFD, 0x2B, 0x00, 0xD0, 0x7D, 0xE1, 0x31, 0xE1,
0xFF, 0xF7, 0x5E, 0xFF, 0x68, 0x4C, 0x20, 0x60,
0x23, 0x68, 0x00, 0x2B, 0x01, 0xD1, 0xFD, 0xF7,
0xC7, 0xFA, 0x23, 0x68, 0x06, 0x22, 0x5A, 0x43,
0x64, 0x4B, 0x65, 0x4C, 0x1A, 0x70, 0x00, 0x25,
0x61, 0x4E, 0x64, 0x4F, 0x12, 0xE0, 0x39, 0x68,
0x06, 0x22, 0x51, 0x43, 0x62, 0x4B, 0x68, 0x46,
0xC9, 0x18, 0xFF, 0xF7, 0x57, 0xFC, 0x00, 0x23,
0x68, 0x46, 0x1A, 0x5C, 0xE2, 0x54, 0x01, 0x33,
0x06, 0x2B, 0xF9, 0xD1, 0xFF, 0xF7, 0x50, 0xFF,
0x01, 0x35, 0x06, 0x34, 0x33, 0x68, 0x9D, 0x42,
0xE9, 0xDB, 0x52, 0xE1, 0x59, 0x49, 0x54, 0x4A,
0x0C, 0x78, 0x13, 0x68, 0x06, 0x20, 0x58, 0x43,
0x00, 0x23, 0x84, 0x42, 0x0A, 0xDA, 0x52, 0x4A,
0x08, 0x78, 0x50, 0x4D, 0x10, 0x18, 0xC4, 0x5C,
0x58, 0x19, 0x01, 0x33, 0x04, 0x70, 0x08, 0x2B,
0xF6, 0xD1, 0x3E, 0xE1, 0x13, 0x60, 0x3C, 0xE1,
0x4F, 0x4A, 0x0F, 0x23, 0x26, 0x20, 0x11, 0x5E,
0x28, 0x25, 0x52, 0x5F, 0x09, 0x11, 0x12, 0x12,
0x99, 0x43, 0x13, 0x40, 0x45, 0x4A, 0xCB, 0x18,
0x13, 0x70, 0x42, 0x4B, 0x1A, 0x88, 0x03, 0x23,
0x12, 0xB2, 0x9A, 0x1A, 0x46, 0x4B, 0x19, 0x8D,
0x40, 0x4B, 0xD1, 0x54, 0x3D, 0x4B, 0x1A, 0x88,
0x04, 0x23, 0x12, 0xB2, 0x9A, 0x1A, 0x42, 0x4B,
0xD9, 0x8C, 0x3C, 0x4B, 0xD1, 0x54, 0x1C, 0xE1,
0x40, 0x4B, 0xDA, 0x8C, 0x39, 0x4B, 0x1A, 0x70,
0x17, 0xE1, 0x3E, 0x4B, 0x34, 0x33, 0x1A, 0x78,
0x36, 0x4B, 0x1A, 0x70, 0x11, 0xE1, 0x3A, 0x4B,
0xDA, 0x7B, 0x34, 0x4B, 0x1A, 0x70, 0x0C, 0xE1,
0x39, 0x4B, 0x1A, 0x78, 0x31, 0x4B, 0x00, 0x2A,
0x02, 0xD0, 0x02, 0x22, 0x1A, 0x70, 0x04, 0xE1,
0x01, 0x22, 0x1A, 0x70, 0x01, 0xE1, 0x35, 0x4B,
0x1A, 0x78, 0x2C, 0x4B, 0x1A, 0x70, 0xFC, 0xE0,
0x12, 0x88, 0x33, 0x4B, 0x12, 0xB2, 0x19, 0x78,
0x0B, 0x23, 0x9A, 0x1A, 0x27, 0x4B, 0xD1, 0x54,
0x24, 0x4B, 0x1A, 0x88, 0x2E, 0x4B, 0x12, 0xB2,
0x59, 0x78, 0x0C, 0x23, 0x9A, 0x1A, 0x23, 0x4B,
0xD1, 0x54, 0x20, 0x4B, 0x1A, 0x88, 0x2B, 0x4B,
0x12, 0xB2, 0x19, 0x78, 0x0D, 0x23, 0x9A, 0x1A,
0x1E, 0x4B, 0xD1, 0x54, 0xE1, 0xE0, 0x23, 0x4B,
0xDA, 0x8D, 0x1C, 0x4B, 0x1A, 0x70, 0xDC, 0xE0,
0x1F, 0x4B, 0x1A, 0x78, 0x19, 0x4B, 0x1A, 0x70,
0x16, 0x4B, 0x01, 0x21, 0x1A, 0x88, 0xF1, 0x23,
0x12, 0xB2, 0x9A, 0x1A, 0x15, 0x4B, 0xD1, 0x54,
0x12, 0x4B, 0x1A, 0x88, 0x18, 0x4B, 0x12, 0xB2,
0x59, 0x78, 0xF2, 0x23, 0x9A, 0x1A, 0x11, 0x4B,
0xD1, 0x54, 0x0E, 0x4B, 0x1A, 0x88, 0x1A, 0x4B,
0x12, 0xB2, 0x19, 0x78, 0xF3, 0x23, 0x9A, 0x1A,
0x0C, 0x4B, 0xD1, 0x54, 0x09, 0x4B, 0x1A, 0x88,
0x16, 0x4B, 0x12, 0xB2, 0x19, 0x78, 0xF4, 0x23,
0x9A, 0x1A, 0x08, 0x4B, 0xD1, 0x54, 0x05, 0x4B,
0x1A, 0x88, 0x13, 0x4B, 0x12, 0xB2, 0x19, 0x78,
0xF5, 0x23, 0x9A, 0x1A, 0x03, 0x4B, 0xD1, 0x54,
0xAB, 0xE0, 0xC0, 0x46, 0x28, 0x00, 0x00, 0x20,
0x98, 0x0D, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x50,
0x88, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x20,
0xF0, 0x09, 0x00, 0x20, 0x2A, 0x00, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0xDD, 0x01, 0x00, 0x20, 0xDF, 0x01, 0x00, 0x20,
0x0A, 0x03, 0x00, 0x20, 0x7C, 0x09, 0x00, 0x20,
0xFF, 0x5B, 0x00, 0x00, 0xFF, 0x73, 0x00, 0x00,
0xFF, 0x7B, 0x00, 0x00, 0x45, 0x4B, 0x46, 0x4A,
0x1B, 0x78, 0xD3, 0x18, 0xDA, 0x78, 0x45, 0x4B,
0x1A, 0x70, 0x45, 0x4B, 0x42, 0x49, 0x1A, 0x88,
0x40, 0x4B, 0x12, 0xB2, 0x1B, 0x78, 0xCB, 0x18,
0x19, 0x79, 0xF7, 0x23, 0x9A, 0x1A, 0x3F, 0x4B,
0xD1, 0x54, 0x3F, 0x4B, 0x1A, 0x88, 0x3C, 0x4B,
0x12, 0xB2, 0x59, 0x79, 0xF8, 0x23, 0x9A, 0x1A,
0x3A, 0x4B, 0xD1, 0x54, 0x3A, 0x4B, 0x1A, 0x88,
0x37, 0x4B, 0x12, 0xB2, 0x99, 0x79, 0xF9, 0x23,
0x9A, 0x1A, 0x36, 0x4B, 0xD1, 0x54, 0x36, 0x4B,
0x1A, 0x88, 0x33, 0x4B, 0x12, 0xB2, 0xD9, 0x79,
0xFA, 0x23, 0x9A, 0x1A, 0x31, 0x4B, 0xD1, 0x54,
0x31, 0x4B, 0x1A, 0x88, 0x2E, 0x4B, 0x12, 0xB2,
0x19, 0x7A, 0xFB, 0x23, 0x9A, 0x1A, 0x2D, 0x4B,
0xD1, 0x54, 0x2D, 0x4B, 0x1A, 0x88, 0x2A, 0x4B,
0x12, 0xB2, 0x59, 0x7A, 0xFC, 0x23, 0x9A, 0x1A,
0x28, 0x4B, 0xD1, 0x54, 0x28, 0x4B, 0x1A, 0x88,
0x25, 0x4B, 0x12, 0xB2, 0x99, 0x7A, 0xFD, 0x23,
0x9A, 0x1A, 0x24, 0x4B, 0xD1, 0x54, 0x40, 0xE0,
0x24, 0x4B, 0x1A, 0x78, 0x21, 0x4B, 0x1A, 0x70,
0xFD, 0xF7, 0x8E, 0xF9, 0x39, 0xE0, 0x22, 0x49,
0x1C, 0x4A, 0x00, 0x23, 0x0C, 0x68, 0x10, 0x78,
0x1C, 0x4D, 0x20, 0x18, 0xC4, 0x5C, 0x58, 0x19,
0x01, 0x33, 0x04, 0x70, 0x08, 0x2B, 0xF5, 0xD1,
0x2B, 0xE0, 0x17, 0x4B, 0x1A, 0x7E, 0x17, 0x4B,
0x1A, 0x70, 0x17, 0x4B, 0x1A, 0x88, 0x14, 0x4B,
0x12, 0xB2, 0xD9, 0x7D, 0xEF, 0x23, 0x9A, 0x1A,
0x12, 0x4B, 0xD1, 0x54, 0x1D, 0xE0, 0x14, 0x49,
0x0E, 0x4A, 0x00, 0x23, 0x0C, 0x68, 0x10, 0x78,
0x0E, 0x4D, 0x20, 0x18, 0xC4, 0x5C, 0x58, 0x19,
0x01, 0x33, 0x04, 0x70, 0x08, 0x2B, 0xF5, 0xD1,
0xFD, 0xF7, 0x62, 0xF9, 0x0D, 0xE0, 0x0D, 0x4B,
0x1A, 0x78, 0x08, 0x4B, 0x1A, 0x70, 0x08, 0xE0,
0x0B, 0x4B, 0x9A, 0x78, 0x05, 0x4B, 0x1A, 0x70,
0x03, 0xE0, 0x09, 0x4B, 0xDA, 0x78, 0x03, 0x4B,
0x1A, 0x70, 0xF7, 0xBD, 0x2A, 0x00, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x50,
0x28, 0x00, 0x00, 0x20, 0xF6, 0x03, 0x00, 0x20,
0x34, 0x0D, 0x00, 0x20, 0xFF, 0x5B, 0x00, 0x00,
0x35, 0x00, 0x00, 0x20, 0x73, 0xB5, 0x0F, 0x4C,
0x0F, 0x4D, 0x00, 0x90, 0x01, 0x91, 0x20, 0x68,
0x1E, 0x21, 0x1F, 0x30, 0x2E, 0x68, 0xFF, 0xF7,
0xCD, 0xFA, 0xB1, 0x42, 0xF7, 0xD0, 0x20, 0x68,
0x06, 0x22, 0x50, 0x43, 0x09, 0x4B, 0x69, 0x46,
0xC0, 0x18, 0xFF, 0xF7, 0xCF, 0xFA, 0x23, 0x68,
0x01, 0x33, 0x23, 0x60, 0x23, 0x68, 0x1D, 0x2B,
0x02, 0xDD, 0x23, 0x68, 0x1E, 0x3B, 0x23, 0x60,
0x73, 0xBD, 0xC0, 0x46, 0x80, 0x00, 0x00, 0x20,
0x84, 0x00, 0x00, 0x20, 0xF0, 0x09, 0x00, 0x20,
0x07, 0xB5, 0x6A, 0x46, 0x0F, 0x23, 0x13, 0x70,
0x00, 0x23, 0x53, 0x70, 0x93, 0x70, 0xD3, 0x70,
0x53, 0x71, 0x00, 0x98, 0x01, 0x99, 0xFF, 0xF7,
0xCD, 0xFF, 0xFD, 0xF7, 0xE3, 0xF8, 0x07, 0xBD,
0xF7, 0xB5, 0x04, 0x38, 0x10, 0x28, 0x00, 0xD9,
0xE3, 0xE0, 0xFF, 0xF7, 0xE3, 0xF9, 0x09, 0xE2,
0x5D, 0x6D, 0xE2, 0xC4, 0xE2, 0xE2, 0xE2, 0xE2,
0xC8, 0xE2, 0xE2, 0xE2, 0xE2, 0xD1, 0xDD, 0x00,
0x6C, 0x4B, 0x1A, 0x78, 0x6C, 0x4B, 0x00, 0x2A,
0x03, 0xD1, 0x6C, 0x4A, 0x10, 0x78, 0x01, 0x1E,
0x09, 0xD0, 0x19, 0x68, 0x00, 0x22, 0x91, 0x42,
0x02, 0xDD, 0x5A, 0x68, 0x8A, 0x18, 0xD2, 0x0F,
0x67, 0x4B, 0x1A, 0x70, 0xC5, 0xE0, 0x67, 0x4A,
0x0A, 0x25, 0x5F, 0x5F, 0x54, 0x7C, 0x15, 0x1C,
0x66, 0x42, 0xB7, 0x42, 0x29, 0xDA, 0x26, 0x26,
0x94, 0x5F, 0x18, 0x68, 0x62, 0x4A, 0xA0, 0x42,
0x0B, 0xDB, 0x5B, 0x68, 0xDC, 0x17, 0xC0, 0x18,
0x1B, 0x19, 0x63, 0x40, 0x98, 0x42, 0x04, 0xDB,
0x5E, 0x4B, 0x01, 0x20, 0x18, 0x70, 0x11, 0x60,
0x08, 0xE0, 0x11, 0x68, 0x01, 0x31, 0x11, 0x60,
0xAB, 0x7C, 0x58, 0x00, 0x81, 0x42, 0x01, 0xDB,
0x5B, 0x08, 0x93, 0x60, 0x93, 0x68, 0x00, 0x2B,
0x00, 0xDC, 0x9E, 0xE0, 0x50, 0x4A, 0x12, 0x68,
0x00, 0x2A, 0x02, 0xDD, 0x50, 0x4A, 0x01, 0x21,
0x11, 0x70, 0x51, 0x4A, 0x01, 0x3B, 0x93, 0x60,
0x93, 0xE0, 0x08, 0x25, 0x5B, 0x5F, 0xA3, 0x42,
0x00, 0xDB, 0x8E, 0xE0, 0x4C, 0x4B, 0x9A, 0x68,
0x00, 0x2A, 0x00, 0xDC, 0x89, 0xE0, 0x19, 0x60,
0x99, 0x60, 0x47, 0x4B, 0x18, 0x70, 0x84, 0xE0,
0x42, 0x4B, 0x46, 0x4C, 0x1A, 0x78, 0x48, 0x4B,
0x00, 0x2A, 0x01, 0xD0, 0x47, 0x4A, 0x00, 0xE0,
0x47, 0x4A, 0x90, 0x7E, 0x19, 0x68, 0x80, 0x01,
0xFF, 0xF7, 0xDA, 0xF9, 0xA0, 0x76, 0x74, 0xE0,
0x44, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x70, 0xD0,
0x43, 0x4B, 0x44, 0x4A, 0x9B, 0x7E, 0x91, 0x1E,
0x01, 0x3B, 0x5B, 0x00, 0x9B, 0x18, 0x00, 0x22,
0x05, 0xE0, 0x00, 0x26, 0x98, 0x5F, 0x64, 0x28,
0x00, 0xDD, 0x01, 0x22, 0x02, 0x3B, 0x8B, 0x42,
0xF7, 0xD1, 0x35, 0x4C, 0x00, 0x2A, 0x06, 0xD0,
0x62, 0x68, 0x64, 0x23, 0x62, 0x2A, 0x00, 0xDC,
0x53, 0x1C, 0x63, 0x60, 0x00, 0xE0, 0x62, 0x60,
0x63, 0x68, 0x63, 0x2B, 0x04, 0xDD, 0x01, 0x20,
0xFF, 0xF7, 0x56, 0xFF, 0x00, 0x23, 0x63, 0x60,
0x30, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x48, 0xD0,
0x31, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x03, 0xD0,
0x30, 0x4B, 0x1B, 0x68, 0x00, 0x2B, 0x40, 0xDD,
0x2F, 0x4B, 0x1B, 0x78, 0x00, 0x2B, 0x08, 0xD0,
0x2E, 0x4A, 0x1F, 0x23, 0x13, 0x80, 0x01, 0x21,
0x03, 0x20, 0x00, 0x23, 0x00, 0x91, 0xFD, 0xF7,
0x0D, 0xFD, 0x00, 0x24, 0x2A, 0x4D, 0x28, 0x4E,
0x0D, 0xE0, 0x33, 0x78, 0x00, 0x2B, 0x09, 0xD0,
0x28, 0x4B, 0xE2, 0x01, 0xD2, 0x18, 0x01, 0x23,
0xE9, 0x7D, 0x03, 0x20, 0x00, 0x93, 0x02, 0x23,
0xFD, 0xF7, 0xFC, 0xFC, 0x01, 0x34, 0x2B, 0x7E,
0x9C, 0x42, 0xEE, 0xDB, 0x1D, 0xE0, 0x22, 0x4B,
0x00, 0x22, 0x1A, 0x60, 0x19, 0xE0, 0x21, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x15, 0xD0, 0xFB, 0xF7,
0xBB, 0xFF, 0xFB, 0xF7, 0xD5, 0xFF, 0x10, 0xE0,
0x0C, 0x4B, 0x20, 0x22, 0x9A, 0x71, 0x05, 0x22,
0xDA, 0x71, 0x01, 0x22, 0x1A, 0x72, 0x03, 0x22,
0x5A, 0x72, 0x00, 0x22, 0x1A, 0x70, 0x04, 0xE0,
0x06, 0x48, 0x0B, 0x49, 0x50, 0x22, 0xFF, 0xF7,
0xC5, 0xF9, 0xF7, 0xBD, 0xDD, 0x01, 0x00, 0x20,
0x70, 0x01, 0x00, 0x20, 0xDF, 0x01, 0x00, 0x20,
0x3D, 0x11, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0xF8, 0x08, 0x00, 0x20, 0x14, 0x09, 0x00, 0x20,
0x78, 0x09, 0x00, 0x20, 0x9A, 0x74, 0x00, 0x00,
0x4A, 0x74, 0x00, 0x00, 0x1C, 0x03, 0x00, 0x20,
0x08, 0x74, 0x00, 0x00, 0x3C, 0x0D, 0x00, 0x20,
0xDE, 0x01, 0x00, 0x20, 0x20, 0x01, 0x00, 0x20,
0xEB, 0x01, 0x00, 0x20, 0x54, 0x11, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0x84, 0x40, 0x00, 0x40,
0x38, 0x0D, 0x00, 0x20, 0xF5, 0x00, 0x00, 0x20,
0x07, 0xB5, 0x06, 0x23, 0x00, 0x90, 0x18, 0x1C,
0x50, 0x43, 0x01, 0x91, 0x03, 0x49, 0x1A, 0x1C,
0x40, 0x18, 0x69, 0x46, 0xFF, 0xF7, 0x8E, 0xF9,
0x07, 0xBD, 0xC0, 0x46, 0xF0, 0x09, 0x00, 0x20,
0xF0, 0xB5, 0xA2, 0x4C, 0x23, 0x23, 0xE0, 0x5C,
0x89, 0xB0, 0x00, 0x25, 0x00, 0x28, 0x00, 0xD1,
0xCD, 0xE0, 0x43, 0x1E, 0xDB, 0xB2, 0x9E, 0x4C,
0x00, 0xE0, 0x13, 0x1C, 0x9A, 0x00, 0x9D, 0x4D,
0xD2, 0x18, 0x52, 0x00, 0xAA, 0x18, 0x3C, 0x25,
0x51, 0x5F, 0x5A, 0x1E, 0x4D, 0x1E, 0xA9, 0x41,
0xE1, 0x54, 0xD2, 0xB2, 0x00, 0x2B, 0xF0, 0xD1,
0x00, 0x25, 0x00, 0x28, 0x00, 0xDC, 0xB6, 0xE0,
0x94, 0x4F, 0x01, 0x24, 0x3C, 0x37, 0x00, 0x26,
0x03, 0x94, 0x1D, 0xE0, 0x08, 0xB2, 0x05, 0x90,
0x6C, 0x46, 0x08, 0x20, 0x04, 0x5F, 0x05, 0x98,
0x00, 0x1B, 0xC4, 0x17, 0x00, 0x19, 0x60, 0x40,
0x84, 0x46, 0x01, 0x98, 0x60, 0x45, 0x32, 0xDD,
0x2C, 0x24, 0x1B, 0x5F, 0x00, 0x2B, 0x32, 0xDD,
0x86, 0x4C, 0x23, 0x23, 0xE3, 0x5C, 0x03, 0x9C,
0x01, 0x35, 0x01, 0x34, 0x03, 0x94, 0x0A, 0x37,
0x02, 0x36, 0xAB, 0x42, 0x00, 0xDC, 0x92, 0xE0,
0x3A, 0x88, 0x13, 0xB2, 0x00, 0x2B, 0x54, 0xDD,
0x80, 0x4C, 0xA1, 0x19, 0x80, 0x4C, 0x08, 0x8C,
0xA3, 0x19, 0x04, 0x90, 0x18, 0x20, 0x1C, 0x5E,
0x10, 0x20, 0xA4, 0x46, 0x6C, 0x46, 0x04, 0x5F,
0x60, 0x46, 0x20, 0x1A, 0x00, 0x94, 0x7B, 0x4C,
0x02, 0x90, 0x34, 0x20, 0x20, 0x5C, 0x89, 0x88,
0x01, 0x90, 0x02, 0x98, 0xC4, 0x17, 0x00, 0x19,
0x60, 0x40, 0x84, 0x46, 0x01, 0x9C, 0x98, 0x88,
0x02, 0x90, 0xA4, 0x45, 0xBE, 0xDB, 0x74, 0x4C,
0x64, 0x5D, 0x00, 0x2C, 0xC8, 0xD0, 0x00, 0x9C,
0x0B, 0xB2, 0x1B, 0x12, 0x20, 0x11, 0x0F, 0x24,
0x1C, 0x40, 0x0F, 0x23, 0x98, 0x43, 0x01, 0x90,
0x60, 0x23, 0x03, 0x98, 0x5B, 0x42, 0x02, 0x94,
0x18, 0x43, 0x3C, 0x79, 0x02, 0x9B, 0x84, 0x46,
0x01, 0x98, 0x05, 0x94, 0x18, 0x43, 0x06, 0xAC,
0x13, 0xB2, 0x02, 0x93, 0x60, 0x70, 0x63, 0x46,
0xA1, 0x70, 0x68, 0x46, 0x10, 0x21, 0x08, 0x5C,
0x23, 0x70, 0x69, 0x46, 0x14, 0x23, 0x59, 0x5C,
0x02, 0x9B, 0xE0, 0x70, 0x21, 0x71, 0xFF, 0x2B,
0x00, 0xDD, 0xFF, 0x22, 0x62, 0x71, 0xE8, 0xB2,
0xFF, 0xF7, 0x18, 0xFB, 0x02, 0x1C, 0x50, 0x1C,
0x39, 0xD0, 0x03, 0xCC, 0xFF, 0xF7, 0x54, 0xFF,
0x9A, 0xE7, 0x57, 0x49, 0x8C, 0x19, 0xA3, 0x8D,
0x1A, 0xB2, 0x00, 0x2A, 0x94, 0xDD, 0x05, 0x20,
0x20, 0x56, 0x22, 0x8B, 0xA4, 0x88, 0x11, 0xB2,
0x04, 0x94, 0x0F, 0x24, 0x04, 0x40, 0x09, 0x11,
0x0F, 0x20, 0x81, 0x43, 0x05, 0x91, 0x03, 0x99,
0x20, 0x20, 0x02, 0x94, 0x01, 0x43, 0x8C, 0x46,
0x02, 0x98, 0x05, 0x99, 0x06, 0xAC, 0x08, 0x43,
0x19, 0xB2, 0x02, 0x91, 0x61, 0x46, 0x21, 0x70,
0x60, 0x70, 0x10, 0x21, 0x68, 0x46, 0x08, 0x5C,
0x02, 0x99, 0xE2, 0x70, 0x00, 0x22, 0xA0, 0x70,
0x22, 0x71, 0xFF, 0x29, 0x00, 0xDD, 0xFF, 0x23,
0x63, 0x71, 0xE8, 0xB2, 0xFF, 0xF7, 0xE2, 0xFA,
0x02, 0x1C, 0x03, 0xCC, 0x53, 0x1C, 0x4C, 0xD0,
0xFF, 0xF7, 0x1E, 0xFF, 0x64, 0xE7, 0x03, 0xCC,
0xFF, 0xF7, 0xD0, 0xFD, 0x60, 0xE7, 0x3D, 0x4E,
0x3D, 0x4B, 0x71, 0x68, 0x5A, 0x68, 0x48, 0x1C,
0x42, 0xD0, 0x91, 0x42, 0x33, 0xD0, 0x53, 0x1C,
0x17, 0xD0, 0x40, 0x21, 0x01, 0x32, 0x06, 0xAC,
0x00, 0x23, 0x0A, 0x43, 0xED, 0xB2, 0x22, 0x70,
0x28, 0x1C, 0x63, 0x70, 0xA3, 0x70, 0xE3, 0x70,
0x23, 0x71, 0x63, 0x71, 0xFF, 0xF7, 0xBE, 0xFA,
0x02, 0x1C, 0x50, 0x1C, 0x44, 0xD0, 0x61, 0x68,
0x06, 0x98, 0xFF, 0xF7, 0xF9, 0xFE, 0x71, 0x68,
0x01, 0xE0, 0xED, 0xB2, 0x06, 0xAC, 0x0B, 0x1D,
0x5B, 0x00, 0x40, 0x20, 0xF2, 0x5A, 0x40, 0x42,
0x01, 0x31, 0x00, 0x23, 0x01, 0x43, 0x62, 0x71,
0x28, 0x1C, 0x21, 0x70, 0x63, 0x70, 0xA3, 0x70,
0xE3, 0x70, 0x23, 0x71, 0xFF, 0xF7, 0xA2, 0xFA,
0x02, 0x1C, 0x06, 0x98, 0x51, 0x1C, 0x2D, 0xD0,
0x61, 0x68, 0xFF, 0xF7, 0xDD, 0xFE, 0x21, 0x4B,
0x1A, 0x68, 0x21, 0x4B, 0x1B, 0x68, 0x9A, 0x42,
0x01, 0xD0, 0xFC, 0xF7, 0xA3, 0xFE, 0x09, 0xB0,
0xF0, 0xBD, 0xFF, 0xF7, 0x87, 0xFD, 0x17, 0xE7,
0x53, 0x1C, 0xF0, 0xD0, 0x40, 0x21, 0x01, 0x32,
0x00, 0x23, 0x6C, 0x46, 0x0A, 0x43, 0x22, 0x76,
0xE8, 0xB2, 0x63, 0x76, 0xA3, 0x76, 0xE3, 0x76,
0x23, 0x77, 0x63, 0x77, 0xFF, 0xF7, 0x7E, 0xFA,
0x02, 0x1C, 0x07, 0x99, 0x06, 0x98, 0x55, 0x1C,
0x0C, 0xD0, 0xFF, 0xF7, 0xB9, 0xFE, 0xDA, 0xE7,
0x61, 0x68, 0x06, 0x98, 0xFF, 0xF7, 0x6A, 0xFD,
0x71, 0x68, 0xBC, 0xE7, 0x61, 0x68, 0xFF, 0xF7,
0x65, 0xFD, 0xD0, 0xE7, 0xFF, 0xF7, 0x62, 0xFD,
0xCD, 0xE7, 0xC0, 0x46, 0xAE, 0x09, 0x00, 0x20,
0xEC, 0x01, 0x00, 0x20, 0x9C, 0x0D, 0x00, 0x20,
0x20, 0x01, 0x00, 0x20, 0x48, 0x0D, 0x00, 0x20,
0x64, 0x01, 0x00, 0x20, 0xE0, 0x00, 0x00, 0x20,
0xCC, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x20,
0x80, 0x00, 0x00, 0x20, 0x38, 0xB5, 0x50, 0x28,
0x05, 0xD1, 0x54, 0x4B, 0x01, 0x20, 0x18, 0x60,
0xFF, 0xF7, 0x02, 0xFA, 0xA0, 0xE0, 0x52, 0x4B,
0x40, 0x28, 0x01, 0xD1, 0x01, 0x24, 0x1C, 0x70,
0x1B, 0x78, 0x00, 0x2B, 0x00, 0xD1, 0x97, 0xE0,
0x41, 0x38, 0x0E, 0x28, 0x00, 0xD9, 0x93, 0xE0,
0xFE, 0xF7, 0x54, 0xFF, 0x08, 0x12, 0x08, 0x2D,
0x08, 0x47, 0x92, 0x92, 0x92, 0x5E, 0x64, 0x7A,
0x92, 0x92, 0x8D, 0x00, 0x47, 0x4B, 0x01, 0x22,
0x1A, 0x70, 0x47, 0x4B, 0x1A, 0x80, 0x47, 0x4A,
0x13, 0x60, 0xFC, 0xF7, 0x3B, 0xFE, 0x7F, 0xE0,
0x42, 0x48, 0x44, 0x4B, 0xFF, 0x2A, 0x0B, 0xD1,
0x43, 0x4A, 0xC9, 0x01, 0x12, 0x78, 0x52, 0x00,
0xD2, 0xB2, 0x02, 0x70, 0x41, 0x4A, 0x89, 0x18,
0x19, 0x60, 0xFC, 0xF7, 0x2B, 0xFE, 0x6F, 0xE0,
0x89, 0x01, 0x8A, 0x18, 0x3D, 0x49, 0x52, 0x00,
0x02, 0x24, 0x52, 0x18, 0x04, 0x70, 0x1A, 0x60,
0xFC, 0xF7, 0x20, 0xFE, 0x64, 0xE0, 0x35, 0x4C,
0x36, 0x4B, 0x39, 0x48, 0xFF, 0x2A, 0x0A, 0xD1,
0x35, 0x4A, 0x89, 0x01, 0x12, 0x78, 0x40, 0x18,
0x52, 0x00, 0xD2, 0xB2, 0x22, 0x70, 0x18, 0x60,
0xFC, 0xF7, 0x10, 0xFE, 0x54, 0xE0, 0x49, 0x01,
0x52, 0x18, 0x52, 0x00, 0x02, 0x25, 0x80, 0x18,
0x25, 0x70, 0x18, 0x60, 0xFC, 0xF7, 0x06, 0xFE,
0x4A, 0xE0, 0x28, 0x4C, 0x29, 0x4B, 0x2D, 0x48,
0xFF, 0x2A, 0x08, 0xD1, 0x28, 0x4A, 0x49, 0x01,
0x92, 0x78, 0x40, 0x18, 0x22, 0x70, 0x18, 0x60,
0xFC, 0xF7, 0xF8, 0xFD, 0x3C, 0xE0, 0x49, 0x01,
0x52, 0x18, 0x01, 0x25, 0x80, 0x18, 0x25, 0x70,
0x18, 0x60, 0xFC, 0xF7, 0xEF, 0xFD, 0x33, 0xE0,
0x1C, 0x49, 0x1E, 0x4B, 0x22, 0x48, 0xFF, 0x2A,
0x0E, 0xD1, 0x04, 0xE0, 0x19, 0x49, 0x1B, 0x4B,
0x20, 0x48, 0xFF, 0x2A, 0x08, 0xD1, 0x20, 0x4A,
0x12, 0x78, 0x52, 0x00, 0xD2, 0xB2, 0x0A, 0x70,
0x18, 0x60, 0xFC, 0xF7, 0xDB, 0xFD, 0x1F, 0xE0,
0x52, 0x00, 0x02, 0x24, 0x80, 0x18, 0x0C, 0x70,
0x18, 0x60, 0xFC, 0xF7, 0xD3, 0xFD, 0x17, 0xE0,
0x0E, 0x48, 0x10, 0x4B, 0x17, 0x49, 0xFF, 0x2A,
0x06, 0xD1, 0x15, 0x4A, 0x12, 0x78, 0x02, 0x70,
0x19, 0x60, 0xFC, 0xF7, 0xC7, 0xFD, 0x0B, 0xE0,
0x01, 0x24, 0x8A, 0x18, 0x04, 0x70, 0x1A, 0x60,
0xFC, 0xF7, 0xC0, 0xFD, 0x04, 0xE0, 0x10, 0x4A,
0x00, 0x23, 0x13, 0x70, 0x02, 0x4A, 0x13, 0x70,
0x38, 0xBD, 0xC0, 0x46, 0x50, 0x11, 0x00, 0x20,
0xE5, 0x01, 0x00, 0x20, 0xF6, 0x03, 0x00, 0x20,
0x08, 0x03, 0x00, 0x20, 0x34, 0x0D, 0x00, 0x20,
0x0A, 0x03, 0x00, 0x20, 0x84, 0x40, 0x00, 0x40,
0xF8, 0x03, 0x00, 0x20, 0xB3, 0x0A, 0x00, 0x20,
0x3C, 0x0D, 0x00, 0x20, 0x14, 0x02, 0x00, 0x20,
0x7C, 0x09, 0x00, 0x20, 0xA4, 0x0A, 0x00, 0x20,
0x1D, 0x03, 0x00, 0x20, 0x08, 0xB5, 0x31, 0x4B,
0x1B, 0x88, 0x0A, 0x2B, 0x2B, 0xD0, 0x04, 0xD8,
0x01, 0x2B, 0x09, 0xD0, 0x09, 0x2B, 0x58, 0xD1,
0x0E, 0xE0, 0xA0, 0x2B, 0x2D, 0xD0, 0xB0, 0x2B,
0x47, 0xD0, 0x5F, 0x2B, 0x51, 0xD1, 0x3A, 0xE0,
0x29, 0x4A, 0x11, 0x78, 0x0E, 0x22, 0x11, 0x42,
0x4B, 0xD1, 0x28, 0x4A, 0x13, 0x70, 0x48, 0xE0,
0x27, 0x4B, 0x34, 0x33, 0x1B, 0x78, 0x00, 0x2B,
0x43, 0xD0, 0x23, 0x4B, 0x1B, 0x78, 0x01, 0x2B,
0x05, 0xD1, 0x24, 0x4A, 0x13, 0x70, 0x24, 0x4B,
0x00, 0x22, 0x1A, 0x70, 0x39, 0xE0, 0x02, 0x2B,
0x37, 0xD1, 0x20, 0x4A, 0x01, 0x23, 0x13, 0x70,
0x1F, 0x4A, 0x13, 0x70, 0x31, 0xE0, 0x1F, 0x4B,
0x1A, 0x78, 0x00, 0x2A, 0x02, 0xD1, 0x01, 0x22,
0x1A, 0x70, 0x2A, 0xE0, 0x00, 0x22, 0x1A, 0x70,
0x27, 0xE0, 0x15, 0x4B, 0x1A, 0x4A, 0x18, 0x78,
0x1A, 0x4B, 0x1A, 0x28, 0x06, 0xD1, 0x19, 0x78,
0x19, 0x4B, 0x10, 0x78, 0x1A, 0x78, 0xFF, 0xF7,
0x89, 0xF9, 0x1A, 0xE0, 0x11, 0x78, 0x1A, 0x78,
0xFF, 0xF7, 0xEC, 0xFE, 0x15, 0xE0, 0x0C, 0x4B,
0x1B, 0x78, 0x00, 0x2B, 0x11, 0xD0, 0x13, 0x4B,
0x08, 0x22, 0x1A, 0x60, 0xFA, 0xF7, 0xC0, 0xFF,
0x0B, 0xE0, 0x07, 0x4B, 0x1B, 0x78, 0x1A, 0x2B,
0x07, 0xD1, 0x0B, 0x4B, 0x18, 0x78, 0x0B, 0x4B,
0x19, 0x78, 0x0B, 0x4B, 0x1A, 0x78, 0xFF, 0xF7,
0x6D, 0xF9, 0x08, 0xBD, 0x28, 0x00, 0x00, 0x20,
0x0C, 0x00, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x20,
0xAE, 0x09, 0x00, 0x20, 0xDC, 0x01, 0x00, 0x20,
0xDD, 0x01, 0x00, 0x20, 0xDF, 0x01, 0x00, 0x20,
0x0E, 0x00, 0x00, 0x50, 0x0D, 0x00, 0x00, 0x50,
0x10, 0x00, 0x00, 0x50, 0x50, 0x11, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x04,
0x4D, 0x31, 0x48, 0x30, 0x50, 0x42, 0x34, 0x35,
0x09, 0x31, 0x09, 0x4C, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x0C, 0x5A,
0x1E, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x11,
0x0A, 0x01, 0x03, 0x11, 0x0A, 0x00, 0x01, 0x00,
0x01, 0x01, 0x00, 0x05, 0x00, 0x00, 0xE0, 0x01,
0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x6E,
0x78, 0x64, 0x01, 0x01, 0x00, 0x00, 0x38, 0x00,
0x2D, 0x00, 0x19, 0x00, 0x07, 0x03, 0x32, 0x32,
0x10, 0x00, 0x01, 0x01, 0x04, 0x00, 0x90, 0x01,
0x18, 0x03, 0x04, 0x01, 0x00, 0xFF, 0x00, 0x04,
0x05, 0x0F, 0x00, 0x05, 0x08, 0x00, 0x7C, 0xFC,
0x0F, 0x14, 0x0A, 0xF6, 0x07, 0xF6, 0x06, 0x23,
0x2D, 0x00, 0xC8, 0x0D, 0x5E, 0x01, 0x00, 0x00,
0x19, 0x00, 0x0F, 0x00, 0x21, 0x17, 0x2D, 0x00,
0xC8, 0x00, 0x16, 0x00, 0x02, 0x01, 0x01, 0x14,
0x50, 0x00, 0x28, 0x00, 0x5A, 0x00, 0x01, 0x01,
0x01, 0x07, 0x07, 0x00, 0x32, 0x00, 0x0A, 0x05,
0xC0, 0x04, 0x59, 0x00, 0xFD, 0x04, 0x59, 0x00,
0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x90, 0x01,
0x30, 0x04, 0x04, 0x01, 0x00, 0xFF, 0x00, 0x04,
0x05, 0x0F, 0x00, 0x08, 0x06, 0x00, 0x18, 0xFC,
0x14, 0x1E, 0x0A, 0xF6, 0x09, 0xF6, 0x08, 0x23,
0x1E, 0x00, 0xC8, 0x0D, 0x58, 0x01, 0x00, 0x00,
0x14, 0x00, 0x0F, 0x00, 0x23, 0x19, 0x2D, 0x01,
0x46, 0x00, 0x16, 0x00, 0x02, 0x01, 0x01, 0x14,
0x96, 0x00, 0x28, 0x00, 0x46, 0x00, 0x01, 0x01,
0x01, 0x07, 0x0A, 0x00, 0x32, 0x00, 0x0A, 0x05,
0x60, 0x04, 0x57, 0x00, 0xEA, 0x04, 0x57, 0x00,
0x19, 0x00, 0x10, 0x11, 0x12, 0x13, 0x14, 0x18,
0x1A, 0x1C, 0x1E, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B,
0x07, 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
0x10, 0x12, 0x02, 0x0A, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00,
0x01, 0x05, 0x08, 0x00, 0x00, 0x00, 0x07, 0x07,
0x07, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,
0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x06,
0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04,
0x04, 0x04, 0x03, 0x04, 0x03, 0x03, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06,
0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x05, 0x05,
0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07,
0x07, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07,
0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04,
0x04, 0x04, 0x03, 0x04, 0x03, 0x03, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06,
0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x05, 0x05,
0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07,
0x07, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x04,
0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x06,
0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1E, 0x28, 0x2B, 0x2C, 0x2F, 0x31,
0x32, 0x34, 0x34, 0x33, 0x34, 0x34, 0x35, 0x34,
0x34, 0x34, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x21, 0x28, 0x2B, 0x2D, 0x2F, 0x32,
0x34, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
0x35, 0x3A, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x23, 0x28, 0x2B, 0x2D, 0x30, 0x32,
0x34, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x36,
0x35, 0x3B, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x21, 0x28, 0x2A, 0x2D, 0x2F, 0x31,
0x32, 0x34, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
0x35, 0x35, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x28, 0x2A, 0x2D, 0x30, 0x32,
0x34, 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36,
0x36, 0x3B, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x21, 0x28, 0x2B, 0x2D, 0x30, 0x32,
0x34, 0x35, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36,
0x36, 0x3B, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x22, 0x28, 0x2B, 0x2E, 0x30, 0x32,
0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x36,
0x36, 0x3B, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x21, 0x28, 0x2B, 0x2E, 0x30, 0x32,
0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x36,
0x36, 0x3B, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x23, 0x28, 0x2B, 0x2E, 0x30, 0x32,
0x34, 0x34, 0x35, 0x35, 0x36, 0x37, 0x37, 0x36,
0x36, 0x3B, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x22, 0x28, 0x2A, 0x2D, 0x2F, 0x31,
0x32, 0x34, 0x34, 0x35, 0x35, 0x37, 0x37, 0x36,
0x36, 0x36, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x09
};
|
#ifndef DASHER_H
#define DASHER_H
#include "GtkDasherControl.h"
/* // TODO: Call these via signals */
extern "C" void <API key>(GtkDasherControl *pDasherControl, gint iParameter, gpointer data);
#endif
|
#ifndef __PIC18F43K22_H__
#define __PIC18F43K22_H__
// Register Definitions
// ANSELA Bits
extern __at(0x0F38) __sfr ANSELA;
typedef struct
{
unsigned ANSA0 : 1;
unsigned ANSA1 : 1;
unsigned ANSA2 : 1;
unsigned ANSA3 : 1;
unsigned : 1;
unsigned ANSA5 : 1;
unsigned : 1;
unsigned : 1;
} __ANSELAbits_t;
extern __at(0x0F38) volatile __ANSELAbits_t ANSELAbits;
#define _ANSA0 0x01
#define _ANSA1 0x02
#define _ANSA2 0x04
#define _ANSA3 0x08
#define _ANSA5 0x20
// ANSELB Bits
extern __at(0x0F39) __sfr ANSELB;
typedef union
{
struct
{
unsigned ANSB0 : 1;
unsigned ANSB1 : 1;
unsigned ANSB2 : 1;
unsigned ANSB3 : 1;
unsigned ANSB4 : 1;
unsigned ANSB5 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned ANSB : 6;
unsigned : 2;
};
} __ANSELBbits_t;
extern __at(0x0F39) volatile __ANSELBbits_t ANSELBbits;
#define _ANSB0 0x01
#define _ANSB1 0x02
#define _ANSB2 0x04
#define _ANSB3 0x08
#define _ANSB4 0x10
#define _ANSB5 0x20
// ANSELC Bits
extern __at(0x0F3A) __sfr ANSELC;
typedef struct
{
unsigned : 1;
unsigned : 1;
unsigned ANSC2 : 1;
unsigned ANSC3 : 1;
unsigned ANSC4 : 1;
unsigned ANSC5 : 1;
unsigned ANSC6 : 1;
unsigned ANSC7 : 1;
} __ANSELCbits_t;
extern __at(0x0F3A) volatile __ANSELCbits_t ANSELCbits;
#define _ANSC2 0x04
#define _ANSC3 0x08
#define _ANSC4 0x10
#define _ANSC5 0x20
#define _ANSC6 0x40
#define _ANSC7 0x80
// ANSELD Bits
extern __at(0x0F3B) __sfr ANSELD;
typedef struct
{
unsigned ANSD0 : 1;
unsigned ANSD1 : 1;
unsigned ANSD2 : 1;
unsigned ANSD3 : 1;
unsigned ANSD4 : 1;
unsigned ANSD5 : 1;
unsigned ANSD6 : 1;
unsigned ANSD7 : 1;
} __ANSELDbits_t;
extern __at(0x0F3B) volatile __ANSELDbits_t ANSELDbits;
#define _ANSD0 0x01
#define _ANSD1 0x02
#define _ANSD2 0x04
#define _ANSD3 0x08
#define _ANSD4 0x10
#define _ANSD5 0x20
#define _ANSD6 0x40
#define _ANSD7 0x80
// ANSELE Bits
extern __at(0x0F3C) __sfr ANSELE;
typedef union
{
struct
{
unsigned ANSE0 : 1;
unsigned ANSE1 : 1;
unsigned ANSE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned ANSE : 3;
unsigned : 5;
};
} __ANSELEbits_t;
extern __at(0x0F3C) volatile __ANSELEbits_t ANSELEbits;
#define _ANSE0 0x01
#define _ANSE1 0x02
#define _ANSE2 0x04
// PMD2 Bits
extern __at(0x0F3D) __sfr PMD2;
typedef struct
{
unsigned ADCMD : 1;
unsigned CMP1MD : 1;
unsigned CMP2MD : 1;
unsigned CTMUMD : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PMD2bits_t;
extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits;
#define _ADCMD 0x01
#define _CMP1MD 0x02
#define _CMP2MD 0x04
#define _CTMUMD 0x08
// PMD1 Bits
extern __at(0x0F3E) __sfr PMD1;
typedef struct
{
unsigned CCP1MD : 1;
unsigned CCP2MD : 1;
unsigned CCP3MD : 1;
unsigned CCP4MD : 1;
unsigned CCP5MD : 1;
unsigned : 1;
unsigned MSSP1MD : 1;
unsigned MSSP2MD : 1;
} __PMD1bits_t;
extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits;
#define _CCP1MD 0x01
#define _CCP2MD 0x02
#define _CCP3MD 0x04
#define _CCP4MD 0x08
#define _CCP5MD 0x10
#define _MSSP1MD 0x40
#define _MSSP2MD 0x80
// PMD0 Bits
extern __at(0x0F3F) __sfr PMD0;
typedef struct
{
unsigned TMR1MD : 1;
unsigned TMR2MD : 1;
unsigned TMR3MD : 1;
unsigned TMR4MD : 1;
unsigned TMR5MD : 1;
unsigned TMR6MD : 1;
unsigned UART1MD : 1;
unsigned UART2MD : 1;
} __PMD0bits_t;
extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits;
#define _TMR1MD 0x01
#define _TMR2MD 0x02
#define _TMR3MD 0x04
#define _TMR4MD 0x08
#define _TMR5MD 0x10
#define _TMR6MD 0x20
#define _UART1MD 0x40
#define _UART2MD 0x80
// DACCON1 Bits
extern __at(0x0F40) __sfr DACCON1;
typedef union
{
struct
{
unsigned DACR0 : 1;
unsigned DACR1 : 1;
unsigned DACR2 : 1;
unsigned DACR3 : 1;
unsigned DACR4 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned DACR : 5;
unsigned : 3;
};
} __DACCON1bits_t;
extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits;
#define _DACR0 0x01
#define _DACR1 0x02
#define _DACR2 0x04
#define _DACR3 0x08
#define _DACR4 0x10
// VREFCON2 Bits
extern __at(0x0F40) __sfr VREFCON2;
typedef union
{
struct
{
unsigned DACR0 : 1;
unsigned DACR1 : 1;
unsigned DACR2 : 1;
unsigned DACR3 : 1;
unsigned DACR4 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned DACR : 5;
unsigned : 3;
};
} __VREFCON2bits_t;
extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits;
#define _VREFCON2_DACR0 0x01
#define _VREFCON2_DACR1 0x02
#define _VREFCON2_DACR2 0x04
#define _VREFCON2_DACR3 0x08
#define _VREFCON2_DACR4 0x10
// DACCON0 Bits
extern __at(0x0F41) __sfr DACCON0;
typedef union
{
struct
{
unsigned DACNSS : 1;
unsigned : 1;
unsigned DACPSS0 : 1;
unsigned DACPSS1 : 1;
unsigned : 1;
unsigned DACOE : 1;
unsigned DACLPS : 1;
unsigned DACEN : 1;
};
struct
{
unsigned : 2;
unsigned DACPSS : 2;
unsigned : 4;
};
} __DACCON0bits_t;
extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits;
#define _DACNSS 0x01
#define _DACPSS0 0x04
#define _DACPSS1 0x08
#define _DACOE 0x20
#define _DACLPS 0x40
#define _DACEN 0x80
// VREFCON1 Bits
extern __at(0x0F41) __sfr VREFCON1;
typedef union
{
struct
{
unsigned DACNSS : 1;
unsigned : 1;
unsigned DACPSS0 : 1;
unsigned DACPSS1 : 1;
unsigned : 1;
unsigned DACOE : 1;
unsigned DACLPS : 1;
unsigned DACEN : 1;
};
struct
{
unsigned : 2;
unsigned DACPSS : 2;
unsigned : 4;
};
} __VREFCON1bits_t;
extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits;
#define _VREFCON1_DACNSS 0x01
#define _VREFCON1_DACPSS0 0x04
#define _VREFCON1_DACPSS1 0x08
#define _VREFCON1_DACOE 0x20
#define _VREFCON1_DACLPS 0x40
#define _VREFCON1_DACEN 0x80
// FVRCON Bits
extern __at(0x0F42) __sfr FVRCON;
typedef union
{
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned FVRS0 : 1;
unsigned FVRS1 : 1;
unsigned FVRST : 1;
unsigned FVREN : 1;
};
struct
{
unsigned : 4;
unsigned FVRS : 2;
unsigned : 2;
};
} __FVRCONbits_t;
extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits;
#define _FVRS0 0x10
#define _FVRS1 0x20
#define _FVRST 0x40
#define _FVREN 0x80
// VREFCON0 Bits
extern __at(0x0F42) __sfr VREFCON0;
typedef union
{
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned FVRS0 : 1;
unsigned FVRS1 : 1;
unsigned FVRST : 1;
unsigned FVREN : 1;
};
struct
{
unsigned : 4;
unsigned FVRS : 2;
unsigned : 2;
};
} __VREFCON0bits_t;
extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits;
#define _VREFCON0_FVRS0 0x10
#define _VREFCON0_FVRS1 0x20
#define _VREFCON0_FVRST 0x40
#define _VREFCON0_FVREN 0x80
// CTMUICON Bits
extern __at(0x0F43) __sfr CTMUICON;
typedef union
{
struct
{
unsigned IRNG0 : 1;
unsigned IRNG1 : 1;
unsigned ITRIM0 : 1;
unsigned ITRIM1 : 1;
unsigned ITRIM2 : 1;
unsigned ITRIM3 : 1;
unsigned ITRIM4 : 1;
unsigned ITRIM5 : 1;
};
struct
{
unsigned IRNG : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned ITRIM : 6;
};
} __CTMUICONbits_t;
extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits;
#define _IRNG0 0x01
#define _IRNG1 0x02
#define _ITRIM0 0x04
#define _ITRIM1 0x08
#define _ITRIM2 0x10
#define _ITRIM3 0x20
#define _ITRIM4 0x40
#define _ITRIM5 0x80
// CTMUICONH Bits
extern __at(0x0F43) __sfr CTMUICONH;
typedef union
{
struct
{
unsigned IRNG0 : 1;
unsigned IRNG1 : 1;
unsigned ITRIM0 : 1;
unsigned ITRIM1 : 1;
unsigned ITRIM2 : 1;
unsigned ITRIM3 : 1;
unsigned ITRIM4 : 1;
unsigned ITRIM5 : 1;
};
struct
{
unsigned IRNG : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned ITRIM : 6;
};
} __CTMUICONHbits_t;
extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits;
#define _CTMUICONH_IRNG0 0x01
#define _CTMUICONH_IRNG1 0x02
#define _CTMUICONH_ITRIM0 0x04
#define _CTMUICONH_ITRIM1 0x08
#define _CTMUICONH_ITRIM2 0x10
#define _CTMUICONH_ITRIM3 0x20
#define _CTMUICONH_ITRIM4 0x40
#define _CTMUICONH_ITRIM5 0x80
// CTMUCON1 Bits
extern __at(0x0F44) __sfr CTMUCON1;
typedef union
{
struct
{
unsigned EDG1STAT : 1;
unsigned EDG2STAT : 1;
unsigned EDG1SEL0 : 1;
unsigned EDG1SEL1 : 1;
unsigned EDG1POL : 1;
unsigned EDG2SEL0 : 1;
unsigned EDG2SEL1 : 1;
unsigned EDG2POL : 1;
};
struct
{
unsigned : 2;
unsigned EDG1SEL : 2;
unsigned : 4;
};
struct
{
unsigned : 5;
unsigned EDG2SEL : 2;
unsigned : 1;
};
} __CTMUCON1bits_t;
extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits;
#define _EDG1STAT 0x01
#define _EDG2STAT 0x02
#define _EDG1SEL0 0x04
#define _EDG1SEL1 0x08
#define _EDG1POL 0x10
#define _EDG2SEL0 0x20
#define _EDG2SEL1 0x40
#define _EDG2POL 0x80
// CTMUCONL Bits
extern __at(0x0F44) __sfr CTMUCONL;
typedef union
{
struct
{
unsigned EDG1STAT : 1;
unsigned EDG2STAT : 1;
unsigned EDG1SEL0 : 1;
unsigned EDG1SEL1 : 1;
unsigned EDG1POL : 1;
unsigned EDG2SEL0 : 1;
unsigned EDG2SEL1 : 1;
unsigned EDG2POL : 1;
};
struct
{
unsigned : 2;
unsigned EDG1SEL : 2;
unsigned : 4;
};
struct
{
unsigned : 5;
unsigned EDG2SEL : 2;
unsigned : 1;
};
} __CTMUCONLbits_t;
extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits;
#define _CTMUCONL_EDG1STAT 0x01
#define _CTMUCONL_EDG2STAT 0x02
#define _CTMUCONL_EDG1SEL0 0x04
#define _CTMUCONL_EDG1SEL1 0x08
#define _CTMUCONL_EDG1POL 0x10
#define _CTMUCONL_EDG2SEL0 0x20
#define _CTMUCONL_EDG2SEL1 0x40
#define _CTMUCONL_EDG2POL 0x80
// CTMUCON0 Bits
extern __at(0x0F45) __sfr CTMUCON0;
typedef struct
{
unsigned CTTRIG : 1;
unsigned IDISSEN : 1;
unsigned EDGSEQEN : 1;
unsigned EDGEN : 1;
unsigned TGEN : 1;
unsigned CTMUSIDL : 1;
unsigned : 1;
unsigned CTMUEN : 1;
} __CTMUCON0bits_t;
extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits;
#define _CTTRIG 0x01
#define _IDISSEN 0x02
#define _EDGSEQEN 0x04
#define _EDGEN 0x08
#define _TGEN 0x10
#define _CTMUSIDL 0x20
#define _CTMUEN 0x80
// CTMUCONH Bits
extern __at(0x0F45) __sfr CTMUCONH;
typedef struct
{
unsigned CTTRIG : 1;
unsigned IDISSEN : 1;
unsigned EDGSEQEN : 1;
unsigned EDGEN : 1;
unsigned TGEN : 1;
unsigned CTMUSIDL : 1;
unsigned : 1;
unsigned CTMUEN : 1;
} __CTMUCONHbits_t;
extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits;
#define _CTMUCONH_CTTRIG 0x01
#define _CTMUCONH_IDISSEN 0x02
#define _CTMUCONH_EDGSEQEN 0x04
#define _CTMUCONH_EDGEN 0x08
#define _CTMUCONH_TGEN 0x10
#define _CTMUCONH_CTMUSIDL 0x20
#define _CTMUCONH_CTMUEN 0x80
// SRCON1 Bits
extern __at(0x0F46) __sfr SRCON1;
typedef struct
{
unsigned SRRC1E : 1;
unsigned SRRC2E : 1;
unsigned SRRCKE : 1;
unsigned SRRPE : 1;
unsigned SRSC1E : 1;
unsigned SRSC2E : 1;
unsigned SRSCKE : 1;
unsigned SRSPE : 1;
} __SRCON1bits_t;
extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits;
#define _SRRC1E 0x01
#define _SRRC2E 0x02
#define _SRRCKE 0x04
#define _SRRPE 0x08
#define _SRSC1E 0x10
#define _SRSC2E 0x20
#define _SRSCKE 0x40
#define _SRSPE 0x80
// SRCON0 Bits
extern __at(0x0F47) __sfr SRCON0;
typedef union
{
struct
{
unsigned SRPR : 1;
unsigned SRPS : 1;
unsigned SRNQEN : 1;
unsigned SRQEN : 1;
unsigned SRCLK0 : 1;
unsigned SRCLK1 : 1;
unsigned SRCLK2 : 1;
unsigned SRLEN : 1;
};
struct
{
unsigned : 4;
unsigned SRCLK : 3;
unsigned : 1;
};
} __SRCON0bits_t;
extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits;
#define _SRPR 0x01
#define _SRPS 0x02
#define _SRNQEN 0x04
#define _SRQEN 0x08
#define _SRCLK0 0x10
#define _SRCLK1 0x20
#define _SRCLK2 0x40
#define _SRLEN 0x80
// CCPTMRS1 Bits
extern __at(0x0F48) __sfr CCPTMRS1;
typedef union
{
struct
{
unsigned C4TSEL0 : 1;
unsigned C4TSEL1 : 1;
unsigned C5TSEL0 : 1;
unsigned C5TSEL1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned C4TSEL : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned C5TSEL : 2;
unsigned : 4;
};
} __CCPTMRS1bits_t;
extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits;
#define _C4TSEL0 0x01
#define _C4TSEL1 0x02
#define _C5TSEL0 0x04
#define _C5TSEL1 0x08
// CCPTMRS0 Bits
extern __at(0x0F49) __sfr CCPTMRS0;
typedef union
{
struct
{
unsigned C1TSEL0 : 1;
unsigned C1TSEL1 : 1;
unsigned : 1;
unsigned C2TSEL0 : 1;
unsigned C2TSEL1 : 1;
unsigned : 1;
unsigned C3TSEL0 : 1;
unsigned C3TSEL1 : 1;
};
struct
{
unsigned C1TSEL : 2;
unsigned : 6;
};
struct
{
unsigned : 3;
unsigned C2TSEL : 2;
unsigned : 3;
};
struct
{
unsigned : 6;
unsigned C3TSEL : 2;
};
} __CCPTMRS0bits_t;
extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits;
#define _C1TSEL0 0x01
#define _C1TSEL1 0x02
#define _C2TSEL0 0x08
#define _C2TSEL1 0x10
#define _C3TSEL0 0x40
#define _C3TSEL1 0x80
// T6CON Bits
extern __at(0x0F4A) __sfr T6CON;
typedef union
{
struct
{
unsigned T6CKPS0 : 1;
unsigned T6CKPS1 : 1;
unsigned TMR6ON : 1;
unsigned T6OUTPS0 : 1;
unsigned T6OUTPS1 : 1;
unsigned T6OUTPS2 : 1;
unsigned T6OUTPS3 : 1;
unsigned : 1;
};
struct
{
unsigned T6CKPS : 2;
unsigned : 6;
};
struct
{
unsigned : 3;
unsigned T6OUTPS : 4;
unsigned : 1;
};
} __T6CONbits_t;
extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits;
#define _T6CKPS0 0x01
#define _T6CKPS1 0x02
#define _TMR6ON 0x04
#define _T6OUTPS0 0x08
#define _T6OUTPS1 0x10
#define _T6OUTPS2 0x20
#define _T6OUTPS3 0x40
extern __at(0x0F4B) __sfr PR6;
extern __at(0x0F4C) __sfr TMR6;
// T5GCON Bits
extern __at(0x0F4D) __sfr T5GCON;
typedef union
{
struct
{
unsigned T5GSS0 : 1;
unsigned T5GSS1 : 1;
unsigned T5GVAL : 1;
unsigned T5GGO_NOT_DONE : 1;
unsigned T5GSPM : 1;
unsigned T5GTM : 1;
unsigned T5GPOL : 1;
unsigned TMR5GE : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T5GGO : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T5G_DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned T5GSS : 2;
unsigned : 6;
};
} __T5GCONbits_t;
extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits;
#define _T5GSS0 0x01
#define _T5GSS1 0x02
#define _T5GVAL 0x04
#define _T5GGO_NOT_DONE 0x08
#define _T5GGO 0x08
#define _T5G_DONE 0x08
#define _T5GSPM 0x10
#define _T5GTM 0x20
#define _T5GPOL 0x40
#define _TMR5GE 0x80
// T5CON Bits
extern __at(0x0F4E) __sfr T5CON;
typedef union
{
struct
{
unsigned TMR5ON : 1;
unsigned T5RD16 : 1;
unsigned NOT_T5SYNC : 1;
unsigned T5SOSCEN : 1;
unsigned T5CKPS0 : 1;
unsigned T5CKPS1 : 1;
unsigned TMR5CS0 : 1;
unsigned TMR5CS1 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned T5SYNC : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 4;
unsigned T5CKPS : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned TMR5CS : 2;
};
} __T5CONbits_t;
extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits;
#define _TMR5ON 0x01
#define _T5RD16 0x02
#define _NOT_T5SYNC 0x04
#define _T5SYNC 0x04
#define _T5SOSCEN 0x08
#define _T5CKPS0 0x10
#define _T5CKPS1 0x20
#define _TMR5CS0 0x40
#define _TMR5CS1 0x80
extern __at(0x0F4F) __sfr TMR5;
extern __at(0x0F4F) __sfr TMR5L;
extern __at(0x0F50) __sfr TMR5H;
// T4CON Bits
extern __at(0x0F51) __sfr T4CON;
typedef union
{
struct
{
unsigned T4CKPS0 : 1;
unsigned T4CKPS1 : 1;
unsigned TMR4ON : 1;
unsigned T4OUTPS0 : 1;
unsigned T4OUTPS1 : 1;
unsigned T4OUTPS2 : 1;
unsigned T4OUTPS3 : 1;
unsigned : 1;
};
struct
{
unsigned T4CKPS : 2;
unsigned : 6;
};
struct
{
unsigned : 3;
unsigned T4OUTPS : 4;
unsigned : 1;
};
} __T4CONbits_t;
extern __at(0x0F51) volatile __T4CONbits_t T4CONbits;
#define _T4CKPS0 0x01
#define _T4CKPS1 0x02
#define _TMR4ON 0x04
#define _T4OUTPS0 0x08
#define _T4OUTPS1 0x10
#define _T4OUTPS2 0x20
#define _T4OUTPS3 0x40
extern __at(0x0F52) __sfr PR4;
extern __at(0x0F53) __sfr TMR4;
// CCP5CON Bits
extern __at(0x0F54) __sfr CCP5CON;
typedef union
{
struct
{
unsigned CCP5M0 : 1;
unsigned CCP5M1 : 1;
unsigned CCP5M2 : 1;
unsigned CCP5M3 : 1;
unsigned DC5B0 : 1;
unsigned DC5B1 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned CCP5M : 4;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned DC5B : 2;
unsigned : 2;
};
} __CCP5CONbits_t;
extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits;
#define _CCP5M0 0x01
#define _CCP5M1 0x02
#define _CCP5M2 0x04
#define _CCP5M3 0x08
#define _DC5B0 0x10
#define _DC5B1 0x20
extern __at(0x0F55) __sfr CCPR5;
extern __at(0x0F55) __sfr CCPR5L;
extern __at(0x0F56) __sfr CCPR5H;
// CCP4CON Bits
extern __at(0x0F57) __sfr CCP4CON;
typedef union
{
struct
{
unsigned CCP4M0 : 1;
unsigned CCP4M1 : 1;
unsigned CCP4M2 : 1;
unsigned CCP4M3 : 1;
unsigned DC4B0 : 1;
unsigned DC4B1 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned CCP4M : 4;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned DC4B : 2;
unsigned : 2;
};
} __CCP4CONbits_t;
extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits;
#define _CCP4M0 0x01
#define _CCP4M1 0x02
#define _CCP4M2 0x04
#define _CCP4M3 0x08
#define _DC4B0 0x10
#define _DC4B1 0x20
extern __at(0x0F58) __sfr CCPR4;
extern __at(0x0F58) __sfr CCPR4L;
extern __at(0x0F59) __sfr CCPR4H;
// PSTR3CON Bits
extern __at(0x0F5A) __sfr PSTR3CON;
typedef struct
{
unsigned STR3A : 1;
unsigned STR3B : 1;
unsigned STR3C : 1;
unsigned STR3D : 1;
unsigned STR3SYNC : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PSTR3CONbits_t;
extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits;
#define _STR3A 0x01
#define _STR3B 0x02
#define _STR3C 0x04
#define _STR3D 0x08
#define _STR3SYNC 0x10
// CCP3AS Bits
extern __at(0x0F5B) __sfr CCP3AS;
typedef union
{
struct
{
unsigned P3SSBD0 : 1;
unsigned P3SSBD1 : 1;
unsigned P3SSAC0 : 1;
unsigned P3SSAC1 : 1;
unsigned CCP3AS0 : 1;
unsigned CCP3AS1 : 1;
unsigned CCP3AS2 : 1;
unsigned CCP3ASE : 1;
};
struct
{
unsigned PSS3BD0 : 1;
unsigned PSS3BD1 : 1;
unsigned PSS3AC0 : 1;
unsigned PSS3AC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSS3BD : 2;
unsigned : 6;
};
struct
{
unsigned P3SSBD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned PSS3AC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned P3SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP3AS : 3;
unsigned : 1;
};
} __CCP3ASbits_t;
extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits;
#define _P3SSBD0 0x01
#define _PSS3BD0 0x01
#define _P3SSBD1 0x02
#define _PSS3BD1 0x02
#define _P3SSAC0 0x04
#define _PSS3AC0 0x04
#define _P3SSAC1 0x08
#define _PSS3AC1 0x08
#define _CCP3AS0 0x10
#define _CCP3AS1 0x20
#define _CCP3AS2 0x40
#define _CCP3ASE 0x80
// ECCP3AS Bits
extern __at(0x0F5B) __sfr ECCP3AS;
typedef union
{
struct
{
unsigned P3SSBD0 : 1;
unsigned P3SSBD1 : 1;
unsigned P3SSAC0 : 1;
unsigned P3SSAC1 : 1;
unsigned CCP3AS0 : 1;
unsigned CCP3AS1 : 1;
unsigned CCP3AS2 : 1;
unsigned CCP3ASE : 1;
};
struct
{
unsigned PSS3BD0 : 1;
unsigned PSS3BD1 : 1;
unsigned PSS3AC0 : 1;
unsigned PSS3AC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSS3BD : 2;
unsigned : 6;
};
struct
{
unsigned P3SSBD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned PSS3AC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned P3SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP3AS : 3;
unsigned : 1;
};
} __ECCP3ASbits_t;
extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits;
#define _ECCP3AS_P3SSBD0 0x01
#define _ECCP3AS_PSS3BD0 0x01
#define _ECCP3AS_P3SSBD1 0x02
#define _ECCP3AS_PSS3BD1 0x02
#define _ECCP3AS_P3SSAC0 0x04
#define _ECCP3AS_PSS3AC0 0x04
#define _ECCP3AS_P3SSAC1 0x08
#define _ECCP3AS_PSS3AC1 0x08
#define _ECCP3AS_CCP3AS0 0x10
#define _ECCP3AS_CCP3AS1 0x20
#define _ECCP3AS_CCP3AS2 0x40
#define _ECCP3AS_CCP3ASE 0x80
// PWM3CON Bits
extern __at(0x0F5C) __sfr PWM3CON;
typedef union
{
struct
{
unsigned P3DC0 : 1;
unsigned P3DC1 : 1;
unsigned P3DC2 : 1;
unsigned P3DC3 : 1;
unsigned P3DC4 : 1;
unsigned P3DC5 : 1;
unsigned P3DC6 : 1;
unsigned P3RSEN : 1;
};
struct
{
unsigned P3DC : 7;
unsigned : 1;
};
} __PWM3CONbits_t;
extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits;
#define _P3DC0 0x01
#define _P3DC1 0x02
#define _P3DC2 0x04
#define _P3DC3 0x08
#define _P3DC4 0x10
#define _P3DC5 0x20
#define _P3DC6 0x40
#define _P3RSEN 0x80
// CCP3CON Bits
extern __at(0x0F5D) __sfr CCP3CON;
typedef union
{
struct
{
unsigned CCP3M0 : 1;
unsigned CCP3M1 : 1;
unsigned CCP3M2 : 1;
unsigned CCP3M3 : 1;
unsigned DC3B0 : 1;
unsigned DC3B1 : 1;
unsigned P3M0 : 1;
unsigned P3M1 : 1;
};
struct
{
unsigned CCP3M : 4;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned DC3B : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned P3M : 2;
};
} __CCP3CONbits_t;
extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits;
#define _CCP3M0 0x01
#define _CCP3M1 0x02
#define _CCP3M2 0x04
#define _CCP3M3 0x08
#define _DC3B0 0x10
#define _DC3B1 0x20
#define _P3M0 0x40
#define _P3M1 0x80
extern __at(0x0F5E) __sfr CCPR3;
extern __at(0x0F5E) __sfr CCPR3L;
extern __at(0x0F5F) __sfr CCPR3H;
// SLRCON Bits
extern __at(0x0F60) __sfr SLRCON;
typedef struct
{
unsigned SLRA : 1;
unsigned SLRB : 1;
unsigned SLRC : 1;
unsigned SLRD : 1;
unsigned SLRE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __SLRCONbits_t;
extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits;
#define _SLRA 0x01
#define _SLRB 0x02
#define _SLRC 0x04
#define _SLRD 0x08
#define _SLRE 0x10
// WPUB Bits
extern __at(0x0F61) __sfr WPUB;
typedef struct
{
unsigned WPUB0 : 1;
unsigned WPUB1 : 1;
unsigned WPUB2 : 1;
unsigned WPUB3 : 1;
unsigned WPUB4 : 1;
unsigned WPUB5 : 1;
unsigned WPUB6 : 1;
unsigned WPUB7 : 1;
} __WPUBbits_t;
extern __at(0x0F61) volatile __WPUBbits_t WPUBbits;
#define _WPUB0 0x01
#define _WPUB1 0x02
#define _WPUB2 0x04
#define _WPUB3 0x08
#define _WPUB4 0x10
#define _WPUB5 0x20
#define _WPUB6 0x40
#define _WPUB7 0x80
// IOCB Bits
extern __at(0x0F62) __sfr IOCB;
typedef struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned IOCB4 : 1;
unsigned IOCB5 : 1;
unsigned IOCB6 : 1;
unsigned IOCB7 : 1;
} __IOCBbits_t;
extern __at(0x0F62) volatile __IOCBbits_t IOCBbits;
#define _IOCB4 0x10
#define _IOCB5 0x20
#define _IOCB6 0x40
#define _IOCB7 0x80
// PSTR2CON Bits
extern __at(0x0F63) __sfr PSTR2CON;
typedef struct
{
unsigned STR2A : 1;
unsigned STR2B : 1;
unsigned STR2C : 1;
unsigned STR2D : 1;
unsigned STR2SYNC : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PSTR2CONbits_t;
extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits;
#define _STR2A 0x01
#define _STR2B 0x02
#define _STR2C 0x04
#define _STR2D 0x08
#define _STR2SYNC 0x10
// CCP2AS Bits
extern __at(0x0F64) __sfr CCP2AS;
typedef union
{
struct
{
unsigned P2SSBD0 : 1;
unsigned P2SSBD1 : 1;
unsigned P2SSAC0 : 1;
unsigned P2SSAC1 : 1;
unsigned CCP2AS0 : 1;
unsigned CCP2AS1 : 1;
unsigned CCP2AS2 : 1;
unsigned CCP2ASE : 1;
};
struct
{
unsigned PSS2BD0 : 1;
unsigned PSS2BD1 : 1;
unsigned PSS2AC0 : 1;
unsigned PSS2AC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSS2BD : 2;
unsigned : 6;
};
struct
{
unsigned P2SSBD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned P2SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned PSS2AC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP2AS : 3;
unsigned : 1;
};
} __CCP2ASbits_t;
extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits;
#define _P2SSBD0 0x01
#define _PSS2BD0 0x01
#define _P2SSBD1 0x02
#define _PSS2BD1 0x02
#define _P2SSAC0 0x04
#define _PSS2AC0 0x04
#define _P2SSAC1 0x08
#define _PSS2AC1 0x08
#define _CCP2AS0 0x10
#define _CCP2AS1 0x20
#define _CCP2AS2 0x40
#define _CCP2ASE 0x80
// ECCP2AS Bits
extern __at(0x0F64) __sfr ECCP2AS;
typedef union
{
struct
{
unsigned P2SSBD0 : 1;
unsigned P2SSBD1 : 1;
unsigned P2SSAC0 : 1;
unsigned P2SSAC1 : 1;
unsigned CCP2AS0 : 1;
unsigned CCP2AS1 : 1;
unsigned CCP2AS2 : 1;
unsigned CCP2ASE : 1;
};
struct
{
unsigned PSS2BD0 : 1;
unsigned PSS2BD1 : 1;
unsigned PSS2AC0 : 1;
unsigned PSS2AC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSS2BD : 2;
unsigned : 6;
};
struct
{
unsigned P2SSBD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned P2SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned PSS2AC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP2AS : 3;
unsigned : 1;
};
} __ECCP2ASbits_t;
extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits;
#define _ECCP2AS_P2SSBD0 0x01
#define _ECCP2AS_PSS2BD0 0x01
#define _ECCP2AS_P2SSBD1 0x02
#define _ECCP2AS_PSS2BD1 0x02
#define _ECCP2AS_P2SSAC0 0x04
#define _ECCP2AS_PSS2AC0 0x04
#define _ECCP2AS_P2SSAC1 0x08
#define _ECCP2AS_PSS2AC1 0x08
#define _ECCP2AS_CCP2AS0 0x10
#define _ECCP2AS_CCP2AS1 0x20
#define _ECCP2AS_CCP2AS2 0x40
#define _ECCP2AS_CCP2ASE 0x80
// PWM2CON Bits
extern __at(0x0F65) __sfr PWM2CON;
typedef union
{
struct
{
unsigned P2DC0 : 1;
unsigned P2DC1 : 1;
unsigned P2DC2 : 1;
unsigned P2DC3 : 1;
unsigned P2DC4 : 1;
unsigned P2DC5 : 1;
unsigned P2DC6 : 1;
unsigned P2RSEN : 1;
};
struct
{
unsigned P2DC : 7;
unsigned : 1;
};
} __PWM2CONbits_t;
extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits;
#define _P2DC0 0x01
#define _P2DC1 0x02
#define _P2DC2 0x04
#define _P2DC3 0x08
#define _P2DC4 0x10
#define _P2DC5 0x20
#define _P2DC6 0x40
#define _P2RSEN 0x80
// CCP2CON Bits
extern __at(0x0F66) __sfr CCP2CON;
typedef union
{
struct
{
unsigned CCP2M0 : 1;
unsigned CCP2M1 : 1;
unsigned CCP2M2 : 1;
unsigned CCP2M3 : 1;
unsigned DC2B0 : 1;
unsigned DC2B1 : 1;
unsigned P2M0 : 1;
unsigned P2M1 : 1;
};
struct
{
unsigned CCP2M : 4;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned DC2B : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned P2M : 2;
};
} __CCP2CONbits_t;
extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits;
#define _CCP2M0 0x01
#define _CCP2M1 0x02
#define _CCP2M2 0x04
#define _CCP2M3 0x08
#define _DC2B0 0x10
#define _DC2B1 0x20
#define _P2M0 0x40
#define _P2M1 0x80
extern __at(0x0F67) __sfr CCPR2;
extern __at(0x0F67) __sfr CCPR2L;
extern __at(0x0F68) __sfr CCPR2H;
// SSP2CON3 Bits
extern __at(0x0F69) __sfr SSP2CON3;
typedef struct
{
unsigned DHEN : 1;
unsigned AHEN : 1;
unsigned SBCDE : 1;
unsigned SDAHT : 1;
unsigned BOEN : 1;
unsigned SCIE : 1;
unsigned PCIE : 1;
unsigned ACKTIM : 1;
} __SSP2CON3bits_t;
extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits;
#define _SSP2CON3_DHEN 0x01
#define _SSP2CON3_AHEN 0x02
#define _SSP2CON3_SBCDE 0x04
#define _SSP2CON3_SDAHT 0x08
#define _SSP2CON3_BOEN 0x10
#define _SSP2CON3_SCIE 0x20
#define _SSP2CON3_PCIE 0x40
#define _SSP2CON3_ACKTIM 0x80
// SSP2MSK Bits
extern __at(0x0F6A) __sfr SSP2MSK;
typedef struct
{
unsigned MSK0 : 1;
unsigned MSK1 : 1;
unsigned MSK2 : 1;
unsigned MSK3 : 1;
unsigned MSK4 : 1;
unsigned MSK5 : 1;
unsigned MSK6 : 1;
unsigned MSK7 : 1;
} __SSP2MSKbits_t;
extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits;
#define _SSP2MSK_MSK0 0x01
#define _SSP2MSK_MSK1 0x02
#define _SSP2MSK_MSK2 0x04
#define _SSP2MSK_MSK3 0x08
#define _SSP2MSK_MSK4 0x10
#define _SSP2MSK_MSK5 0x20
#define _SSP2MSK_MSK6 0x40
#define _SSP2MSK_MSK7 0x80
// SSP2CON2 Bits
extern __at(0x0F6B) __sfr SSP2CON2;
typedef struct
{
unsigned SEN : 1;
unsigned RSEN : 1;
unsigned PEN : 1;
unsigned RCEN : 1;
unsigned ACKEN : 1;
unsigned ACKDT : 1;
unsigned ACKSTAT : 1;
unsigned GCEN : 1;
} __SSP2CON2bits_t;
extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
#define _SSP2CON2_SEN 0x01
#define _SSP2CON2_RSEN 0x02
#define _SSP2CON2_PEN 0x04
#define _SSP2CON2_RCEN 0x08
#define _SSP2CON2_ACKEN 0x10
#define _SSP2CON2_ACKDT 0x20
#define _SSP2CON2_ACKSTAT 0x40
#define _SSP2CON2_GCEN 0x80
// SSP2CON1 Bits
extern __at(0x0F6C) __sfr SSP2CON1;
typedef union
{
struct
{
unsigned SSPM0 : 1;
unsigned SSPM1 : 1;
unsigned SSPM2 : 1;
unsigned SSPM3 : 1;
unsigned CKP : 1;
unsigned SSPEN : 1;
unsigned SSPOV : 1;
unsigned WCOL : 1;
};
struct
{
unsigned SSPM : 4;
unsigned : 4;
};
} __SSP2CON1bits_t;
extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
#define _SSP2CON1_SSPM0 0x01
#define _SSP2CON1_SSPM1 0x02
#define _SSP2CON1_SSPM2 0x04
#define _SSP2CON1_SSPM3 0x08
#define _SSP2CON1_CKP 0x10
#define _SSP2CON1_SSPEN 0x20
#define _SSP2CON1_SSPOV 0x40
#define _SSP2CON1_WCOL 0x80
// SSP2STAT Bits
extern __at(0x0F6D) __sfr SSP2STAT;
typedef union
{
struct
{
unsigned BF : 1;
unsigned UA : 1;
unsigned R_NOT_W : 1;
unsigned S : 1;
unsigned P : 1;
unsigned D_NOT_A : 1;
unsigned CKE : 1;
unsigned SMP : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R : 1;
unsigned : 1;
unsigned : 1;
unsigned D : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_W : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R_W : 1;
unsigned : 1;
unsigned : 1;
unsigned D_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_WRITE : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_ADDRESS : 1;
unsigned : 1;
unsigned : 1;
};
} __SSP2STATbits_t;
extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
#define _SSP2STAT_BF 0x01
#define _SSP2STAT_UA 0x02
#define _SSP2STAT_R_NOT_W 0x04
#define _SSP2STAT_R 0x04
#define _SSP2STAT_NOT_W 0x04
#define _SSP2STAT_R_W 0x04
#define _SSP2STAT_NOT_WRITE 0x04
#define _SSP2STAT_S 0x08
#define _SSP2STAT_P 0x10
#define _SSP2STAT_D_NOT_A 0x20
#define _SSP2STAT_D 0x20
#define _SSP2STAT_NOT_A 0x20
#define _SSP2STAT_D_A 0x20
#define <API key> 0x20
#define _SSP2STAT_CKE 0x40
#define _SSP2STAT_SMP 0x80
extern __at(0x0F6E) __sfr SSP2ADD;
extern __at(0x0F6F) __sfr SSP2BUF;
// BAUD2CON Bits
extern __at(0x0F70) __sfr BAUD2CON;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUD2CONbits_t;
extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits;
#define _BAUD2CON_ABDEN 0x01
#define _BAUD2CON_WUE 0x02
#define _BAUD2CON_BRG16 0x08
#define _BAUD2CON_CKTXP 0x10
#define _BAUD2CON_SCKP 0x10
#define _BAUD2CON_DTRXP 0x20
#define _BAUD2CON_RCIDL 0x40
#define _BAUD2CON_ABDOVF 0x80
// BAUDCON2 Bits
extern __at(0x0F70) __sfr BAUDCON2;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUDCON2bits_t;
extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits;
#define _BAUDCON2_ABDEN 0x01
#define _BAUDCON2_WUE 0x02
#define _BAUDCON2_BRG16 0x08
#define _BAUDCON2_CKTXP 0x10
#define _BAUDCON2_SCKP 0x10
#define _BAUDCON2_DTRXP 0x20
#define _BAUDCON2_RCIDL 0x40
#define _BAUDCON2_ABDOVF 0x80
// RC2STA Bits
extern __at(0x0F71) __sfr RC2STA;
typedef union
{
struct
{
unsigned RX9D : 1;
unsigned OERR : 1;
unsigned FERR : 1;
unsigned ADDEN : 1;
unsigned CREN : 1;
unsigned SREN : 1;
unsigned RX9 : 1;
unsigned SPEN : 1;
};
struct
{
unsigned RX9D2 : 1;
unsigned OERR2 : 1;
unsigned FERR2 : 1;
unsigned ADEN : 1;
unsigned CREN2 : 1;
unsigned SREN2 : 1;
unsigned RX92 : 1;
unsigned SPEN2 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned ADDEN2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RC2STAbits_t;
extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits;
#define _RC2STA_RX9D 0x01
#define _RC2STA_RX9D2 0x01
#define _RC2STA_OERR 0x02
#define _RC2STA_OERR2 0x02
#define _RC2STA_FERR 0x04
#define _RC2STA_FERR2 0x04
#define _RC2STA_ADDEN 0x08
#define _RC2STA_ADEN 0x08
#define _RC2STA_ADDEN2 0x08
#define _RC2STA_CREN 0x10
#define _RC2STA_CREN2 0x10
#define _RC2STA_SREN 0x20
#define _RC2STA_SREN2 0x20
#define _RC2STA_RX9 0x40
#define _RC2STA_RX92 0x40
#define _RC2STA_SPEN 0x80
#define _RC2STA_SPEN2 0x80
// RCSTA2 Bits
extern __at(0x0F71) __sfr RCSTA2;
typedef union
{
struct
{
unsigned RX9D : 1;
unsigned OERR : 1;
unsigned FERR : 1;
unsigned ADDEN : 1;
unsigned CREN : 1;
unsigned SREN : 1;
unsigned RX9 : 1;
unsigned SPEN : 1;
};
struct
{
unsigned RX9D2 : 1;
unsigned OERR2 : 1;
unsigned FERR2 : 1;
unsigned ADEN : 1;
unsigned CREN2 : 1;
unsigned SREN2 : 1;
unsigned RX92 : 1;
unsigned SPEN2 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned ADDEN2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RCSTA2bits_t;
extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits;
#define _RCSTA2_RX9D 0x01
#define _RCSTA2_RX9D2 0x01
#define _RCSTA2_OERR 0x02
#define _RCSTA2_OERR2 0x02
#define _RCSTA2_FERR 0x04
#define _RCSTA2_FERR2 0x04
#define _RCSTA2_ADDEN 0x08
#define _RCSTA2_ADEN 0x08
#define _RCSTA2_ADDEN2 0x08
#define _RCSTA2_CREN 0x10
#define _RCSTA2_CREN2 0x10
#define _RCSTA2_SREN 0x20
#define _RCSTA2_SREN2 0x20
#define _RCSTA2_RX9 0x40
#define _RCSTA2_RX92 0x40
#define _RCSTA2_SPEN 0x80
#define _RCSTA2_SPEN2 0x80
// TX2STA Bits
extern __at(0x0F72) __sfr TX2STA;
typedef union
{
struct
{
unsigned TX9D : 1;
unsigned TRMT : 1;
unsigned BRGH : 1;
unsigned SENDB : 1;
unsigned SYNC : 1;
unsigned TXEN : 1;
unsigned TX9 : 1;
unsigned CSRC : 1;
};
struct
{
unsigned TX9D2 : 1;
unsigned TRMT2 : 1;
unsigned BRGH2 : 1;
unsigned SENDB2 : 1;
unsigned SYNC2 : 1;
unsigned TXEN2 : 1;
unsigned TX92 : 1;
unsigned CSRC2 : 1;
};
} __TX2STAbits_t;
extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits;
#define _TX2STA_TX9D 0x01
#define _TX2STA_TX9D2 0x01
#define _TX2STA_TRMT 0x02
#define _TX2STA_TRMT2 0x02
#define _TX2STA_BRGH 0x04
#define _TX2STA_BRGH2 0x04
#define _TX2STA_SENDB 0x08
#define _TX2STA_SENDB2 0x08
#define _TX2STA_SYNC 0x10
#define _TX2STA_SYNC2 0x10
#define _TX2STA_TXEN 0x20
#define _TX2STA_TXEN2 0x20
#define _TX2STA_TX9 0x40
#define _TX2STA_TX92 0x40
#define _TX2STA_CSRC 0x80
#define _TX2STA_CSRC2 0x80
// TXSTA2 Bits
extern __at(0x0F72) __sfr TXSTA2;
typedef union
{
struct
{
unsigned TX9D : 1;
unsigned TRMT : 1;
unsigned BRGH : 1;
unsigned SENDB : 1;
unsigned SYNC : 1;
unsigned TXEN : 1;
unsigned TX9 : 1;
unsigned CSRC : 1;
};
struct
{
unsigned TX9D2 : 1;
unsigned TRMT2 : 1;
unsigned BRGH2 : 1;
unsigned SENDB2 : 1;
unsigned SYNC2 : 1;
unsigned TXEN2 : 1;
unsigned TX92 : 1;
unsigned CSRC2 : 1;
};
} __TXSTA2bits_t;
extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits;
#define _TXSTA2_TX9D 0x01
#define _TXSTA2_TX9D2 0x01
#define _TXSTA2_TRMT 0x02
#define _TXSTA2_TRMT2 0x02
#define _TXSTA2_BRGH 0x04
#define _TXSTA2_BRGH2 0x04
#define _TXSTA2_SENDB 0x08
#define _TXSTA2_SENDB2 0x08
#define _TXSTA2_SYNC 0x10
#define _TXSTA2_SYNC2 0x10
#define _TXSTA2_TXEN 0x20
#define _TXSTA2_TXEN2 0x20
#define _TXSTA2_TX9 0x40
#define _TXSTA2_TX92 0x40
#define _TXSTA2_CSRC 0x80
#define _TXSTA2_CSRC2 0x80
extern __at(0x0F73) __sfr TX2REG;
extern __at(0x0F73) __sfr TXREG2;
extern __at(0x0F74) __sfr RC2REG;
extern __at(0x0F74) __sfr RCREG2;
extern __at(0x0F75) __sfr SP2BRG;
extern __at(0x0F75) __sfr SPBRG2;
extern __at(0x0F76) __sfr SP2BRGH;
extern __at(0x0F76) __sfr SPBRGH2;
// CM12CON Bits
extern __at(0x0F77) __sfr CM12CON;
typedef struct
{
unsigned C2SYNC : 1;
unsigned C1SYNC : 1;
unsigned C2HYS : 1;
unsigned C1HYS : 1;
unsigned C2RSEL : 1;
unsigned C1RSEL : 1;
unsigned MC2OUT : 1;
unsigned MC1OUT : 1;
} __CM12CONbits_t;
extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits;
#define _CM12CON_C2SYNC 0x01
#define _CM12CON_C1SYNC 0x02
#define _CM12CON_C2HYS 0x04
#define _CM12CON_C1HYS 0x08
#define _CM12CON_C2RSEL 0x10
#define _CM12CON_C1RSEL 0x20
#define _CM12CON_MC2OUT 0x40
#define _CM12CON_MC1OUT 0x80
// CM2CON1 Bits
extern __at(0x0F77) __sfr CM2CON1;
typedef struct
{
unsigned C2SYNC : 1;
unsigned C1SYNC : 1;
unsigned C2HYS : 1;
unsigned C1HYS : 1;
unsigned C2RSEL : 1;
unsigned C1RSEL : 1;
unsigned MC2OUT : 1;
unsigned MC1OUT : 1;
} __CM2CON1bits_t;
extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits;
#define _C2SYNC 0x01
#define _C1SYNC 0x02
#define _C2HYS 0x04
#define _C1HYS 0x08
#define _C2RSEL 0x10
#define _C1RSEL 0x20
#define _MC2OUT 0x40
#define _MC1OUT 0x80
// CM2CON Bits
extern __at(0x0F78) __sfr CM2CON;
typedef union
{
struct
{
unsigned C2CH0 : 1;
unsigned C2CH1 : 1;
unsigned C2R : 1;
unsigned C2SP : 1;
unsigned C2POL : 1;
unsigned C2OE : 1;
unsigned C2OUT : 1;
unsigned C2ON : 1;
};
struct
{
unsigned C2CH : 2;
unsigned : 6;
};
} __CM2CONbits_t;
extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits;
#define _C2CH0 0x01
#define _C2CH1 0x02
#define _C2R 0x04
#define _C2SP 0x08
#define _C2POL 0x10
#define _C2OE 0x20
#define _C2OUT 0x40
#define _C2ON 0x80
// CM2CON0 Bits
extern __at(0x0F78) __sfr CM2CON0;
typedef union
{
struct
{
unsigned C2CH0 : 1;
unsigned C2CH1 : 1;
unsigned C2R : 1;
unsigned C2SP : 1;
unsigned C2POL : 1;
unsigned C2OE : 1;
unsigned C2OUT : 1;
unsigned C2ON : 1;
};
struct
{
unsigned C2CH : 2;
unsigned : 6;
};
} __CM2CON0bits_t;
extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits;
#define _CM2CON0_C2CH0 0x01
#define _CM2CON0_C2CH1 0x02
#define _CM2CON0_C2R 0x04
#define _CM2CON0_C2SP 0x08
#define _CM2CON0_C2POL 0x10
#define _CM2CON0_C2OE 0x20
#define _CM2CON0_C2OUT 0x40
#define _CM2CON0_C2ON 0x80
// CM1CON Bits
extern __at(0x0F79) __sfr CM1CON;
typedef union
{
struct
{
unsigned C1CH0 : 1;
unsigned C1CH1 : 1;
unsigned C1R : 1;
unsigned C1SP : 1;
unsigned C1POL : 1;
unsigned C1OE : 1;
unsigned C1OUT : 1;
unsigned C1ON : 1;
};
struct
{
unsigned C1CH : 2;
unsigned : 6;
};
} __CM1CONbits_t;
extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits;
#define _C1CH0 0x01
#define _C1CH1 0x02
#define _C1R 0x04
#define _C1SP 0x08
#define _C1POL 0x10
#define _C1OE 0x20
#define _C1OUT 0x40
#define _C1ON 0x80
// CM1CON0 Bits
extern __at(0x0F79) __sfr CM1CON0;
typedef union
{
struct
{
unsigned C1CH0 : 1;
unsigned C1CH1 : 1;
unsigned C1R : 1;
unsigned C1SP : 1;
unsigned C1POL : 1;
unsigned C1OE : 1;
unsigned C1OUT : 1;
unsigned C1ON : 1;
};
struct
{
unsigned C1CH : 2;
unsigned : 6;
};
} __CM1CON0bits_t;
extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits;
#define _CM1CON0_C1CH0 0x01
#define _CM1CON0_C1CH1 0x02
#define _CM1CON0_C1R 0x04
#define _CM1CON0_C1SP 0x08
#define _CM1CON0_C1POL 0x10
#define _CM1CON0_C1OE 0x20
#define _CM1CON0_C1OUT 0x40
#define _CM1CON0_C1ON 0x80
// PIE4 Bits
extern __at(0x0F7A) __sfr PIE4;
typedef struct
{
unsigned CCP3IE : 1;
unsigned CCP4IE : 1;
unsigned CCP5IE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PIE4bits_t;
extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits;
#define _CCP3IE 0x01
#define _CCP4IE 0x02
#define _CCP5IE 0x04
// PIR4 Bits
extern __at(0x0F7B) __sfr PIR4;
typedef struct
{
unsigned CCP3IF : 1;
unsigned CCP4IF : 1;
unsigned CCP5IF : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PIR4bits_t;
extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits;
#define _CCP3IF 0x01
#define _CCP4IF 0x02
#define _CCP5IF 0x04
// IPR4 Bits
extern __at(0x0F7C) __sfr IPR4;
typedef struct
{
unsigned CCP3IP : 1;
unsigned CCP4IP : 1;
unsigned CCP5IP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __IPR4bits_t;
extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits;
#define _CCP3IP 0x01
#define _CCP4IP 0x02
#define _CCP5IP 0x04
// PIE5 Bits
extern __at(0x0F7D) __sfr PIE5;
typedef struct
{
unsigned TMR4IE : 1;
unsigned TMR5IE : 1;
unsigned TMR6IE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PIE5bits_t;
extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits;
#define _TMR4IE 0x01
#define _TMR5IE 0x02
#define _TMR6IE 0x04
// PIR5 Bits
extern __at(0x0F7E) __sfr PIR5;
typedef struct
{
unsigned TMR4IF : 1;
unsigned TMR5IF : 1;
unsigned TMR6IF : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PIR5bits_t;
extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits;
#define _TMR4IF 0x01
#define _TMR5IF 0x02
#define _TMR6IF 0x04
// IPR5 Bits
extern __at(0x0F7F) __sfr IPR5;
typedef struct
{
unsigned TMR4IP : 1;
unsigned TMR5IP : 1;
unsigned TMR6IP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __IPR5bits_t;
extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits;
#define _TMR4IP 0x01
#define _TMR5IP 0x02
#define _TMR6IP 0x04
// PORTA Bits
extern __at(0x0F80) __sfr PORTA;
typedef union
{
struct
{
unsigned RA0 : 1;
unsigned RA1 : 1;
unsigned RA2 : 1;
unsigned RA3 : 1;
unsigned RA4 : 1;
unsigned RA5 : 1;
unsigned RA6 : 1;
unsigned RA7 : 1;
};
struct
{
unsigned AN0 : 1;
unsigned AN1 : 1;
unsigned AN2 : 1;
unsigned AN3 : 1;
unsigned C1OUT : 1;
unsigned AN4 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned C12IN0M : 1;
unsigned C12IN1M : 1;
unsigned C2INP : 1;
unsigned C1INP : 1;
unsigned T0CKI : 1;
unsigned C2OUT : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned C12IN0N : 1;
unsigned C12IN1N : 1;
unsigned VREFM : 1;
unsigned VREFP : 1;
unsigned SRQ : 1;
unsigned SS : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned VREFN : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_SS : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned CVREF : 1;
unsigned : 1;
unsigned : 1;
unsigned LVDIN : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned DACOUT : 1;
unsigned : 1;
unsigned : 1;
unsigned HLVDIN : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SS1 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_SS1 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SRNQ : 1;
unsigned : 1;
unsigned : 1;
};
} __PORTAbits_t;
extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
#define _PORTA_RA0 0x01
#define _PORTA_AN0 0x01
#define _PORTA_C12IN0M 0x01
#define _PORTA_C12IN0N 0x01
#define _PORTA_RA1 0x02
#define _PORTA_AN1 0x02
#define _PORTA_C12IN1M 0x02
#define _PORTA_C12IN1N 0x02
#define _PORTA_RA2 0x04
#define _PORTA_AN2 0x04
#define _PORTA_C2INP 0x04
#define _PORTA_VREFM 0x04
#define _PORTA_VREFN 0x04
#define _PORTA_CVREF 0x04
#define _PORTA_DACOUT 0x04
#define _PORTA_RA3 0x08
#define _PORTA_AN3 0x08
#define _PORTA_C1INP 0x08
#define _PORTA_VREFP 0x08
#define _PORTA_RA4 0x10
#define _PORTA_C1OUT 0x10
#define _PORTA_T0CKI 0x10
#define _PORTA_SRQ 0x10
#define _PORTA_RA5 0x20
#define _PORTA_AN4 0x20
#define _PORTA_C2OUT 0x20
#define _PORTA_SS 0x20
#define _PORTA_NOT_SS 0x20
#define _PORTA_LVDIN 0x20
#define _PORTA_HLVDIN 0x20
#define _PORTA_SS1 0x20
#define _PORTA_NOT_SS1 0x20
#define _PORTA_SRNQ 0x20
#define _PORTA_RA6 0x40
#define _PORTA_RA7 0x80
// PORTB Bits
extern __at(0x0F81) __sfr PORTB;
typedef union
{
struct
{
unsigned RB0 : 1;
unsigned RB1 : 1;
unsigned RB2 : 1;
unsigned RB3 : 1;
unsigned RB4 : 1;
unsigned RB5 : 1;
unsigned RB6 : 1;
unsigned RB7 : 1;
};
struct
{
unsigned INT0 : 1;
unsigned INT1 : 1;
unsigned INT2 : 1;
unsigned CCP2 : 1;
unsigned KBI0 : 1;
unsigned KBI1 : 1;
unsigned KBI2 : 1;
unsigned KBI3 : 1;
};
struct
{
unsigned AN12 : 1;
unsigned AN10 : 1;
unsigned AN8 : 1;
unsigned AN9 : 1;
unsigned AN11 : 1;
unsigned AN13 : 1;
unsigned PGC : 1;
unsigned PGD : 1;
};
struct
{
unsigned FLT0 : 1;
unsigned C12IN3M : 1;
unsigned CTED1 : 1;
unsigned C12IN2M : 1;
unsigned T5G : 1;
unsigned T1G : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned SRI : 1;
unsigned C12IN3N : 1;
unsigned : 1;
unsigned C12IN2N : 1;
unsigned : 1;
unsigned CCP3 : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned CTED2 : 1;
unsigned : 1;
unsigned T3CKI : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned P2A : 1;
unsigned : 1;
unsigned P3A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned INT : 3;
unsigned : 5;
};
struct
{
unsigned : 4;
unsigned KBI : 4;
};
} __PORTBbits_t;
extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
#define _PORTB_RB0 0x01
#define _PORTB_INT0 0x01
#define _PORTB_AN12 0x01
#define _PORTB_FLT0 0x01
#define _PORTB_SRI 0x01
#define _PORTB_RB1 0x02
#define _PORTB_INT1 0x02
#define _PORTB_AN10 0x02
#define _PORTB_C12IN3M 0x02
#define _PORTB_C12IN3N 0x02
#define _PORTB_RB2 0x04
#define _PORTB_INT2 0x04
#define _PORTB_AN8 0x04
#define _PORTB_CTED1 0x04
#define _PORTB_RB3 0x08
#define _PORTB_CCP2 0x08
#define _PORTB_AN9 0x08
#define _PORTB_C12IN2M 0x08
#define _PORTB_C12IN2N 0x08
#define _PORTB_CTED2 0x08
#define _PORTB_P2A 0x08
#define _PORTB_RB4 0x10
#define _PORTB_KBI0 0x10
#define _PORTB_AN11 0x10
#define _PORTB_T5G 0x10
#define _PORTB_RB5 0x20
#define _PORTB_KBI1 0x20
#define _PORTB_AN13 0x20
#define _PORTB_T1G 0x20
#define _PORTB_CCP3 0x20
#define _PORTB_T3CKI 0x20
#define _PORTB_P3A 0x20
#define _PORTB_RB6 0x40
#define _PORTB_KBI2 0x40
#define _PORTB_PGC 0x40
#define _PORTB_RB7 0x80
#define _PORTB_KBI3 0x80
#define _PORTB_PGD 0x80
// PORTC Bits
extern __at(0x0F82) __sfr PORTC;
typedef union
{
struct
{
unsigned RC0 : 1;
unsigned RC1 : 1;
unsigned RC2 : 1;
unsigned RC3 : 1;
unsigned RC4 : 1;
unsigned RC5 : 1;
unsigned RC6 : 1;
unsigned RC7 : 1;
};
struct
{
unsigned T1OSO : 1;
unsigned T1OSI : 1;
unsigned T5CKI : 1;
unsigned SCK : 1;
unsigned SDI : 1;
unsigned SDO : 1;
unsigned TX : 1;
unsigned RX : 1;
};
struct
{
unsigned P2B : 1;
unsigned P2A : 1;
unsigned P1A : 1;
unsigned SCL : 1;
unsigned SDA : 1;
unsigned SDO1 : 1;
unsigned CK : 1;
unsigned RX1 : 1;
};
struct
{
unsigned T1CKI : 1;
unsigned CCP2 : 1;
unsigned CCP1 : 1;
unsigned SCK1 : 1;
unsigned SDI1 : 1;
unsigned AN17 : 1;
unsigned TX1 : 1;
unsigned DT1 : 1;
};
struct
{
unsigned T3CKI : 1;
unsigned : 1;
unsigned CTPLS : 1;
unsigned SCL1 : 1;
unsigned SDA1 : 1;
unsigned : 1;
unsigned CK1 : 1;
unsigned AN19 : 1;
};
struct
{
unsigned T3G : 1;
unsigned : 1;
unsigned AN14 : 1;
unsigned AN15 : 1;
unsigned AN16 : 1;
unsigned : 1;
unsigned AN18 : 1;
unsigned : 1;
};
} __PORTCbits_t;
extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
#define _PORTC_RC0 0x01
#define _PORTC_T1OSO 0x01
#define _PORTC_P2B 0x01
#define _PORTC_T1CKI 0x01
#define _PORTC_T3CKI 0x01
#define _PORTC_T3G 0x01
#define _PORTC_RC1 0x02
#define _PORTC_T1OSI 0x02
#define _PORTC_P2A 0x02
#define _PORTC_CCP2 0x02
#define _PORTC_RC2 0x04
#define _PORTC_T5CKI 0x04
#define _PORTC_P1A 0x04
#define _PORTC_CCP1 0x04
#define _PORTC_CTPLS 0x04
#define _PORTC_AN14 0x04
#define _PORTC_RC3 0x08
#define _PORTC_SCK 0x08
#define _PORTC_SCL 0x08
#define _PORTC_SCK1 0x08
#define _PORTC_SCL1 0x08
#define _PORTC_AN15 0x08
#define _PORTC_RC4 0x10
#define _PORTC_SDI 0x10
#define _PORTC_SDA 0x10
#define _PORTC_SDI1 0x10
#define _PORTC_SDA1 0x10
#define _PORTC_AN16 0x10
#define _PORTC_RC5 0x20
#define _PORTC_SDO 0x20
#define _PORTC_SDO1 0x20
#define _PORTC_AN17 0x20
#define _PORTC_RC6 0x40
#define _PORTC_TX 0x40
#define _PORTC_CK 0x40
#define _PORTC_TX1 0x40
#define _PORTC_CK1 0x40
#define _PORTC_AN18 0x40
#define _PORTC_RC7 0x80
#define _PORTC_RX 0x80
#define _PORTC_RX1 0x80
#define _PORTC_DT1 0x80
#define _PORTC_AN19 0x80
// PORTD Bits
extern __at(0x0F83) __sfr PORTD;
typedef union
{
struct
{
unsigned RD0 : 1;
unsigned RD1 : 1;
unsigned RD2 : 1;
unsigned RD3 : 1;
unsigned RD4 : 1;
unsigned RD5 : 1;
unsigned RD6 : 1;
unsigned RD7 : 1;
};
struct
{
unsigned SCK2 : 1;
unsigned CCP4 : 1;
unsigned P2B : 1;
unsigned P2C : 1;
unsigned P2D : 1;
unsigned P1B : 1;
unsigned P1C : 1;
unsigned P1D : 1;
};
struct
{
unsigned SCL2 : 1;
unsigned SDI2 : 1;
unsigned AN22 : 1;
unsigned NOT_SS2 : 1;
unsigned SDO2 : 1;
unsigned AN25 : 1;
unsigned TX2 : 1;
unsigned RX2 : 1;
};
struct
{
unsigned AN20 : 1;
unsigned SDA2 : 1;
unsigned : 1;
unsigned SS2 : 1;
unsigned AN24 : 1;
unsigned : 1;
unsigned CK2 : 1;
unsigned DT2 : 1;
};
struct
{
unsigned : 1;
unsigned AN21 : 1;
unsigned : 1;
unsigned AN23 : 1;
unsigned : 1;
unsigned : 1;
unsigned AN26 : 1;
unsigned AN27 : 1;
};
} __PORTDbits_t;
extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
#define _PORTD_RD0 0x01
#define _PORTD_SCK2 0x01
#define _PORTD_SCL2 0x01
#define _PORTD_AN20 0x01
#define _PORTD_RD1 0x02
#define _PORTD_CCP4 0x02
#define _PORTD_SDI2 0x02
#define _PORTD_SDA2 0x02
#define _PORTD_AN21 0x02
#define _PORTD_RD2 0x04
#define _PORTD_P2B 0x04
#define _PORTD_AN22 0x04
#define _PORTD_RD3 0x08
#define _PORTD_P2C 0x08
#define _PORTD_NOT_SS2 0x08
#define _PORTD_SS2 0x08
#define _PORTD_AN23 0x08
#define _PORTD_RD4 0x10
#define _PORTD_P2D 0x10
#define _PORTD_SDO2 0x10
#define _PORTD_AN24 0x10
#define _PORTD_RD5 0x20
#define _PORTD_P1B 0x20
#define _PORTD_AN25 0x20
#define _PORTD_RD6 0x40
#define _PORTD_P1C 0x40
#define _PORTD_TX2 0x40
#define _PORTD_CK2 0x40
#define _PORTD_AN26 0x40
#define _PORTD_RD7 0x80
#define _PORTD_P1D 0x80
#define _PORTD_RX2 0x80
#define _PORTD_DT2 0x80
#define _PORTD_AN27 0x80
// PORTE Bits
extern __at(0x0F84) __sfr PORTE;
typedef union
{
struct
{
unsigned RE0 : 1;
unsigned RE1 : 1;
unsigned RE2 : 1;
unsigned RE3 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned AN5 : 1;
unsigned AN6 : 1;
unsigned AN7 : 1;
unsigned MCLR : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned P3A : 1;
unsigned P3B : 1;
unsigned CCP5 : 1;
unsigned NOT_MCLR : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned CCP3 : 1;
unsigned : 1;
unsigned : 1;
unsigned VPP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned RE : 4;
unsigned : 4;
};
} __PORTEbits_t;
extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
#define _PORTE_RE0 0x01
#define _PORTE_AN5 0x01
#define _PORTE_P3A 0x01
#define _PORTE_CCP3 0x01
#define _PORTE_RE1 0x02
#define _PORTE_AN6 0x02
#define _PORTE_P3B 0x02
#define _PORTE_RE2 0x04
#define _PORTE_AN7 0x04
#define _PORTE_CCP5 0x04
#define _PORTE_RE3 0x08
#define _PORTE_MCLR 0x08
#define _PORTE_NOT_MCLR 0x08
#define _PORTE_VPP 0x08
// LATA Bits
extern __at(0x0F89) __sfr LATA;
typedef struct
{
unsigned LATA0 : 1;
unsigned LATA1 : 1;
unsigned LATA2 : 1;
unsigned LATA3 : 1;
unsigned LATA4 : 1;
unsigned LATA5 : 1;
unsigned LATA6 : 1;
unsigned LATA7 : 1;
} __LATAbits_t;
extern __at(0x0F89) volatile __LATAbits_t LATAbits;
#define _LATA0 0x01
#define _LATA1 0x02
#define _LATA2 0x04
#define _LATA3 0x08
#define _LATA4 0x10
#define _LATA5 0x20
#define _LATA6 0x40
#define _LATA7 0x80
// LATB Bits
extern __at(0x0F8A) __sfr LATB;
typedef struct
{
unsigned LATB0 : 1;
unsigned LATB1 : 1;
unsigned LATB2 : 1;
unsigned LATB3 : 1;
unsigned LATB4 : 1;
unsigned LATB5 : 1;
unsigned LATB6 : 1;
unsigned LATB7 : 1;
} __LATBbits_t;
extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
#define _LATB0 0x01
#define _LATB1 0x02
#define _LATB2 0x04
#define _LATB3 0x08
#define _LATB4 0x10
#define _LATB5 0x20
#define _LATB6 0x40
#define _LATB7 0x80
// LATC Bits
extern __at(0x0F8B) __sfr LATC;
typedef struct
{
unsigned LATC0 : 1;
unsigned LATC1 : 1;
unsigned LATC2 : 1;
unsigned LATC3 : 1;
unsigned LATC4 : 1;
unsigned LATC5 : 1;
unsigned LATC6 : 1;
unsigned LATC7 : 1;
} __LATCbits_t;
extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
#define _LATC0 0x01
#define _LATC1 0x02
#define _LATC2 0x04
#define _LATC3 0x08
#define _LATC4 0x10
#define _LATC5 0x20
#define _LATC6 0x40
#define _LATC7 0x80
// LATD Bits
extern __at(0x0F8C) __sfr LATD;
typedef struct
{
unsigned LATD0 : 1;
unsigned LATD1 : 1;
unsigned LATD2 : 1;
unsigned LATD3 : 1;
unsigned LATD4 : 1;
unsigned LATD5 : 1;
unsigned LATD6 : 1;
unsigned LATD7 : 1;
} __LATDbits_t;
extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
#define _LATD0 0x01
#define _LATD1 0x02
#define _LATD2 0x04
#define _LATD3 0x08
#define _LATD4 0x10
#define _LATD5 0x20
#define _LATD6 0x40
#define _LATD7 0x80
// LATE Bits
extern __at(0x0F8D) __sfr LATE;
typedef union
{
struct
{
unsigned LATE0 : 1;
unsigned LATE1 : 1;
unsigned LATE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned LATE : 3;
unsigned : 5;
};
} __LATEbits_t;
extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
#define _LATE0 0x01
#define _LATE1 0x02
#define _LATE2 0x04
// DDRA Bits
extern __at(0x0F92) __sfr DDRA;
typedef union
{
struct
{
unsigned TRISA0 : 1;
unsigned TRISA1 : 1;
unsigned TRISA2 : 1;
unsigned TRISA3 : 1;
unsigned TRISA4 : 1;
unsigned TRISA5 : 1;
unsigned TRISA6 : 1;
unsigned TRISA7 : 1;
};
struct
{
unsigned RA0 : 1;
unsigned RA1 : 1;
unsigned RA2 : 1;
unsigned RA3 : 1;
unsigned RA4 : 1;
unsigned RA5 : 1;
unsigned RA6 : 1;
unsigned RA7 : 1;
};
} __DDRAbits_t;
extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
#define _TRISA0 0x01
#define _RA0 0x01
#define _TRISA1 0x02
#define _RA1 0x02
#define _TRISA2 0x04
#define _RA2 0x04
#define _TRISA3 0x08
#define _RA3 0x08
#define _TRISA4 0x10
#define _RA4 0x10
#define _TRISA5 0x20
#define _RA5 0x20
#define _TRISA6 0x40
#define _RA6 0x40
#define _TRISA7 0x80
#define _RA7 0x80
// TRISA Bits
extern __at(0x0F92) __sfr TRISA;
typedef union
{
struct
{
unsigned TRISA0 : 1;
unsigned TRISA1 : 1;
unsigned TRISA2 : 1;
unsigned TRISA3 : 1;
unsigned TRISA4 : 1;
unsigned TRISA5 : 1;
unsigned TRISA6 : 1;
unsigned TRISA7 : 1;
};
struct
{
unsigned RA0 : 1;
unsigned RA1 : 1;
unsigned RA2 : 1;
unsigned RA3 : 1;
unsigned RA4 : 1;
unsigned RA5 : 1;
unsigned RA6 : 1;
unsigned RA7 : 1;
};
} __TRISAbits_t;
extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
#define _TRISA_TRISA0 0x01
#define _TRISA_RA0 0x01
#define _TRISA_TRISA1 0x02
#define _TRISA_RA1 0x02
#define _TRISA_TRISA2 0x04
#define _TRISA_RA2 0x04
#define _TRISA_TRISA3 0x08
#define _TRISA_RA3 0x08
#define _TRISA_TRISA4 0x10
#define _TRISA_RA4 0x10
#define _TRISA_TRISA5 0x20
#define _TRISA_RA5 0x20
#define _TRISA_TRISA6 0x40
#define _TRISA_RA6 0x40
#define _TRISA_TRISA7 0x80
#define _TRISA_RA7 0x80
// DDRB Bits
extern __at(0x0F93) __sfr DDRB;
typedef union
{
struct
{
unsigned TRISB0 : 1;
unsigned TRISB1 : 1;
unsigned TRISB2 : 1;
unsigned TRISB3 : 1;
unsigned TRISB4 : 1;
unsigned TRISB5 : 1;
unsigned TRISB6 : 1;
unsigned TRISB7 : 1;
};
struct
{
unsigned RB0 : 1;
unsigned RB1 : 1;
unsigned RB2 : 1;
unsigned RB3 : 1;
unsigned RB4 : 1;
unsigned RB5 : 1;
unsigned RB6 : 1;
unsigned RB7 : 1;
};
} __DDRBbits_t;
extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
#define _TRISB0 0x01
#define _RB0 0x01
#define _TRISB1 0x02
#define _RB1 0x02
#define _TRISB2 0x04
#define _RB2 0x04
#define _TRISB3 0x08
#define _RB3 0x08
#define _TRISB4 0x10
#define _RB4 0x10
#define _TRISB5 0x20
#define _RB5 0x20
#define _TRISB6 0x40
#define _RB6 0x40
#define _TRISB7 0x80
#define _RB7 0x80
// TRISB Bits
extern __at(0x0F93) __sfr TRISB;
typedef union
{
struct
{
unsigned TRISB0 : 1;
unsigned TRISB1 : 1;
unsigned TRISB2 : 1;
unsigned TRISB3 : 1;
unsigned TRISB4 : 1;
unsigned TRISB5 : 1;
unsigned TRISB6 : 1;
unsigned TRISB7 : 1;
};
struct
{
unsigned RB0 : 1;
unsigned RB1 : 1;
unsigned RB2 : 1;
unsigned RB3 : 1;
unsigned RB4 : 1;
unsigned RB5 : 1;
unsigned RB6 : 1;
unsigned RB7 : 1;
};
} __TRISBbits_t;
extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
#define _TRISB_TRISB0 0x01
#define _TRISB_RB0 0x01
#define _TRISB_TRISB1 0x02
#define _TRISB_RB1 0x02
#define _TRISB_TRISB2 0x04
#define _TRISB_RB2 0x04
#define _TRISB_TRISB3 0x08
#define _TRISB_RB3 0x08
#define _TRISB_TRISB4 0x10
#define _TRISB_RB4 0x10
#define _TRISB_TRISB5 0x20
#define _TRISB_RB5 0x20
#define _TRISB_TRISB6 0x40
#define _TRISB_RB6 0x40
#define _TRISB_TRISB7 0x80
#define _TRISB_RB7 0x80
// DDRC Bits
extern __at(0x0F94) __sfr DDRC;
typedef union
{
struct
{
unsigned TRISC0 : 1;
unsigned TRISC1 : 1;
unsigned TRISC2 : 1;
unsigned TRISC3 : 1;
unsigned TRISC4 : 1;
unsigned TRISC5 : 1;
unsigned TRISC6 : 1;
unsigned TRISC7 : 1;
};
struct
{
unsigned RC0 : 1;
unsigned RC1 : 1;
unsigned RC2 : 1;
unsigned RC3 : 1;
unsigned RC4 : 1;
unsigned RC5 : 1;
unsigned RC6 : 1;
unsigned RC7 : 1;
};
} __DDRCbits_t;
extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
#define _TRISC0 0x01
#define _RC0 0x01
#define _TRISC1 0x02
#define _RC1 0x02
#define _TRISC2 0x04
#define _RC2 0x04
#define _TRISC3 0x08
#define _RC3 0x08
#define _TRISC4 0x10
#define _RC4 0x10
#define _TRISC5 0x20
#define _RC5 0x20
#define _TRISC6 0x40
#define _RC6 0x40
#define _TRISC7 0x80
#define _RC7 0x80
// TRISC Bits
extern __at(0x0F94) __sfr TRISC;
typedef union
{
struct
{
unsigned TRISC0 : 1;
unsigned TRISC1 : 1;
unsigned TRISC2 : 1;
unsigned TRISC3 : 1;
unsigned TRISC4 : 1;
unsigned TRISC5 : 1;
unsigned TRISC6 : 1;
unsigned TRISC7 : 1;
};
struct
{
unsigned RC0 : 1;
unsigned RC1 : 1;
unsigned RC2 : 1;
unsigned RC3 : 1;
unsigned RC4 : 1;
unsigned RC5 : 1;
unsigned RC6 : 1;
unsigned RC7 : 1;
};
} __TRISCbits_t;
extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
#define _TRISC_TRISC0 0x01
#define _TRISC_RC0 0x01
#define _TRISC_TRISC1 0x02
#define _TRISC_RC1 0x02
#define _TRISC_TRISC2 0x04
#define _TRISC_RC2 0x04
#define _TRISC_TRISC3 0x08
#define _TRISC_RC3 0x08
#define _TRISC_TRISC4 0x10
#define _TRISC_RC4 0x10
#define _TRISC_TRISC5 0x20
#define _TRISC_RC5 0x20
#define _TRISC_TRISC6 0x40
#define _TRISC_RC6 0x40
#define _TRISC_TRISC7 0x80
#define _TRISC_RC7 0x80
// DDRD Bits
extern __at(0x0F95) __sfr DDRD;
typedef union
{
struct
{
unsigned TRISD0 : 1;
unsigned TRISD1 : 1;
unsigned TRISD2 : 1;
unsigned TRISD3 : 1;
unsigned TRISD4 : 1;
unsigned TRISD5 : 1;
unsigned TRISD6 : 1;
unsigned TRISD7 : 1;
};
struct
{
unsigned RD0 : 1;
unsigned RD1 : 1;
unsigned RD2 : 1;
unsigned RD3 : 1;
unsigned RD4 : 1;
unsigned RD5 : 1;
unsigned RD6 : 1;
unsigned RD7 : 1;
};
} __DDRDbits_t;
extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
#define _TRISD0 0x01
#define _RD0 0x01
#define _TRISD1 0x02
#define _RD1 0x02
#define _TRISD2 0x04
#define _RD2 0x04
#define _TRISD3 0x08
#define _RD3 0x08
#define _TRISD4 0x10
#define _RD4 0x10
#define _TRISD5 0x20
#define _RD5 0x20
#define _TRISD6 0x40
#define _RD6 0x40
#define _TRISD7 0x80
#define _RD7 0x80
// TRISD Bits
extern __at(0x0F95) __sfr TRISD;
typedef union
{
struct
{
unsigned TRISD0 : 1;
unsigned TRISD1 : 1;
unsigned TRISD2 : 1;
unsigned TRISD3 : 1;
unsigned TRISD4 : 1;
unsigned TRISD5 : 1;
unsigned TRISD6 : 1;
unsigned TRISD7 : 1;
};
struct
{
unsigned RD0 : 1;
unsigned RD1 : 1;
unsigned RD2 : 1;
unsigned RD3 : 1;
unsigned RD4 : 1;
unsigned RD5 : 1;
unsigned RD6 : 1;
unsigned RD7 : 1;
};
} __TRISDbits_t;
extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
#define _TRISD_TRISD0 0x01
#define _TRISD_RD0 0x01
#define _TRISD_TRISD1 0x02
#define _TRISD_RD1 0x02
#define _TRISD_TRISD2 0x04
#define _TRISD_RD2 0x04
#define _TRISD_TRISD3 0x08
#define _TRISD_RD3 0x08
#define _TRISD_TRISD4 0x10
#define _TRISD_RD4 0x10
#define _TRISD_TRISD5 0x20
#define _TRISD_RD5 0x20
#define _TRISD_TRISD6 0x40
#define _TRISD_RD6 0x40
#define _TRISD_TRISD7 0x80
#define _TRISD_RD7 0x80
// DDRE Bits
extern __at(0x0F96) __sfr DDRE;
typedef union
{
struct
{
unsigned TRISE0 : 1;
unsigned TRISE1 : 1;
unsigned TRISE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned WPUE3 : 1;
};
struct
{
unsigned RE0 : 1;
unsigned RE1 : 1;
unsigned RE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned RE : 3;
unsigned : 5;
};
struct
{
unsigned TRISE : 3;
unsigned : 5;
};
} __DDREbits_t;
extern __at(0x0F96) volatile __DDREbits_t DDREbits;
#define _TRISE0 0x01
#define _RE0 0x01
#define _TRISE1 0x02
#define _RE1 0x02
#define _TRISE2 0x04
#define _RE2 0x04
#define _WPUE3 0x80
// TRISE Bits
extern __at(0x0F96) __sfr TRISE;
typedef union
{
struct
{
unsigned TRISE0 : 1;
unsigned TRISE1 : 1;
unsigned TRISE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned WPUE3 : 1;
};
struct
{
unsigned RE0 : 1;
unsigned RE1 : 1;
unsigned RE2 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned RE : 3;
unsigned : 5;
};
struct
{
unsigned TRISE : 3;
unsigned : 5;
};
} __TRISEbits_t;
extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
#define _TRISE_TRISE0 0x01
#define _TRISE_RE0 0x01
#define _TRISE_TRISE1 0x02
#define _TRISE_RE1 0x02
#define _TRISE_TRISE2 0x04
#define _TRISE_RE2 0x04
#define _TRISE_WPUE3 0x80
// OSCTUNE Bits
extern __at(0x0F9B) __sfr OSCTUNE;
typedef union
{
struct
{
unsigned TUN0 : 1;
unsigned TUN1 : 1;
unsigned TUN2 : 1;
unsigned TUN3 : 1;
unsigned TUN4 : 1;
unsigned TUN5 : 1;
unsigned PLLEN : 1;
unsigned INTSRC : 1;
};
struct
{
unsigned TUN : 6;
unsigned : 2;
};
} __OSCTUNEbits_t;
extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
#define _TUN0 0x01
#define _TUN1 0x02
#define _TUN2 0x04
#define _TUN3 0x08
#define _TUN4 0x10
#define _TUN5 0x20
#define _PLLEN 0x40
#define _INTSRC 0x80
// HLVDCON Bits
extern __at(0x0F9C) __sfr HLVDCON;
typedef union
{
struct
{
unsigned HLVDL0 : 1;
unsigned HLVDL1 : 1;
unsigned HLVDL2 : 1;
unsigned HLVDL3 : 1;
unsigned HLVDEN : 1;
unsigned IRVST : 1;
unsigned BGVST : 1;
unsigned VDIRMAG : 1;
};
struct
{
unsigned LVDL0 : 1;
unsigned LVDL1 : 1;
unsigned LVDL2 : 1;
unsigned LVDL3 : 1;
unsigned LVDEN : 1;
unsigned IVRST : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned LVV0 : 1;
unsigned LVV1 : 1;
unsigned LVV2 : 1;
unsigned LVV3 : 1;
unsigned : 1;
unsigned BGST : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned LVV : 4;
unsigned : 4;
};
struct
{
unsigned HLVDL : 4;
unsigned : 4;
};
struct
{
unsigned LVDL : 4;
unsigned : 4;
};
} __HLVDCONbits_t;
extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
#define _HLVDL0 0x01
#define _LVDL0 0x01
#define _LVV0 0x01
#define _HLVDL1 0x02
#define _LVDL1 0x02
#define _LVV1 0x02
#define _HLVDL2 0x04
#define _LVDL2 0x04
#define _LVV2 0x04
#define _HLVDL3 0x08
#define _LVDL3 0x08
#define _LVV3 0x08
#define _HLVDEN 0x10
#define _LVDEN 0x10
#define _IRVST 0x20
#define _IVRST 0x20
#define _BGST 0x20
#define _BGVST 0x40
#define _VDIRMAG 0x80
// LVDCON Bits
extern __at(0x0F9C) __sfr LVDCON;
typedef union
{
struct
{
unsigned HLVDL0 : 1;
unsigned HLVDL1 : 1;
unsigned HLVDL2 : 1;
unsigned HLVDL3 : 1;
unsigned HLVDEN : 1;
unsigned IRVST : 1;
unsigned BGVST : 1;
unsigned VDIRMAG : 1;
};
struct
{
unsigned LVDL0 : 1;
unsigned LVDL1 : 1;
unsigned LVDL2 : 1;
unsigned LVDL3 : 1;
unsigned LVDEN : 1;
unsigned IVRST : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned LVV0 : 1;
unsigned LVV1 : 1;
unsigned LVV2 : 1;
unsigned LVV3 : 1;
unsigned : 1;
unsigned BGST : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned LVV : 4;
unsigned : 4;
};
struct
{
unsigned HLVDL : 4;
unsigned : 4;
};
struct
{
unsigned LVDL : 4;
unsigned : 4;
};
} __LVDCONbits_t;
extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits;
#define _LVDCON_HLVDL0 0x01
#define _LVDCON_LVDL0 0x01
#define _LVDCON_LVV0 0x01
#define _LVDCON_HLVDL1 0x02
#define _LVDCON_LVDL1 0x02
#define _LVDCON_LVV1 0x02
#define _LVDCON_HLVDL2 0x04
#define _LVDCON_LVDL2 0x04
#define _LVDCON_LVV2 0x04
#define _LVDCON_HLVDL3 0x08
#define _LVDCON_LVDL3 0x08
#define _LVDCON_LVV3 0x08
#define _LVDCON_HLVDEN 0x10
#define _LVDCON_LVDEN 0x10
#define _LVDCON_IRVST 0x20
#define _LVDCON_IVRST 0x20
#define _LVDCON_BGST 0x20
#define _LVDCON_BGVST 0x40
#define _LVDCON_VDIRMAG 0x80
// PIE1 Bits
extern __at(0x0F9D) __sfr PIE1;
typedef union
{
struct
{
unsigned TMR1IE : 1;
unsigned TMR2IE : 1;
unsigned CCP1IE : 1;
unsigned SSP1IE : 1;
unsigned TX1IE : 1;
unsigned RC1IE : 1;
unsigned ADIE : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SSPIE : 1;
unsigned TXIE : 1;
unsigned RCIE : 1;
unsigned : 1;
unsigned : 1;
};
} __PIE1bits_t;
extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
#define _TMR1IE 0x01
#define _TMR2IE 0x02
#define _CCP1IE 0x04
#define _SSP1IE 0x08
#define _SSPIE 0x08
#define _TX1IE 0x10
#define _TXIE 0x10
#define _RC1IE 0x20
#define _RCIE 0x20
#define _ADIE 0x40
// PIR1 Bits
extern __at(0x0F9E) __sfr PIR1;
typedef union
{
struct
{
unsigned TMR1IF : 1;
unsigned TMR2IF : 1;
unsigned CCP1IF : 1;
unsigned SSP1IF : 1;
unsigned TX1IF : 1;
unsigned RC1IF : 1;
unsigned ADIF : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SSPIF : 1;
unsigned TXIF : 1;
unsigned RCIF : 1;
unsigned : 1;
unsigned : 1;
};
} __PIR1bits_t;
extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
#define _TMR1IF 0x01
#define _TMR2IF 0x02
#define _CCP1IF 0x04
#define _SSP1IF 0x08
#define _SSPIF 0x08
#define _TX1IF 0x10
#define _TXIF 0x10
#define _RC1IF 0x20
#define _RCIF 0x20
#define _ADIF 0x40
// IPR1 Bits
extern __at(0x0F9F) __sfr IPR1;
typedef union
{
struct
{
unsigned TMR1IP : 1;
unsigned TMR2IP : 1;
unsigned CCP1IP : 1;
unsigned SSP1IP : 1;
unsigned TX1IP : 1;
unsigned RC1IP : 1;
unsigned ADIP : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SSPIP : 1;
unsigned TXIP : 1;
unsigned RCIP : 1;
unsigned : 1;
unsigned : 1;
};
} __IPR1bits_t;
extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
#define _TMR1IP 0x01
#define _TMR2IP 0x02
#define _CCP1IP 0x04
#define _SSP1IP 0x08
#define _SSPIP 0x08
#define _TX1IP 0x10
#define _TXIP 0x10
#define _RC1IP 0x20
#define _RCIP 0x20
#define _ADIP 0x40
// PIE2 Bits
extern __at(0x0FA0) __sfr PIE2;
typedef union
{
struct
{
unsigned CCP2IE : 1;
unsigned TMR3IE : 1;
unsigned HLVDIE : 1;
unsigned BCL1IE : 1;
unsigned EEIE : 1;
unsigned C2IE : 1;
unsigned C1IE : 1;
unsigned OSCFIE : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned LVDIE : 1;
unsigned BCLIE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __PIE2bits_t;
extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
#define _CCP2IE 0x01
#define _TMR3IE 0x02
#define _HLVDIE 0x04
#define _LVDIE 0x04
#define _BCL1IE 0x08
#define _BCLIE 0x08
#define _EEIE 0x10
#define _C2IE 0x20
#define _C1IE 0x40
#define _OSCFIE 0x80
// PIR2 Bits
extern __at(0x0FA1) __sfr PIR2;
typedef union
{
struct
{
unsigned CCP2IF : 1;
unsigned TMR3IF : 1;
unsigned HLVDIF : 1;
unsigned BCL1IF : 1;
unsigned EEIF : 1;
unsigned C2IF : 1;
unsigned C1IF : 1;
unsigned OSCFIF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned LVDIF : 1;
unsigned BCLIF : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __PIR2bits_t;
extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
#define _CCP2IF 0x01
#define _TMR3IF 0x02
#define _HLVDIF 0x04
#define _LVDIF 0x04
#define _BCL1IF 0x08
#define _BCLIF 0x08
#define _EEIF 0x10
#define _C2IF 0x20
#define _C1IF 0x40
#define _OSCFIF 0x80
// IPR2 Bits
extern __at(0x0FA2) __sfr IPR2;
typedef union
{
struct
{
unsigned CCP2IP : 1;
unsigned TMR3IP : 1;
unsigned HLVDIP : 1;
unsigned BCL1IP : 1;
unsigned EEIP : 1;
unsigned C2IP : 1;
unsigned C1IP : 1;
unsigned OSCFIP : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned LVDIP : 1;
unsigned BCLIP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __IPR2bits_t;
extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
#define _CCP2IP 0x01
#define _TMR3IP 0x02
#define _HLVDIP 0x04
#define _LVDIP 0x04
#define _BCL1IP 0x08
#define _BCLIP 0x08
#define _EEIP 0x10
#define _C2IP 0x20
#define _C1IP 0x40
#define _OSCFIP 0x80
// PIE3 Bits
extern __at(0x0FA3) __sfr PIE3;
typedef struct
{
unsigned TMR1GIE : 1;
unsigned TMR3GIE : 1;
unsigned TMR5GIE : 1;
unsigned CTMUIE : 1;
unsigned TX2IE : 1;
unsigned RC2IE : 1;
unsigned BCL2IE : 1;
unsigned SSP2IE : 1;
} __PIE3bits_t;
extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
#define _TMR1GIE 0x01
#define _TMR3GIE 0x02
#define _TMR5GIE 0x04
#define _CTMUIE 0x08
#define _TX2IE 0x10
#define _RC2IE 0x20
#define _BCL2IE 0x40
#define _SSP2IE 0x80
// PIR3 Bits
extern __at(0x0FA4) __sfr PIR3;
typedef struct
{
unsigned TMR1GIF : 1;
unsigned TMR3GIF : 1;
unsigned TMR5GIF : 1;
unsigned CTMUIF : 1;
unsigned TX2IF : 1;
unsigned RC2IF : 1;
unsigned BCL2IF : 1;
unsigned SSP2IF : 1;
} __PIR3bits_t;
extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
#define _TMR1GIF 0x01
#define _TMR3GIF 0x02
#define _TMR5GIF 0x04
#define _CTMUIF 0x08
#define _TX2IF 0x10
#define _RC2IF 0x20
#define _BCL2IF 0x40
#define _SSP2IF 0x80
// IPR3 Bits
extern __at(0x0FA5) __sfr IPR3;
typedef struct
{
unsigned TMR1GIP : 1;
unsigned TMR3GIP : 1;
unsigned TMR5GIP : 1;
unsigned CTMUIP : 1;
unsigned TX2IP : 1;
unsigned RC2IP : 1;
unsigned BCL2IP : 1;
unsigned SSP2IP : 1;
} __IPR3bits_t;
extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
#define _TMR1GIP 0x01
#define _TMR3GIP 0x02
#define _TMR5GIP 0x04
#define _CTMUIP 0x08
#define _TX2IP 0x10
#define _RC2IP 0x20
#define _BCL2IP 0x40
#define _SSP2IP 0x80
// EECON1 Bits
extern __at(0x0FA6) __sfr EECON1;
typedef struct
{
unsigned RD : 1;
unsigned WR : 1;
unsigned WREN : 1;
unsigned WRERR : 1;
unsigned FREE : 1;
unsigned : 1;
unsigned CFGS : 1;
unsigned EEPGD : 1;
} __EECON1bits_t;
extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
#define _RD 0x01
#define _WR 0x02
#define _WREN 0x04
#define _WRERR 0x08
#define _FREE 0x10
#define _CFGS 0x40
#define _EEPGD 0x80
extern __at(0x0FA7) __sfr EECON2;
extern __at(0x0FA8) __sfr EEDATA;
// EEADR Bits
extern __at(0x0FA9) __sfr EEADR;
typedef struct
{
unsigned EEADR0 : 1;
unsigned EEADR1 : 1;
unsigned EEADR2 : 1;
unsigned EEADR3 : 1;
unsigned EEADR4 : 1;
unsigned EEADR5 : 1;
unsigned EEADR6 : 1;
unsigned EEADR7 : 1;
} __EEADRbits_t;
extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
#define _EEADR0 0x01
#define _EEADR1 0x02
#define _EEADR2 0x04
#define _EEADR3 0x08
#define _EEADR4 0x10
#define _EEADR5 0x20
#define _EEADR6 0x40
#define _EEADR7 0x80
// RC1STA Bits
extern __at(0x0FAB) __sfr RC1STA;
typedef union
{
struct
{
unsigned RX9D : 1;
unsigned OERR : 1;
unsigned FERR : 1;
unsigned ADDEN : 1;
unsigned CREN : 1;
unsigned SREN : 1;
unsigned RX9 : 1;
unsigned SPEN : 1;
};
struct
{
unsigned RX9D1 : 1;
unsigned OERR1 : 1;
unsigned FERR1 : 1;
unsigned ADEN : 1;
unsigned CREN1 : 1;
unsigned SREN1 : 1;
unsigned RX91 : 1;
unsigned SPEN1 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned ADDEN1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RC1STAbits_t;
extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
#define _RX9D 0x01
#define _RX9D1 0x01
#define _OERR 0x02
#define _OERR1 0x02
#define _FERR 0x04
#define _FERR1 0x04
#define _ADDEN 0x08
#define _ADEN 0x08
#define _ADDEN1 0x08
#define _CREN 0x10
#define _CREN1 0x10
#define _SREN 0x20
#define _SREN1 0x20
#define _RX9 0x40
#define _RX91 0x40
#define _SPEN 0x80
#define _SPEN1 0x80
// RCSTA Bits
extern __at(0x0FAB) __sfr RCSTA;
typedef union
{
struct
{
unsigned RX9D : 1;
unsigned OERR : 1;
unsigned FERR : 1;
unsigned ADDEN : 1;
unsigned CREN : 1;
unsigned SREN : 1;
unsigned RX9 : 1;
unsigned SPEN : 1;
};
struct
{
unsigned RX9D1 : 1;
unsigned OERR1 : 1;
unsigned FERR1 : 1;
unsigned ADEN : 1;
unsigned CREN1 : 1;
unsigned SREN1 : 1;
unsigned RX91 : 1;
unsigned SPEN1 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned ADDEN1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RCSTAbits_t;
extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
#define _RCSTA_RX9D 0x01
#define _RCSTA_RX9D1 0x01
#define _RCSTA_OERR 0x02
#define _RCSTA_OERR1 0x02
#define _RCSTA_FERR 0x04
#define _RCSTA_FERR1 0x04
#define _RCSTA_ADDEN 0x08
#define _RCSTA_ADEN 0x08
#define _RCSTA_ADDEN1 0x08
#define _RCSTA_CREN 0x10
#define _RCSTA_CREN1 0x10
#define _RCSTA_SREN 0x20
#define _RCSTA_SREN1 0x20
#define _RCSTA_RX9 0x40
#define _RCSTA_RX91 0x40
#define _RCSTA_SPEN 0x80
#define _RCSTA_SPEN1 0x80
// RCSTA1 Bits
extern __at(0x0FAB) __sfr RCSTA1;
typedef union
{
struct
{
unsigned RX9D : 1;
unsigned OERR : 1;
unsigned FERR : 1;
unsigned ADDEN : 1;
unsigned CREN : 1;
unsigned SREN : 1;
unsigned RX9 : 1;
unsigned SPEN : 1;
};
struct
{
unsigned RX9D1 : 1;
unsigned OERR1 : 1;
unsigned FERR1 : 1;
unsigned ADEN : 1;
unsigned CREN1 : 1;
unsigned SREN1 : 1;
unsigned RX91 : 1;
unsigned SPEN1 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned ADDEN1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RCSTA1bits_t;
extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
#define _RCSTA1_RX9D 0x01
#define _RCSTA1_RX9D1 0x01
#define _RCSTA1_OERR 0x02
#define _RCSTA1_OERR1 0x02
#define _RCSTA1_FERR 0x04
#define _RCSTA1_FERR1 0x04
#define _RCSTA1_ADDEN 0x08
#define _RCSTA1_ADEN 0x08
#define _RCSTA1_ADDEN1 0x08
#define _RCSTA1_CREN 0x10
#define _RCSTA1_CREN1 0x10
#define _RCSTA1_SREN 0x20
#define _RCSTA1_SREN1 0x20
#define _RCSTA1_RX9 0x40
#define _RCSTA1_RX91 0x40
#define _RCSTA1_SPEN 0x80
#define _RCSTA1_SPEN1 0x80
// TX1STA Bits
extern __at(0x0FAC) __sfr TX1STA;
typedef union
{
struct
{
unsigned TX9D : 1;
unsigned TRMT : 1;
unsigned BRGH : 1;
unsigned SENDB : 1;
unsigned SYNC : 1;
unsigned TXEN : 1;
unsigned TX9 : 1;
unsigned CSRC : 1;
};
struct
{
unsigned TX9D1 : 1;
unsigned TRMT1 : 1;
unsigned BRGH1 : 1;
unsigned SENDB1 : 1;
unsigned SYNC1 : 1;
unsigned TXEN1 : 1;
unsigned TX91 : 1;
unsigned CSRC1 : 1;
};
} __TX1STAbits_t;
extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
#define _TX9D 0x01
#define _TX9D1 0x01
#define _TRMT 0x02
#define _TRMT1 0x02
#define _BRGH 0x04
#define _BRGH1 0x04
#define _SENDB 0x08
#define _SENDB1 0x08
#define _SYNC 0x10
#define _SYNC1 0x10
#define _TXEN 0x20
#define _TXEN1 0x20
#define _TX9 0x40
#define _TX91 0x40
#define _CSRC 0x80
#define _CSRC1 0x80
// TXSTA Bits
extern __at(0x0FAC) __sfr TXSTA;
typedef union
{
struct
{
unsigned TX9D : 1;
unsigned TRMT : 1;
unsigned BRGH : 1;
unsigned SENDB : 1;
unsigned SYNC : 1;
unsigned TXEN : 1;
unsigned TX9 : 1;
unsigned CSRC : 1;
};
struct
{
unsigned TX9D1 : 1;
unsigned TRMT1 : 1;
unsigned BRGH1 : 1;
unsigned SENDB1 : 1;
unsigned SYNC1 : 1;
unsigned TXEN1 : 1;
unsigned TX91 : 1;
unsigned CSRC1 : 1;
};
} __TXSTAbits_t;
extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
#define _TXSTA_TX9D 0x01
#define _TXSTA_TX9D1 0x01
#define _TXSTA_TRMT 0x02
#define _TXSTA_TRMT1 0x02
#define _TXSTA_BRGH 0x04
#define _TXSTA_BRGH1 0x04
#define _TXSTA_SENDB 0x08
#define _TXSTA_SENDB1 0x08
#define _TXSTA_SYNC 0x10
#define _TXSTA_SYNC1 0x10
#define _TXSTA_TXEN 0x20
#define _TXSTA_TXEN1 0x20
#define _TXSTA_TX9 0x40
#define _TXSTA_TX91 0x40
#define _TXSTA_CSRC 0x80
#define _TXSTA_CSRC1 0x80
// TXSTA1 Bits
extern __at(0x0FAC) __sfr TXSTA1;
typedef union
{
struct
{
unsigned TX9D : 1;
unsigned TRMT : 1;
unsigned BRGH : 1;
unsigned SENDB : 1;
unsigned SYNC : 1;
unsigned TXEN : 1;
unsigned TX9 : 1;
unsigned CSRC : 1;
};
struct
{
unsigned TX9D1 : 1;
unsigned TRMT1 : 1;
unsigned BRGH1 : 1;
unsigned SENDB1 : 1;
unsigned SYNC1 : 1;
unsigned TXEN1 : 1;
unsigned TX91 : 1;
unsigned CSRC1 : 1;
};
} __TXSTA1bits_t;
extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
#define _TXSTA1_TX9D 0x01
#define _TXSTA1_TX9D1 0x01
#define _TXSTA1_TRMT 0x02
#define _TXSTA1_TRMT1 0x02
#define _TXSTA1_BRGH 0x04
#define _TXSTA1_BRGH1 0x04
#define _TXSTA1_SENDB 0x08
#define _TXSTA1_SENDB1 0x08
#define _TXSTA1_SYNC 0x10
#define _TXSTA1_SYNC1 0x10
#define _TXSTA1_TXEN 0x20
#define _TXSTA1_TXEN1 0x20
#define _TXSTA1_TX9 0x40
#define _TXSTA1_TX91 0x40
#define _TXSTA1_CSRC 0x80
#define _TXSTA1_CSRC1 0x80
extern __at(0x0FAD) __sfr TX1REG;
extern __at(0x0FAD) __sfr TXREG;
extern __at(0x0FAD) __sfr TXREG1;
extern __at(0x0FAE) __sfr RC1REG;
extern __at(0x0FAE) __sfr RCREG;
extern __at(0x0FAE) __sfr RCREG1;
extern __at(0x0FAF) __sfr SP1BRG;
extern __at(0x0FAF) __sfr SPBRG;
extern __at(0x0FAF) __sfr SPBRG1;
extern __at(0x0FB0) __sfr SP1BRGH;
extern __at(0x0FB0) __sfr SPBRGH;
extern __at(0x0FB0) __sfr SPBRGH1;
// T3CON Bits
extern __at(0x0FB1) __sfr T3CON;
typedef union
{
struct
{
unsigned TMR3ON : 1;
unsigned T3RD16 : 1;
unsigned NOT_T3SYNC : 1;
unsigned T3SOSCEN : 1;
unsigned T3CKPS0 : 1;
unsigned T3CKPS1 : 1;
unsigned TMR3CS0 : 1;
unsigned TMR3CS1 : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T3OSCEN : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 4;
unsigned T3CKPS : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned TMR3CS : 2;
};
} __T3CONbits_t;
extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
#define _TMR3ON 0x01
#define _T3RD16 0x02
#define _NOT_T3SYNC 0x04
#define _T3SOSCEN 0x08
#define _T3OSCEN 0x08
#define _T3CKPS0 0x10
#define _T3CKPS1 0x20
#define _TMR3CS0 0x40
#define _TMR3CS1 0x80
extern __at(0x0FB2) __sfr TMR3;
extern __at(0x0FB2) __sfr TMR3L;
extern __at(0x0FB3) __sfr TMR3H;
// T3GCON Bits
extern __at(0x0FB4) __sfr T3GCON;
typedef union
{
struct
{
unsigned T3GSS0 : 1;
unsigned T3GSS1 : 1;
unsigned T3GVAL : 1;
unsigned T3GGO_NOT_DONE : 1;
unsigned T3GSPM : 1;
unsigned T3GTM : 1;
unsigned T3GPOL : 1;
unsigned TMR3GE : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T3G_DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T3GGO : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned T3GSS : 2;
unsigned : 6;
};
} __T3GCONbits_t;
extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
#define _T3GSS0 0x01
#define _T3GSS1 0x02
#define _T3GVAL 0x04
#define _T3GGO_NOT_DONE 0x08
#define _T3G_DONE 0x08
#define _T3GGO 0x08
#define _T3GSPM 0x10
#define _T3GTM 0x20
#define _T3GPOL 0x40
#define _TMR3GE 0x80
// ECCP1AS Bits
extern __at(0x0FB6) __sfr ECCP1AS;
typedef union
{
struct
{
unsigned P1SSBD0 : 1;
unsigned P1SSBD1 : 1;
unsigned P1SSAC0 : 1;
unsigned P1SSAC1 : 1;
unsigned CCP1AS0 : 1;
unsigned CCP1AS1 : 1;
unsigned CCP1AS2 : 1;
unsigned CCP1ASE : 1;
};
struct
{
unsigned PSS1BD0 : 1;
unsigned PSS1BD1 : 1;
unsigned PSS1AC0 : 1;
unsigned PSS1AC1 : 1;
unsigned ECCPAS0 : 1;
unsigned ECCPAS1 : 1;
unsigned ECCPAS2 : 1;
unsigned ECCPASE : 1;
};
struct
{
unsigned PSSBD0 : 1;
unsigned PSSBD1 : 1;
unsigned PSSAC0 : 1;
unsigned PSSAC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSSBD : 2;
unsigned : 6;
};
struct
{
unsigned P1SSBD : 2;
unsigned : 6;
};
struct
{
unsigned PSS1BD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned PSS1AC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned P1SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned PSSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP1AS : 3;
unsigned : 1;
};
struct
{
unsigned : 4;
unsigned ECCPAS : 3;
unsigned : 1;
};
} __ECCP1ASbits_t;
extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
#define _P1SSBD0 0x01
#define _PSS1BD0 0x01
#define _PSSBD0 0x01
#define _P1SSBD1 0x02
#define _PSS1BD1 0x02
#define _PSSBD1 0x02
#define _P1SSAC0 0x04
#define _PSS1AC0 0x04
#define _PSSAC0 0x04
#define _P1SSAC1 0x08
#define _PSS1AC1 0x08
#define _PSSAC1 0x08
#define _CCP1AS0 0x10
#define _ECCPAS0 0x10
#define _CCP1AS1 0x20
#define _ECCPAS1 0x20
#define _CCP1AS2 0x40
#define _ECCPAS2 0x40
#define _CCP1ASE 0x80
#define _ECCPASE 0x80
// ECCPAS Bits
extern __at(0x0FB6) __sfr ECCPAS;
typedef union
{
struct
{
unsigned P1SSBD0 : 1;
unsigned P1SSBD1 : 1;
unsigned P1SSAC0 : 1;
unsigned P1SSAC1 : 1;
unsigned CCP1AS0 : 1;
unsigned CCP1AS1 : 1;
unsigned CCP1AS2 : 1;
unsigned CCP1ASE : 1;
};
struct
{
unsigned PSS1BD0 : 1;
unsigned PSS1BD1 : 1;
unsigned PSS1AC0 : 1;
unsigned PSS1AC1 : 1;
unsigned ECCPAS0 : 1;
unsigned ECCPAS1 : 1;
unsigned ECCPAS2 : 1;
unsigned ECCPASE : 1;
};
struct
{
unsigned PSSBD0 : 1;
unsigned PSSBD1 : 1;
unsigned PSSAC0 : 1;
unsigned PSSAC1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned PSSBD : 2;
unsigned : 6;
};
struct
{
unsigned P1SSBD : 2;
unsigned : 6;
};
struct
{
unsigned PSS1BD : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned PSS1AC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned P1SSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 2;
unsigned PSSAC : 2;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned CCP1AS : 3;
unsigned : 1;
};
struct
{
unsigned : 4;
unsigned ECCPAS : 3;
unsigned : 1;
};
} __ECCPASbits_t;
extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
#define _ECCPAS_P1SSBD0 0x01
#define _ECCPAS_PSS1BD0 0x01
#define _ECCPAS_PSSBD0 0x01
#define _ECCPAS_P1SSBD1 0x02
#define _ECCPAS_PSS1BD1 0x02
#define _ECCPAS_PSSBD1 0x02
#define _ECCPAS_P1SSAC0 0x04
#define _ECCPAS_PSS1AC0 0x04
#define _ECCPAS_PSSAC0 0x04
#define _ECCPAS_P1SSAC1 0x08
#define _ECCPAS_PSS1AC1 0x08
#define _ECCPAS_PSSAC1 0x08
#define _ECCPAS_CCP1AS0 0x10
#define _ECCPAS_ECCPAS0 0x10
#define _ECCPAS_CCP1AS1 0x20
#define _ECCPAS_ECCPAS1 0x20
#define _ECCPAS_CCP1AS2 0x40
#define _ECCPAS_ECCPAS2 0x40
#define _ECCPAS_CCP1ASE 0x80
#define _ECCPAS_ECCPASE 0x80
// PWM1CON Bits
extern __at(0x0FB7) __sfr PWM1CON;
typedef union
{
struct
{
unsigned P1DC0 : 1;
unsigned P1DC1 : 1;
unsigned P1DC2 : 1;
unsigned P1DC3 : 1;
unsigned P1DC4 : 1;
unsigned P1DC5 : 1;
unsigned P1DC6 : 1;
unsigned P1RSEN : 1;
};
struct
{
unsigned PDC0 : 1;
unsigned PDC1 : 1;
unsigned PDC2 : 1;
unsigned PDC3 : 1;
unsigned PDC4 : 1;
unsigned PDC5 : 1;
unsigned PDC6 : 1;
unsigned PRSEN : 1;
};
struct
{
unsigned P1DC : 7;
unsigned : 1;
};
struct
{
unsigned PDC : 7;
unsigned : 1;
};
} __PWM1CONbits_t;
extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
#define _P1DC0 0x01
#define _PDC0 0x01
#define _P1DC1 0x02
#define _PDC1 0x02
#define _P1DC2 0x04
#define _PDC2 0x04
#define _P1DC3 0x08
#define _PDC3 0x08
#define _P1DC4 0x10
#define _PDC4 0x10
#define _P1DC5 0x20
#define _PDC5 0x20
#define _P1DC6 0x40
#define _PDC6 0x40
#define _P1RSEN 0x80
#define _PRSEN 0x80
// PWMCON Bits
extern __at(0x0FB7) __sfr PWMCON;
typedef union
{
struct
{
unsigned P1DC0 : 1;
unsigned P1DC1 : 1;
unsigned P1DC2 : 1;
unsigned P1DC3 : 1;
unsigned P1DC4 : 1;
unsigned P1DC5 : 1;
unsigned P1DC6 : 1;
unsigned P1RSEN : 1;
};
struct
{
unsigned PDC0 : 1;
unsigned PDC1 : 1;
unsigned PDC2 : 1;
unsigned PDC3 : 1;
unsigned PDC4 : 1;
unsigned PDC5 : 1;
unsigned PDC6 : 1;
unsigned PRSEN : 1;
};
struct
{
unsigned P1DC : 7;
unsigned : 1;
};
struct
{
unsigned PDC : 7;
unsigned : 1;
};
} __PWMCONbits_t;
extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
#define _PWMCON_P1DC0 0x01
#define _PWMCON_PDC0 0x01
#define _PWMCON_P1DC1 0x02
#define _PWMCON_PDC1 0x02
#define _PWMCON_P1DC2 0x04
#define _PWMCON_PDC2 0x04
#define _PWMCON_P1DC3 0x08
#define _PWMCON_PDC3 0x08
#define _PWMCON_P1DC4 0x10
#define _PWMCON_PDC4 0x10
#define _PWMCON_P1DC5 0x20
#define _PWMCON_PDC5 0x20
#define _PWMCON_P1DC6 0x40
#define _PWMCON_PDC6 0x40
#define _PWMCON_P1RSEN 0x80
#define _PWMCON_PRSEN 0x80
// BAUD1CON Bits
extern __at(0x0FB8) __sfr BAUD1CON;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUD1CONbits_t;
extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
#define _ABDEN 0x01
#define _WUE 0x02
#define _BRG16 0x08
#define _CKTXP 0x10
#define _SCKP 0x10
#define _DTRXP 0x20
#define _RCIDL 0x40
#define _ABDOVF 0x80
// BAUDCON Bits
extern __at(0x0FB8) __sfr BAUDCON;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUDCONbits_t;
extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
#define _BAUDCON_ABDEN 0x01
#define _BAUDCON_WUE 0x02
#define _BAUDCON_BRG16 0x08
#define _BAUDCON_CKTXP 0x10
#define _BAUDCON_SCKP 0x10
#define _BAUDCON_DTRXP 0x20
#define _BAUDCON_RCIDL 0x40
#define _BAUDCON_ABDOVF 0x80
// BAUDCON1 Bits
extern __at(0x0FB8) __sfr BAUDCON1;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUDCON1bits_t;
extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
#define _BAUDCON1_ABDEN 0x01
#define _BAUDCON1_WUE 0x02
#define _BAUDCON1_BRG16 0x08
#define _BAUDCON1_CKTXP 0x10
#define _BAUDCON1_SCKP 0x10
#define _BAUDCON1_DTRXP 0x20
#define _BAUDCON1_RCIDL 0x40
#define _BAUDCON1_ABDOVF 0x80
// BAUDCTL Bits
extern __at(0x0FB8) __sfr BAUDCTL;
typedef union
{
struct
{
unsigned ABDEN : 1;
unsigned WUE : 1;
unsigned : 1;
unsigned BRG16 : 1;
unsigned CKTXP : 1;
unsigned DTRXP : 1;
unsigned RCIDL : 1;
unsigned ABDOVF : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned SCKP : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __BAUDCTLbits_t;
extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
#define _BAUDCTL_ABDEN 0x01
#define _BAUDCTL_WUE 0x02
#define _BAUDCTL_BRG16 0x08
#define _BAUDCTL_CKTXP 0x10
#define _BAUDCTL_SCKP 0x10
#define _BAUDCTL_DTRXP 0x20
#define _BAUDCTL_RCIDL 0x40
#define _BAUDCTL_ABDOVF 0x80
// PSTR1CON Bits
extern __at(0x0FB9) __sfr PSTR1CON;
typedef struct
{
unsigned STR1A : 1;
unsigned STR1B : 1;
unsigned STR1C : 1;
unsigned STR1D : 1;
unsigned STR1SYNC : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PSTR1CONbits_t;
extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
#define _STR1A 0x01
#define _STR1B 0x02
#define _STR1C 0x04
#define _STR1D 0x08
#define _STR1SYNC 0x10
// PSTRCON Bits
extern __at(0x0FB9) __sfr PSTRCON;
typedef struct
{
unsigned STR1A : 1;
unsigned STR1B : 1;
unsigned STR1C : 1;
unsigned STR1D : 1;
unsigned STR1SYNC : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __PSTRCONbits_t;
extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
#define _PSTRCON_STR1A 0x01
#define _PSTRCON_STR1B 0x02
#define _PSTRCON_STR1C 0x04
#define _PSTRCON_STR1D 0x08
#define _PSTRCON_STR1SYNC 0x10
// T2CON Bits
extern __at(0x0FBA) __sfr T2CON;
typedef union
{
struct
{
unsigned T2CKPS0 : 1;
unsigned T2CKPS1 : 1;
unsigned TMR2ON : 1;
unsigned T2OUTPS0 : 1;
unsigned T2OUTPS1 : 1;
unsigned T2OUTPS2 : 1;
unsigned T2OUTPS3 : 1;
unsigned : 1;
};
struct
{
unsigned T2CKPS : 2;
unsigned : 6;
};
struct
{
unsigned : 3;
unsigned T2OUTPS : 4;
unsigned : 1;
};
} __T2CONbits_t;
extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
#define _T2CKPS0 0x01
#define _T2CKPS1 0x02
#define _TMR2ON 0x04
#define _T2OUTPS0 0x08
#define _T2OUTPS1 0x10
#define _T2OUTPS2 0x20
#define _T2OUTPS3 0x40
extern __at(0x0FBB) __sfr PR2;
extern __at(0x0FBC) __sfr TMR2;
// CCP1CON Bits
extern __at(0x0FBD) __sfr CCP1CON;
typedef union
{
struct
{
unsigned CCP1M0 : 1;
unsigned CCP1M1 : 1;
unsigned CCP1M2 : 1;
unsigned CCP1M3 : 1;
unsigned DC1B0 : 1;
unsigned DC1B1 : 1;
unsigned P1M0 : 1;
unsigned P1M1 : 1;
};
struct
{
unsigned CCP1M : 4;
unsigned : 4;
};
struct
{
unsigned : 4;
unsigned DC1B : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned P1M : 2;
};
} __CCP1CONbits_t;
extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
#define _CCP1M0 0x01
#define _CCP1M1 0x02
#define _CCP1M2 0x04
#define _CCP1M3 0x08
#define _DC1B0 0x10
#define _DC1B1 0x20
#define _P1M0 0x40
#define _P1M1 0x80
extern __at(0x0FBE) __sfr CCPR1;
extern __at(0x0FBE) __sfr CCPR1L;
extern __at(0x0FBF) __sfr CCPR1H;
// ADCON2 Bits
extern __at(0x0FC0) __sfr ADCON2;
typedef union
{
struct
{
unsigned ADCS0 : 1;
unsigned ADCS1 : 1;
unsigned ADCS2 : 1;
unsigned ACQT0 : 1;
unsigned ACQT1 : 1;
unsigned ACQT2 : 1;
unsigned : 1;
unsigned ADFM : 1;
};
struct
{
unsigned ADCS : 3;
unsigned : 5;
};
struct
{
unsigned : 3;
unsigned ACQT : 3;
unsigned : 2;
};
} __ADCON2bits_t;
extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
#define _ADCS0 0x01
#define _ADCS1 0x02
#define _ADCS2 0x04
#define _ACQT0 0x08
#define _ACQT1 0x10
#define _ACQT2 0x20
#define _ADFM 0x80
// ADCON1 Bits
extern __at(0x0FC1) __sfr ADCON1;
typedef union
{
struct
{
unsigned NVCFG0 : 1;
unsigned NVCFG1 : 1;
unsigned PVCFG0 : 1;
unsigned PVCFG1 : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned TRIGSEL : 1;
};
struct
{
unsigned NVCFG : 2;
unsigned : 6;
};
struct
{
unsigned : 2;
unsigned PVCFG : 2;
unsigned : 4;
};
} __ADCON1bits_t;
extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
#define _NVCFG0 0x01
#define _NVCFG1 0x02
#define _PVCFG0 0x04
#define _PVCFG1 0x08
#define _TRIGSEL 0x80
// ADCON0 Bits
extern __at(0x0FC2) __sfr ADCON0;
typedef union
{
struct
{
unsigned ADON : 1;
unsigned GO_NOT_DONE : 1;
unsigned CHS0 : 1;
unsigned CHS1 : 1;
unsigned CHS2 : 1;
unsigned CHS3 : 1;
unsigned CHS4 : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned GO : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned NOT_DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned GO_DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 2;
unsigned CHS : 5;
unsigned : 1;
};
} __ADCON0bits_t;
extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
#define _ADON 0x01
#define _GO_NOT_DONE 0x02
#define _GO 0x02
#define _DONE 0x02
#define _NOT_DONE 0x02
#define _GO_DONE 0x02
#define _CHS0 0x04
#define _CHS1 0x08
#define _CHS2 0x10
#define _CHS3 0x20
#define _CHS4 0x40
extern __at(0x0FC3) __sfr ADRES;
extern __at(0x0FC3) __sfr ADRESL;
extern __at(0x0FC4) __sfr ADRESH;
// SSP1CON2 Bits
extern __at(0x0FC5) __sfr SSP1CON2;
typedef struct
{
unsigned SEN : 1;
unsigned RSEN : 1;
unsigned PEN : 1;
unsigned RCEN : 1;
unsigned ACKEN : 1;
unsigned ACKDT : 1;
unsigned ACKSTAT : 1;
unsigned GCEN : 1;
} __SSP1CON2bits_t;
extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
#define _SEN 0x01
#define _RSEN 0x02
#define _PEN 0x04
#define _RCEN 0x08
#define _ACKEN 0x10
#define _ACKDT 0x20
#define _ACKSTAT 0x40
#define _GCEN 0x80
// SSPCON2 Bits
extern __at(0x0FC5) __sfr SSPCON2;
typedef struct
{
unsigned SEN : 1;
unsigned RSEN : 1;
unsigned PEN : 1;
unsigned RCEN : 1;
unsigned ACKEN : 1;
unsigned ACKDT : 1;
unsigned ACKSTAT : 1;
unsigned GCEN : 1;
} __SSPCON2bits_t;
extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
#define _SSPCON2_SEN 0x01
#define _SSPCON2_RSEN 0x02
#define _SSPCON2_PEN 0x04
#define _SSPCON2_RCEN 0x08
#define _SSPCON2_ACKEN 0x10
#define _SSPCON2_ACKDT 0x20
#define _SSPCON2_ACKSTAT 0x40
#define _SSPCON2_GCEN 0x80
// SSP1CON1 Bits
extern __at(0x0FC6) __sfr SSP1CON1;
typedef union
{
struct
{
unsigned SSPM0 : 1;
unsigned SSPM1 : 1;
unsigned SSPM2 : 1;
unsigned SSPM3 : 1;
unsigned CKP : 1;
unsigned SSPEN : 1;
unsigned SSPOV : 1;
unsigned WCOL : 1;
};
struct
{
unsigned SSPM : 4;
unsigned : 4;
};
} __SSP1CON1bits_t;
extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
#define _SSPM0 0x01
#define _SSPM1 0x02
#define _SSPM2 0x04
#define _SSPM3 0x08
#define _CKP 0x10
#define _SSPEN 0x20
#define _SSPOV 0x40
#define _WCOL 0x80
// SSPCON1 Bits
extern __at(0x0FC6) __sfr SSPCON1;
typedef union
{
struct
{
unsigned SSPM0 : 1;
unsigned SSPM1 : 1;
unsigned SSPM2 : 1;
unsigned SSPM3 : 1;
unsigned CKP : 1;
unsigned SSPEN : 1;
unsigned SSPOV : 1;
unsigned WCOL : 1;
};
struct
{
unsigned SSPM : 4;
unsigned : 4;
};
} __SSPCON1bits_t;
extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
#define _SSPCON1_SSPM0 0x01
#define _SSPCON1_SSPM1 0x02
#define _SSPCON1_SSPM2 0x04
#define _SSPCON1_SSPM3 0x08
#define _SSPCON1_CKP 0x10
#define _SSPCON1_SSPEN 0x20
#define _SSPCON1_SSPOV 0x40
#define _SSPCON1_WCOL 0x80
// SSP1STAT Bits
extern __at(0x0FC7) __sfr SSP1STAT;
typedef union
{
struct
{
unsigned BF : 1;
unsigned UA : 1;
unsigned R_NOT_W : 1;
unsigned S : 1;
unsigned P : 1;
unsigned D_NOT_A : 1;
unsigned CKE : 1;
unsigned SMP : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R : 1;
unsigned : 1;
unsigned : 1;
unsigned D : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_W : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R_W : 1;
unsigned : 1;
unsigned : 1;
unsigned D_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_WRITE : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_ADDRESS : 1;
unsigned : 1;
unsigned : 1;
};
} __SSP1STATbits_t;
extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
#define _BF 0x01
#define _UA 0x02
#define _R_NOT_W 0x04
#define _R 0x04
#define _NOT_W 0x04
#define _R_W 0x04
#define _NOT_WRITE 0x04
#define _S 0x08
#define _P 0x10
#define _D_NOT_A 0x20
#define _D 0x20
#define _NOT_A 0x20
#define _D_A 0x20
#define _NOT_ADDRESS 0x20
#define _CKE 0x40
#define _SMP 0x80
// SSPSTAT Bits
extern __at(0x0FC7) __sfr SSPSTAT;
typedef union
{
struct
{
unsigned BF : 1;
unsigned UA : 1;
unsigned R_NOT_W : 1;
unsigned S : 1;
unsigned P : 1;
unsigned D_NOT_A : 1;
unsigned CKE : 1;
unsigned SMP : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R : 1;
unsigned : 1;
unsigned : 1;
unsigned D : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_W : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned R_W : 1;
unsigned : 1;
unsigned : 1;
unsigned D_A : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned NOT_WRITE : 1;
unsigned : 1;
unsigned : 1;
unsigned NOT_ADDRESS : 1;
unsigned : 1;
unsigned : 1;
};
} __SSPSTATbits_t;
extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
#define _SSPSTAT_BF 0x01
#define _SSPSTAT_UA 0x02
#define _SSPSTAT_R_NOT_W 0x04
#define _SSPSTAT_R 0x04
#define _SSPSTAT_NOT_W 0x04
#define _SSPSTAT_R_W 0x04
#define _SSPSTAT_NOT_WRITE 0x04
#define _SSPSTAT_S 0x08
#define _SSPSTAT_P 0x10
#define _SSPSTAT_D_NOT_A 0x20
#define _SSPSTAT_D 0x20
#define _SSPSTAT_NOT_A 0x20
#define _SSPSTAT_D_A 0x20
#define <API key> 0x20
#define _SSPSTAT_CKE 0x40
#define _SSPSTAT_SMP 0x80
extern __at(0x0FC8) __sfr SSP1ADD;
extern __at(0x0FC8) __sfr SSPADD;
extern __at(0x0FC9) __sfr SSP1BUF;
extern __at(0x0FC9) __sfr SSPBUF;
// SSP1MSK Bits
extern __at(0x0FCA) __sfr SSP1MSK;
typedef struct
{
unsigned MSK0 : 1;
unsigned MSK1 : 1;
unsigned MSK2 : 1;
unsigned MSK3 : 1;
unsigned MSK4 : 1;
unsigned MSK5 : 1;
unsigned MSK6 : 1;
unsigned MSK7 : 1;
} __SSP1MSKbits_t;
extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
#define _MSK0 0x01
#define _MSK1 0x02
#define _MSK2 0x04
#define _MSK3 0x08
#define _MSK4 0x10
#define _MSK5 0x20
#define _MSK6 0x40
#define _MSK7 0x80
// SSPMSK Bits
extern __at(0x0FCA) __sfr SSPMSK;
typedef struct
{
unsigned MSK0 : 1;
unsigned MSK1 : 1;
unsigned MSK2 : 1;
unsigned MSK3 : 1;
unsigned MSK4 : 1;
unsigned MSK5 : 1;
unsigned MSK6 : 1;
unsigned MSK7 : 1;
} __SSPMSKbits_t;
extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
#define _SSPMSK_MSK0 0x01
#define _SSPMSK_MSK1 0x02
#define _SSPMSK_MSK2 0x04
#define _SSPMSK_MSK3 0x08
#define _SSPMSK_MSK4 0x10
#define _SSPMSK_MSK5 0x20
#define _SSPMSK_MSK6 0x40
#define _SSPMSK_MSK7 0x80
// SSP1CON3 Bits
extern __at(0x0FCB) __sfr SSP1CON3;
typedef struct
{
unsigned DHEN : 1;
unsigned AHEN : 1;
unsigned SBCDE : 1;
unsigned SDAHT : 1;
unsigned BOEN : 1;
unsigned SCIE : 1;
unsigned PCIE : 1;
unsigned ACKTIM : 1;
} __SSP1CON3bits_t;
extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
#define _DHEN 0x01
#define _AHEN 0x02
#define _SBCDE 0x04
#define _SDAHT 0x08
#define _BOEN 0x10
#define _SCIE 0x20
#define _PCIE 0x40
#define _ACKTIM 0x80
// SSPCON3 Bits
extern __at(0x0FCB) __sfr SSPCON3;
typedef struct
{
unsigned DHEN : 1;
unsigned AHEN : 1;
unsigned SBCDE : 1;
unsigned SDAHT : 1;
unsigned BOEN : 1;
unsigned SCIE : 1;
unsigned PCIE : 1;
unsigned ACKTIM : 1;
} __SSPCON3bits_t;
extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
#define _SSPCON3_DHEN 0x01
#define _SSPCON3_AHEN 0x02
#define _SSPCON3_SBCDE 0x04
#define _SSPCON3_SDAHT 0x08
#define _SSPCON3_BOEN 0x10
#define _SSPCON3_SCIE 0x20
#define _SSPCON3_PCIE 0x40
#define _SSPCON3_ACKTIM 0x80
// T1GCON Bits
extern __at(0x0FCC) __sfr T1GCON;
typedef union
{
struct
{
unsigned T1GSS0 : 1;
unsigned T1GSS1 : 1;
unsigned T1GVAL : 1;
unsigned T1GGO_NOT_DONE : 1;
unsigned T1GSPM : 1;
unsigned T1GTM : 1;
unsigned T1GPOL : 1;
unsigned TMR1GE : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T1G_DONE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned T1GGO : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned T1GSS : 2;
unsigned : 6;
};
} __T1GCONbits_t;
extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
#define _T1GSS0 0x01
#define _T1GSS1 0x02
#define _T1GVAL 0x04
#define _T1GGO_NOT_DONE 0x08
#define _T1G_DONE 0x08
#define _T1GGO 0x08
#define _T1GSPM 0x10
#define _T1GTM 0x20
#define _T1GPOL 0x40
#define _TMR1GE 0x80
// T1CON Bits
extern __at(0x0FCD) __sfr T1CON;
typedef union
{
struct
{
unsigned TMR1ON : 1;
unsigned T1RD16 : 1;
unsigned NOT_T1SYNC : 1;
unsigned T1SOSCEN : 1;
unsigned T1CKPS0 : 1;
unsigned T1CKPS1 : 1;
unsigned TMR1CS0 : 1;
unsigned TMR1CS1 : 1;
};
struct
{
unsigned : 1;
unsigned RD16 : 1;
unsigned T1SYNC : 1;
unsigned T1OSCEN : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned : 4;
unsigned T1CKPS : 2;
unsigned : 2;
};
struct
{
unsigned : 6;
unsigned TMR1CS : 2;
};
} __T1CONbits_t;
extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
#define _TMR1ON 0x01
#define _T1RD16 0x02
#define _RD16 0x02
#define _NOT_T1SYNC 0x04
#define _T1SYNC 0x04
#define _T1SOSCEN 0x08
#define _T1OSCEN 0x08
#define _T1CKPS0 0x10
#define _T1CKPS1 0x20
#define _TMR1CS0 0x40
#define _TMR1CS1 0x80
extern __at(0x0FCE) __sfr TMR1;
extern __at(0x0FCE) __sfr TMR1L;
extern __at(0x0FCF) __sfr TMR1H;
// RCON Bits
extern __at(0x0FD0) __sfr RCON;
typedef union
{
struct
{
unsigned NOT_BOR : 1;
unsigned NOT_POR : 1;
unsigned NOT_PD : 1;
unsigned NOT_TO : 1;
unsigned NOT_RI : 1;
unsigned : 1;
unsigned SBOREN : 1;
unsigned IPEN : 1;
};
struct
{
unsigned BOR : 1;
unsigned POR : 1;
unsigned PD : 1;
unsigned TO : 1;
unsigned RI : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __RCONbits_t;
extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
#define _NOT_BOR 0x01
#define _BOR 0x01
#define _NOT_POR 0x02
#define _POR 0x02
#define _NOT_PD 0x04
#define _PD 0x04
#define _NOT_TO 0x08
#define _TO 0x08
#define _NOT_RI 0x10
#define _RI 0x10
#define _SBOREN 0x40
#define _IPEN 0x80
// WDTCON Bits
extern __at(0x0FD1) __sfr WDTCON;
typedef union
{
struct
{
unsigned SWDTEN : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned SWDTE : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
} __WDTCONbits_t;
extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
#define _SWDTEN 0x01
#define _SWDTE 0x01
// OSCCON2 Bits
extern __at(0x0FD2) __sfr OSCCON2;
typedef struct
{
unsigned LFIOFS : 1;
unsigned MFIOFS : 1;
unsigned PRISD : 1;
unsigned SOSCGO : 1;
unsigned MFIOSEL : 1;
unsigned : 1;
unsigned SOSCRUN : 1;
unsigned PLLRDY : 1;
} __OSCCON2bits_t;
extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
#define _LFIOFS 0x01
#define _MFIOFS 0x02
#define _PRISD 0x04
#define _SOSCGO 0x08
#define _MFIOSEL 0x10
#define _SOSCRUN 0x40
#define _PLLRDY 0x80
// OSCCON Bits
extern __at(0x0FD3) __sfr OSCCON;
typedef union
{
struct
{
unsigned SCS0 : 1;
unsigned SCS1 : 1;
unsigned HFIOFS : 1;
unsigned OSTS : 1;
unsigned IRCF0 : 1;
unsigned IRCF1 : 1;
unsigned IRCF2 : 1;
unsigned IDLEN : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned IOFS : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct
{
unsigned SCS : 2;
unsigned : 6;
};
struct
{
unsigned : 4;
unsigned IRCF : 3;
unsigned : 1;
};
} __OSCCONbits_t;
extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
#define _SCS0 0x01
#define _SCS1 0x02
#define _HFIOFS 0x04
#define _IOFS 0x04
#define _OSTS 0x08
#define _IRCF0 0x10
#define _IRCF1 0x20
#define _IRCF2 0x40
#define _IDLEN 0x80
// T0CON Bits
extern __at(0x0FD5) __sfr T0CON;
typedef union
{
struct
{
unsigned T0PS0 : 1;
unsigned T0PS1 : 1;
unsigned T0PS2 : 1;
unsigned PSA : 1;
unsigned T0SE : 1;
unsigned T0CS : 1;
unsigned T08BIT : 1;
unsigned TMR0ON : 1;
};
struct
{
unsigned T0PS : 3;
unsigned : 5;
};
} __T0CONbits_t;
extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
#define _T0PS0 0x01
#define _T0PS1 0x02
#define _T0PS2 0x04
#define _PSA 0x08
#define _T0SE 0x10
#define _T0CS 0x20
#define _T08BIT 0x40
#define _TMR0ON 0x80
extern __at(0x0FD6) __sfr TMR0;
extern __at(0x0FD6) __sfr TMR0L;
extern __at(0x0FD7) __sfr TMR0H;
// STATUS Bits
extern __at(0x0FD8) __sfr STATUS;
typedef struct
{
unsigned C : 1;
unsigned DC : 1;
unsigned Z : 1;
unsigned OV : 1;
unsigned N : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
} __STATUSbits_t;
extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
#define _C 0x01
#define _DC 0x02
#define _Z 0x04
#define _OV 0x08
#define _N 0x10
extern __at(0x0FD9) __sfr FSR2L;
extern __at(0x0FDA) __sfr FSR2H;
extern __at(0x0FDB) __sfr PLUSW2;
extern __at(0x0FDC) __sfr PREINC2;
extern __at(0x0FDD) __sfr POSTDEC2;
extern __at(0x0FDE) __sfr POSTINC2;
extern __at(0x0FDF) __sfr INDF2;
extern __at(0x0FE0) __sfr BSR;
extern __at(0x0FE1) __sfr FSR1L;
extern __at(0x0FE2) __sfr FSR1H;
extern __at(0x0FE3) __sfr PLUSW1;
extern __at(0x0FE4) __sfr PREINC1;
extern __at(0x0FE5) __sfr POSTDEC1;
extern __at(0x0FE6) __sfr POSTINC1;
extern __at(0x0FE7) __sfr INDF1;
extern __at(0x0FE8) __sfr WREG;
extern __at(0x0FE9) __sfr FSR0L;
extern __at(0x0FEA) __sfr FSR0H;
extern __at(0x0FEB) __sfr PLUSW0;
extern __at(0x0FEC) __sfr PREINC0;
extern __at(0x0FED) __sfr POSTDEC0;
extern __at(0x0FEE) __sfr POSTINC0;
extern __at(0x0FEF) __sfr INDF0;
// INTCON3 Bits
extern __at(0x0FF0) __sfr INTCON3;
typedef union
{
struct
{
unsigned INT1IF : 1;
unsigned INT2IF : 1;
unsigned : 1;
unsigned INT1IE : 1;
unsigned INT2IE : 1;
unsigned : 1;
unsigned INT1IP : 1;
unsigned INT2IP : 1;
};
struct
{
unsigned INT1F : 1;
unsigned INT2F : 1;
unsigned : 1;
unsigned INT1E : 1;
unsigned INT2E : 1;
unsigned : 1;
unsigned INT1P : 1;
unsigned INT2P : 1;
};
} __INTCON3bits_t;
extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
#define _INT1IF 0x01
#define _INT1F 0x01
#define _INT2IF 0x02
#define _INT2F 0x02
#define _INT1IE 0x08
#define _INT1E 0x08
#define _INT2IE 0x10
#define _INT2E 0x10
#define _INT1IP 0x40
#define _INT1P 0x40
#define _INT2IP 0x80
#define _INT2P 0x80
// INTCON2 Bits
extern __at(0x0FF1) __sfr INTCON2;
typedef union
{
struct
{
unsigned RBIP : 1;
unsigned : 1;
unsigned TMR0IP : 1;
unsigned : 1;
unsigned INTEDG2 : 1;
unsigned INTEDG1 : 1;
unsigned INTEDG0 : 1;
unsigned NOT_RBPU : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned RBPU : 1;
};
} __INTCON2bits_t;
extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
#define _RBIP 0x01
#define _TMR0IP 0x04
#define _INTEDG2 0x10
#define _INTEDG1 0x20
#define _INTEDG0 0x40
#define _NOT_RBPU 0x80
#define _RBPU 0x80
// INTCON Bits
extern __at(0x0FF2) __sfr INTCON;
typedef union
{
struct
{
unsigned RBIF : 1;
unsigned INT0IF : 1;
unsigned TMR0IF : 1;
unsigned RBIE : 1;
unsigned INT0IE : 1;
unsigned TMR0IE : 1;
unsigned PEIE_GIEL : 1;
unsigned GIE_GIEH : 1;
};
struct
{
unsigned : 1;
unsigned INT0F : 1;
unsigned T0IF : 1;
unsigned : 1;
unsigned INT0E : 1;
unsigned T0IE : 1;
unsigned PEIE : 1;
unsigned GIE : 1;
};
struct
{
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned : 1;
unsigned GIEL : 1;
unsigned GIEH : 1;
};
} __INTCONbits_t;
extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
#define _RBIF 0x01
#define _INT0IF 0x02
#define _INT0F 0x02
#define _TMR0IF 0x04
#define _T0IF 0x04
#define _RBIE 0x08
#define _INT0IE 0x10
#define _INT0E 0x10
#define _TMR0IE 0x20
#define _T0IE 0x20
#define _PEIE_GIEL 0x40
#define _PEIE 0x40
#define _GIEL 0x40
#define _GIE_GIEH 0x80
#define _GIE 0x80
#define _GIEH 0x80
extern __at(0x0FF3) __sfr PROD;
extern __at(0x0FF3) __sfr PRODL;
extern __at(0x0FF4) __sfr PRODH;
extern __at(0x0FF5) __sfr TABLAT;
extern __at(0x0FF6) __sfr TBLPTR;
extern __at(0x0FF6) __sfr TBLPTRL;
extern __at(0x0FF7) __sfr TBLPTRH;
extern __at(0x0FF8) __sfr TBLPTRU;
extern __at(0x0FF9) __sfr PC;
extern __at(0x0FF9) __sfr PCL;
extern __at(0x0FFA) __sfr PCLATH;
extern __at(0x0FFB) __sfr PCLATU;
// STKPTR Bits
extern __at(0x0FFC) __sfr STKPTR;
typedef union
{
struct
{
unsigned STKPTR0 : 1;
unsigned STKPTR1 : 1;
unsigned STKPTR2 : 1;
unsigned STKPTR3 : 1;
unsigned STKPTR4 : 1;
unsigned : 1;
unsigned STKUNF : 1;
unsigned STKFUL : 1;
};
struct
{
unsigned SP0 : 1;
unsigned SP1 : 1;
unsigned SP2 : 1;
unsigned SP3 : 1;
unsigned SP4 : 1;
unsigned : 1;
unsigned : 1;
unsigned STKOVF : 1;
};
struct
{
unsigned STKPTR : 5;
unsigned : 3;
};
struct
{
unsigned SP : 5;
unsigned : 3;
};
} __STKPTRbits_t;
extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
#define _STKPTR0 0x01
#define _SP0 0x01
#define _STKPTR1 0x02
#define _SP1 0x02
#define _STKPTR2 0x04
#define _SP2 0x04
#define _STKPTR3 0x08
#define _SP3 0x08
#define _STKPTR4 0x10
#define _SP4 0x10
#define _STKUNF 0x40
#define _STKFUL 0x80
#define _STKOVF 0x80
extern __at(0x0FFD) __sfr TOS;
extern __at(0x0FFD) __sfr TOSL;
extern __at(0x0FFE) __sfr TOSH;
extern __at(0x0FFF) __sfr TOSU;
// Configuration Bits
#define __CONFIG1H 0x300001
#define __CONFIG2L 0x300002
#define __CONFIG2H 0x300003
#define __CONFIG3H 0x300005
#define __CONFIG4L 0x300006
#define __CONFIG5L 0x300008
#define __CONFIG5H 0x300009
#define __CONFIG6L 0x30000A
#define __CONFIG6H 0x30000B
#define __CONFIG7L 0x30000C
#define __CONFIG7H 0x30000D
#define _FOSC_LP_1H 0xF0 // LP oscillator.
#define _FOSC_XT_1H 0xF1 // XT oscillator.
#define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
#define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
#define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
#define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
#define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
#define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
#define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
#define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
#define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
#define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
#define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
#define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
#define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
#define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
#define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
#define _PRICLKEN_ON_1H 0xFF // Primary clock is always enabled.
#define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
#define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
#define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
#define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
#define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
#define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
#define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
#define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
#define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
#define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
#define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
#define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
#define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
#define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
#define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
#define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
#define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
#define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
#define _WDTPS_1_2H 0xC3
#define _WDTPS_2_2H 0xC7
#define _WDTPS_4_2H 0xCB
#define _WDTPS_8_2H 0xCF
#define _WDTPS_16_2H 0xD3 // 1:16.
#define _WDTPS_32_2H 0xD7 // 1:32.
#define _WDTPS_64_2H 0xDB // 1:64.
#define _WDTPS_128_2H 0xDF // 1:128.
#define _WDTPS_256_2H 0xE3 // 1:256.
#define _WDTPS_512_2H 0xE7 // 1:512.
#define _WDTPS_1024_2H 0xEB // 1:1024.
#define _WDTPS_2048_2H 0xEF // 1:2048.
#define _WDTPS_4096_2H 0xF3 // 1:4096.
#define _WDTPS_8192_2H 0xF7 // 1:8192.
#define _WDTPS_16384_2H 0xFB // 1:16384.
#define _WDTPS_32768_2H 0xFF // 1:32768.
#define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
#define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
#define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
#define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
#define _CCP3MX_PORTE0_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RE0.
#define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
#define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
#define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
#define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
#define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
#define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
#define _P2BMX_PORTD2_3H 0xFF // P2B is on RD2.
#define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
#define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
#define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
#define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
#define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
#define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
#define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
#define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
#define _DEBUG_ON_4L 0x7F // Enabled.
#define _DEBUG_OFF_4L 0xFF // Disabled.
#define _CP0_ON_5L 0xFE // Block 0 (000200-000FFFh) code-protected.
#define _CP0_OFF_5L 0xFF // Block 0 (000200-000FFFh) not code-protected.
#define _CP1_ON_5L 0xFD // Block 1 (001000-001FFFh) code-protected.
#define _CP1_OFF_5L 0xFF // Block 1 (001000-001FFFh) not code-protected.
#define _CPB_ON_5H 0xBF // Boot block (000000-0001FFh) code-protected.
#define _CPB_OFF_5H 0xFF // Boot block (000000-0001FFh) not code-protected.
#define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
#define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
#define _WRT0_ON_6L 0xFE // Block 0 (000200-000FFFh) write-protected.
#define _WRT0_OFF_6L 0xFF // Block 0 (000200-000FFFh) not write-protected.
#define _WRT1_ON_6L 0xFD // Block 1 (001000-001FFFh) write-protected.
#define _WRT1_OFF_6L 0xFF // Block 1 (001000-001FFFh) not write-protected.
#define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
#define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
#define _WRTB_ON_6H 0xBF // Boot Block (000000-0001FFh) write-protected.
#define _WRTB_OFF_6H 0xFF // Boot Block (000000-0001FFh) not write-protected.
#define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
#define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
#define _EBTR0_ON_7L 0xFE // Block 0 (000200-000FFFh) protected from table reads executed in other blocks.
#define _EBTR0_OFF_7L 0xFF // Block 0 (000200-000FFFh) not protected from table reads executed in other blocks.
#define _EBTR1_ON_7L 0xFD // Block 1 (001000-001FFFh) protected from table reads executed in other blocks.
#define _EBTR1_OFF_7L 0xFF // Block 1 (001000-001FFFh) not protected from table reads executed in other blocks.
#define _EBTRB_ON_7H 0xBF // Boot Block (000000-0001FFh) protected from table reads executed in other blocks.
#define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks.
#define __DEVID1 0x3FFFFE
#define __DEVID2 0x3FFFFF
#define __IDLOC0 0x200000
#define __IDLOC1 0x200001
#define __IDLOC2 0x200002
#define __IDLOC3 0x200003
#define __IDLOC4 0x200004
#define __IDLOC5 0x200005
#define __IDLOC6 0x200006
#define __IDLOC7 0x200007
#endif // #ifndef __PIC18F43K22_H__
|
import os
import subprocess
import time
import logging
from autotest.client import utils
from autotest.client.shared import error, utils_cgroup
class MemoryLimit(object):
"""
Test memory sub system.
Use it to control memory resource.
1. Clear all cgroups and init modules and parent cgroup.
2. Create 2 sub cgroups.
3. Set property values into desired cgroup.
4. Apply for memory and get process id.
5. Classify pid to each cgroup and get memory information
6. Confirm result.
7. Recover environment.
"""
def __init__(self, cgroup_dir=None, tmpdir="/tmp", bindir="/tmp"):
"""
Get cgroup default mountdir
"""
self.cgroup_dir = cgroup_dir
self.tmpdir = tmpdir
self.bindir = bindir
def test(self):
"""
Start testing
"""
controller_name = 'memory'
controller_list = [controller_name]
cgroup_name1 = "test1"
cgroup_name2 = "test2"
memory_use = 60
test_memory1 = memory_use + 10
test_memory2 = memory_use - 10
property_values1 = {'memory.<API key>': '1',
'memory.limit_in_bytes': '%dM' % test_memory1,
'memory.memsw.limit_in_bytes': '%dM' % test_memory1,
'memory.swappiness': '0'}
property_values2 = {'memory.<API key>': '1',
'memory.limit_in_bytes': '%dM' % test_memory2,
'memory.memsw.limit_in_bytes': '%dM' % test_memory2,
'memory.swappiness': '0'}
get_property_list = ['memory.limit_in_bytes',
'memory.max_usage_in_bytes',
'memory.memsw.usage_in_bytes',
'memory.memsw.max_usage_in_bytes']
memory_file = os.path.join(self.bindir, "memory_use.c")
binary_file = os.path.join(self.tmpdir, "memory_use.o")
def get_property_dict(cgroup_index, get_property_list):
"""
Get all property value in desired cgroup
@param: cgroup_index: Desired cgroup index
@param: get_property_list: Property list
@return property dict:{property1:value1, property2,value2}
"""
output_property_dic = {}
for pro in get_property_list:
output = cgroup.get_property(pro, cgroup_index)
output_property_dic[pro] = output[0]
return output_property_dic
try:
# Apply for memory
pid = execute_stresser(memory_use, memory_file, binary_file)
utils_cgroup.all_cgroup_delete()
modules = utils_cgroup.CgroupModules(self.cgroup_dir)
modules.init(controller_list)
cgroup = utils_cgroup.Cgroup(controller_name, None)
cgroup.initialize(modules)
cgroup.<API key>()
# Create cgroup
cgroup_index1 = cgroup.mk_cgroup(cgroup=cgroup_name1)
cgroup_index2 = cgroup.mk_cgroup(cgroup=cgroup_name2)
# Set property value
# 'memory.limit_in_bytes' must be set first, if not,
# 'memory.memsw.limit_in_bytes' will fail
_pro = 'memory.limit_in_bytes'
cgroup.cgset_property(_pro, property_values1.get(_pro),
cgroup_index1, check=False)
for property, value in property_values1.iteritems():
cgroup.cgset_property(property, value,
cgroup_index1, check=False)
cgroup.cgset_property(_pro, property_values2.get(_pro),
cgroup_index2, check=False)
for property, value in property_values2.iteritems():
cgroup.cgset_property(property, value,
cgroup_index2, check=False)
# Classify pid to cgroup_name1
cgroup.cgclassify_cgroup(pid, cgroup_name1)
# Apply enough time to get memory use
time.sleep(3)
all_property_dict = {}
property_dict1 = get_property_dict(cgroup_index1,
get_property_list)
all_property_dict[cgroup_name1] = property_dict1
# Kill process to free memory
if os.path.exists("/proc/%d/stat" % pid):
logging.debug("Kill process %d to free memory" % pid)
os.kill(pid, 9)
pid = execute_stresser(memory_use, memory_file, binary_file)
# Classify pid to cgroup_name2
cgroup.cgclassify_cgroup(pid, cgroup_name2)
# Apply enough time to get memory use
time.sleep(3)
property_dict2 = get_property_dict(cgroup_index2,
get_property_list)
all_property_dict[cgroup_name2] = property_dict2
if os.path.exists("/proc/%d/stat" % pid):
logging.debug("Kill process %d to free memory" % pid)
os.kill(pid, 0)
# Check output
for sub_pro in all_property_dict:
property_check(all_property_dict.get(sub_pro), memory_use)
finally:
# Recover environment
if "modules" in dir():
del modules
if "pid" in dir():
if os.path.exists("/proc/%d/stat" % pid):
os.kill(pid, 9)
utils_cgroup.cgconfig_restart()
def execute_stresser(memory, memory_file, binary_file):
"""
Make a C file and compile it
@param: memory: used memroy
@param: memory_file: C file to malloce memory
@param: binary_file: binary file
"""
if os.system("%s %s -o %s" % (utils.get_cc(), memory_file, binary_file)):
raise error.TestNAError("Compile C file failed!")
try:
memory_use_cmd = "%s %d" % (binary_file, memory)
process = subprocess.Popen(memory_use_cmd, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
return process.pid
except Exception, err:
raise error.TestNAError("Execute malloc process failed!\n"
"%s", err)
def property_check(property_dict, memory):
"""
Check property value is right or not
@param: property_dict: Checked property dict
@param: memory: Memory process used, for example:10M
"""
logging.debug(property_dict)
memory_limit = int(property_dict.get('memory.limit_in_bytes'))
max_usage = int(property_dict.get('memory.max_usage_in_bytes'))
memsw_usage = int(property_dict.get('memory.memsw.usage_in_bytes'))
memsw_max = int(property_dict.get('memory.memsw.max_usage_in_bytes'))
if (memory * 1024 * 1024) > memory_limit:
# process will be killed in this switch
if max_usage != memory_limit:
raise error.TestFail("max_usage should equal with memory_limit")
if memsw_usage:
raise error.TestFail("memsw_usage should be 0!")
if memsw_max != memory_limit:
raise error.TestFail("memsw_max should equal with memory_limit")
else:
if max_usage / 1024 / 1024 != memory:
raise error.TestFail("max_usage should equal with memory use")
if not memsw_usage:
raise error.TestFail("memsw_usage should not be 0!")
if memsw_max / 1024 / 1024 != memory:
raise error.TestFail("memsw_max should equal with memory use")
def execute(cgroup_cls):
"""
Execute memory test.
:param cgroup_cls: Cgroup class
"""
if cgroup_cls is None:
raise error.TestNAError("Got a none cgroup class")
memory_limit_test = MemoryLimit(cgroup_cls._cgroup_dir, cgroup_cls.tmpdir,
cgroup_cls.bindir)
memory_limit_test.test()
|
#include <stdio.h>
#include <rsf.h>
#include "spray.h"
int main(void) {
double dot1[2], dot2[2];
int n=20, ns=3, ns2;
ns2 = spray_init(ns);
sf_dot_test(spray_lop, n, n*ns2, dot1, dot2);
printf ("%12.8f ? %12.8f\n",dot1[0],dot1[1]);
printf ("%12.8f ? %12.8f\n",dot2[0],dot2[1]);
exit(0);
}
|
<?php
/**
* This file displays page with no sidebar.
*
*/
?>
<?php
/**
* <API key>
*
* <API key> PRIORITY
*
* <API key> 10
*/
do_action( '<API key>' );
/**
* <API key>
*
* <API key> PRIORITY
*
* travelify_theloop 10
*/
do_action( '<API key>' );
/**
* <API key>
*
* <API key> PRIORITY
*
* <API key> 5
* <API key> 10
*/
do_action( '<API key>' );
?>
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<table cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top">
<img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200">
</td>
<td valign="top" align="right">
<a href="http:
<img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0">
</a>
</td>
</tr>
</tbody>
</table>
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceboost.html">boost</a></li><li class="navelem"><a class="el" href="<API key>.html">geometry</a></li><li class="navelem"><a class="el" href="<API key>.html">resolve_variant</a></li><li class="navelem"><a class="el" href="<API key>.html">is_simple</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">boost::geometry::resolve_variant::is_simple< Geometry > Member List</div> </div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="<API key>.html">boost::geometry::resolve_variant::is_simple< Geometry ></a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">apply</a>(Geometry const &geometry)</td><td class="entry"><a class="el" href="<API key>.html">boost::geometry::resolve_variant::is_simple< Geometry ></a></td><td class="entry"><span class="mlabel">static</span></td></tr>
</table></div><!-- contents -->
<hr size="1">
<table width="100%">
<tbody>
<tr>
<td align="left"><small>
<p>April 2, 2011</p>
</small></td>
<td align="right">
<small>
Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands<br>
Copyright © 2008-2011 Bruno Lalande, Paris, France<br>
Copyright © 2009-2010 Mateusz Loskot, London, UK<br>
</small>
</td>
</tr>
</tbody>
</table>
<address style="text-align: right;"><small>
Documentation is generated by <a href="http:
</small></address>
</body>
</html>
|
//This code is part of a larger project whose main purpose is to entretain either //
//by working on it and helping it be better or by playing it in it's actual state //
// This program is free software; you can redistribute it and/or modify //
// the Free Software Foundation; either version 2, or (at your option) //
// any later version. //
// This program is distributed in the hope that it will be useful, //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// along with this program; if not, write to the Free Software Foundation, //
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //
// You can contact us at projectpgz.blogspot.com //
#include "Teleporter.h"
Teleporter::Teleporter(MapLocation m, int x, int y, Game* g, GameState* gs, int w, int h) : Entity(x, y, g, gs)
{
mask = new MaskBox(x, y, w, h, "teleporter");
//graphic = new Stamp("data/graphics/coltest.png", g->getGfxEngine());
solid = false;
destination = m;
teleportType = STEP;
transitionEffect = FADE;
}
Teleporter::~Teleporter()
{
}
void Teleporter::onCollision(CollisionPair pair, Entity* other)
{
if (((PGZGame*) game)->controller->getState() == Controller::TRANSITION)
return;
if (pair.b == "player")
{
if (teleportType == STEP || teleportType == LEFT || teleportType == RIGHT || teleportType == UP || teleportType == DOWN)
{
((PGZGame*) game)->controller->teleportTo(destination, (Player*) other, transitionEffect, false);
}
else if (teleportType == INSIDE)
{
if (isInside(other->mask))
{
((PGZGame*) game)->controller->teleportTo(destination, (Player*) other, transitionEffect, false);
}
}
}
}
void Teleporter::setTeleportType(TeleportType type)
{
teleportType = type;
if (type == LEFT)
{
mask->xoffset = 0;
mask->yoffset = 0;
mask->width = 2;
mask->height = 16;
}
else if (type == RIGHT)
{
mask->xoffset = 14;
mask->yoffset = 0;
mask->width = 2;
mask->height = 16;
}
else if (type == UP)
{
mask->xoffset = 0;
mask->yoffset = 0;
mask->width = 16;
mask->height = 2;
}
else if (type == DOWN)
{
mask->xoffset = 0;
mask->yoffset = 14;
mask->width = 16;
mask->height = 2;
}
else if (type == DUNGEONFINAL)
{
graphic = new Stamp("data/basic-gfx/teleport.png", game->getGfxEngine());
teleportType = INSIDE;
}
}
void Teleporter::setTransition(TransitionEffect te)
{
transitionEffect = te;
}
bool Teleporter::isInside(Mask* mask)
{
//Calculamos los vertices superior izquierdo e inferior derecho
int x1 = mask->x + mask->xoffset;
int y1 = mask->y + mask->yoffset;
int x2 = mask->x + mask->xoffset + mask->width;
int y2 = mask->y + mask->yoffset + mask->height;
if ((x1 >= this->mask->x + this->mask->xoffset)
&& (x2 <= this->mask->x + this->mask->xoffset + this->mask->width)
&& (y1 >= this->mask->y + this->mask->yoffset)
&& (y2 <= this->mask->y + this->mask->yoffset + this->mask->height))
return true;
return false;
}
void Teleporter::onRender()
{
if (visible && enabled && mask != NULL)
if (graphic != NULL)
//game->getGfxEngine()->renderRectangle(x+mask->xoffset, mask->yoffset+y, mask->width, mask->height, Color(200, 10, 215));
//else
graphic->render(x, y);
};
|
#include "keyframehandles.h"
#include "mwindow.h"
#include "theme.h"
KeyframeHandle::KeyframeHandle(MWindow *mwindow,
TrackCanvas *trackcanvas,
Track *track,
int64_t position,
int x,
int y)
: CanvasTool(mwindow,
trackcanvas,
0,
x,
y,
0)
{
this->track = track;
this->position = position;
}
KeyframeHandle::~KeyframeHandle()
{
}
int KeyframeHandle::handle_event()
{
return 1;
}
KeyframeHandles::KeyframeHandles(MWindow *mwindow,
TrackCanvas *trackcanvas)
: CanvasTools(mwindow, trackcanvas)
{
}
KeyframeHandles::~KeyframeHandles()
{
}
|
#pragma once
#include <memory>
#include <QWidget>
namespace Ui {
class ConfigureGraphics;
}
class ConfigureGraphics : public QWidget {
Q_OBJECT
public:
explicit ConfigureGraphics(QWidget* parent = nullptr);
~ConfigureGraphics();
void applyConfiguration();
void retranslateUi();
private:
void setConfiguration();
private:
std::unique_ptr<Ui::ConfigureGraphics> ui;
};
|
#ifndef __VIDSTBAPI_H__
#define __VIDSTBAPI_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include "basetype.h"
/* Function return values */
typedef enum VideoStbRet_
{
VIDEOSTB_OK = 0,
VIDEOSTB_ERROR = -1,
<API key> = -2,
<API key> = -3,
<API key> = -4,
VIDEOSTB_EWL_ERROR = -5,
<API key> = -6,
<API key> = -9,
VIDEOSTB_HW_TIMEOUT = -11,
<API key> = -12,
<API key> = -13,
<API key> = -14,
VIDEOSTB_HW_RESET = -16
} VideoStbRet;
/* YUV type for initialization */
typedef enum <API key>
{
<API key> = 0, /* YYYY... UUUU... VVVV */
<API key> = 1, /* YYYY... UVUVUV... */
<API key> = 2, /* YUYVYUYV... */
<API key> = 3, /* UYVYUYVY... */
VIDEOSTB_RGB565 = 4, /* 16-bit RGB */
VIDEOSTB_BGR565 = 5, /* 16-bit RGB */
VIDEOSTB_RGB555 = 6, /* 15-bit RGB */
VIDEOSTB_BGR555 = 7, /* 15-bit RGB */
VIDEOSTB_RGB444 = 8, /* 12-bit RGB */
VIDEOSTB_BGR444 = 9, /* 12-bit RGB */
VIDEOSTB_RGB888 = 10, /* 24-bit RGB */
VIDEOSTB_BGR888 = 11, /* 24-bit RGB */
VIDEOSTB_RGB101010 = 12, /* 30-bit RGB */
VIDEOSTB_BGR101010 = 13 /* 30-bit RGB */
} VideoStbInputFormat;
typedef const void *VideoStbInst;
typedef struct VideoStbParam_
{
u32 inputWidth;
u32 inputHeight;
u32 stride;
u32 stabilizedWidth;
u32 stabilizedHeight;
VideoStbInputFormat format;
} VideoStbParam;
typedef struct VideoStbResult_
{
u32 stabOffsetX;
u32 stabOffsetY;
} VideoStbResult;
/* Version information */
typedef struct
{
u32 major; /* API major version */
u32 minor; /* API minor version */
} VideoStbApiVersion;
typedef struct
{
u32 swBuild; /* Software build ID */
u32 hwBuild; /* Hardware build ID */
} VideoStbBuild;
/* Version information */
VideoStbApiVersion <API key>(void);
VideoStbBuild VideoStbGetBuild(void);
/* Initialization & release */
VideoStbRet VideoStbInit(VideoStbInst * instAddr,
const VideoStbParam * param);
VideoStbRet VideoStbReset(VideoStbInst vidStab,
const VideoStbParam * param);
VideoStbRet VideoStbRelease(VideoStbInst vidStab);
/* Stabilize next image based on the current one */
VideoStbRet VideoStbStabilize(VideoStbInst vidStab, VideoStbResult * result,
u32 referenceFrameLum, u32 stabilizedFameLum);
/* API tracing callback function */
void VideoStb_Trace(const char *str);
#ifdef __cplusplus
}
#endif
#endif /* __VIDSTBAPI_H__ */
|
#media-browser-page fieldset .fieldset-wrapper {
padding-left: 5px;
}
.view-media-default {
margin-right: 0;
border-right: 0;
}
div.form-item-link-text {
margin-left: 10px;
position: relative;
z-index: 2;
}
div.form-item-link-text {
margin-top: 0.3em;
margin-left: 10.5em;
}
div.form-item-link-text label {
float: left;
margin-left: -10em;
}
div.vertical-tabs {
background-position: -120px 0;
margin-top: 2em;
}
div.vertical-tabs:before {
content: 'Link To';
font-weight: bold;
position: relative;
top: -2em;
left: 10px;
}
div.vertical-tabs .vertical-tabs-panes {
margin-left: 130px;
margin-top: -25px
}
.vertical-tabs-pane input[type=submit] {
display: none;
}
div.vertical-tabs .vertical-tabs-list {
width: 120px;
}
.views-exposed-form .<API key> {
margin-bottom: 0;
border: 0;
padding-bottom: 0;
}
.<API key> .form-item {
padding-top: 0;
padding-bottom: 0;
}
.view-content {
padding-top: 0.75em;
border-top: 1px solid lightgray;
margin-top: 0.5em;
}
#<API key> li {
margin-right: 5px;
}
#<API key> {
position: absolute;
top: -2px;
z-index: 5;
height: 40px;
}
#<API key>:after {
content: 'Or';
position: absolute;
top: 1.7em;
left: 115px;
}
#<API key> .form-item-upload {
margin: 0;
}
#<API key> .form-actions {
display: none;
}
#<API key> label[for="edit-upload"] {
display: none;
}
#<API key> .form-help {
position: absolute;
top: 0;
right: 0;
}
#<API key> .description {
position: absolute;
background: white;
padding: 5px;
border: 1px solid lightgray;
border-radius: 5px;
width: 200px;
bottom: -125px;
left: 0;
}
.messages {
float: right;
width: 45%;
}
#<API key> #edit-upload label {
padding: 13px 13px;
}
#<API key> #edit-upload .add-new {
background: #A1D4A1;
border-radius: 5px;
border: 1px solid #8B8;
color: #293552;
}
#<API key> .form-item-upload .form-file {
left: -500px;
}
.<API key> {
margin-left: 150px
}
.insert-buttons {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: white;
border-top: 1px solid lightgray;
text-align: right;
}
.insert-buttons .form-submit {
margin-top: 0.5em;
margin-bottom: 0;
}
#edit-upload .messages {
position: absolute;
width: 300px;
right: -650px;
}
/*
animation for new files added to media browser
*/
@keyframes pulse {
from {
-webkit-transform: scale(1.0, 1.0);
-moz-transform: scale(1.0, 1.0);
-ms-transform: scale(1.0, 1.0);
-o-transform: scale(1.0, 1.0);
transform: scale(1.0, 1.0);
}
to {
-webkit-transform: scale(1.1, 1.1);
-moz-transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
-o-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
}
@-webkit-keyframes pulse {
from {
-webkit-transform: scale(1.0, 1.0);
transform: scale(1.0, 1.0);
}
to {
-webkit-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
}
.media-item-new {
animation-duration: 1s;
animation-name: pulse;
<API key>: infinite;
animation-direction: alternate;
-<API key>: 1s;
-<API key>: pulse;
-<API key>: infinite;
-<API key>: alternate;
}
|
#ifndef THD_CDEV_H
#define THD_CDEV_H
#include "thd_common.h"
#include "thd_sys_fs.h"
#include "thd_preference.h"
#include <time.h>
class cthd_cdev
{
protected:
int index;
int curr_state;
int max_state;
int min_state;
csys_fs cdev_sysfs;
unsigned int trip_point;
std::string type_str;
unsigned int sensor_mask;
time_t last_op_time;
int curr_pow;
int base_pow_state;
int inc_dec_val;
bool auto_down_adjust;
private:
unsigned int int_2_pow(int pow)
{
int i;
int _pow = 1;
for(i = 0; i < pow; ++i)
_pow = _pow * 2;
return _pow;
}
public:
cthd_cdev(unsigned int _index, std::string control_path): index(_index),
cdev_sysfs(control_path.c_str()), trip_point(0), max_state(0), min_state(0),
curr_state(0), sensor_mask(0), last_op_time(0), curr_pow(0), base_pow_state
(0), inc_dec_val(1), auto_down_adjust(false){}
virtual int thd_cdev_set_state(int set_point, int temperature, int state, int arg);
virtual int thd_cdev_get_index()
{
return index;
}
virtual int init()
{
return 0;
};
virtual int control_begin()
{
return 0;
};
virtual int control_end()
{
return 0;
};
virtual void set_curr_state(int state, int arg){}
virtual int get_curr_state()
{
return curr_state;
}
virtual int get_max_state()
{
return 0;
};
virtual int update()
{
return 0;
};
virtual void set_inc_dec_value(int value)
{
inc_dec_val = value;
}
virtual void <API key>(bool value)
{
auto_down_adjust = value;
}
bool in_min_state()
{
if(get_curr_state() <= min_state)
return true;
return false;
}
bool in_max_state()
{
if(get_curr_state() >= get_max_state())
return true;
return false;
}
};
#endif
|
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/asoundef.h>
#include <sound/tlv.h>
#include "hda_codec.h"
#include "hda_local.h"
#include "hda_jack.h"
static bool static_hdmi_pcm;
module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
struct hdmi_spec_per_cvt {
hda_nid_t cvt_nid;
int assigned;
unsigned int channels_min;
unsigned int channels_max;
u32 rates;
u64 formats;
unsigned int maxbps;
};
/* max. connections to a widget */
#define HDA_MAX_CONNECTIONS 32
struct hdmi_spec_per_pin {
hda_nid_t pin_nid;
int num_mux_nids;
hda_nid_t mux_nids[HDA_MAX_CONNECTIONS];
struct hda_codec *codec;
struct hdmi_eld sink_eld;
struct delayed_work work;
struct snd_kcontrol *eld_ctl;
int repoll_count;
bool setup; /* the stream has been set up by prepare callback */
int channels; /* current number of channels */
bool non_pcm;
bool chmap_set; /* channel-map override by ALSA API? */
unsigned char chmap[8]; /* ALSA API channel-map */
char pcm_name[8]; /* filled in build_pcm callbacks */
};
struct hdmi_spec {
int num_cvts;
struct snd_array cvts; /* struct hdmi_spec_per_cvt */
hda_nid_t cvt_nids[4]; /* only for haswell fix */
int num_pins;
struct snd_array pins; /* struct hdmi_spec_per_pin */
struct snd_array pcm_rec; /* struct hda_pcm */
unsigned int channels_max; /* max over all cvts */
struct hdmi_eld temp_eld;
bool dyn_pin_out;
/*
* Non-generic ATI/NVIDIA specific
*/
struct hda_multi_out multiout;
struct hda_pcm_stream pcm_playback;
};
struct <API key> {
u8 type; /* 0x84 */
u8 ver; /* 0x01 */
u8 len; /* 0x0a */
u8 checksum;
u8 CC02_CT47; /* CC in bits 0:2, CT in 4:7 */
u8 SS01_SF24;
u8 CXT04;
u8 CA;
u8 <API key>;
};
struct dp_audio_infoframe {
u8 type; /* 0x84 */
u8 len; /* 0x1b */
u8 ver; /* 0x11 << 2 */
u8 CC02_CT47; /* match with HDMI infoframe from this on */
u8 SS01_SF24;
u8 CXT04;
u8 CA;
u8 <API key>;
};
union audio_infoframe {
struct <API key> hdmi;
struct dp_audio_infoframe dp;
u8 bytes[0];
};
/*
* CEA speaker placement:
*
* FLH FCH FRH
* FLW FL FLC FC FRC FR FRW
*
* LFE
* TC
*
* RL RLC RC RRC RR
*
* The Left/Right Surround channel _notions_ LS/RS in SMPTE 320M corresponds to
* CEA RL/RR; The SMPTE channel _assignment_ C/LFE is swapped to CEA LFE/FC.
*/
enum <API key> {
FL = (1 << 0), /* Front Left */
FC = (1 << 1), /* Front Center */
FR = (1 << 2), /* Front Right */
FLC = (1 << 3), /* Front Left Center */
FRC = (1 << 4), /* Front Right Center */
RL = (1 << 5), /* Rear Left */
RC = (1 << 6), /* Rear Center */
RR = (1 << 7), /* Rear Right */
RLC = (1 << 8), /* Rear Left Center */
RRC = (1 << 9), /* Rear Right Center */
LFE = (1 << 10), /* Low Frequency Effect */
FLW = (1 << 11), /* Front Left Wide */
FRW = (1 << 12), /* Front Right Wide */
FLH = (1 << 13), /* Front Left High */
FCH = (1 << 14), /* Front Center High */
FRH = (1 << 15), /* Front Right High */
TC = (1 << 16), /* Top Center */
};
/*
* ELD SA bits in the CEA Speaker Allocation data block
*/
static int <API key>[] = {
[0] = FL | FR,
[1] = LFE,
[2] = FC,
[3] = RL | RR,
[4] = RC,
[5] = FLC | FRC,
[6] = RLC | RRC,
/* the following are not defined in ELD yet */
[7] = FLW | FRW,
[8] = FLH | FRH,
[9] = TC,
[10] = FCH,
};
struct <API key> {
int ca_index;
int speakers[8];
/* derived values, just for convenience */
int channels;
int spk_mask;
};
/*
* ALSA sequence is:
*
* surround40 surround41 surround50 surround51 surround71
* ch0 front left = = = =
* ch1 front right = = = =
* ch2 rear left = = = =
* ch3 rear right = = = =
* ch4 LFE center center center
* ch5 LFE LFE
* ch6 side left
* ch7 side right
*
* surround71 = {FL, FR, RLC, RRC, FC, LFE, RL, RR}
*/
static int <API key>[0x32][8] = {
/* stereo */
[0x00] = { 0x00, 0x11, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7 },
[0x01] = { 0x00, 0x11, 0x22, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7 },
/* Dolby Surround */
[0x02] = { 0x00, 0x11, 0x23, 0xf2, 0xf4, 0xf5, 0xf6, 0xf7 },
/* surround40 */
[0x08] = { 0x00, 0x11, 0x24, 0x35, 0xf3, 0xf2, 0xf6, 0xf7 },
/* 4ch */
[0x03] = { 0x00, 0x11, 0x23, 0x32, 0x44, 0xf5, 0xf6, 0xf7 },
/* surround41 */
[0x09] = { 0x00, 0x11, 0x24, 0x35, 0x42, 0xf3, 0xf6, 0xf7 },
/* surround50 */
[0x0a] = { 0x00, 0x11, 0x24, 0x35, 0x43, 0xf2, 0xf6, 0xf7 },
/* surround51 */
[0x0b] = { 0x00, 0x11, 0x24, 0x35, 0x43, 0x52, 0xf6, 0xf7 },
[0x13] = { 0x00, 0x11, 0x26, 0x37, 0x43, 0x52, 0x64, 0x75 },
};
/*
* This is an ordered list!
*
* The preceding ones have better chances to be selected by
* <API key>().
*/
static struct <API key> channel_allocations[] = {
/* channel: 7 6 5 4 3 2 1 0 */
{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } },
{ .ca_index = 0x01, .speakers = { 0, 0, 0, 0, 0, LFE, FR, FL } },
/* Dolby Surround */
{ .ca_index = 0x02, .speakers = { 0, 0, 0, 0, FC, 0, FR, FL } },
/* surround40 */
{ .ca_index = 0x08, .speakers = { 0, 0, RR, RL, 0, 0, FR, FL } },
/* surround41 */
{ .ca_index = 0x09, .speakers = { 0, 0, RR, RL, 0, LFE, FR, FL } },
/* surround50 */
{ .ca_index = 0x0a, .speakers = { 0, 0, RR, RL, FC, 0, FR, FL } },
/* surround51 */
{ .ca_index = 0x0b, .speakers = { 0, 0, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x0f, .speakers = { 0, RC, RR, RL, FC, LFE, FR, FL } },
/* surround71 */
{ .ca_index = 0x13, .speakers = { RRC, RLC, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x03, .speakers = { 0, 0, 0, 0, FC, LFE, FR, FL } },
{ .ca_index = 0x04, .speakers = { 0, 0, 0, RC, 0, 0, FR, FL } },
{ .ca_index = 0x05, .speakers = { 0, 0, 0, RC, 0, LFE, FR, FL } },
{ .ca_index = 0x06, .speakers = { 0, 0, 0, RC, FC, 0, FR, FL } },
{ .ca_index = 0x07, .speakers = { 0, 0, 0, RC, FC, LFE, FR, FL } },
{ .ca_index = 0x0c, .speakers = { 0, RC, RR, RL, 0, 0, FR, FL } },
{ .ca_index = 0x0d, .speakers = { 0, RC, RR, RL, 0, LFE, FR, FL } },
{ .ca_index = 0x0e, .speakers = { 0, RC, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x10, .speakers = { RRC, RLC, RR, RL, 0, 0, FR, FL } },
{ .ca_index = 0x11, .speakers = { RRC, RLC, RR, RL, 0, LFE, FR, FL } },
{ .ca_index = 0x12, .speakers = { RRC, RLC, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x14, .speakers = { FRC, FLC, 0, 0, 0, 0, FR, FL } },
{ .ca_index = 0x15, .speakers = { FRC, FLC, 0, 0, 0, LFE, FR, FL } },
{ .ca_index = 0x16, .speakers = { FRC, FLC, 0, 0, FC, 0, FR, FL } },
{ .ca_index = 0x17, .speakers = { FRC, FLC, 0, 0, FC, LFE, FR, FL } },
{ .ca_index = 0x18, .speakers = { FRC, FLC, 0, RC, 0, 0, FR, FL } },
{ .ca_index = 0x19, .speakers = { FRC, FLC, 0, RC, 0, LFE, FR, FL } },
{ .ca_index = 0x1a, .speakers = { FRC, FLC, 0, RC, FC, 0, FR, FL } },
{ .ca_index = 0x1b, .speakers = { FRC, FLC, 0, RC, FC, LFE, FR, FL } },
{ .ca_index = 0x1c, .speakers = { FRC, FLC, RR, RL, 0, 0, FR, FL } },
{ .ca_index = 0x1d, .speakers = { FRC, FLC, RR, RL, 0, LFE, FR, FL } },
{ .ca_index = 0x1e, .speakers = { FRC, FLC, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x1f, .speakers = { FRC, FLC, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x20, .speakers = { 0, FCH, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x21, .speakers = { 0, FCH, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x22, .speakers = { TC, 0, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x23, .speakers = { TC, 0, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x24, .speakers = { FRH, FLH, RR, RL, 0, 0, FR, FL } },
{ .ca_index = 0x25, .speakers = { FRH, FLH, RR, RL, 0, LFE, FR, FL } },
{ .ca_index = 0x26, .speakers = { FRW, FLW, RR, RL, 0, 0, FR, FL } },
{ .ca_index = 0x27, .speakers = { FRW, FLW, RR, RL, 0, LFE, FR, FL } },
{ .ca_index = 0x28, .speakers = { TC, RC, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x29, .speakers = { TC, RC, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x2a, .speakers = { FCH, RC, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x2b, .speakers = { FCH, RC, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x2c, .speakers = { TC, FCH, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x2d, .speakers = { TC, FCH, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x2e, .speakers = { FRH, FLH, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x2f, .speakers = { FRH, FLH, RR, RL, FC, LFE, FR, FL } },
{ .ca_index = 0x30, .speakers = { FRW, FLW, RR, RL, FC, 0, FR, FL } },
{ .ca_index = 0x31, .speakers = { FRW, FLW, RR, RL, FC, LFE, FR, FL } },
};
/*
* HDMI routines
*/
#define get_pin(spec, idx) \
((struct hdmi_spec_per_pin *)snd_array_elem(&spec->pins, idx))
#define get_cvt(spec, idx) \
((struct hdmi_spec_per_cvt *)snd_array_elem(&spec->cvts, idx))
#define get_pcm_rec(spec, idx) \
((struct hda_pcm *)snd_array_elem(&spec->pcm_rec, idx))
static int <API key>(struct hdmi_spec *spec, hda_nid_t pin_nid)
{
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++)
if (get_pin(spec, pin_idx)->pin_nid == pin_nid)
return pin_idx;
snd_printk(KERN_WARNING "HDMI: pin nid %d not registered\n", pin_nid);
return -EINVAL;
}
static int hinfo_to_pin_index(struct hdmi_spec *spec,
struct hda_pcm_stream *hinfo)
{
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++)
if (get_pcm_rec(spec, pin_idx)->stream == hinfo)
return pin_idx;
snd_printk(KERN_WARNING "HDMI: hinfo %p not registered\n", hinfo);
return -EINVAL;
}
static int <API key>(struct hdmi_spec *spec, hda_nid_t cvt_nid)
{
int cvt_idx;
for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++)
if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid)
return cvt_idx;
snd_printk(KERN_WARNING "HDMI: cvt nid %d not registered\n", cvt_nid);
return -EINVAL;
}
static int hdmi_eld_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hdmi_spec *spec = codec->spec;
struct hdmi_eld *eld;
int pin_idx;
uinfo->type = <API key>;
pin_idx = kcontrol->private_value;
eld = &get_pin(spec, pin_idx)->sink_eld;
mutex_lock(&eld->lock);
uinfo->count = eld->eld_valid ? eld->eld_size : 0;
mutex_unlock(&eld->lock);
return 0;
}
static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hdmi_spec *spec = codec->spec;
struct hdmi_eld *eld;
int pin_idx;
pin_idx = kcontrol->private_value;
eld = &get_pin(spec, pin_idx)->sink_eld;
mutex_lock(&eld->lock);
if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data)) {
mutex_unlock(&eld->lock);
snd_BUG();
return -EINVAL;
}
memset(ucontrol->value.bytes.data, 0,
ARRAY_SIZE(ucontrol->value.bytes.data));
if (eld->eld_valid)
memcpy(ucontrol->value.bytes.data, eld->eld_buffer,
eld->eld_size);
mutex_unlock(&eld->lock);
return 0;
}
static struct snd_kcontrol_new eld_bytes_ctl = {
.access = <API key> | <API key>,
.iface = <API key>,
.name = "ELD",
.info = hdmi_eld_ctl_info,
.get = hdmi_eld_ctl_get,
};
static int hdmi_create_eld_ctl(struct hda_codec *codec, int pin_idx,
int device)
{
struct snd_kcontrol *kctl;
struct hdmi_spec *spec = codec->spec;
int err;
kctl = snd_ctl_new1(&eld_bytes_ctl, codec);
if (!kctl)
return -ENOMEM;
kctl->private_value = pin_idx;
kctl->id.device = device;
err = snd_hda_ctl_add(codec, get_pin(spec, pin_idx)->pin_nid, kctl);
if (err < 0)
return err;
get_pin(spec, pin_idx)->eld_ctl = kctl;
return 0;
}
#ifdef BE_PARANOID
static void hdmi_get_dip_index(struct hda_codec *codec, hda_nid_t pin_nid,
int *packet_index, int *byte_index)
{
int val;
val = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, 0);
*packet_index = val >> 5;
*byte_index = val & 0x1f;
}
#endif
static void hdmi_set_dip_index(struct hda_codec *codec, hda_nid_t pin_nid,
int packet_index, int byte_index)
{
int val;
val = (packet_index << 5) | (byte_index & 0x1f);
snd_hda_codec_write(codec, pin_nid, 0, <API key>, val);
}
static void hdmi_write_dip_byte(struct hda_codec *codec, hda_nid_t pin_nid,
unsigned char val)
{
snd_hda_codec_write(codec, pin_nid, 0, <API key>, val);
}
static void hdmi_init_pin(struct hda_codec *codec, hda_nid_t pin_nid)
{
struct hdmi_spec *spec = codec->spec;
int pin_out;
/* Unmute */
if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP)
snd_hda_codec_write(codec, pin_nid, 0,
<API key>, AMP_OUT_UNMUTE);
if (spec->dyn_pin_out)
/* Disable pin out until stream is active */
pin_out = 0;
else
/* Enable pin out: some machines with GM965 gets broken output
* when the pin is disabled or changed while using with HDMI
*/
pin_out = PIN_OUT;
snd_hda_codec_write(codec, pin_nid, 0,
<API key>, pin_out);
}
static int <API key>(struct hda_codec *codec, hda_nid_t cvt_nid)
{
return 1 + snd_hda_codec_read(codec, cvt_nid, 0,
<API key>, 0);
}
static void <API key>(struct hda_codec *codec,
hda_nid_t cvt_nid, int chs)
{
if (chs != <API key>(codec, cvt_nid))
snd_hda_codec_write(codec, cvt_nid, 0,
<API key>, chs - 1);
}
/*
* Channel mapping routines
*/
/*
* Compute derived values in channel_allocations[].
*/
static void <API key>(void)
{
int i, j;
struct <API key> *p;
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
p = channel_allocations + i;
p->channels = 0;
p->spk_mask = 0;
for (j = 0; j < ARRAY_SIZE(p->speakers); j++)
if (p->speakers[j]) {
p->channels++;
p->spk_mask |= p->speakers[j];
}
}
}
static int <API key>(int ca)
{
int i;
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
if (channel_allocations[i].ca_index == ca)
break;
}
return i;
}
/*
* The transformation takes two steps:
*
* eld->spk_alloc => (<API key>[]) => spk_mask
* spk_mask => (channel_allocations[]) => ai->CA
*
* TODO: it could select the wrong CA from multiple candidates.
*/
static int <API key>(struct hdmi_eld *eld, int channels)
{
int i;
int ca = 0;
int spk_mask = 0;
char buf[<API key>];
/*
* CA defaults to 0 for basic stereo audio
*/
if (channels <= 2)
return 0;
/*
* expand ELD's speaker allocation mask
*
* ELD tells the speaker mask in a compact(paired) form,
* expand ELD's notions to match the ones used by Audio InfoFrame.
*/
for (i = 0; i < ARRAY_SIZE(<API key>); i++) {
if (eld->info.spk_alloc & (1 << i))
spk_mask |= <API key>[i];
}
/* search for the first working match in the CA table */
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
if (channels == channel_allocations[i].channels &&
(spk_mask & channel_allocations[i].spk_mask) ==
channel_allocations[i].spk_mask) {
ca = channel_allocations[i].ca_index;
break;
}
}
if (!ca) {
/* if there was no match, select the regular ALSA channel
* allocation with the matching number of channels */
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
if (channels == channel_allocations[i].channels) {
ca = channel_allocations[i].ca_index;
break;
}
}
}
<API key>(eld->info.spk_alloc, buf, sizeof(buf));
snd_printdd("HDMI: select CA 0x%x for %d-channel allocation: %s\n",
ca, channels, buf);
return ca;
}
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid)
{
#ifdef <API key>
int i;
int slot;
for (i = 0; i < 8; i++) {
slot = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, i);
printk(KERN_DEBUG "HDMI: ASP channel %d => slot %d\n",
slot >> 4, slot & 0xf);
}
#endif
}
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid,
bool non_pcm,
int ca)
{
int i;
int err;
int order;
int non_pcm_mapping[8];
order = <API key>(ca);
if (<API key>[ca][1] == 0) {
for (i = 0; i < channel_allocations[order].channels; i++)
<API key>[ca][i] = i | (i << 4);
for (; i < 8; i++)
<API key>[ca][i] = 0xf | (i << 4);
}
if (non_pcm) {
for (i = 0; i < channel_allocations[order].channels; i++)
non_pcm_mapping[i] = i | (i << 4);
for (; i < 8; i++)
non_pcm_mapping[i] = 0xf | (i << 4);
}
for (i = 0; i < 8; i++) {
err = snd_hda_codec_write(codec, pin_nid, 0,
<API key>,
non_pcm ? non_pcm_mapping[i] : <API key>[ca][i]);
if (err) {
snd_printdd(KERN_NOTICE
"HDMI: channel mapping failed\n");
break;
}
}
<API key>(codec, pin_nid);
}
struct channel_map_table {
unsigned char map; /* ALSA API channel map position */
unsigned char cea_slot; /* CEA slot value */
int spk_mask; /* speaker position bit mask */
};
static struct channel_map_table map_tables[] = {
{ SNDRV_CHMAP_FL, 0x00, FL },
{ SNDRV_CHMAP_FR, 0x01, FR },
{ SNDRV_CHMAP_RL, 0x04, RL },
{ SNDRV_CHMAP_RR, 0x05, RR },
{ SNDRV_CHMAP_LFE, 0x02, LFE },
{ SNDRV_CHMAP_FC, 0x03, FC },
{ SNDRV_CHMAP_RLC, 0x06, RLC },
{ SNDRV_CHMAP_RRC, 0x07, RRC },
{} /* terminator */
};
/* from ALSA API channel position to speaker bit mask */
static int to_spk_mask(unsigned char c)
{
struct channel_map_table *t = map_tables;
for (; t->map; t++) {
if (t->map == c)
return t->spk_mask;
}
return 0;
}
/* from ALSA API channel position to CEA slot */
static int to_cea_slot(unsigned char c)
{
struct channel_map_table *t = map_tables;
for (; t->map; t++) {
if (t->map == c)
return t->cea_slot;
}
return 0x0f;
}
/* from CEA slot to ALSA API channel position */
static int from_cea_slot(unsigned char c)
{
struct channel_map_table *t = map_tables;
for (; t->map; t++) {
if (t->cea_slot == c)
return t->map;
}
return 0;
}
/* from speaker bit mask to ALSA API channel position */
static int spk_to_chmap(int spk)
{
struct channel_map_table *t = map_tables;
for (; t->map; t++) {
if (t->spk_mask == spk)
return t->map;
}
return 0;
}
/* get the CA index corresponding to the given ALSA API channel map */
static int <API key>(int chs, unsigned char *map)
{
int i, spks = 0, spk_mask = 0;
for (i = 0; i < chs; i++) {
int mask = to_spk_mask(map[i]);
if (mask) {
spk_mask |= mask;
spks++;
}
}
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
if ((chs == channel_allocations[i].channels ||
spks == channel_allocations[i].channels) &&
(spk_mask & channel_allocations[i].spk_mask) ==
channel_allocations[i].spk_mask)
return channel_allocations[i].ca_index;
}
return -1;
}
/* set up the channel slots for the given ALSA API channel map */
static int <API key>(struct hda_codec *codec,
hda_nid_t pin_nid,
int chs, unsigned char *map)
{
int i;
for (i = 0; i < 8; i++) {
int val, err;
if (i < chs)
val = to_cea_slot(map[i]);
else
val = 0xf;
val |= (i << 4);
err = snd_hda_codec_write(codec, pin_nid, 0,
<API key>, val);
if (err)
return -EINVAL;
}
return 0;
}
/* store ALSA API channel map from the current default map */
static void <API key>(unsigned char *map, int ca)
{
int i;
int ordered_ca = <API key>(ca);
for (i = 0; i < 8; i++) {
if (i < channel_allocations[ordered_ca].channels)
map[i] = from_cea_slot(<API key>[ca][i] & 0x0f);
else
map[i] = 0;
}
}
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid, bool non_pcm, int ca,
int channels, unsigned char *map,
bool chmap_set)
{
if (!non_pcm && chmap_set) {
<API key>(codec, pin_nid,
channels, map);
} else {
<API key>(codec, pin_nid, non_pcm, ca);
<API key>(map, ca);
}
}
/*
* Audio InfoFrame routines
*/
/*
* Enable Audio InfoFrame Transmission
*/
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid)
{
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
snd_hda_codec_write(codec, pin_nid, 0, <API key>,
AC_DIPXMIT_BEST);
}
/*
* Disable Audio InfoFrame Transmission
*/
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid)
{
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
snd_hda_codec_write(codec, pin_nid, 0, <API key>,
AC_DIPXMIT_DISABLE);
}
static void hdmi_debug_dip_size(struct hda_codec *codec, hda_nid_t pin_nid)
{
#ifdef <API key>
int i;
int size;
size = <API key>(codec, pin_nid);
printk(KERN_DEBUG "HDMI: ELD buf size is %d\n", size);
for (i = 0; i < 8; i++) {
size = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, i);
printk(KERN_DEBUG "HDMI: DIP GP[%d] buf size is %d\n", i, size);
}
#endif
}
static void <API key>(struct hda_codec *codec, hda_nid_t pin_nid)
{
#ifdef BE_PARANOID
int i, j;
int size;
int pi, bi;
for (i = 0; i < 8; i++) {
size = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, i);
if (size == 0)
continue;
hdmi_set_dip_index(codec, pin_nid, i, 0x0);
for (j = 1; j < 1000; j++) {
hdmi_write_dip_byte(codec, pin_nid, 0x0);
hdmi_get_dip_index(codec, pin_nid, &pi, &bi);
if (pi != i)
snd_printd(KERN_INFO "dip index %d: %d != %d\n",
bi, pi, i);
if (bi == 0) /* byte index wrapped around */
break;
}
snd_printd(KERN_INFO
"HDMI: DIP GP[%d] buf reported size=%d, written=%d\n",
i, size, j);
}
#endif
}
static void <API key>(struct <API key> *hdmi_ai)
{
u8 *bytes = (u8 *)hdmi_ai;
u8 sum = 0;
int i;
hdmi_ai->checksum = 0;
for (i = 0; i < sizeof(*hdmi_ai); i++)
sum += bytes[i];
hdmi_ai->checksum = -sum;
}
static void <API key>(struct hda_codec *codec,
hda_nid_t pin_nid,
u8 *dip, int size)
{
int i;
hdmi_debug_dip_size(codec, pin_nid);
<API key>(codec, pin_nid); /* be paranoid */
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
for (i = 0; i < size; i++)
hdmi_write_dip_byte(codec, pin_nid, dip[i]);
}
static bool <API key>(struct hda_codec *codec, hda_nid_t pin_nid,
u8 *dip, int size)
{
u8 val;
int i;
if (snd_hda_codec_read(codec, pin_nid, 0, <API key>, 0)
!= AC_DIPXMIT_BEST)
return false;
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
for (i = 0; i < size; i++) {
val = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, 0);
if (val != dip[i])
return false;
}
return true;
}
static void <API key>(struct hda_codec *codec,
struct hdmi_spec_per_pin *per_pin,
bool non_pcm)
{
hda_nid_t pin_nid = per_pin->pin_nid;
int channels = per_pin->channels;
struct hdmi_eld *eld;
int ca;
union audio_infoframe ai;
if (!channels)
return;
eld = &per_pin->sink_eld;
if (!eld->monitor_present)
return;
if (!non_pcm && per_pin->chmap_set)
ca = <API key>(channels, per_pin->chmap);
else
ca = <API key>(eld, channels);
if (ca < 0)
ca = 0;
memset(&ai, 0, sizeof(ai));
if (eld->info.conn_type == 0) { /* HDMI */
struct <API key> *hdmi_ai = &ai.hdmi;
hdmi_ai->type = 0x84;
hdmi_ai->ver = 0x01;
hdmi_ai->len = 0x0a;
hdmi_ai->CC02_CT47 = channels - 1;
hdmi_ai->CA = ca;
<API key>(hdmi_ai);
} else if (eld->info.conn_type == 1) { /* DisplayPort */
struct dp_audio_infoframe *dp_ai = &ai.dp;
dp_ai->type = 0x84;
dp_ai->len = 0x1b;
dp_ai->ver = 0x11 << 2;
dp_ai->CC02_CT47 = channels - 1;
dp_ai->CA = ca;
} else {
snd_printd("HDMI: unknown connection type at pin %d\n",
pin_nid);
return;
}
/*
* always configure channel mapping, it may have been changed by the
* user in the meantime
*/
<API key>(codec, pin_nid, non_pcm, ca,
channels, per_pin->chmap,
per_pin->chmap_set);
/*
* sizeof(ai) is used instead of sizeof(*hdmi_ai) or
* sizeof(*dp_ai) to avoid partial match/update problems when
* the user switches between HDMI/DP monitors.
*/
if (!<API key>(codec, pin_nid, ai.bytes,
sizeof(ai))) {
snd_printdd("<API key>: "
"pin=%d channels=%d\n",
pin_nid,
channels);
<API key>(codec, pin_nid);
<API key>(codec, pin_nid,
ai.bytes, sizeof(ai));
<API key>(codec, pin_nid);
}
per_pin->non_pcm = non_pcm;
}
/*
* Unsolicited events
*/
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
static void <API key>(struct hda_codec *codec, unsigned int res)
{
struct hdmi_spec *spec = codec->spec;
int tag = res >> <API key>;
int pin_nid;
int pin_idx;
struct hda_jack_tbl *jack;
jack = <API key>(codec, tag);
if (!jack)
return;
pin_nid = jack->nid;
jack->jack_dirty = 1;
_snd_printd(SND_PR_VERBOSE,
"HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
codec->addr, pin_nid,
!!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
pin_idx = <API key>(spec, pin_nid);
if (pin_idx < 0)
return;
hdmi_present_sense(get_pin(spec, pin_idx), 1);
<API key>(codec);
}
static void <API key>(struct hda_codec *codec, unsigned int res)
{
int tag = res >> <API key>;
int subtag = (res & AC_UNSOL_RES_SUBTAG) >> <API key>;
int cp_state = !!(res & <API key>);
int cp_ready = !!(res & <API key>);
printk(KERN_INFO
"HDMI CP event: CODEC=%d TAG=%d SUBTAG=0x%x CP_STATE=%d CP_READY=%d\n",
codec->addr,
tag,
subtag,
cp_state,
cp_ready);
/* TODO */
if (cp_state)
;
if (cp_ready)
;
}
static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res)
{
int tag = res >> <API key>;
int subtag = (res & AC_UNSOL_RES_SUBTAG) >> <API key>;
if (!<API key>(codec, tag)) {
snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag);
return;
}
if (subtag == 0)
<API key>(codec, res);
else
<API key>(codec, res);
}
static void <API key>(struct hda_codec *codec,
hda_nid_t cvt_nid, hda_nid_t nid)
{
int pwr, lamp, ramp;
/* For Haswell, the converter 1/2 may keep in D3 state after bootup,
* thus pins could only choose converter 0 for use. Make sure the
* converters are in correct power state */
if (!<API key>(codec, cvt_nid, AC_PWRST_D0))
snd_hda_codec_write(codec, cvt_nid, 0, <API key>, AC_PWRST_D0);
if (!<API key>(codec, nid, AC_PWRST_D0)) {
snd_hda_codec_write(codec, nid, 0, <API key>,
AC_PWRST_D0);
msleep(40);
pwr = snd_hda_codec_read(codec, nid, 0, <API key>, 0);
pwr = (pwr & AC_PWRST_ACTUAL) >> <API key>;
snd_printd("Haswell HDMI audio: Power for pin 0x%x is now D%d\n", nid, pwr);
}
lamp = snd_hda_codec_read(codec, nid, 0,
<API key>,
AC_AMP_GET_LEFT | AC_AMP_GET_OUTPUT);
ramp = snd_hda_codec_read(codec, nid, 0,
<API key>,
AC_AMP_GET_RIGHT | AC_AMP_GET_OUTPUT);
if (lamp != ramp) {
snd_hda_codec_write(codec, nid, 0, <API key>,
AC_AMP_SET_RIGHT | AC_AMP_SET_OUTPUT | lamp);
lamp = snd_hda_codec_read(codec, nid, 0,
<API key>,
AC_AMP_GET_LEFT | AC_AMP_GET_OUTPUT);
ramp = snd_hda_codec_read(codec, nid, 0,
<API key>,
AC_AMP_GET_RIGHT | AC_AMP_GET_OUTPUT);
snd_printd("Haswell HDMI audio: Mute after set on pin 0x%x: [0x%x 0x%x]\n", nid, lamp, ramp);
}
}
/*
* Callbacks
*/
/* HBR should be Non-PCM, 8 channels */
#define is_hbr_format(format) \
((format & AC_FMT_TYPE_NON_PCM) && (format & AC_FMT_CHAN_MASK) == 7)
static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
hda_nid_t pin_nid, u32 stream_tag, int format)
{
int pinctl;
int new_pinctl = 0;
if (codec->vendor_id == 0x80862807)
<API key>(codec, cvt_nid, pin_nid);
if (<API key>(codec, pin_nid) & AC_PINCAP_HBR) {
pinctl = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, 0);
new_pinctl = pinctl & ~AC_PINCTL_EPT;
if (is_hbr_format(format))
new_pinctl |= AC_PINCTL_EPT_HBR;
else
new_pinctl |= <API key>;
snd_printdd("hdmi_setup_stream: "
"NID=0x%x, %spinctl=0x%x\n",
pin_nid,
pinctl == new_pinctl ? "" : "new-",
new_pinctl);
if (pinctl != new_pinctl)
snd_hda_codec_write(codec, pin_nid, 0,
<API key>,
new_pinctl);
}
if (is_hbr_format(format) && !new_pinctl) {
snd_printdd("hdmi_setup_stream: HBR is not supported\n");
return -EINVAL;
}
<API key>(codec, cvt_nid, stream_tag, 0, format);
return 0;
}
static int hdmi_choose_cvt(struct hda_codec *codec,
int pin_idx, int *cvt_id, int *mux_id)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin;
struct hdmi_spec_per_cvt *per_cvt = NULL;
int cvt_idx, mux_idx = 0;
per_pin = get_pin(spec, pin_idx);
/* Dynamically assign converter to stream */
for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) {
per_cvt = get_cvt(spec, cvt_idx);
/* Must not already be assigned */
if (per_cvt->assigned)
continue;
/* Must be in pin's mux's list of converters */
for (mux_idx = 0; mux_idx < per_pin->num_mux_nids; mux_idx++)
if (per_pin->mux_nids[mux_idx] == per_cvt->cvt_nid)
break;
/* Not in mux list */
if (mux_idx == per_pin->num_mux_nids)
continue;
break;
}
/* No free converters */
if (cvt_idx == spec->num_cvts)
return -ENODEV;
if (cvt_id)
*cvt_id = cvt_idx;
if (mux_id)
*mux_id = mux_idx;
return 0;
}
static void haswell_config_cvts(struct hda_codec *codec,
int pin_id, int mux_id)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin;
int pin_idx, mux_idx;
int curr;
int err;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
per_pin = get_pin(spec, pin_idx);
if (pin_idx == pin_id)
continue;
curr = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
<API key>, 0);
/* Choose another unused converter */
if (curr == mux_id) {
err = hdmi_choose_cvt(codec, pin_idx, NULL, &mux_idx);
if (err < 0)
return;
snd_printdd("HDMI: choose converter %d for pin %d\n", mux_idx, pin_idx);
<API key>(codec, per_pin->pin_nid, 0,
<API key>,
mux_idx);
}
}
}
/*
* HDA PCM callbacks
*/
static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
struct snd_pcm_runtime *runtime = substream->runtime;
int pin_idx, cvt_idx, mux_idx = 0;
struct hdmi_spec_per_pin *per_pin;
struct hdmi_eld *eld;
struct hdmi_spec_per_cvt *per_cvt = NULL;
int err;
/* Validate hinfo */
pin_idx = hinfo_to_pin_index(spec, hinfo);
if (snd_BUG_ON(pin_idx < 0))
return -EINVAL;
per_pin = get_pin(spec, pin_idx);
eld = &per_pin->sink_eld;
err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx, &mux_idx);
if (err < 0)
return err;
per_cvt = get_cvt(spec, cvt_idx);
/* Claim converter */
per_cvt->assigned = 1;
hinfo->nid = per_cvt->cvt_nid;
<API key>(codec, per_pin->pin_nid, 0,
<API key>,
mux_idx);
/* configure unused pins to choose other converters */
if (codec->vendor_id == 0x80862807)
haswell_config_cvts(codec, pin_idx, mux_idx);
<API key>(codec, pin_idx, per_cvt->cvt_nid);
/* Initially set the converter's capabilities */
hinfo->channels_min = per_cvt->channels_min;
hinfo->channels_max = per_cvt->channels_max;
hinfo->rates = per_cvt->rates;
hinfo->formats = per_cvt->formats;
hinfo->maxbps = per_cvt->maxbps;
/* Restrict capabilities by ELD if this isn't disabled */
if (!static_hdmi_pcm && eld->eld_valid) {
<API key>(&eld->info, hinfo);
if (hinfo->channels_min > hinfo->channels_max ||
!hinfo->rates || !hinfo->formats) {
per_cvt->assigned = 0;
hinfo->nid = 0;
<API key>(codec, pin_idx);
return -ENODEV;
}
}
/* Store the updated parameters */
runtime->hw.channels_min = hinfo->channels_min;
runtime->hw.channels_max = hinfo->channels_max;
runtime->hw.formats = hinfo->formats;
runtime->hw.rates = hinfo->rates;
<API key>(substream->runtime, 0,
<API key>, 2);
return 0;
}
/*
* HDA/HDMI auto parsing
*/
static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
hda_nid_t pin_nid = per_pin->pin_nid;
if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) {
snd_printk(KERN_WARNING
"HDMI: pin %d wcaps %
"does not support connection list\n",
pin_nid, get_wcaps(codec, pin_nid));
return -EINVAL;
}
per_pin->num_mux_nids = <API key>(codec, pin_nid,
per_pin->mux_nids,
HDA_MAX_CONNECTIONS);
return 0;
}
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
{
struct hda_codec *codec = per_pin->codec;
struct hdmi_spec *spec = codec->spec;
struct hdmi_eld *eld = &spec->temp_eld;
struct hdmi_eld *pin_eld = &per_pin->sink_eld;
hda_nid_t pin_nid = per_pin->pin_nid;
/*
* Always execute a GetPinSense verb here, even when called from
* <API key>; for some NVIDIA HW, the unsolicited
* response's PD bit is not the real PD value, but indicates that
* the real PD value changed. An older version of the HD-audio
* specification worked this way. Hence, we just ignore the data in
* the unsolicited response to avoid custom WARs.
*/
int present = snd_hda_pin_sense(codec, pin_nid);
bool update_eld = false;
bool eld_changed = false;
pin_eld->monitor_present = !!(present & <API key>);
if (pin_eld->monitor_present)
eld->eld_valid = !!(present & AC_PINSENSE_ELDV);
else
eld->eld_valid = false;
_snd_printd(SND_PR_VERBOSE,
"HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid);
if (eld->eld_valid) {
if (snd_hdmi_get_eld(codec, pin_nid, eld->eld_buffer,
&eld->eld_size) < 0)
eld->eld_valid = false;
else {
memset(&eld->info, 0, sizeof(struct parsed_hdmi_eld));
if (snd_hdmi_parse_eld(&eld->info, eld->eld_buffer,
eld->eld_size) < 0)
eld->eld_valid = false;
}
if (eld->eld_valid) {
snd_hdmi_show_eld(&eld->info);
update_eld = true;
}
else if (repoll) {
queue_delayed_work(codec->bus->workq,
&per_pin->work,
msecs_to_jiffies(300));
return;
}
}
mutex_lock(&pin_eld->lock);
if (pin_eld->eld_valid && !eld->eld_valid) {
update_eld = true;
eld_changed = true;
}
if (update_eld) {
bool old_eld_valid = pin_eld->eld_valid;
pin_eld->eld_valid = eld->eld_valid;
eld_changed = pin_eld->eld_size != eld->eld_size ||
memcmp(pin_eld->eld_buffer, eld->eld_buffer,
eld->eld_size) != 0;
if (eld_changed)
memcpy(pin_eld->eld_buffer, eld->eld_buffer,
eld->eld_size);
pin_eld->eld_size = eld->eld_size;
pin_eld->info = eld->info;
/* Haswell-specific workaround: re-setup when the transcoder is
* changed during the stream playback
*/
if (codec->vendor_id == 0x80862807 &&
eld->eld_valid && !old_eld_valid && per_pin->setup) {
snd_hda_codec_write(codec, pin_nid, 0,
<API key>,
AMP_OUT_UNMUTE);
<API key>(codec, per_pin,
per_pin->non_pcm);
}
}
mutex_unlock(&pin_eld->lock);
if (eld_changed)
snd_ctl_notify(codec->bus->card,
<API key> | <API key>,
&per_pin->eld_ctl->id);
}
static void hdmi_repoll_eld(struct work_struct *work)
{
struct hdmi_spec_per_pin *per_pin =
container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
if (per_pin->repoll_count++ > 6)
per_pin->repoll_count = 0;
hdmi_present_sense(per_pin, per_pin->repoll_count);
}
static void <API key>(struct hda_codec *codec,
hda_nid_t nid);
static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
{
struct hdmi_spec *spec = codec->spec;
unsigned int caps, config;
int pin_idx;
struct hdmi_spec_per_pin *per_pin;
int err;
caps = <API key>(codec, pin_nid);
if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP)))
return 0;
config = <API key>(codec, pin_nid);
if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
return 0;
if (codec->vendor_id == 0x80862807)
<API key>(codec, pin_nid);
pin_idx = spec->num_pins;
per_pin = snd_array_new(&spec->pins);
if (!per_pin)
return -ENOMEM;
per_pin->pin_nid = pin_nid;
per_pin->non_pcm = false;
err = hdmi_read_pin_conn(codec, pin_idx);
if (err < 0)
return err;
spec->num_pins++;
return 0;
}
static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_cvt *per_cvt;
unsigned int chans;
int err;
chans = get_wcaps(codec, cvt_nid);
chans = get_wcaps_channels(chans);
per_cvt = snd_array_new(&spec->cvts);
if (!per_cvt)
return -ENOMEM;
per_cvt->cvt_nid = cvt_nid;
per_cvt->channels_min = 2;
if (chans <= 16) {
per_cvt->channels_max = chans;
if (chans > spec->channels_max)
spec->channels_max = chans;
}
err = <API key>(codec, cvt_nid,
&per_cvt->rates,
&per_cvt->formats,
&per_cvt->maxbps);
if (err < 0)
return err;
if (spec->num_cvts < ARRAY_SIZE(spec->cvt_nids))
spec->cvt_nids[spec->num_cvts] = cvt_nid;
spec->num_cvts++;
return 0;
}
static int hdmi_parse_codec(struct hda_codec *codec)
{
hda_nid_t nid;
int i, nodes;
nodes = <API key>(codec, codec->afg, &nid);
if (!nid || nodes < 0) {
snd_printk(KERN_WARNING "HDMI: failed to get afg sub nodes\n");
return -EINVAL;
}
for (i = 0; i < nodes; i++, nid++) {
unsigned int caps;
unsigned int type;
caps = get_wcaps(codec, nid);
type = get_wcaps_type(caps);
if (!(caps & AC_WCAP_DIGITAL))
continue;
switch (type) {
case AC_WID_AUD_OUT:
hdmi_add_cvt(codec, nid);
break;
case AC_WID_PIN:
hdmi_add_pin(codec, nid);
break;
}
}
#ifdef CONFIG_PM
/* We're seeing some problems with unsolicited hot plug events on
* PantherPoint after S3, if this is not enabled */
if (codec->vendor_id == 0x80862806)
codec->bus->power_keep_link_on = 1;
/*
* G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event
* can be lost and presence sense verb will become inaccurate if the
* HDA link is powered off at hot plug or hw initialization time.
*/
else if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) &
AC_PWRST_EPSS))
codec->bus->power_keep_link_on = 1;
#endif
return 0;
}
static bool <API key>(struct hda_codec *codec, hda_nid_t cvt_nid)
{
struct hda_spdif_out *spdif;
bool non_pcm;
mutex_lock(&codec->spdif_mutex);
spdif = <API key>(codec, cvt_nid);
non_pcm = !!(spdif->status & <API key>);
mutex_unlock(&codec->spdif_mutex);
return non_pcm;
}
/*
* HDMI callbacks
*/
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *substream)
{
hda_nid_t cvt_nid = hinfo->nid;
struct hdmi_spec *spec = codec->spec;
int pin_idx = hinfo_to_pin_index(spec, hinfo);
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
hda_nid_t pin_nid = per_pin->pin_nid;
bool non_pcm;
int pinctl;
non_pcm = <API key>(codec, cvt_nid);
per_pin->channels = substream->runtime->channels;
per_pin->setup = true;
<API key>(codec, cvt_nid, substream->runtime->channels);
<API key>(codec, per_pin, non_pcm);
if (spec->dyn_pin_out) {
pinctl = snd_hda_codec_read(codec, pin_nid, 0,
<API key>, 0);
snd_hda_codec_write(codec, pin_nid, 0,
<API key>,
pinctl | PIN_OUT);
}
return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
}
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
<API key>(codec, hinfo->nid);
return 0;
}
static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
int cvt_idx, pin_idx;
struct hdmi_spec_per_cvt *per_cvt;
struct hdmi_spec_per_pin *per_pin;
int pinctl;
if (hinfo->nid) {
cvt_idx = <API key>(spec, hinfo->nid);
if (snd_BUG_ON(cvt_idx < 0))
return -EINVAL;
per_cvt = get_cvt(spec, cvt_idx);
snd_BUG_ON(!per_cvt->assigned);
per_cvt->assigned = 0;
hinfo->nid = 0;
pin_idx = hinfo_to_pin_index(spec, hinfo);
if (snd_BUG_ON(pin_idx < 0))
return -EINVAL;
per_pin = get_pin(spec, pin_idx);
if (spec->dyn_pin_out) {
pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
<API key>, 0);
snd_hda_codec_write(codec, per_pin->pin_nid, 0,
<API key>,
pinctl & ~PIN_OUT);
}
<API key>(codec, pin_idx);
per_pin->chmap_set = false;
memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
per_pin->setup = false;
per_pin->channels = 0;
}
return 0;
}
static const struct hda_pcm_ops generic_ops = {
.open = hdmi_pcm_open,
.close = hdmi_pcm_close,
.prepare = <API key>,
.cleanup = <API key>,
};
/*
* ALSA API channel-map control callbacks
*/
static int hdmi_chmap_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
struct hda_codec *codec = info->private_data;
struct hdmi_spec *spec = codec->spec;
uinfo->type = <API key>;
uinfo->count = spec->channels_max;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = SNDRV_CHMAP_LAST;
return 0;
}
static int hdmi_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
unsigned int size, unsigned int __user *tlv)
{
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
struct hda_codec *codec = info->private_data;
struct hdmi_spec *spec = codec->spec;
const unsigned int valid_mask =
FL | FR | RL | RR | LFE | FC | RLC | RRC;
unsigned int __user *dst;
int chs, count = 0;
if (size < 8)
return -ENOMEM;
if (put_user(<API key>, tlv))
return -EFAULT;
size -= 8;
dst = tlv + 2;
for (chs = 2; chs <= spec->channels_max; chs++) {
int i, c;
struct <API key> *cap;
cap = channel_allocations;
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) {
int chs_bytes = chs * 4;
if (cap->channels != chs)
continue;
if (cap->spk_mask & ~valid_mask)
continue;
if (size < 8)
return -ENOMEM;
if (put_user(<API key>, dst) ||
put_user(chs_bytes, dst + 1))
return -EFAULT;
dst += 2;
size -= 8;
count += 8;
if (size < chs_bytes)
return -ENOMEM;
size -= chs_bytes;
count += chs_bytes;
for (c = 7; c >= 0; c
int spk = cap->speakers[c];
if (!spk)
continue;
if (put_user(spk_to_chmap(spk), dst))
return -EFAULT;
dst++;
}
}
}
if (put_user(count, tlv + 1))
return -EFAULT;
return 0;
}
static int hdmi_chmap_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
struct hda_codec *codec = info->private_data;
struct hdmi_spec *spec = codec->spec;
int pin_idx = kcontrol->private_value;
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
int i;
for (i = 0; i < ARRAY_SIZE(per_pin->chmap); i++)
ucontrol->value.integer.value[i] = per_pin->chmap[i];
return 0;
}
static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
struct hda_codec *codec = info->private_data;
struct hdmi_spec *spec = codec->spec;
int pin_idx = kcontrol->private_value;
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
unsigned int ctl_idx;
struct snd_pcm_substream *substream;
unsigned char chmap[8];
int i, ca, prepared = 0;
ctl_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
substream = <API key>(info, ctl_idx);
if (!substream || !substream->runtime)
return 0; /* just for avoiding error from alsactl restore */
switch (substream->runtime->status->state) {
case <API key>:
case <API key>:
break;
case <API key>:
prepared = 1;
break;
default:
return -EBUSY;
}
memset(chmap, 0, sizeof(chmap));
for (i = 0; i < ARRAY_SIZE(chmap); i++)
chmap[i] = ucontrol->value.integer.value[i];
if (!memcmp(chmap, per_pin->chmap, sizeof(chmap)))
return 0;
ca = <API key>(ARRAY_SIZE(chmap), chmap);
if (ca < 0)
return -EINVAL;
per_pin->chmap_set = true;
memcpy(per_pin->chmap, chmap, sizeof(chmap));
if (prepared)
<API key>(codec, per_pin, per_pin->non_pcm);
return 0;
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hda_pcm *info;
struct hda_pcm_stream *pstr;
struct hdmi_spec_per_pin *per_pin;
per_pin = get_pin(spec, pin_idx);
sprintf(per_pin->pcm_name, "HDMI %d", pin_idx);
info = snd_array_new(&spec->pcm_rec);
if (!info)
return -ENOMEM;
info->name = per_pin->pcm_name;
info->pcm_type = HDA_PCM_TYPE_HDMI;
info->own_chmap = true;
pstr = &info->stream[<API key>];
pstr->substreams = 1;
pstr->ops = generic_ops;
/* other pstr fields are set in open */
}
codec->num_pcms = spec->num_pins;
codec->pcm_info = spec->pcm_rec.list;
return 0;
}
static int <API key>(struct hda_codec *codec, int pin_idx)
{
char hdmi_str[32] = "HDMI/DP";
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
int pcmdev = get_pcm_rec(spec, pin_idx)->device;
if (pcmdev > 0)
sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev);
if (!is_jack_detectable(codec, per_pin->pin_nid))
strncat(hdmi_str, " Phantom",
sizeof(hdmi_str) - strlen(hdmi_str) - 1);
return <API key>(codec, per_pin->pin_nid, hdmi_str, 0);
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int err;
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
err = <API key>(codec, pin_idx);
if (err < 0)
return err;
err = <API key>(codec,
per_pin->pin_nid,
per_pin->mux_nids[0],
HDA_PCM_TYPE_HDMI);
if (err < 0)
return err;
<API key>(codec, pin_idx);
/* add control for ELD Bytes */
err = hdmi_create_eld_ctl(codec, pin_idx,
get_pcm_rec(spec, pin_idx)->device);
if (err < 0)
return err;
hdmi_present_sense(per_pin, 0);
}
/* add channel maps */
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct snd_pcm_chmap *chmap;
struct snd_kcontrol *kctl;
int i;
if (!codec->pcm_info[pin_idx].pcm)
break;
err = <API key>(codec->pcm_info[pin_idx].pcm,
<API key>,
NULL, 0, pin_idx, &chmap);
if (err < 0)
return err;
/* override handlers */
chmap->private_data = codec;
kctl = chmap->kctl;
for (i = 0; i < kctl->count; i++)
kctl->vd[i].access |= <API key>;
kctl->info = hdmi_chmap_ctl_info;
kctl->get = hdmi_chmap_ctl_get;
kctl->put = hdmi_chmap_ctl_put;
kctl->tlv.c = hdmi_chmap_ctl_tlv;
}
return 0;
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
struct hdmi_eld *eld = &per_pin->sink_eld;
per_pin->codec = codec;
mutex_init(&eld->lock);
INIT_DELAYED_WORK(&per_pin->work, hdmi_repoll_eld);
<API key>(codec, eld, pin_idx);
}
return 0;
}
static int generic_hdmi_init(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
hda_nid_t pin_nid = per_pin->pin_nid;
hdmi_init_pin(codec, pin_nid);
<API key>(codec, pin_nid, pin_nid);
}
return 0;
}
static void hdmi_array_init(struct hdmi_spec *spec, int nums)
{
snd_array_init(&spec->pins, sizeof(struct hdmi_spec_per_pin), nums);
snd_array_init(&spec->cvts, sizeof(struct hdmi_spec_per_cvt), nums);
snd_array_init(&spec->pcm_rec, sizeof(struct hda_pcm), nums);
}
static void hdmi_array_free(struct hdmi_spec *spec)
{
snd_array_free(&spec->pins);
snd_array_free(&spec->cvts);
snd_array_free(&spec->pcm_rec);
}
static void generic_hdmi_free(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int pin_idx;
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
struct hdmi_eld *eld = &per_pin->sink_eld;
cancel_delayed_work(&per_pin->work);
<API key>(codec, eld);
}
flush_workqueue(codec->bus->workq);
hdmi_array_free(spec);
kfree(spec);
}
#ifdef CONFIG_PM
static int generic_hdmi_resume(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int pin_idx;
generic_hdmi_init(codec);
<API key>(codec);
<API key>(codec);
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
hdmi_present_sense(per_pin, 1);
}
return 0;
}
#endif
static const struct hda_codec_ops <API key> = {
.init = generic_hdmi_init,
.free = generic_hdmi_free,
.build_pcms = <API key>,
.build_controls = <API key>,
.unsol_event = hdmi_unsol_event,
#ifdef CONFIG_PM
.resume = generic_hdmi_resume,
#endif
};
static void <API key>(struct hda_codec *codec,
hda_nid_t nid)
{
struct hdmi_spec *spec = codec->spec;
hda_nid_t conns[4];
int nconns;
nconns = <API key>(codec, nid, conns, ARRAY_SIZE(conns));
if (nconns == spec->num_cvts &&
!memcmp(conns, spec->cvt_nids, spec->num_cvts * sizeof(hda_nid_t)))
return;
/* override pins connection list */
snd_printdd("hdmi: haswell: override pin connection 0x%x\n", nid);
<API key>(codec, nid, spec->num_cvts, spec->cvt_nids);
}
#define INTEL_VENDOR_NID 0x08
#define <API key> 0xf81
#define <API key> 0x781
#define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */
#define <API key> 0x01 /* enable 2nd & 3rd pins and convertors */
static void <API key>(struct hda_codec *codec,
bool update_tree)
{
unsigned int vendor_param;
vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0,
<API key>, 0);
if (vendor_param == -1 || vendor_param & <API key>)
return;
vendor_param |= <API key>;
vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0,
<API key>, vendor_param);
if (vendor_param == -1)
return;
if (update_tree)
<API key>(codec);
}
static void <API key>(struct hda_codec *codec)
{
unsigned int vendor_param;
vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0,
<API key>, 0);
if (vendor_param == -1 || vendor_param & INTEL_EN_DP12)
return;
/* enable DP1.2 mode */
vendor_param |= INTEL_EN_DP12;
<API key>(codec, INTEL_VENDOR_NID, 0,
<API key>, vendor_param);
}
/* Haswell needs to re-issue the vendor-specific verbs before turning to D0.
* Otherwise you may get severe h/w communication errors.
*/
static void <API key>(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state)
{
if (power_state == AC_PWRST_D0) {
<API key>(codec, false);
<API key>(codec);
}
snd_hda_codec_read(codec, fg, 0, <API key>, power_state);
<API key>(codec, fg, power_state);
}
static int patch_generic_hdmi(struct hda_codec *codec)
{
struct hdmi_spec *spec;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
codec->spec = spec;
hdmi_array_init(spec, 4);
if (codec->vendor_id == 0x80862807) {
<API key>(codec, true);
<API key>(codec);
}
if (hdmi_parse_codec(codec) < 0) {
codec->spec = NULL;
kfree(spec);
return -EINVAL;
}
codec->patch_ops = <API key>;
if (codec->vendor_id == 0x80862807)
codec->patch_ops.set_power_state = <API key>;
<API key>(codec);
<API key>();
return 0;
}
/*
* Shared non-generic implementations
*/
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
struct hda_pcm *info;
unsigned int chans;
struct hda_pcm_stream *pstr;
struct hdmi_spec_per_cvt *per_cvt;
per_cvt = get_cvt(spec, 0);
chans = get_wcaps(codec, per_cvt->cvt_nid);
chans = get_wcaps_channels(chans);
info = snd_array_new(&spec->pcm_rec);
if (!info)
return -ENOMEM;
info->name = get_pin(spec, 0)->pcm_name;
sprintf(info->name, "HDMI 0");
info->pcm_type = HDA_PCM_TYPE_HDMI;
pstr = &info->stream[<API key>];
*pstr = spec->pcm_playback;
pstr->nid = per_cvt->cvt_nid;
if (pstr->channels_max <= 2 && chans && chans <= 16)
pstr->channels_max = chans;
codec->num_pcms = 1;
codec->pcm_info = info;
return 0;
}
/* unsolicited event for jack sensing */
static void <API key>(struct hda_codec *codec,
unsigned int res)
{
<API key>(codec);
<API key>(codec);
}
/* <API key> can be used for simple_hdmi, too,
* as long as spec->pins[] is set correctly
*/
#define <API key> <API key>
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_cvt *per_cvt;
int err;
per_cvt = get_cvt(spec, 0);
err = <API key>(codec, per_cvt->cvt_nid,
per_cvt->cvt_nid,
HDA_PCM_TYPE_HDMI);
if (err < 0)
return err;
return <API key>(codec, 0);
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = get_pin(spec, 0);
hda_nid_t pin = per_pin->pin_nid;
snd_hda_codec_write(codec, pin, 0,
<API key>, PIN_OUT);
/* some codecs require to unmute the pin */
if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP)
snd_hda_codec_write(codec, pin, 0, <API key>,
AMP_OUT_UNMUTE);
<API key>(codec, pin, pin);
return 0;
}
static void <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
hdmi_array_free(spec);
kfree(spec);
}
/*
* Nvidia specific implementations
*/
#define <API key> 0xF79
#define <API key> 0xF7A
#define <API key> 0xF98
#define <API key> 0xF99
#define <API key> 0x04
#define <API key> 0x05
static const hda_nid_t nvhdmi_con_nids_7x[4] = {
/*front, rear, clfe, rear_surr */
0x6, 0x8, 0xa, 0xc,
};
static const struct hda_verb <API key>[] = {
/* set audio protect on */
{ 0x1, <API key>, 0x1},
/* enable digital output on pin widget */
{ 0x5, <API key>, PIN_OUT | 0x5 },
{} /* terminator */
};
static const struct hda_verb <API key>[] = {
/* set audio protect on */
{ 0x1, <API key>, 0x1},
/* enable digital output on pin widget */
{ 0x5, <API key>, PIN_OUT | 0x5 },
{ 0x7, <API key>, PIN_OUT | 0x5 },
{ 0x9, <API key>, PIN_OUT | 0x5 },
{ 0xb, <API key>, PIN_OUT | 0x5 },
{ 0xd, <API key>, PIN_OUT | 0x5 },
{} /* terminator */
};
#ifdef <API key>
/* support only the safe format and rate */
#define SUPPORTED_RATES <API key>
#define SUPPORTED_MAXBPS 16
#define SUPPORTED_FORMATS <API key>
#else
/* support all rates and formats */
#define SUPPORTED_RATES \
(<API key> | <API key> | <API key> |\
<API key> | <API key> | <API key> |\
<API key>)
#define SUPPORTED_MAXBPS 24
#define SUPPORTED_FORMATS \
(<API key> | <API key>)
#endif
static int nvhdmi_7x_init_2ch(struct hda_codec *codec)
{
<API key>(codec, <API key>);
return 0;
}
static int nvhdmi_7x_init_8ch(struct hda_codec *codec)
{
<API key>(codec, <API key>);
return 0;
}
static unsigned int channels_2_6_8[] = {
2, 6, 8
};
static unsigned int channels_2_8[] = {
2, 8
};
static struct <API key> <API key> = {
.count = ARRAY_SIZE(channels_2_6_8),
.list = channels_2_6_8,
.mask = 0,
};
static struct <API key> <API key> = {
.count = ARRAY_SIZE(channels_2_8),
.list = channels_2_8,
.mask = 0,
};
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
struct <API key> *<API key> = NULL;
switch (codec->preset->id) {
case 0x10de0002:
case 0x10de0003:
case 0x10de0005:
case 0x10de0006:
<API key> = &<API key>;
break;
case 0x10de0007:
<API key> = &<API key>;
break;
default:
break;
}
if (<API key> != NULL) {
<API key>(substream->runtime, 0,
<API key>,
<API key>);
} else {
<API key>(substream->runtime, 0,
<API key>, 2);
}
return <API key>(codec, &spec->multiout);
}
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
return <API key>(codec, &spec->multiout);
}
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
return <API key>(codec, &spec->multiout,
stream_tag, format, substream);
}
static const struct hda_pcm_stream simple_pcm_playback = {
.substreams = 1,
.channels_min = 2,
.channels_max = 2,
.ops = {
.open = <API key>,
.close = <API key>,
.prepare = <API key>
},
};
static const struct hda_codec_ops <API key> = {
.build_controls = <API key>,
.build_pcms = <API key>,
.init = <API key>,
.free = <API key>,
.unsol_event = <API key>,
};
static int patch_simple_hdmi(struct hda_codec *codec,
hda_nid_t cvt_nid, hda_nid_t pin_nid)
{
struct hdmi_spec *spec;
struct hdmi_spec_per_cvt *per_cvt;
struct hdmi_spec_per_pin *per_pin;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
return -ENOMEM;
codec->spec = spec;
hdmi_array_init(spec, 1);
spec->multiout.num_dacs = 0; /* no analog */
spec->multiout.max_channels = 2;
spec->multiout.dig_out_nid = cvt_nid;
spec->num_cvts = 1;
spec->num_pins = 1;
per_pin = snd_array_new(&spec->pins);
per_cvt = snd_array_new(&spec->cvts);
if (!per_pin || !per_cvt) {
<API key>(codec);
return -ENOMEM;
}
per_cvt->cvt_nid = cvt_nid;
per_pin->pin_nid = pin_nid;
spec->pcm_playback = simple_pcm_playback;
codec->patch_ops = <API key>;
return 0;
}
static void <API key>(struct hda_codec *codec,
int channels)
{
unsigned int chanmask;
int chan = channels ? (channels - 1) : 1;
switch (channels) {
default:
case 0:
case 2:
chanmask = 0x00;
break;
case 4:
chanmask = 0x08;
break;
case 6:
chanmask = 0x0b;
break;
case 8:
chanmask = 0x13;
break;
}
/* Set the audio infoframe channel allocation and checksum fields. The
* channel count is computed implicitly by the hardware. */
snd_hda_codec_write(codec, 0x1, 0,
<API key>, chanmask);
snd_hda_codec_write(codec, 0x1, 0,
<API key>,
(0x71 - chan - chanmask));
}
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
int i;
snd_hda_codec_write(codec, <API key>,
0, <API key>, 0);
for (i = 0; i < 4; i++) {
/* set the stream id */
snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
<API key>, 0);
/* set the stream format */
snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
<API key>, 0);
}
/* The audio hardware sends a channel count of 0x7 (8ch) when all the
* streams are disabled. */
<API key>(codec, 8);
return <API key>(codec, &spec->multiout);
}
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *substream)
{
int chs;
unsigned int dataDCC2, channel_id;
int i;
struct hdmi_spec *spec = codec->spec;
struct hda_spdif_out *spdif;
struct hdmi_spec_per_cvt *per_cvt;
mutex_lock(&codec->spdif_mutex);
per_cvt = get_cvt(spec, 0);
spdif = <API key>(codec, per_cvt->cvt_nid);
chs = substream->runtime->channels;
dataDCC2 = 0x2;
/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
snd_hda_codec_write(codec,
<API key>,
0,
<API key>,
spdif->ctls & ~AC_DIG1_ENABLE & 0xff);
/* set the stream id */
snd_hda_codec_write(codec, <API key>, 0,
<API key>, (stream_tag << 4) | 0x0);
/* set the stream format */
snd_hda_codec_write(codec, <API key>, 0,
<API key>, format);
/* turn on again (if needed) */
/* enable and set the channel status audio/data flag */
if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec,
<API key>,
0,
<API key>,
spdif->ctls & 0xff);
snd_hda_codec_write(codec,
<API key>,
0,
<API key>, dataDCC2);
}
for (i = 0; i < 4; i++) {
if (chs == 2)
channel_id = 0;
else
channel_id = i * 2;
/* turn off SPDIF once;
*otherwise the IEC958 bits won't be updated
*/
if (codec->spdif_status_reset &&
(spdif->ctls & AC_DIG1_ENABLE))
snd_hda_codec_write(codec,
nvhdmi_con_nids_7x[i],
0,
<API key>,
spdif->ctls & ~AC_DIG1_ENABLE & 0xff);
/* set the stream id */
snd_hda_codec_write(codec,
nvhdmi_con_nids_7x[i],
0,
<API key>,
(stream_tag << 4) | channel_id);
/* set the stream format */
snd_hda_codec_write(codec,
nvhdmi_con_nids_7x[i],
0,
<API key>,
format);
/* turn on again (if needed) */
/* enable and set the channel status audio/data flag */
if (codec->spdif_status_reset &&
(spdif->ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec,
nvhdmi_con_nids_7x[i],
0,
<API key>,
spdif->ctls & 0xff);
snd_hda_codec_write(codec,
nvhdmi_con_nids_7x[i],
0,
<API key>, dataDCC2);
}
}
<API key>(codec, chs);
mutex_unlock(&codec->spdif_mutex);
return 0;
}
static const struct hda_pcm_stream <API key> = {
.substreams = 1,
.channels_min = 2,
.channels_max = 8,
.nid = <API key>,
.rates = SUPPORTED_RATES,
.maxbps = SUPPORTED_MAXBPS,
.formats = SUPPORTED_FORMATS,
.ops = {
.open = <API key>,
.close = <API key>,
.prepare = <API key>
},
};
static int patch_nvhdmi_2ch(struct hda_codec *codec)
{
struct hdmi_spec *spec;
int err = patch_simple_hdmi(codec, <API key>,
<API key>);
if (err < 0)
return err;
codec->patch_ops.init = nvhdmi_7x_init_2ch;
/* override the PCM rates, etc, as the codec doesn't give full list */
spec = codec->spec;
spec->pcm_playback.rates = SUPPORTED_RATES;
spec->pcm_playback.maxbps = SUPPORTED_MAXBPS;
spec->pcm_playback.formats = SUPPORTED_FORMATS;
return 0;
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
int err = <API key>(codec);
if (!err) {
struct hda_pcm *info = get_pcm_rec(spec, 0);
info->own_chmap = true;
}
return err;
}
static int <API key>(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
struct hda_pcm *info;
struct snd_pcm_chmap *chmap;
int err;
err = <API key>(codec);
if (err < 0)
return err;
/* add channel maps */
info = get_pcm_rec(spec, 0);
err = <API key>(info->pcm,
<API key>,
snd_pcm_alt_chmaps, 8, 0, &chmap);
if (err < 0)
return err;
switch (codec->preset->id) {
case 0x10de0002:
case 0x10de0003:
case 0x10de0005:
case 0x10de0006:
chmap->channel_mask = (1U << 2) | (1U << 8);
break;
case 0x10de0007:
chmap->channel_mask = (1U << 2) | (1U << 6) | (1U << 8);
}
return 0;
}
static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
{
struct hdmi_spec *spec;
int err = patch_nvhdmi_2ch(codec);
if (err < 0)
return err;
spec = codec->spec;
spec->multiout.max_channels = 8;
spec->pcm_playback = <API key>;
codec->patch_ops.init = nvhdmi_7x_init_8ch;
codec->patch_ops.build_pcms = <API key>;
codec->patch_ops.build_controls = <API key>;
/* Initialize the audio infoframe channel mask and checksum to something
* valid */
<API key>(codec, 8);
return 0;
}
static int patch_nvhdmi(struct hda_codec *codec)
{
struct hdmi_spec *spec;
int err;
err = patch_generic_hdmi(codec);
if (err)
return err;
spec = codec->spec;
spec->dyn_pin_out = true;
return 0;
}
/*
* ATI-specific implementations
*
* FIXME: we may omit the whole this and use the generic code once after
* it's confirmed to work.
*/
#define ATIHDMI_CVT_NID 0x02 /* audio converter */
#define ATIHDMI_PIN_NID 0x03 /* HDMI output pin */
static int <API key>(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *substream)
{
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_cvt *per_cvt = get_cvt(spec, 0);
int chans = substream->runtime->channels;
int i, err;
err = <API key>(hinfo, codec, stream_tag, format,
substream);
if (err < 0)
return err;
snd_hda_codec_write(codec, per_cvt->cvt_nid, 0,
<API key>, chans - 1);
/* FIXME: XXX */
for (i = 0; i < chans; i++) {
snd_hda_codec_write(codec, per_cvt->cvt_nid, 0,
<API key>,
(i << 4) | i);
}
return 0;
}
static int patch_atihdmi(struct hda_codec *codec)
{
struct hdmi_spec *spec;
int err = patch_simple_hdmi(codec, ATIHDMI_CVT_NID, ATIHDMI_PIN_NID);
if (err < 0)
return err;
spec = codec->spec;
spec->pcm_playback.ops.prepare = <API key>;
return 0;
}
/* VIA HDMI Implementation */
#define VIAHDMI_CVT_NID 0x02 /* audio converter1 */
#define VIAHDMI_PIN_NID 0x03 /* HDMI output pin1 */
static int patch_via_hdmi(struct hda_codec *codec)
{
return patch_simple_hdmi(codec, VIAHDMI_CVT_NID, VIAHDMI_PIN_NID);
}
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_hdmi[] = {
{ .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002aa01, .name = "R6xx HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10de0002, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0003, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0005, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0006, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0007, .name = "MCP79/7A HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_nvhdmi },
{ .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_nvhdmi },
/* 17 is known to be absent */
{ .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x11069f80, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi },
{ .id = 0x11069f81, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi },
{ .id = 0x11069f84, .name = "VX11 HDMI/DP", .patch = patch_generic_hdmi },
{ .id = 0x11069f85, .name = "VX11 HDMI/DP", .patch = patch_generic_hdmi },
{ .id = 0x80860054, .name = "IbexPeak HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862801, .name = "Bearlake HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862802, .name = "Cantiga HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862803, .name = "Eaglelake HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862804, .name = "IbexPeak HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862805, .name = "CougarPoint HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862806, .name = "PantherPoint HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862807, .name = "Haswell HDMI", .patch = patch_generic_hdmi },
{ .id = 0x80862880, .name = "CedarTrail HDMI", .patch = patch_generic_hdmi },
{ .id = 0x808629fb, .name = "Crestline HDMI", .patch = patch_generic_hdmi },
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:1002793c");
MODULE_ALIAS("snd-hda-codec-id:10027919");
MODULE_ALIAS("snd-hda-codec-id:1002791a");
MODULE_ALIAS("snd-hda-codec-id:1002aa01");
MODULE_ALIAS("snd-hda-codec-id:10951390");
MODULE_ALIAS("snd-hda-codec-id:10951392");
MODULE_ALIAS("snd-hda-codec-id:10de0002");
MODULE_ALIAS("snd-hda-codec-id:10de0003");
MODULE_ALIAS("snd-hda-codec-id:10de0005");
MODULE_ALIAS("snd-hda-codec-id:10de0006");
MODULE_ALIAS("snd-hda-codec-id:10de0007");
MODULE_ALIAS("snd-hda-codec-id:10de000a");
MODULE_ALIAS("snd-hda-codec-id:10de000b");
MODULE_ALIAS("snd-hda-codec-id:10de000c");
MODULE_ALIAS("snd-hda-codec-id:10de000d");
MODULE_ALIAS("snd-hda-codec-id:10de0010");
MODULE_ALIAS("snd-hda-codec-id:10de0011");
MODULE_ALIAS("snd-hda-codec-id:10de0012");
MODULE_ALIAS("snd-hda-codec-id:10de0013");
MODULE_ALIAS("snd-hda-codec-id:10de0014");
MODULE_ALIAS("snd-hda-codec-id:10de0015");
MODULE_ALIAS("snd-hda-codec-id:10de0016");
MODULE_ALIAS("snd-hda-codec-id:10de0018");
MODULE_ALIAS("snd-hda-codec-id:10de0019");
MODULE_ALIAS("snd-hda-codec-id:10de001a");
MODULE_ALIAS("snd-hda-codec-id:10de001b");
MODULE_ALIAS("snd-hda-codec-id:10de001c");
MODULE_ALIAS("snd-hda-codec-id:10de0040");
MODULE_ALIAS("snd-hda-codec-id:10de0041");
MODULE_ALIAS("snd-hda-codec-id:10de0042");
MODULE_ALIAS("snd-hda-codec-id:10de0043");
MODULE_ALIAS("snd-hda-codec-id:10de0044");
MODULE_ALIAS("snd-hda-codec-id:10de0051");
MODULE_ALIAS("snd-hda-codec-id:10de0060");
MODULE_ALIAS("snd-hda-codec-id:10de0067");
MODULE_ALIAS("snd-hda-codec-id:10de8001");
MODULE_ALIAS("snd-hda-codec-id:11069f80");
MODULE_ALIAS("snd-hda-codec-id:11069f81");
MODULE_ALIAS("snd-hda-codec-id:11069f84");
MODULE_ALIAS("snd-hda-codec-id:11069f85");
MODULE_ALIAS("snd-hda-codec-id:17e80047");
MODULE_ALIAS("snd-hda-codec-id:80860054");
MODULE_ALIAS("snd-hda-codec-id:80862801");
MODULE_ALIAS("snd-hda-codec-id:80862802");
MODULE_ALIAS("snd-hda-codec-id:80862803");
MODULE_ALIAS("snd-hda-codec-id:80862804");
MODULE_ALIAS("snd-hda-codec-id:80862805");
MODULE_ALIAS("snd-hda-codec-id:80862806");
MODULE_ALIAS("snd-hda-codec-id:80862807");
MODULE_ALIAS("snd-hda-codec-id:80862880");
MODULE_ALIAS("snd-hda-codec-id:808629fb");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("HDMI HD-audio codec");
MODULE_ALIAS("<API key>");
MODULE_ALIAS("<API key>");
MODULE_ALIAS("<API key>");
static struct <API key> intel_list = {
.preset = snd_hda_preset_hdmi,
.owner = THIS_MODULE,
};
static int __init patch_hdmi_init(void)
{
return <API key>(&intel_list);
}
static void __exit patch_hdmi_exit(void)
{
<API key>(&intel_list);
}
module_init(patch_hdmi_init)
module_exit(patch_hdmi_exit)
|
<?php
namespace eZ\Publish\Core\Persistence\Legacy\Content\Search\Common\Gateway\SortClauseHandler;
use eZ\Publish\Core\Persistence\Legacy\Content\Search\Common\Gateway\SortClauseHandler;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use eZ\Publish\Core\Persistence\Database\SelectQuery;
/**
* Content locator gateway implementation using the DoctrineDatabase.
*/
class ContentName extends SortClauseHandler
{
/**
* Check if this sort clause handler accepts to handle the given sort clause.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
*
* @return boolean
*/
public function accept( SortClause $sortClause )
{
return $sortClause instanceof SortClause\ContentName;
}
/**
* Apply selects to the query
*
* Returns the name of the (aliased) column, which information should be
* used for sorting.
*
* @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
* @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
* @param int $number
*
* @return string
*/
public function applySelect( SelectQuery $query, SortClause $sortClause, $number )
{
$query
->select(
$query->alias(
$this->dbHandler->quoteColumn(
"name",
"ezcontentobject"
),
$column = $this->getSortColumnName( $number )
)
);
return $column;
}
}
|
-- Convert schema '/home/martchus/repos/openQA/script/../dbicdh/_source/deploy/46/001-auto.yml' to '/home/martchus/repos/openQA/script/../dbicdh/_source/deploy/47/001-auto.yml':;
;
BEGIN;
;
CREATE TABLE job_group_parents (
id INTEGER PRIMARY KEY NOT NULL,
name text NOT NULL,
<API key> integer,
<API key> integer,
<API key> integer,
<API key> integer,
<API key> integer,
default_priority integer,
sort_order integer,
description text,
t_created timestamp NOT NULL,
t_updated timestamp NOT NULL
);
;
CREATE UNIQUE INDEX <API key> ON job_group_parents (name);
;
CREATE TEMPORARY TABLE <API key> (
id INTEGER PRIMARY KEY NOT NULL,
name text NOT NULL,
parent_id integer,
size_limit_gb integer,
keep_logs_in_days integer,
<API key> integer,
<API key> integer,
<API key> integer,
default_priority integer,
sort_order integer,
description text,
t_created timestamp NOT NULL,
t_updated timestamp NOT NULL,
FOREIGN KEY (parent_id) REFERENCES job_group_parents(id) ON DELETE SET NULL ON UPDATE CASCADE
);
;
INSERT INTO <API key>( id, name, size_limit_gb, keep_logs_in_days, t_created, t_updated) SELECT id, name, size_limit_gb, keep_logs_in_days, t_created, t_updated FROM job_groups;
;
DROP TABLE job_groups;
;
CREATE TABLE job_groups (
id INTEGER PRIMARY KEY NOT NULL,
name text NOT NULL,
parent_id integer,
size_limit_gb integer,
keep_logs_in_days integer,
<API key> integer,
<API key> integer,
<API key> integer,
default_priority integer,
sort_order integer,
description text,
t_created timestamp NOT NULL,
t_updated timestamp NOT NULL,
FOREIGN KEY (parent_id) REFERENCES job_group_parents(id) ON DELETE SET NULL ON UPDATE CASCADE
);
;
CREATE INDEX <API key> ON job_groups (parent_id);
;
CREATE UNIQUE INDEX job_groups_name02 ON job_groups (name);
;
INSERT INTO job_groups SELECT id, name, parent_id, size_limit_gb, keep_logs_in_days, <API key>, <API key>, <API key>, default_priority, sort_order, description, t_created, t_updated FROM <API key>;
;
DROP TABLE <API key>;
;
COMMIT;
|
/*
* Scripts for spells with SPELLFAMILY_ROGUE and SPELLFAMILY_GENERIC spells used by rogue players.
* Ordered alphabetically using scriptname.
* Scriptnames of files in this file should be prefixed with "spell_rog_".
*/
#include "Player.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Containers.h"
enum RogueSpells
{
<API key> = 13877,
<API key> = 22482,
<API key> = 31231,
<API key> = 3409,
<API key> = 56819,
<API key> = 51690,
<API key> = 57840,
<API key> = 57841,
<API key> = 61851,
<API key> = 31665,
<API key> = 31223,
<API key> = 31666,
<API key> = 58426,
<API key> = 58428,
<API key> = 58427,
<API key> = 58670,
<API key> = 5940,
<API key> = 5171,
<API key> = 57933,
<API key> = 59628,
<API key> = 14171,
SPELL_ROGUE_RUPTURE = 1943,
};
enum RogueSpellIcons
{
<API key> = 4819
};
// 13877, 33735, (check 51211, 65956) - Blade Flurry
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
public:
<API key>()
{
_procTarget = nullptr;
}
private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
_procTarget = GetTarget()->SelectNearbyTarget(eventInfo.GetProcTarget());
return _procTarget && eventInfo.GetDamageInfo();
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
<API key>();
TC_LOG_ERROR("misc", "damage: %u procSpell: %u",
eventInfo.GetDamageInfo()->GetDamage(), eventInfo.GetDamageInfo()->GetSpellInfo() ? eventInfo.GetDamageInfo()->GetSpellInfo()->Id : 0);
GetTarget()->CastCustomSpell(<API key>, <API key>, eventInfo.GetDamageInfo()->GetDamage(), _procTarget, true, NULL, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(<API key>::CheckProc);
if (m_scriptSpellId == <API key>)
OnEffectProc += AuraEffectProcFn(<API key>::HandleProc, EFFECT_0, <API key>);
else
OnEffectProc += AuraEffectProcFn(<API key>::HandleProc, EFFECT_0, <API key>);
}
private:
Unit* _procTarget;
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 31228 - Cheat Death
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
public:
<API key>()
{
absorbChance = 0;
}
private:
uint32 absorbChance;
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
bool Load() override
{
absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
Player* target = GetTarget()->ToPlayer();
if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(<API key>) || !roll_chance_i(absorbChance))
return;
target->CastSpell(target, <API key>, true);
target->AddSpellCooldown(<API key>, 0, time(NULL) + 60);
uint32 health10 = target-><API key>(10);
// hp > 10% - absorb hp till 10%
if (target->GetHealth() > health10)
absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10;
// hp lower than 10% - absorb everything
else
absorbAmount = dmgInfo.GetDamage();
}
void Register() override
{
DoEffectCalcAmount += <API key>(<API key>::CalculateAmount, EFFECT_0, <API key>);
OnEffectAbsorb += AuraEffectAbsorbFn(<API key>::Absorb, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// -51625 - Deadly Brew
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
<API key>();
GetTarget()->CastSpell(eventInfo.GetProcTarget(), <API key>, true, NULL, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(<API key>::OnProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// -51664 - Cut to the Chase
class <API key> : public SpellScriptLoader
{
public:
<API key> () : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
<API key>();
if (Aura* aur = GetTarget()->GetAura(<API key>))
aur->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(<API key>::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 2818 - Deadly Poison
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public SpellScript
{
PrepareSpellScript(<API key>);
public:
<API key>()
{
_stackAmount = 0;
}
private:
bool Load() override
{
// at this point CastItem must already be initialized
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
}
void HandleBeforeHit()
{
if (Unit* target = GetHitUnit())
// Deadly Poison
if (AuraEffect const* aurEff = target->GetAuraEffect(<API key>, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID()))
_stackAmount = aurEff->GetBase()->GetStackAmount();
}
void HandleAfterHit()
{
if (_stackAmount < 5)
return;
Player* player = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
Item* item = player->GetItemByPos(<API key>, <API key>);
if (item == GetCastItem())
item = player->GetItemByPos(<API key>, <API key>);
if (!item)
return;
// item combat enchantments
for (uint8 slot = 0; slot < <API key>; ++slot)
{
if (slot > <API key> && slot < <API key>) // not holding enchantment id
continue;
<API key> const* enchant = <API key>.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot)));
if (!enchant)
continue;
for (uint8 s = 0; s < 3; ++s)
{
if (enchant->type[s] != <API key>)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
if (!spellInfo)
{
TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUIDLow(), enchant->spellid[s]);
continue;
}
// Proc only rogue poisons
if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON)
continue;
// Do not reproc deadly
if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0))
continue;
if (spellInfo->IsPositive())
player->CastSpell(player, enchant->spellid[s], true, item);
else
player->CastSpell(target, enchant->spellid[s], true, item);
}
}
}
}
void Register() override
{
BeforeHit += SpellHitFn(<API key>::HandleBeforeHit);
AfterHit += SpellHitFn(<API key>::HandleAfterHit);
}
uint8 _stackAmount;
};
SpellScript* GetSpellScript() const override
{
return new <API key>();
}
};
// 51690 - Killing Spree
#define <API key> "<API key>"
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader(<API key>) { }
class <API key> : public SpellScript
{
PrepareSpellScript(<API key>);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty() || GetCaster()->GetVehicleBase())
FinishCast(<API key>);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Aura* aura = GetCaster()->GetAura(<API key>))
{
if (<API key>* script = dynamic_cast<<API key>*>(aura->GetScriptByName(<API key>)))
script->AddTarget(GetHitUnit());
}
}
void Register() override
{
<API key> += <API key>(<API key>::FilterTargets, EFFECT_1, <API key>);
OnEffectHitTarget += SpellEffectFn(<API key>::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new <API key>();
}
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>)
|| !sSpellMgr->GetSpellInfo(<API key>)
|| !sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void HandleApply(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), <API key>, true);
}
void <API key>(AuraEffect const* /*aurEff*/)
{
while (!_targets.empty())
{
ObjectGuid guid = Trinity::Containers::<API key>(_targets);
if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid))
{
GetTarget()->CastSpell(target, <API key>, true);
GetTarget()->CastSpell(target, <API key>, true);
break;
}
else
_targets.remove(guid);
}
}
void HandleRemove(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
GetTarget()-><API key>(<API key>);
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(<API key>::HandleApply, EFFECT_0, <API key>, <API key>);
OnEffectPeriodic += <API key>(<API key>::<API key>, EFFECT_0, <API key>);
AfterEffectRemove += AuraEffectRemoveFn(<API key>::HandleRemove, EFFECT_0, <API key>, <API key>);
}
public:
void AddTarget(Unit* target)
{
_targets.push_back(target->GetGUID());
}
private:
GuidList _targets;
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 31666 - Master of Subtlety
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void <API key>(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
if (!target->HasAuraType(<API key>))
target-><API key>(<API key>);
}
void Register()
{
OnEffectPeriodic += <API key>(<API key>::<API key>, EFFECT_0, <API key>);
}
};
AuraScript* GetAuraScript() const
{
return new <API key>();
}
};
// 31130 - Nerves of Steel
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
public:
<API key>()
{
absorbPct = 0;
}
private:
uint32 absorbPct;
bool Load() override
{
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
return true;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// reduces all damage taken while stun or fear
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register() override
{
DoEffectCalcAmount += <API key>(<API key>::CalculateAmount, EFFECT_0, <API key>);
OnEffectAbsorb += AuraEffectAbsorbFn(<API key>::Absorb, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 58428 - Overkill
class spell_rog_overkill : public SpellScriptLoader
{
public:
spell_rog_overkill() : SpellScriptLoader("spell_rog_overkill") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void <API key>(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
if (!target->HasAuraType(<API key>))
target-><API key>(<API key>);
}
void Register()
{
OnEffectPeriodic += <API key>(<API key>::<API key>, EFFECT_0, <API key>);
}
};
AuraScript* GetAuraScript() const
{
return new <API key>();
}
};
// 14185 - Preparation
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public SpellScript
{
PrepareSpellScript(<API key>);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
// immediately finishes the cooldown on certain Rogue abilities
SpellCooldowns const& cm = caster->GetSpellCooldownMap();
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
{
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE)
{
++itr;
continue;
}
if ((spellInfo->SpellFamilyFlags[1] & <API key> || // Shadowstep
spellInfo->SpellFamilyFlags[0] & <API key>) || // Vanish, Sprint
// Glyph of Preparation
(caster->HasAura(<API key>) &&
(spellInfo->SpellFamilyFlags[1] & <API key> || // Dismantle, Smoke Bomb
spellInfo->SpellFamilyFlags[0] & <API key>))) // Kick
{
caster->RemoveSpellCooldown((itr++)->first, true);
}
else
++itr;
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(<API key>::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new <API key>();
}
};
// 51685 - Prey on the Weak
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void <API key>(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
Unit* victim = target->GetVictim();
if (victim && (target->GetHealthPct() > victim->GetHealthPct()))
{
if (!target->HasAura(<API key>))
{
int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
target->CastCustomSpell(target, <API key>, &bp, nullptr, nullptr, true);
}
}
else
target-><API key>(<API key>);
}
void Register() override
{
OnEffectPeriodic += <API key>(<API key>::<API key>, EFFECT_0, <API key>);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 73651 - Recuperate
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* caster = GetCaster())
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
effect->RecalculateAmount(caster);
}
void CalculateBonus(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
canBeRecalculated = false;
if (Unit* caster = GetCaster())
{
int32 baseAmount = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster) * 1000;
// Improved Recuperate
if (AuraEffect const* auraEffect = caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, <API key>, EFFECT_0))
baseAmount += auraEffect->GetAmount();
amount = CalculatePct(caster->GetMaxHealth(), float(baseAmount) / 1000.0f);
}
}
void Register() override
{
OnEffectPeriodic += <API key>(<API key>::OnPeriodic, EFFECT_0, <API key>);
DoEffectCalcAmount += <API key>(<API key>::CalculateBonus, EFFECT_0, <API key>);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 1943 - Rupture
class spell_rog_rupture : public SpellScriptLoader
{
public:
spell_rog_rupture() : SpellScriptLoader("spell_rog_rupture") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Load() override
{
Unit* caster = GetCaster();
return caster && caster->GetTypeId() == TYPEID_PLAYER;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
if (Unit* caster = GetCaster())
{
canBeRecalculated = false;
float const attackpowerPerCombo[6] =
{
0.0f,
0.015f, // 1 point: ${($m1 + $b1*1 + 0.015 * $AP) * 4} damage over 8 secs
0.024f, // 2 points: ${($m1 + $b1*2 + 0.024 * $AP) * 5} damage over 10 secs
0.03f, // 3 points: ${($m1 + $b1*3 + 0.03 * $AP) * 6} damage over 12 secs
0.03428571f, // 4 points: ${($m1 + $b1*4 + 0.03428571 * $AP) * 7} damage over 14 secs
0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
};
uint8 cp = caster->ToPlayer()->GetComboPoints();
if (cp > 5)
cp = 5;
amount += int32(caster-><API key>(BASE_ATTACK) * attackpowerPerCombo[cp]);
}
}
void Register() override
{
DoEffectCalcAmount += <API key>(<API key>::CalculateAmount, EFFECT_0, <API key>);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 5938 - Shiv
class spell_rog_shiv : public SpellScriptLoader
{
public:
spell_rog_shiv() : SpellScriptLoader("spell_rog_shiv") { }
class <API key> : public SpellScript
{
PrepareSpellScript(<API key>);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
caster->CastSpell(unitTarget, <API key>, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(<API key>::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new <API key>();
}
};
// 1784 - Stealth
class spell_rog_stealth : public SpellScriptLoader
{
public:
spell_rog_stealth() : SpellScriptLoader("spell_rog_stealth") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(<API key>) ||
!sSpellMgr->GetSpellInfo(<API key>) ||
!sSpellMgr->GetSpellInfo(<API key>) ||
!sSpellMgr->GetSpellInfo(<API key>) ||
!sSpellMgr->GetSpellInfo(<API key>) ||
!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
Unit* target = GetTarget();
// Master of Subtlety
if (AuraEffect const* aurEff = target->GetAuraEffect(<API key>, EFFECT_0))
{
int32 basepoints0 = aurEff->GetAmount();
target->CastCustomSpell(target, <API key>, &basepoints0, NULL, NULL, true);
}
// Overkill
if (target->HasAura(<API key>))
target->CastSpell(target, <API key>, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
Unit* target = GetTarget();
// Master of subtlety
if (target->HasAura(<API key>))
target->CastSpell(target, <API key>, true);
// Overkill
if (target->HasAura(<API key>))
target->CastSpell(target, <API key>, true);
}
void Register()
{
AfterEffectApply += AuraEffectApplyFn(<API key>::HandleEffectApply, EFFECT_0, <API key>, <API key>);
AfterEffectRemove += AuraEffectRemoveFn(<API key>::HandleEffectRemove, EFFECT_0, <API key>, <API key>);
}
};
AuraScript* GetAuraScript() const
{
return new <API key>();
}
};
// 57934 - Tricks of the Trade
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
public:
<API key>()
{
_redirectTarget = nullptr;
}
private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
if (!sSpellMgr->GetSpellInfo(<API key>))
return false;
return true;
}
void OnRemove(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
if (<API key>()->GetRemoveMode() != <API key>)
GetTarget()->ResetRedirectThreat();
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
_redirectTarget = GetTarget()-><API key>();
return _redirectTarget != nullptr;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
<API key>();
Unit* target = GetTarget();
target->CastSpell(_redirectTarget, <API key>, true);
target->CastSpell(target, <API key>, true);
Remove(<API key>); // maybe handle by proc charges
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(<API key>::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, <API key>);
DoCheckProc += AuraCheckProcFn(<API key>::CheckProc);
OnEffectProc += AuraEffectProcFn(<API key>::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
private:
Unit* _redirectTarget;
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
// 59628 - Tricks of the Trade (Proc)
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public AuraScript
{
PrepareAuraScript(<API key>);
void HandleRemove(AuraEffect const* /*aurEff*/, <API key> /*mode*/)
{
GetTarget()->ResetRedirectThreat();
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(<API key>::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, <API key>);
}
};
AuraScript* GetAuraScript() const override
{
return new <API key>();
}
};
class <API key> : public SpellScriptLoader
{
public:
<API key>() : SpellScriptLoader("<API key>") { }
class <API key> : public SpellScript
{
PrepareSpellScript(<API key>);
void HandleHit()
{
if (AuraEffect* blade = GetCaster()-><API key>(<API key>, EFFECT_0))
{
uint8 combo = GetCaster()->ToPlayer()->GetComboPoints();
if (roll_chance_i(blade->GetAmount() * combo))
if (Aura* dot = GetHitUnit()->GetAura(SPELL_ROGUE_RUPTURE, GetCaster()->GetGUID()))
dot->RefreshDuration();
}
}
void Register()
{
OnHit += SpellHitFn(<API key>::HandleHit);
}
};
SpellScript* GetSpellScript() const override
{
return new <API key>();
}
};
void <API key>()
{
new <API key>();
new <API key>();
new <API key>();
new <API key>();
new <API key>();
new <API key>();
new <API key>();
new <API key>();
new spell_rog_overkill();
new <API key>();
new <API key>();
new <API key>();
new spell_rog_rupture();
new spell_rog_shiv();
new spell_rog_stealth();
new <API key>();
new <API key>();
new <API key>();
}
|
/* <API key>: GPL-2.0 */
#include <linux/sched.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/interrupt.h>
#include <asm/sections.h>
#include <asm/ptrace.h>
#include <asm/bitops.h>
#include <asm/stacktrace.h>
#include <asm/unwind.h>
unsigned long <API key>(struct unwind_state *state)
{
if (unwind_done(state))
return 0;
return <API key>(state->ip) ? state->ip : 0;
}
EXPORT_SYMBOL_GPL(<API key>);
static bool outside_of_stack(struct unwind_state *state, unsigned long sp)
{
return (sp <= state->sp) ||
(sp > state->stack_info.end - sizeof(struct stack_frame));
}
static bool update_stack_info(struct unwind_state *state, unsigned long sp)
{
struct stack_info *info = &state->stack_info;
unsigned long *mask = &state->stack_mask;
/* New stack pointer leaves the current stack */
if (get_stack_info(sp, state->task, info, mask) != 0 ||
!on_stack(info, sp, sizeof(struct stack_frame)))
/* 'sp' does not point to a valid stack */
return false;
return true;
}
bool unwind_next_frame(struct unwind_state *state)
{
struct stack_info *info = &state->stack_info;
struct stack_frame *sf;
struct pt_regs *regs;
unsigned long sp, ip;
bool reliable;
regs = state->regs;
if (unlikely(regs)) {
if (state->reuse_sp) {
sp = state->sp;
state->reuse_sp = false;
} else {
sp = READ_ONCE_NOCHECK(regs->gprs[15]);
if (unlikely(outside_of_stack(state, sp))) {
if (!update_stack_info(state, sp))
goto out_err;
}
}
sf = (struct stack_frame *) sp;
ip = READ_ONCE_NOCHECK(sf->gprs[8]);
reliable = false;
regs = NULL;
} else {
sf = (struct stack_frame *) state->sp;
sp = READ_ONCE_NOCHECK(sf->back_chain);
if (likely(sp)) {
/* Non-zero back-chain points to the previous frame */
if (unlikely(outside_of_stack(state, sp))) {
if (!update_stack_info(state, sp))
goto out_err;
}
sf = (struct stack_frame *) sp;
ip = READ_ONCE_NOCHECK(sf->gprs[8]);
reliable = true;
} else {
/* No back-chain, look for a pt_regs structure */
sp = state->sp + <API key>;
if (!on_stack(info, sp, sizeof(struct pt_regs)))
goto out_stop;
regs = (struct pt_regs *) sp;
if (READ_ONCE_NOCHECK(regs->psw.mask) & PSW_MASK_PSTATE)
goto out_stop;
ip = READ_ONCE_NOCHECK(regs->psw.addr);
reliable = true;
}
}
#ifdef <API key>
/* Decode any ftrace redirection */
if (ip == (unsigned long) return_to_handler)
ip = <API key>(state->task, &state->graph_idx,
ip, (void *) sp);
#endif
/* Update unwind state */
state->sp = sp;
state->ip = ip;
state->regs = regs;
state->reliable = reliable;
return true;
out_err:
state->error = true;
out_stop:
state->stack_info.type = STACK_TYPE_UNKNOWN;
return false;
}
EXPORT_SYMBOL_GPL(unwind_next_frame);
void __unwind_start(struct unwind_state *state, struct task_struct *task,
struct pt_regs *regs, unsigned long sp)
{
struct stack_info *info = &state->stack_info;
unsigned long *mask = &state->stack_mask;
bool reliable, reuse_sp;
struct stack_frame *sf;
unsigned long ip;
memset(state, 0, sizeof(*state));
state->task = task;
state->regs = regs;
/* Don't even attempt to start from user mode regs: */
if (regs && user_mode(regs)) {
info->type = STACK_TYPE_UNKNOWN;
return;
}
/* Get current stack pointer and initialize stack info */
if (get_stack_info(sp, task, info, mask) != 0 ||
!on_stack(info, sp, sizeof(struct stack_frame))) {
/* Something is wrong with the stack pointer */
info->type = STACK_TYPE_UNKNOWN;
state->error = true;
return;
}
/* Get the instruction pointer from pt_regs or the stack frame */
if (regs) {
ip = READ_ONCE_NOCHECK(regs->psw.addr);
reliable = true;
reuse_sp = true;
} else {
sf = (struct stack_frame *) sp;
ip = READ_ONCE_NOCHECK(sf->gprs[8]);
reliable = false;
reuse_sp = false;
}
#ifdef <API key>
/* Decode any ftrace redirection */
if (ip == (unsigned long) return_to_handler)
ip = <API key>(state->task, &state->graph_idx,
ip, NULL);
#endif
/* Update unwind state */
state->sp = sp;
state->ip = ip;
state->reliable = reliable;
state->reuse_sp = reuse_sp;
}
EXPORT_SYMBOL_GPL(__unwind_start);
|
#ifndef _SOC_ROMSTAGE_H_
#define _SOC_ROMSTAGE_H_
#include <soc/intel/common/romstage.h>
struct chipset_power_state;
struct chipset_power_state *fill_power_state(void);
void <API key>(void);
void pch_early_init(void);
void pch_uart_init(void);
void <API key>(void);
void enable_smbus(void);
int smbus_read_byte(unsigned device, unsigned address);
int early_spi_read(u32 offset, u32 size, u8 *buffer);
int early_spi_read_wpsr(u8 *sr);
void <API key>(struct pei_data *pei_data);
#endif /* _SOC_ROMSTAGE_H_ */
|
#ifndef _LINUX_MM_TYPES_H
#define _LINUX_MM_TYPES_H
#include <linux/auxvec.h>
#include <linux/types.h>
#include <linux/threads.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/prio_tree.h>
#include <linux/rbtree.h>
#include <linux/rwsem.h>
#include <linux/completion.h>
#include <linux/cpumask.h>
#include <linux/page-debug-flags.h>
#include <asm/page.h>
#include <asm/mmu.h>
#ifndef AT_VECTOR_SIZE_ARCH
#define AT_VECTOR_SIZE_ARCH 0
#endif
#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
struct address_space;
#define USE_SPLIT_PTLOCKS (NR_CPUS >= <API key>)
#if USE_SPLIT_PTLOCKS
typedef atomic_long_t mm_counter_t;
#else /* !USE_SPLIT_PTLOCKS */
typedef unsigned long mm_counter_t;
#endif /* !USE_SPLIT_PTLOCKS */
/*
* Each physical page in the system has a struct page associated with
* it to keep track of whatever it is we are using the page for at the
* moment. Note that we have no way to track which tasks are using
* a page, though if it is a pagecache page, rmap structures can tell us
* who is mapping it.
*/
struct page {
unsigned long flags; /* Atomic flags, some possibly
* updated asynchronously */
atomic_t _count; /* Usage count, see below. */
union {
atomic_t _mapcount; /* Count of ptes mapped in mms,
* to show when page is mapped
* & limit reverse map searches.
*/
struct { /* SLUB */
u16 inuse;
u16 objects;
};
};
union {
struct {
unsigned long private; /* Mapping-private opaque data:
* usually used for buffer_heads
* if PagePrivate set; used for
* swp_entry_t if PageSwapCache;
* indicates order in the buddy
* system if PG_buddy is set.
*/
struct address_space *mapping; /* If low bit clear, points to
* inode address_space, or NULL.
* If page mapped as anonymous
* memory, low bit is set, and
* it points to anon_vma object:
* see PAGE_MAPPING_ANON below.
*/
};
#if USE_SPLIT_PTLOCKS
#ifndef CONFIG_PREEMPT_RT
spinlock_t ptl;
#else
spinlock_t *ptl;
#endif
#endif
struct kmem_cache *slab; /* SLUB: Pointer to slab */
struct page *first_page; /* Compound tail pages */
};
union {
pgoff_t index; /* Our offset within mapping. */
void *freelist; /* SLUB: freelist req. slab lock */
};
struct list_head lru; /* Pageout list, eg. active_list
* protected by zone->lru_lock !
*/
/*
* On machines where all RAM is mapped into kernel address space,
* we can simply calculate the virtual address. On machines with
* highmem some memory is mapped into kernel virtual memory
* dynamically, so we need a place to store that address.
* Note that this field could be 16 bits on x86 ... ;)
*
* Architectures with slow multiplication can define
* WANT_PAGE_VIRTUAL in asm/page.h
*/
#if defined(WANT_PAGE_VIRTUAL)
void *virtual; /* Kernel virtual address (NULL if
not kmapped, ie. highmem) */
#endif /* WANT_PAGE_VIRTUAL */
#ifdef <API key>
unsigned long debug_flags; /* Use atomic bitops on this */
#endif
#ifdef CONFIG_KMEMCHECK
/*
* kmemcheck wants to track the status of each byte in a page; this
* is a pointer to such a status block. NULL if not tracked.
*/
void *shadow;
#endif
};
/*
* A region containing a mapping of a non-memory backed file under NOMMU
* conditions. These are held in a global tree and are pinned by the VMAs that
* map parts of them.
*/
struct vm_region {
struct rb_node vm_rb; /* link in global region tree */
unsigned long vm_flags; /* VMA vm_flags */
unsigned long vm_start; /* start address of region */
unsigned long vm_end; /* region initialised to here */
unsigned long vm_top; /* region allocated to here */
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
struct file *vm_file; /* the backing file or NULL */
int vm_usage; /* region usage count (access under nommu_region_sem) */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
* this region */
};
/*
* This struct defines a memory VMM memory area. There is one of these
* per VM-area/task. A VM area is any part of the process virtual memory
* space that has a special rule for the page-fault handlers (ie a shared
* library, the executable area etc).
*/
struct vm_area_struct {
struct mm_struct * vm_mm; /* The address space we belong to. */
unsigned long vm_start; /* Our start address within vm_mm. */
unsigned long vm_end; /* The first byte after our end address
within vm_mm. */
/* linked list of VM areas per task, sorted by address */
struct vm_area_struct *vm_next, *vm_prev;
pgprot_t vm_page_prot;
unsigned long vm_flags; /* Flags, see mm.h. */
struct rb_node vm_rb;
/*
* For areas with an address space and backing store,
* linkage into the address_space->i_mmap prio tree, or
* linkage to the list of like vmas hanging off its node, or
* linkage of vma in the address_space->i_mmap_nonlinear list.
*/
union {
struct {
struct list_head list;
void *parent; /* aligns with prio_tree_node parent */
struct vm_area_struct *head;
} vm_set;
struct raw_prio_tree_node prio_tree_node;
} shared;
/*
* A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
* list, after a COW of one of the file pages. A MAP_SHARED vma
* can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack
* or brk vma (with NULL file) can only be in an anon_vma list.
*/
struct list_head anon_vma_node; /* Serialized by anon_vma->lock */
struct anon_vma *anon_vma; /* Serialized by page_table_lock */
/* Function pointers to deal with this struct. */
const struct <API key> *vm_ops;
/* Information about our backing store: */
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units, *not* PAGE_CACHE_SIZE */
struct file * vm_file; /* File we map to (can be NULL). */
void * vm_private_data; /* was vm_pte (shared mem) */
unsigned long vm_truncate_count;/* truncate_count or restart_addr */
#ifndef CONFIG_MMU
struct vm_region *vm_region; /* NOMMU mapping region */
#endif
#ifdef CONFIG_NUMA
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
};
struct core_thread {
struct task_struct *task;
struct core_thread *next;
};
struct core_state {
atomic_t nr_threads;
struct core_thread dumper;
struct completion startup;
};
struct mm_struct {
struct vm_area_struct * mmap; /* list of VMAs */
struct rb_root mm_rb;
struct vm_area_struct * mmap_cache; /* last find_vma result */
#ifdef CONFIG_MMU
unsigned long (*get_unmapped_area) (struct file *filp,
unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags);
void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
#endif
unsigned long mmap_base; /* base of mmap area */
unsigned long task_size; /* size of task vm space */
unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
pgd_t * pgd;
atomic_t mm_users; /* How many users with user space? */
atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
int map_count; /* number of VMAs */
struct rw_semaphore mmap_sem;
spinlock_t page_table_lock; /* Protects page tables and some counters */
struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung
* together off init_mm.mmlist, and are protected
* by mmlist_lock
*/
/* Special counters, in some configurations protected by the
* page_table_lock, in other configurations by being atomic.
*/
mm_counter_t _file_rss;
mm_counter_t _anon_rss;
unsigned long hiwater_rss; /* High-watermark of RSS usage */
unsigned long hiwater_vm; /* High-water virtual memory usage */
unsigned long total_vm, locked_vm, shared_vm, exec_vm;
unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
unsigned long start_code, end_code, start_data, end_data;
unsigned long start_brk, brk, start_stack;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
struct linux_binfmt *binfmt;
cpumask_t cpu_vm_mask;
/* <API key> MM context */
mm_context_t context;
/* realtime bits */
struct list_head delayed_drop;
/* Swap token stuff */
/*
* Last value of global fault stamp as seen by this process.
* In other words, this value gives an indication of how long
* it has been since this task got the token.
* Look at mm/thrash.c
*/
unsigned int faultstamp;
unsigned int token_priority;
unsigned int last_interval;
unsigned long flags; /* Must use atomic bitops to access the bits */
struct core_state *core_state; /* coredumping support */
#ifdef CONFIG_AIO
spinlock_t ioctx_lock;
struct hlist_head ioctx_list;
#endif
#ifdef CONFIG_MM_OWNER
/*
* "owner" points to a task that is regarded as the canonical
* user/owner of this mm. All of the following must be true in
* order for it to be changed:
*
* current == mm->owner
* current->mm != mm
* new_owner->mm == mm
* new_owner->alloc_lock is held
*/
struct task_struct *owner;
#endif
#ifdef CONFIG_PROC_FS
/* store ref to file /proc/<pid>/exe symlink points to */
struct file *exe_file;
unsigned long num_exe_file_vmas;
#endif
#ifdef CONFIG_MMU_NOTIFIER
struct mmu_notifier_mm *mmu_notifier_mm;
#endif
};
/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
#define mm_cpumask(mm) (&(mm)->cpu_vm_mask)
#endif /* _LINUX_MM_TYPES_H */
|
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
if(WITH_WARNINGS)
set(WARNING_FLAGS "-W -Wall -Wextra -Wwrite-strings -Winit-self -Woverloaded-virtual -Wfatal-errors")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
message(STATUS "Clang: All warnings enabled")
endif()
if(WITH_COREDEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
message(STATUS "Clang: Debug-flags set (-g3)")
endif()
|
#ifndef PAN_VIEW_H
#define PAN_VIEW_H
void pan_window_new(FileData *dir_fd);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
|
#ifndef __CUST_EINTH
#define __CUST_EINTH
#ifdef __cplusplus
extern "C" {
#endif
#define <API key> 0
#define <API key> 1
#define <API key> 0
#define <API key> 1
#define <API key> 0
#define <API key> 1
#define CUST_EINT_ALS_NUM 1
#define <API key> 1
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define <API key> 3
#define <API key> 1
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define <API key> 5
#define <API key> 0
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define CUST_EINT_GSE_1_NUM 6
#define <API key> 0
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define CUST_EINT_WIFI_NUM 9
#define <API key> 0
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define <API key> 10
#define <API key> 256
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define CUST_EINT_HALL_NUM 74
#define <API key> 128
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define CUST_EINT_MHL_NUM 129
#define <API key> 3
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#define <API key> 154
#define <API key> 3
#define <API key> <API key>
#define <API key> <API key>
#define <API key> <API key>
#ifdef __cplusplus
}
#endif
#endif //_CUST_EINT_H
|
#define DEBUG_SUBSYSTEM S_CLASS
#ifndef __KERNEL__
#include <liblustre.h>
#endif
#include <lustre_export.h>
#include <lustre_net.h>
#include <obd_support.h>
#include <obd_class.h>
void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs)
{
memset(osfs, 0, sizeof(*osfs));
osfs->os_type = sfs->f_type;
osfs->os_blocks = sfs->f_blocks;
osfs->os_bfree = sfs->f_bfree;
osfs->os_bavail = sfs->f_bavail;
osfs->os_files = sfs->f_files;
osfs->os_ffree = sfs->f_ffree;
osfs->os_bsize = sfs->f_bsize;
osfs->os_namelen = sfs->f_namelen;
}
EXPORT_SYMBOL(statfs_pack);
void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs)
{
memset(sfs, 0, sizeof(*sfs));
sfs->f_type = osfs->os_type;
sfs->f_blocks = osfs->os_blocks;
sfs->f_bfree = osfs->os_bfree;
sfs->f_bavail = osfs->os_bavail;
sfs->f_files = osfs->os_files;
sfs->f_ffree = osfs->os_ffree;
sfs->f_bsize = osfs->os_bsize;
sfs->f_namelen = osfs->os_namelen;
}
EXPORT_SYMBOL(statfs_unpack);
|
<?php
defined('_JEXEC') or die('Restricted access');
?><?php
JHTML::_('behavior.modal','a.modal');
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_acymailing'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php')){
echo 'This module can not work without the AcyMailing Component';
}
if(!ACYMAILING_J16){
class JElementListid extends JElement
{
function fetchElement($name, $value, &$node, $control_name){
$listType = acymailing_get('type.lists');
$listType->getValues();
if(empty($node->_attributes['menu']) || (string)$node->_attributes['menu'] != 'archive') array_shift($listType->values);
return $listType->display($control_name.'[listid]',(int) $value,false);
}
}
}else{
class JFormFieldListid extends JFormField
{
var $type = 'listid';
function getInput(){
$listType = acymailing_get('type.lists');
$listType->getValues();
if(empty($this->element['menu']) || (string)$this->element['menu'] != 'archive') array_shift($listType->values);
return $listType->display($this->name,(int) $this->value,false);
}
}
}
|
<?php
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( <API key>() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>
<!-- You can start editing here. -->
<div id="commentsbox">
<?php if ( have_comments() ) : ?>
<h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> so far.</h3>
<ol class="commentlist">
<?php wp_list_comments(); ?>
</ol>
<div class="comment-nav clearfix">
<div class="alignleft"><?php <API key>() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div id="comment-form">
<div id="respond">
<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
<small><?php <API key>(); ?></small>
<?php if ( get_option('<API key>') && !is_user_logged_in() ) : ?>
<p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out »</a></p>
<?php else : ?>
<label for="author">Name <small><?php if ($req) echo "(required)"; ?></small></label>
<input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email">Mail <small><?php if ($req) echo "(required)"; ?></small></label>
<input type="text" name="email" id="email" value="<?php echo esc_attr($<API key>); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="url">Website</label>
<input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
<?php endif; ?>
<textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea><br />
<input name="submit" type="submit" id="commentSubmit" tabindex="5" value="Submit" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</div>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>
</div>
|
#include "adreno.h"
#include "kgsl_sharedmem.h"
#include "a3xx_reg.h"
#include "adreno_pm4types.h"
#define <API key> 0x5FF064
#define <API key> 0x5FF052
/*
* _wait_reg() - make CP poll on a register
* @cmds: Pointer to memory where commands are to be added
* @addr: Register address to poll for
* @val: Value to poll for
* @mask: The value against which register value is masked
* @interval: wait interval
*/
static unsigned int _wait_reg(struct adreno_device *adreno_dev,
unsigned int *cmds, unsigned int addr,
unsigned int val, unsigned int mask,
unsigned int interval)
{
unsigned int *start = cmds;
if (adreno_is_a3xx(adreno_dev)) {
*cmds++ = cp_packet(adreno_dev, CP_WAIT_REG_EQ, 4);
*cmds++ = addr;
*cmds++ = val;
*cmds++ = mask;
*cmds++ = interval;
} else {
*cmds++ = cp_mem_packet(adreno_dev, CP_WAIT_REG_MEM, 5, 1);
*cmds++ = 0x3; /* Mem Space = Register, Function = Equals */
cmds += cp_gpuaddr(adreno_dev, cmds, addr); /* Poll address */
*cmds++ = val; /* ref val */
*cmds++ = mask;
*cmds++ = interval;
/* WAIT_REG_MEM turns back on protected mode - push it off */
*cmds++ = cp_packet(adreno_dev, <API key>, 1);
*cmds++ = 0;
}
return cmds - start;
}
#define KGSL_MMU(_dev) \
((struct kgsl_mmu *) (&(KGSL_DEVICE((_dev))->mmu)))
static unsigned int _iommu_lock(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
unsigned int *start = cmds;
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
/*
* If we don't have this register, probe should have forced
* global pagetables and we shouldn't get here.
* BUG() so we don't debug a bad register write.
*/
BUG_ON(iommu->micro_mmu_ctrl == UINT_MAX);
/*
* glue commands together until next
* WAIT_FOR_ME
*/
cmds += _wait_reg(adreno_dev, cmds,
adreno_getreg(adreno_dev, <API key>),
1, 0xFFFFFFFF, 0xF);
/* set the iommu lock bit */
*cmds++ = cp_packet(adreno_dev, CP_REG_RMW, 3);
*cmds++ = iommu->micro_mmu_ctrl >> 2;
/* AND to unmask the lock bit */
*cmds++ = ~(<API key>);
/* OR to set the IOMMU lock bit */
*cmds++ = <API key>;
/* wait for smmu to lock */
cmds += _wait_reg(adreno_dev, cmds, iommu->micro_mmu_ctrl >> 2,
<API key>,
<API key>, 0xF);
return cmds - start;
}
static unsigned int _iommu_unlock(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
unsigned int *start = cmds;
BUG_ON(iommu->micro_mmu_ctrl == UINT_MAX);
/* unlock the IOMMU lock */
*cmds++ = cp_packet(adreno_dev, CP_REG_RMW, 3);
*cmds++ = iommu->micro_mmu_ctrl >> 2;
/* AND to unmask the lock bit */
*cmds++ = ~(<API key>);
/* OR with 0 so lock bit is unset */
*cmds++ = 0;
/* release all commands since _iommu_lock() with wait_for_me */
cmds += cp_wait_for_me(adreno_dev, cmds);
return cmds - start;
}
static unsigned int _vbif_lock(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
unsigned int *start = cmds;
/*
* glue commands together until next
* WAIT_FOR_ME
*/
cmds += _wait_reg(adreno_dev, cmds,
adreno_getreg(adreno_dev, <API key>),
1, 0xFFFFFFFF, 0xF);
/* MMU-500 VBIF stall */
*cmds++ = cp_packet(adreno_dev, CP_REG_RMW, 3);
*cmds++ = <API key>;
/* AND to unmask the HALT bit */
*cmds++ = ~(<API key>);
/* OR to set the HALT bit */
*cmds++ = 0x1;
/* Wait for acknowledgement */
cmds += _wait_reg(adreno_dev, cmds,
<API key>,
1, 0xFFFFFFFF, 0xF);
return cmds - start;
}
static unsigned int _vbif_unlock(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
unsigned int *start = cmds;
/* MMU-500 VBIF unstall */
*cmds++ = cp_packet(adreno_dev, CP_REG_RMW, 3);
*cmds++ = <API key>;
/* AND to unmask the HALT bit */
*cmds++ = ~(<API key>);
/* OR to reset the HALT bit */
*cmds++ = 0;
/* release all commands since _vbif_lock() with wait_for_me */
cmds += cp_wait_for_me(adreno_dev, cmds);
return cmds - start;
}
static unsigned int _cp_smmu_reg(struct adreno_device *adreno_dev,
unsigned int *cmds,
enum kgsl_iommu_reg_map reg,
unsigned int num)
{
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
unsigned int *start = cmds;
unsigned int offset;
offset = <API key>(KGSL_MMU(adreno_dev),
<API key>, reg) >> 2;
if (adreno_is_a5xx(adreno_dev) || iommu->version == 1) {
*cmds++ = cp_register(adreno_dev, offset, num);
} else if (adreno_is_a3xx(adreno_dev)) {
*cmds++ = cp_packet(adreno_dev, CP_REG_WR_NO_CTXT, num + 1);
*cmds++ = offset;
} else if (adreno_is_a4xx(adreno_dev)) {
*cmds++ = cp_packet(adreno_dev, CP_WIDE_REG_WRITE, num + 1);
*cmds++ = offset;
} else {
BUG();
}
return cmds - start;
}
static unsigned int _tlbiall(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
unsigned int *start = cmds;
unsigned int tlbstatus;
tlbstatus = <API key>(KGSL_MMU(adreno_dev),
<API key>,
<API key>) >> 2;
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 1);
*cmds++ = 1;
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 1);
*cmds++ = 0;
cmds += _wait_reg(adreno_dev, cmds, tlbstatus, 0,
<API key>, 0xF);
return cmds - start;
}
/**
* <API key> - Add pm4 packets for GPU idle
* @adreno_dev - Pointer to device structure
* @cmds - Pointer to memory where idle commands need to be added
*/
static inline int <API key>(struct adreno_device *adreno_dev,
unsigned int *cmds)
{
unsigned int *start = cmds;
cmds += cp_wait_for_idle(adreno_dev, cmds);
if (adreno_is_a3xx(adreno_dev))
cmds += cp_wait_for_me(adreno_dev, cmds);
return cmds - start;
}
/*
* <API key>() - Invalidate UCHE using CPU
* @adreno_dev: the device
*/
static void <API key>(struct adreno_device *adreno_dev)
{
/* Invalidate UCHE using CPU */
if (adreno_is_a5xx(adreno_dev))
adreno_writereg(adreno_dev,
<API key>, 0x12);
else if (adreno_is_a4xx(adreno_dev)) {
adreno_writereg(adreno_dev,
<API key>, 0);
adreno_writereg(adreno_dev,
<API key>, 0x12);
} else if (adreno_is_a3xx(adreno_dev)) {
adreno_writereg(adreno_dev,
<API key>, 0);
adreno_writereg(adreno_dev,
<API key>,
0x90000000);
} else {
BUG();
}
}
/*
* <API key>() - Decide whether to use cpu path
* @adreno_dev: the device
* @new_pt: pagetable to switch
* @rb: ringbuffer for ctx switch
*
* If we are idle and switching to default pagetable it is
* preferable to poke the iommu directly rather than using the
* GPU command stream.
*/
static bool <API key>(
struct adreno_device *adreno_dev,
struct kgsl_pagetable *new_pt,
struct adreno_ringbuffer *rb)
{
struct kgsl_mmu *mmu = KGSL_MMU(adreno_dev);
/*
* If rb is current, we can use cpu path when GPU is
* idle and we are switching to default pt.
* If rb is not current, we can use cpu path when rb has no
* pending commands (rptr = wptr) and we are switching to default pt.
*/
if (adreno_dev->cur_rb == rb)
return adreno_isidle(KGSL_DEVICE(adreno_dev)) &&
(new_pt == mmu->defaultpagetable);
else if (adreno_rb_empty(rb) &&
(new_pt == mmu->defaultpagetable))
return true;
return false;
}
/**
* <API key>() - Generate commands to set/reset the APRIV
* @adreno_dev: Device on which the commands will execute
* @cmds: The memory pointer where commands are generated
* @set: If set then APRIV is set else reset
*
* Returns the number of commands generated
*/
static unsigned int <API key>(struct adreno_device *adreno_dev,
unsigned int *cmds, int set)
{
unsigned int *cmds_orig = cmds;
/* adreno 3xx doesn't have the CP_CNTL.APRIV field */
if (adreno_is_a3xx(adreno_dev))
return 0;
cmds += cp_wait_for_idle(adreno_dev, cmds);
cmds += cp_wait_for_me(adreno_dev, cmds);
*cmds++ = cp_register(adreno_dev, adreno_getreg(adreno_dev,
ADRENO_REG_CP_CNTL), 1);
if (set)
*cmds++ = 1;
else
*cmds++ = 0;
return cmds - cmds_orig;
}
static inline int <API key>(
struct adreno_device *adreno_dev,
unsigned int *cmds, uint64_t nop_gpuaddr)
{
unsigned int *start = cmds;
/*
* Adding an indirect buffer ensures that the prefetch stalls until
* the commands in indirect buffer have completed. We need to stall
* prefetch with a nop indirect buffer when updating pagetables
* because it provides stabler synchronization */
cmds += cp_wait_for_me(adreno_dev, cmds);
*cmds++ = cp_mem_packet(adreno_dev, <API key>, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds, nop_gpuaddr);
*cmds++ = 2;
cmds += cp_wait_for_idle(adreno_dev, cmds);
return cmds - start;
}
/**
* <API key>() - Generate commands to setup a
* flag to indicate whether pt switch is required or not by comparing
* current pt id and incoming pt id
* @rb: The RB on which the commands will execute
* @cmds: The pointer to memory where the commands are placed.
* @ptname: Incoming pt id to set to
*
* Returns number of commands added.
*/
static unsigned int <API key>(
struct adreno_ringbuffer *rb,
unsigned int *cmds, unsigned int ptname)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
unsigned int *cmds_orig = cmds;
/*
* write 1 to switch pt flag indicating that we need to execute the
* pt switch commands
*/
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(switch_pt_enable)));
*cmds++ = 1;
*cmds++ = cp_packet(adreno_dev, CP_WAIT_MEM_WRITES, 1);
*cmds++ = 0;
cmds += cp_wait_for_me(adreno_dev, cmds);
/*
* The current ptname is
* directly compared to the incoming pt id
*/
*cmds++ = cp_mem_packet(adreno_dev, CP_COND_WRITE, 6, 2);
/* write to mem space, when a mem space is equal to ref val */
*cmds++ = (1 << 8) | (1 << 4) | 3;
cmds += cp_gpuaddr(adreno_dev, cmds,
(adreno_dev->ringbuffers[0].pagetable_desc.gpuaddr +
PT_INFO_OFFSET(<API key>)));
*cmds++ = ptname;
*cmds++ = 0xFFFFFFFF;
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(switch_pt_enable)));
*cmds++ = 0;
*cmds++ = cp_packet(adreno_dev, CP_WAIT_MEM_WRITES, 1);
*cmds++ = 0;
cmds += cp_wait_for_me(adreno_dev, cmds);
return cmds - cmds_orig;
}
/**
* <API key>() - Add commands to write to memory the
* pagetable id.
* @rb: The ringbuffer on which these commands will execute
* @cmds: Pointer to memory where the commands are copied
* @ptname: The pagetable id
*/
static unsigned int <API key>(
struct adreno_ringbuffer *rb,
unsigned int *cmds, int ptname)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
unsigned int *cmds_orig = cmds;
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(current_rb_ptname)));
*cmds++ = ptname;
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds,
(adreno_dev->ringbuffers[0].pagetable_desc.gpuaddr +
PT_INFO_OFFSET(<API key>)));
*cmds++ = ptname;
/* pagetable switch done, Housekeeping: set the switch_pt_enable to 0 */
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(switch_pt_enable)));
*cmds++ = 0;
*cmds++ = cp_packet(adreno_dev, CP_WAIT_MEM_WRITES, 1);
*cmds++ = 0;
cmds += cp_wait_for_me(adreno_dev, cmds);
return cmds - cmds_orig;
}
static unsigned int <API key>(struct adreno_ringbuffer *rb,
unsigned int *cmds_orig,
u64 ttbr0, u32 contextidr, u32 ptname)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
unsigned int *cmds = cmds_orig;
unsigned int *cond_exec_ptr;
cmds += <API key>(adreno_dev, cmds);
/* set flag that indicates whether pt switch is required*/
cmds += <API key>(rb, cmds, ptname);
*cmds++ = cp_mem_packet(adreno_dev, CP_COND_EXEC, 4, 2);
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(switch_pt_enable)));
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(switch_pt_enable)));
*cmds++ = 1;
/* Exec count to be filled later */
cond_exec_ptr = cmds;
cmds++;
cmds += cp_wait_for_idle(adreno_dev, cmds);
cmds += _iommu_lock(adreno_dev, cmds);
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 2);
*cmds++ = lower_32_bits(ttbr0);
*cmds++ = upper_32_bits(ttbr0);
cmds += _cp_smmu_reg(adreno_dev, cmds,
<API key>, 1);
*cmds++ = contextidr;
/* a3xx doesn't have MEQ space to hold the TLBI commands */
if (adreno_is_a3xx(adreno_dev))
cmds += _iommu_unlock(adreno_dev, cmds);
cmds += _tlbiall(adreno_dev, cmds);
/* unlock or wait for me to finish the TLBI */
if (!adreno_is_a3xx(adreno_dev))
cmds += _iommu_unlock(adreno_dev, cmds);
else
cmds += cp_wait_for_me(adreno_dev, cmds);
/* Exec count ordinal of CP_COND_EXEC packet */
*cond_exec_ptr = (cmds - cond_exec_ptr - 1);
cmds += <API key>(adreno_dev, cmds);
cmds += <API key>(rb, cmds, ptname);
return cmds - cmds_orig;
}
static unsigned int <API key>(struct kgsl_device *device,
unsigned int *cmds_orig,
u64 ttbr0, u32 contextidr)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
unsigned int *cmds = cmds_orig;
cmds += <API key>(adreno_dev, cmds);
cmds += _vbif_lock(adreno_dev, cmds);
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 2);
*cmds++ = lower_32_bits(ttbr0);
*cmds++ = upper_32_bits(ttbr0);
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 1);
*cmds++ = contextidr;
cmds += _vbif_unlock(adreno_dev, cmds);
cmds += _tlbiall(adreno_dev, cmds);
/* wait for me to finish the TLBI */
cmds += cp_wait_for_me(adreno_dev, cmds);
cmds += <API key>(adreno_dev, cmds);
return cmds - cmds_orig;
}
static unsigned int <API key>(struct kgsl_device *device,
unsigned int *cmds_orig,
u64 ttbr0, u32 contextidr)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
unsigned int *cmds = cmds_orig;
cmds += <API key>(adreno_dev, cmds);
cmds += _vbif_lock(adreno_dev, cmds);
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 2);
*cmds++ = lower_32_bits(ttbr0);
*cmds++ = upper_32_bits(ttbr0);
cmds += _cp_smmu_reg(adreno_dev, cmds, <API key>, 1);
*cmds++ = contextidr;
cmds += _vbif_unlock(adreno_dev, cmds);
cmds += _tlbiall(adreno_dev, cmds);
/* wait for me to finish the TLBI */
cmds += cp_wait_for_me(adreno_dev, cmds);
cmds += <API key>(adreno_dev, cmds);
return cmds - cmds_orig;
}
static unsigned int <API key>(struct kgsl_device *device,
unsigned int *cmds_orig,
u64 ttbr0, u32 contextidr,
struct adreno_ringbuffer *rb)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
unsigned int *cmds = cmds_orig;
cmds += <API key>(adreno_dev, cmds);
cmds += cp_wait_for_me(adreno_dev, cmds);
/* CP switches the pagetable and flushes the Caches */
*cmds++ = cp_packet(adreno_dev, <API key>, 3);
*cmds++ = lower_32_bits(ttbr0);
*cmds++ = upper_32_bits(ttbr0);
*cmds++ = contextidr;
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 4, 1);
cmds += cp_gpuaddr(adreno_dev, cmds, (rb->pagetable_desc.gpuaddr +
PT_INFO_OFFSET(ttbr0)));
*cmds++ = lower_32_bits(ttbr0);
*cmds++ = upper_32_bits(ttbr0);
*cmds++ = contextidr;
/* release all commands with wait_for_me */
cmds += cp_wait_for_me(adreno_dev, cmds);
cmds += <API key>(adreno_dev, cmds);
return cmds - cmds_orig;
}
/**
* <API key>() - Generate commands to change pagetable
* @rb: The RB pointer in which these commaands are to be submitted
* @cmds: The pointer where the commands are placed
* @pt: The pagetable to switch to
*/
unsigned int <API key>(
struct adreno_ringbuffer *rb,
unsigned int *cmds,
struct kgsl_pagetable *pt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
u64 ttbr0;
u32 contextidr;
unsigned int *cmds_orig = cmds;
ttbr0 = <API key>(pt);
contextidr = <API key>(pt);
cmds += <API key>(adreno_dev, cmds, 1);
cmds += <API key>(adreno_dev, cmds,
iommu->setstate.gpuaddr + <API key>);
if (iommu->version >= 2) {
if (adreno_is_a5xx(adreno_dev))
cmds += <API key>(device, cmds,
ttbr0, contextidr, rb);
else if (adreno_is_a4xx(adreno_dev))
cmds += <API key>(device, cmds,
ttbr0, contextidr);
else if (adreno_is_a3xx(adreno_dev))
cmds += <API key>(device, cmds,
ttbr0, contextidr);
else
BUG(); /* new GPU family? */
} else {
cmds += <API key>(rb, cmds, ttbr0, contextidr,
pt->name);
}
/* invalidate all base pointers */
cmds += cp_invalidate_state(adreno_dev, cmds);
cmds += <API key>(adreno_dev, cmds, 0);
return cmds - cmds_orig;
}
/**
* <API key>() - Add commands to set a context id in memstore
* @rb: The RB in which the commands will be added for execution
* @cmds: Pointer to memory where commands are added
* @drawctxt: The context whose id is being set in memstore
*
* Returns the number of dwords
*/
static unsigned int <API key>(struct adreno_ringbuffer *rb,
unsigned int *cmds,
struct adreno_context *drawctxt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
unsigned int *cmds_orig = cmds;
/* write the context identifier to memstore memory */
*cmds++ = cp_packet(adreno_dev, CP_NOP, 1);
*cmds++ = <API key>;
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds,
<API key>(device, rb, current_context));
*cmds++ = (drawctxt ? drawctxt->base.id : 0);
*cmds++ = cp_mem_packet(adreno_dev, CP_MEM_WRITE, 2, 1);
cmds += cp_gpuaddr(adreno_dev, cmds,
<API key>(device,
<API key>, current_context));
*cmds++ = (drawctxt ? drawctxt->base.id : 0);
/* Invalidate UCHE for new context */
if (adreno_is_a5xx(adreno_dev)) {
*cmds++ = cp_register(adreno_dev,
adreno_getreg(adreno_dev,
<API key>), 1);
*cmds++ = 0x12;
} else if (adreno_is_a4xx(adreno_dev)) {
*cmds++ = cp_register(adreno_dev,
adreno_getreg(adreno_dev,
<API key>), 2);
*cmds++ = 0;
*cmds++ = 0x12;
} else if (adreno_is_a3xx(adreno_dev)) {
*cmds++ = cp_register(adreno_dev,
adreno_getreg(adreno_dev,
<API key>), 2);
*cmds++ = 0;
*cmds++ = 0x90000000;
} else
BUG();
return cmds - cmds_orig;
}
/*
* _set_ctxt_cpu() - Set the current context in memstore
* @rb: The ringbuffer memstore to set curr context
* @drawctxt: The context whose id is being set in memstore
*/
static void _set_ctxt_cpu(struct adreno_ringbuffer *rb,
struct adreno_context *drawctxt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
if (rb == adreno_dev->cur_rb) {
<API key>(adreno_dev);
/* Update global memstore with current context */
<API key>(device, &device->memstore,
<API key>(<API key>,
current_context),
drawctxt ? drawctxt->base.id : 0);
}
/* Update rb memstore with current context */
<API key>(device, &device->memstore,
MEMSTORE_RB_OFFSET(rb, current_context),
drawctxt ? drawctxt->base.id : 0);
}
/**
* _set_ctxt_gpu() - Add commands to set the current context in memstore
* @rb: The ringbuffer in which commands to set memstore are added
* @drawctxt: The context whose id is being set in memstore
*/
static int _set_ctxt_gpu(struct adreno_ringbuffer *rb,
struct adreno_context *drawctxt)
{
unsigned int link[15], *cmds;
int result;
cmds = &link[0];
cmds += <API key>(rb, cmds, drawctxt);
result = <API key>(rb, 0, link,
(unsigned int)(cmds - link));
return result;
}
/**
* _set_pagetable_cpu() - Use CPU to switch the pagetable
* @rb: The rb for which pagetable needs to be switched
* @new_pt: The pagetable to switch to
*/
static int _set_pagetable_cpu(struct adreno_ringbuffer *rb,
struct kgsl_pagetable *new_pt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
int result;
/* update TTBR0 only if we are updating current RB */
if (adreno_dev->cur_rb == rb) {
result = kgsl_mmu_set_pt(&device->mmu, new_pt);
if (result)
return result;
/* write the new pt set to memory var */
<API key>(adreno_dev, new_pt->name);
}
/* Update the RB pagetable info here */
<API key>(rb, new_pt);
return 0;
}
/**
* _set_pagetable_gpu() - Use GPU to switch the pagetable
* @rb: The rb in which commands to switch pagetable are to be
* submitted
* @new_pt: The pagetable to switch to
*/
static int _set_pagetable_gpu(struct adreno_ringbuffer *rb,
struct kgsl_pagetable *new_pt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
unsigned int *link = NULL, *cmds;
int result;
link = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (link == NULL)
return -ENOMEM;
cmds = link;
/* If we are in a fault the MMU will be reset soon */
if (test_bit(ADRENO_DEVICE_FAULT, &adreno_dev->priv)) {
kfree(link);
return 0;
}
cmds += <API key>(rb, cmds, new_pt);
if ((unsigned int) (cmds - link) > (PAGE_SIZE / sizeof(unsigned int))) {
KGSL_DRV_ERR(KGSL_DEVICE(adreno_dev),
"Temp command buffer overflow\n");
BUG();
}
/*
* This returns the per context timestamp but we need to
* use the global timestamp for iommu clock disablement
*/
result = <API key>(rb,
<API key>, link,
(unsigned int)(cmds - link));
kfree(link);
return result;
}
/**
* adreno_iommu_init() - Adreno iommu init
* @adreno_dev: Adreno device
*/
int adreno_iommu_init(struct adreno_device *adreno_dev)
{
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
if (<API key>(device) == KGSL_MMU_TYPE_NONE)
return 0;
/*
* A nop is required in an indirect buffer when switching
* pagetables in-stream
*/
<API key>(device, &iommu->setstate,
<API key>,
cp_packet(adreno_dev, CP_NOP, 1));
/* set iommu features here */
if (adreno_is_a420(adreno_dev))
device->mmu.features |= <API key>;
/*
* A5XX: per process PT is supported starting PFP 0x5FF064 me 0x5FF052
* versions
*/
if (adreno_is_a5xx(adreno_dev) &&
!MMU_FEATURE(&device->mmu, <API key>)) {
if ((<API key>(adreno_dev,
<API key>) < 0) ||
(<API key>(adreno_dev,
<API key>) < 0)) {
KGSL_DRV_ERR(device,
"Invalid ucode for per process pagetables\n");
return -ENODEV;
}
}
/* Enable guard page MMU feature for A3xx and A4xx targets only */
if (adreno_is_a3xx(adreno_dev) || adreno_is_a4xx(adreno_dev))
device->mmu.features |= <API key>;
return 0;
}
/**
* <API key>() - Change the pagetable of the current RB
* @device: Pointer to device to which the rb belongs
* @rb: The RB pointer on which pagetable is to be changed
* @new_pt: The new pt the device will change to
* @drawctxt: The context whose pagetable the ringbuffer is switching to,
* NULL means KGSL_CONTEXT_GLOBAL
*
* Returns 0 on success else error code.
*/
int <API key>(struct adreno_ringbuffer *rb,
struct kgsl_pagetable *new_pt,
struct adreno_context *drawctxt)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
struct kgsl_pagetable *cur_pt = device->mmu.defaultpagetable;
int result = 0;
int cpu_path = 0;
if (rb->drawctxt_active)
cur_pt = rb->drawctxt_active->base.proc_priv->pagetable;
cpu_path = <API key>(adreno_dev, new_pt, rb);
/* Pagetable switch */
if (new_pt != cur_pt) {
if (cpu_path)
result = _set_pagetable_cpu(rb, new_pt);
else
result = _set_pagetable_gpu(rb, new_pt);
}
if (result)
return result;
/* Context switch */
if (cpu_path)
_set_ctxt_cpu(rb, drawctxt);
else
result = _set_ctxt_gpu(rb, drawctxt);
return result;
}
|
#define _LARGEFILE64_SOURCE
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <libgen.h>
#include <linux/hdreg.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <inttypes.h>
struct file_ext {
__u32 f_pos;
__u32 start_blk;
__u32 end_blk;
__u32 blk_count;
};
void print_ext(struct file_ext *ext)
{
if (ext->end_blk == 0)
printf("%8d %8d %8d %8d\n", ext->f_pos, 0, 0, ext->blk_count);
else
printf("%8d %8d %8d %8d\n", ext->f_pos, ext->start_blk,
ext->end_blk, ext->blk_count);
}
void print_stat(struct stat64 *st)
{
printf("
printf("dev [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
printf("ino [0x%8"PRIx64" : %"PRIu64"]\n",
st->st_ino, st->st_ino);
printf("mode [0x%8x : %d]\n", st->st_mode, st->st_mode);
printf("nlink [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
printf("uid [0x%8x : %d]\n", st->st_uid, st->st_uid);
printf("gid [0x%8x : %d]\n", st->st_gid, st->st_gid);
printf("size [0x%8"PRIx64" : %"PRIu64"]\n",
st->st_size, st->st_size);
printf("blksize [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
printf("blocks [0x%8"PRIx64" : %"PRIu64"]\n",
st->st_blocks, st->st_blocks);
printf("
}
void stat_bdev(struct stat64 *st, unsigned int *start_lba)
{
struct stat bdev_stat;
struct hd_geometry geom;
char devname[32] = { 0, };
char linkname[32] = { 0, };
int fd;
sprintf(devname, "/dev/block/%d:%d", major(st->st_dev), minor(st->st_dev));
fd = open(devname, O_RDONLY);
if (fd < 0)
return;
if (fstat(fd, &bdev_stat) < 0)
goto out;
if (S_ISBLK(bdev_stat.st_mode)) {
if (ioctl(fd, HDIO_GETGEO, &geom) < 0)
*start_lba = 0;
else
*start_lba = geom.start;
}
if (readlink(devname, linkname, sizeof(linkname)) < 0)
goto out;
printf("
printf("devname = %s\n", basename(linkname));
printf("start_lba = %u\n", *start_lba);
out:
close(fd);
}
int main(int argc, char *argv[])
{
int fd;
int ret = 0;
char *filename;
struct stat64 st;
int total_blks;
unsigned int i;
struct file_ext ext;
__u32 start_lba;
__u32 blknum;
if (argc != 2) {
fprintf(stderr, "No filename\n");
exit(-1);
}
filename = argv[1];
fd = open(filename, O_RDONLY|O_LARGEFILE);
if (fd < 0) {
ret = errno;
perror(filename);
exit(-1);
}
fsync(fd);
if (fstat64(fd, &st) < 0) {
ret = errno;
perror(filename);
goto out;
}
stat_bdev(&st, &start_lba);
total_blks = (st.st_size + st.st_blksize - 1) / st.st_blksize;
printf("\<API key> info
printf("%s :\n", filename);
print_stat(&st);
printf("file_pos start_blk end_blk blks\n");
blknum = 0;
if (ioctl(fd, FIBMAP, &blknum) < 0) {
ret = errno;
perror("ioctl(FIBMAP)");
goto out;
}
ext.f_pos = 0;
ext.start_blk = blknum;
ext.end_blk = blknum;
ext.blk_count = 1;
for (i = 1; i < total_blks; i++) {
blknum = i;
if (ioctl(fd, FIBMAP, &blknum) < 0) {
ret = errno;
perror("ioctl(FIBMAP)");
goto out;
}
if ((blknum == 0 && blknum == ext.end_blk) || (ext.end_blk + 1) == blknum) {
ext.end_blk = blknum;
ext.blk_count++;
} else {
print_ext(&ext);
ext.f_pos = i * st.st_blksize;
ext.start_blk = blknum;
ext.end_blk = blknum;
ext.blk_count = 1;
}
}
print_ext(&ext);
out:
close(fd);
return ret;
}
|
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/cache.h>
#include <linux/profile.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/seq_file.h>
#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/clockchips.h>
#include <asm/atomic.h>
#include <asm/cacheflush.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
#include <asm/mmu_context.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/tlbflush.h>
#include <asm/ptrace.h>
#include <asm/localtimer.h>
#include <asm/smp_plat.h>
/*
* as from 2.5, kernels no longer have an init_tasks structure
* so we need some other way of telling a new secondary core
* where to place its SVC stack
*/
struct secondary_data secondary_data;
/*
* structures for inter-processor calls
* - A collection of single bit ipi messages.
*/
struct ipi_data {
spinlock_t lock;
unsigned long ipi_count;
unsigned long bits;
};
static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
.lock = SPIN_LOCK_UNLOCKED,
};
enum ipi_msg_type {
IPI_TIMER,
IPI_RESCHEDULE,
IPI_CALL_FUNC,
<API key>,
IPI_CPU_STOP,
};
int __cpuinit __cpu_up(unsigned int cpu)
{
struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
struct task_struct *idle = ci->idle;
pgd_t *pgd;
pmd_t *pmd;
int ret;
/*
* Spawn a new process manually, if not already done.
* Grab a pointer to its task struct so we can mess with it
*/
if (!idle) {
idle = fork_idle(cpu);
if (IS_ERR(idle)) {
printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
return PTR_ERR(idle);
}
ci->idle = idle;
} else {
/*
* Since this idle thread is being re-used, call
* init_idle() to reinitialize the thread structure.
*/
init_idle(idle, cpu);
}
/*
* Allocate initial page tables to allow the new CPU to
* enable the MMU safely. This essentially means a set
* of our "standard" page tables, with the addition of
* a 1:1 mapping for the physical address of the kernel.
*/
pgd = pgd_alloc(&init_mm);
pmd = pmd_offset(pgd + pgd_index(PHYS_OFFSET), PHYS_OFFSET);
*pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) |
PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
flush_pmd_entry(pmd);
outer_clean_range(__pa(pmd), __pa(pmd + 1));
/*
* We need to tell the secondary core where to find
* its stack and the page tables.
*/
secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
secondary_data.pgdir = virt_to_phys(pgd);
<API key>(&secondary_data, sizeof(secondary_data));
outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
/*
* Now bring the CPU into our world.
*/
ret = boot_secondary(cpu, idle);
if (ret == 0) {
unsigned long timeout;
/*
* CPU was successfully started, wait for it
* to come online or time out.
*/
timeout = jiffies + HZ;
while (time_before(jiffies, timeout)) {
if (cpu_online(cpu))
break;
udelay(10);
barrier();
}
if (!cpu_online(cpu))
ret = -EIO;
}
secondary_data.stack = NULL;
secondary_data.pgdir = 0;
*pmd = __pmd(0);
clean_pmd_entry(pmd);
pgd_free(&init_mm, pgd);
if (ret) {
printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu);
/*
* FIXME: We need to clean up the new idle thread. --rmk
*/
}
return ret;
}
#ifdef CONFIG_HOTPLUG_CPU
/*
* __cpu_disable runs on the processor to be shutdown.
*/
int __cpu_disable(void)
{
unsigned int cpu = smp_processor_id();
struct task_struct *p;
int ret;
ret = <API key>(cpu);
if (ret)
return ret;
/*
* Take this CPU offline. Once we clear this, we can't return,
* and we must not schedule until we're ready to give up the cpu.
*/
set_cpu_online(cpu, false);
/*
* OK - migrate IRQs away from this CPU
*/
migrate_irqs();
/*
* Stop the local timer for this CPU.
*/
local_timer_stop();
/*
* Flush user cache and TLB mappings, and then remove this CPU
* from the vm mask set of all processes.
*/
flush_cache_all();
local_flush_tlb_all();
read_lock(&tasklist_lock);
for_each_process(p) {
if (p->mm)
cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
}
read_unlock(&tasklist_lock);
return 0;
}
/*
* called on the thread which is asking for a CPU to be shutdown -
* waits until shutdown has completed, or it is timed out.
*/
void __cpu_die(unsigned int cpu)
{
if (!platform_cpu_kill(cpu))
printk("CPU%u: unable to kill\n", cpu);
}
/*
* Called from the idle thread for the CPU which has been shutdown.
*
* Note that we disable IRQs here, but do not re-enable them
* before returning to the caller. This is also the behaviour
* of the other hotplug-cpu capable cores, so presumably coming
* out of idle fixes this.
*/
void __ref cpu_die(void)
{
unsigned int cpu = smp_processor_id();
local_irq_disable();
idle_task_exit();
/*
* actual CPU shutdown procedure is at least platform (if not
* CPU) specific
*/
platform_cpu_die(cpu);
/*
* Do not return to the idle loop - jump back to the secondary
* cpu initialisation. There's some initialisation which needs
* to be repeated to undo the effects of taking the CPU offline.
*/
__asm__("mov sp, %0\n"
" b <API key>"
:
: "r" (task_stack_page(current) + THREAD_SIZE - 8));
}
#endif /* CONFIG_HOTPLUG_CPU */
/*
* Skip the secondary calibration on architectures sharing clock
* with primary cpu. Archs can use <API key>
* for this.
*/
static inline int <API key>(void)
{
#ifdef <API key>
return 0;
#else
return -ENXIO;
#endif
}
/*
* This is the secondary CPU boot entry. We're using this CPUs
* idle thread stack, but a set of temporary page tables.
*/
asmlinkage void __cpuinit <API key>(void)
{
struct mm_struct *mm = &init_mm;
unsigned int cpu = smp_processor_id();
printk("CPU%u: Booted secondary processor\n", cpu);
/*
* All kernel threads share the same mm context; grab a
* reference and switch to it.
*/
atomic_inc(&mm->mm_users);
atomic_inc(&mm->mm_count);
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
cpu_switch_mm(mm->pgd, mm);
enter_lazy_tlb(mm, current);
local_flush_tlb_all();
cpu_init();
preempt_disable();
/*
* Give the platform a chance to do its own initialisation.
*/
<API key>(cpu);
/*
* Enable local interrupts.
*/
notify_cpu_starting(cpu);
local_irq_enable();
local_fiq_enable();
/*
* Setup the percpu timer for this CPU.
*/
percpu_timer_setup();
if (<API key>())
calibrate_delay();
smp_store_cpu_info(cpu);
/*
* OK, now it's safe to let the boot CPU continue
*/
set_cpu_online(cpu, true);
/*
* OK, it's off to the idle thread for us
*/
cpu_idle();
}
/*
* Called by both boot and secondaries to move global data into
* per-processor storage.
*/
void __cpuinit smp_store_cpu_info(unsigned int cpuid)
{
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
cpu_info->loops_per_jiffy = loops_per_jiffy;
}
void __init smp_cpus_done(unsigned int max_cpus)
{
int cpu;
unsigned long bogosum = 0;
for_each_online_cpu(cpu)
bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
printk(KERN_INFO "SMP: Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
num_online_cpus(),
bogosum / (500000/HZ),
(bogosum / (5000/HZ)) % 100);
}
void __init <API key>(void)
{
unsigned int cpu = smp_processor_id();
per_cpu(cpu_data, cpu).idle = current;
}
static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)
{
unsigned long flags;
unsigned int cpu;
local_irq_save(flags);
for_each_cpu(cpu, mask) {
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
spin_lock(&ipi->lock);
ipi->bits |= 1 << msg;
spin_unlock(&ipi->lock);
}
/*
* Call the platform specific cross-CPU call function.
*/
smp_cross_call(mask);
local_irq_restore(flags);
}
void <API key>(const struct cpumask *mask)
{
send_ipi_message(mask, IPI_CALL_FUNC);
}
void <API key>(int cpu)
{
send_ipi_message(cpumask_of(cpu), <API key>);
}
void show_ipi_list(struct seq_file *p)
{
unsigned int cpu;
seq_puts(p, "IPI:");
<API key>(cpu)
seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
seq_putc(p, '\n');
}
void show_local_irqs(struct seq_file *p)
{
unsigned int cpu;
seq_printf(p, "LOC: ");
<API key>(cpu)
seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);
seq_putc(p, '\n');
}
/*
* Timer (local or broadcast) support
*/
static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
static void ipi_timer(void)
{
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
irq_enter();
evt->event_handler(evt);
irq_exit();
}
#ifdef CONFIG_LOCAL_TIMERS
asmlinkage void __exception do_local_timer(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
int cpu = smp_processor_id();
if (local_timer_ack()) {
irq_stat[cpu].local_timer_irqs++;
ipi_timer();
}
set_irq_regs(old_regs);
}
#endif
#ifdef <API key>
static void smp_timer_broadcast(const struct cpumask *mask)
{
send_ipi_message(mask, IPI_TIMER);
}
static void <API key>(enum clock_event_mode mode,
struct clock_event_device *evt)
{
}
static void local_timer_setup(struct clock_event_device *evt)
{
evt->name = "dummy_timer";
evt->features = <API key> |
<API key> |
<API key>;
evt->rating = 400;
evt->mult = 1;
evt->set_mode = <API key>;
evt->broadcast = smp_timer_broadcast;
<API key>(evt);
}
#endif
void __cpuinit percpu_timer_setup(void)
{
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
evt->cpumask = cpumask_of(cpu);
local_timer_setup(evt);
}
static DEFINE_SPINLOCK(stop_lock);
/*
* ipi_cpu_stop - handle IPI from smp_send_stop()
*/
static void ipi_cpu_stop(unsigned int cpu)
{
spin_lock(&stop_lock);
printk(KERN_CRIT "CPU%u: stopping\n", cpu);
dump_stack();
spin_unlock(&stop_lock);
set_cpu_online(cpu, false);
local_fiq_disable();
local_irq_disable();
flush_cache_all();
local_flush_tlb_all();
while (1)
cpu_relax();
}
/*
* Main handler for inter-processor interrupts
*
* For ARM, the ipimask now only identifies a single
* category of IPI (Bit 1 IPIs have been replaced by a
* different mechanism):
*
* Bit 0 - Inter-processor function call
*/
asmlinkage void __exception do_IPI(struct pt_regs *regs)
{
unsigned int cpu = smp_processor_id();
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
struct pt_regs *old_regs = set_irq_regs(regs);
ipi->ipi_count++;
for (;;) {
unsigned long msgs;
spin_lock(&ipi->lock);
msgs = ipi->bits;
ipi->bits = 0;
spin_unlock(&ipi->lock);
if (!msgs)
break;
do {
unsigned nextmsg;
nextmsg = msgs & -msgs;
msgs &= ~nextmsg;
nextmsg = ffz(~nextmsg);
switch (nextmsg) {
case IPI_TIMER:
ipi_timer();
break;
case IPI_RESCHEDULE:
/*
* nothing more to do - eveything is
* done on the interrupt return path
*/
break;
case IPI_CALL_FUNC:
<API key>();
break;
case <API key>:
<API key>();
break;
case IPI_CPU_STOP:
ipi_cpu_stop(cpu);
break;
default:
printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
cpu, nextmsg);
break;
}
} while (msgs);
}
set_irq_regs(old_regs);
}
void smp_send_reschedule(int cpu)
{
send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
}
void smp_send_stop(void)
{
cpumask_t mask = cpu_online_map;
cpu_clear(smp_processor_id(), mask);
send_ipi_message(&mask, IPI_CPU_STOP);
}
/*
* not supported here
*/
int <API key>(unsigned int multiplier)
{
return -EINVAL;
}
static void
on_each_cpu_mask(void (*func)(void *), void *info, int wait,
const struct cpumask *mask)
{
preempt_disable();
<API key>(mask, func, info, wait);
if (cpumask_test_cpu(smp_processor_id(), mask))
func(info);
preempt_enable();
}
/*
* TLB operations
*/
struct tlb_args {
struct vm_area_struct *ta_vma;
unsigned long ta_start;
unsigned long ta_end;
};
static inline void ipi_flush_tlb_all(void *ignored)
{
local_flush_tlb_all();
}
static inline void ipi_flush_tlb_mm(void *arg)
{
struct mm_struct *mm = (struct mm_struct *)arg;
local_flush_tlb_mm(mm);
}
static inline void ipi_flush_tlb_page(void *arg)
{
struct tlb_args *ta = (struct tlb_args *)arg;
<API key>(ta->ta_vma, ta->ta_start);
}
static inline void <API key>(void *arg)
{
struct tlb_args *ta = (struct tlb_args *)arg;
<API key>(ta->ta_start);
}
static inline void ipi_flush_tlb_range(void *arg)
{
struct tlb_args *ta = (struct tlb_args *)arg;
<API key>(ta->ta_vma, ta->ta_start, ta->ta_end);
}
static inline void <API key>(void *arg)
{
struct tlb_args *ta = (struct tlb_args *)arg;
<API key>(ta->ta_start, ta->ta_end);
}
void flush_tlb_all(void)
{
if (<API key>())
on_each_cpu(ipi_flush_tlb_all, NULL, 1);
else
local_flush_tlb_all();
}
void flush_tlb_mm(struct mm_struct *mm)
{
if (<API key>())
on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm));
else
local_flush_tlb_mm(mm);
}
void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
{
if (<API key>()) {
struct tlb_args ta;
ta.ta_vma = vma;
ta.ta_start = uaddr;
on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm));
} else
<API key>(vma, uaddr);
}
void <API key>(unsigned long kaddr)
{
if (<API key>()) {
struct tlb_args ta;
ta.ta_start = kaddr;
on_each_cpu(<API key>, &ta, 1);
} else
<API key>(kaddr);
}
void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
if (<API key>()) {
struct tlb_args ta;
ta.ta_vma = vma;
ta.ta_start = start;
ta.ta_end = end;
on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm));
} else
<API key>(vma, start, end);
}
void <API key>(unsigned long start, unsigned long end)
{
if (<API key>()) {
struct tlb_args ta;
ta.ta_start = start;
ta.ta_end = end;
on_each_cpu(<API key>, &ta, 1);
} else
<API key>(start, end);
}
static void flush_all_cpu_cache(void *info)
{
flush_cache_all();
}
void <API key>(void)
{
on_each_cpu(flush_all_cpu_cache, NULL, 1);
}
|
package edu.cmu.tetrad.cli.util;
import java.io.PrintStream;
import java.io.StringReader;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.<API key>;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.<API key>;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
/**
*
* Mar 2, 2016 4:33:51 PM
*
* @author Kevin V. Bui (kvb2@pitt.edu)
*/
public class XmlPrint {
private static final String DEFAULT_INDENTATION = "4";
private XmlPrint() {
}
public static void printPretty(String xml, PrintStream writer) throws <API key>, <API key>, <API key> {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", DEFAULT_INDENTATION);
transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(writer));
}
}
|
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "spline1d.h"
int main(int argc, char **argv)
{
ap::real_1d_array x;
ap::real_1d_array y;
ap::real_1d_array d;
int n;
int i;
double t;
spline1dinterpolant s;
double err;
double maxerr;
// Interpolation by natural Cubic spline.
printf("INTERPOLATION BY HERMITE SPLINE\n\n");
printf("F(x)=sin(x), [0, pi], 3 nodes\n\n");
printf(" x F(x) S(x) Error\n");
// Create spline
n = 3;
x.setlength(n);
y.setlength(n);
d.setlength(n);
for(i = 0; i <= n-1; i++)
{
x(i) = ap::pi()*i/(n-1);
y(i) = sin(x(i));
d(i) = cos(x(i));
}
<API key>(x, y, d, n, s);
// Output results
t = 0;
maxerr = 0;
while(ap::fp_less(t,0.999999*ap::pi()))
{
err = fabs(spline1dcalc(s, t)-sin(t));
maxerr = ap::maxreal(err, maxerr);
printf("%6.3lf %6.3lf %6.3lf %6.3lf\n",
double(t),
double(sin(t)),
double(spline1dcalc(s, t)),
double(err));
t = ap::minreal(ap::pi(), t+0.25);
}
err = fabs(spline1dcalc(s, ap::pi())-sin(ap::pi()));
maxerr = ap::maxreal(err, maxerr);
printf("%6.3lf %6.3lf %6.3lf %6.3lf\n\n",
double(ap::pi()),
double(sin(ap::pi())),
double(spline1dcalc(s, ap::pi())),
double(err));
printf("max|error| = %0.3lf\n",
double(maxerr));
printf("Try other demos (spline1d_linear, spline1d_cubic) and compare errors...\n\n\n");
return 0;
}
|
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// PLEASE DO "NOT" EDIT THIS FILE!
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP
#include "ConfigPanel.h"
ConfigPanel::ConfigPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, wxT("BrowseTracker Options"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_staticText2->Wrap( -1 );
m_staticText2->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Tahoma") ) );
bSizer3->Add( m_staticText2, 0, <API key>|wxALL|wxEXPAND, 5 );
bSizer3->Add( 0, 10, 0, 0, 5 );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
<API key> = new wxCheckBox( this, wxID_ANY, wxT("Enable BrowseMarks"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer7->Add( <API key>, 1, <API key>|wxALL, 5 );
Cfg_WrapJumpEntries = new wxCheckBox( this, wxID_ANY, wxT("Wrap Jump Entries"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer7->Add( Cfg_WrapJumpEntries, 1, <API key>|wxALL, 5 );
bSizer3->Add( bSizer7, 0, <API key>|wxEXPAND|wxSHAPED, 5 );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
wxString <API key>[] = { wxT("Browse_Marks "), wxT("Book_Marks"), wxT("Hide") };
int <API key> = sizeof( <API key> ) / sizeof( wxString );
Cfg_MarkStyle = new wxRadioBox( this, wxID_ANY, wxT("Mark style"), wxDefaultPosition, wxDefaultSize, <API key>, <API key>, 3, wxRA_SPECIFY_COLS );
Cfg_MarkStyle->SetSelection( 1 );
bSizer6->Add( Cfg_MarkStyle, 1, wxALL, 5 );
bSizer3->Add( bSizer6, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
wxString <API key>[] = { wxT("Left_Mouse"), wxT("Ctrl-Left_Mouse") };
int <API key> = sizeof( <API key> ) / sizeof( wxString );
Cfg_ToggleKey = new wxRadioBox( this, wxID_ANY, wxT("Toggle BrowseMark Key"), wxDefaultPosition, wxDefaultSize, <API key>, <API key>, 3, wxRA_SPECIFY_COLS );
Cfg_ToggleKey->SetSelection( 0 );
bSizer8->Add( Cfg_ToggleKey, 0, wxALL|wxEXPAND, 5 );
bSizer3->Add( bSizer8, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxVERTICAL );
m_staticText4 = new wxStaticText( this, wxID_ANY, wxT(" Left_Mouse Toggle Delay (Milliseconds)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
bSizer9->Add( m_staticText4, 0, wxALL|wxEXPAND, 5 );
Cfg_LeftMouseDelay = new wxSlider( this, wxID_ANY, 200, 0, 1000, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS );
bSizer9->Add( Cfg_LeftMouseDelay, 1, wxALL|wxEXPAND, 5 );
bSizer3->Add( bSizer9, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
wxString <API key>[] = { wxT("Ctrl-Left_Mouse"), wxT("Ctrl-Left_DblClick") };
int <API key> = sizeof( <API key> ) / sizeof( wxString );
Cfg_ClearAllKey = new wxRadioBox( this, wxID_ANY, wxT("Clear All BrowseMarks"), wxDefaultPosition, wxDefaultSize, <API key>, <API key>, 2, wxRA_SPECIFY_COLS );
Cfg_ClearAllKey->SetSelection( 0 );
bSizer10->Add( Cfg_ClearAllKey, 0, wxALL|wxEXPAND, 5 );
bSizer3->Add( bSizer10, 1, wxEXPAND, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, wxT("Note: The Ctrl-Left_Mouse key options are disabled when\nthe editors multi-selection option is enabled at:\nSettings/Editor/Margins/Allow Multiple Selections\n\nMenu items can be used to clear BrowseMarks.\n\n"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
bSizer3->Add( m_staticText3, 0, wxALL, 5 );
this->SetSizer( bSizer3 );
this->Layout();
// Connect Events
<API key>->Connect( <API key>, <API key>( ConfigPanel::OnEnableBrowseMarks ), NULL, this );
Cfg_WrapJumpEntries->Connect( <API key>, <API key>( ConfigPanel::OnWrapJumpEntries ), NULL, this );
Cfg_ToggleKey->Connect( <API key>, <API key>( ConfigPanel::<API key> ), NULL, this );
Cfg_ClearAllKey->Connect( <API key>, <API key>( ConfigPanel::<API key> ), NULL, this );
}
ConfigPanel::~ConfigPanel()
{
// Disconnect Events
<API key>->Disconnect( <API key>, <API key>( ConfigPanel::OnEnableBrowseMarks ), NULL, this );
Cfg_WrapJumpEntries->Disconnect( <API key>, <API key>( ConfigPanel::OnWrapJumpEntries ), NULL, this );
Cfg_ToggleKey->Disconnect( <API key>, <API key>( ConfigPanel::<API key> ), NULL, this );
Cfg_ClearAllKey->Disconnect( <API key>, <API key>( ConfigPanel::<API key> ), NULL, this );
}
|
#!/usr/bin/env python
from pyurdme.adfsp_solver import ADFSPSolver
from examples.cylinder_demo.cylinder_demo3D import cylinderDemo3D
import matplotlib.pyplot as plt
import numpy
import pyurdme
import time
model = cylinderDemo3D()
sol = ADFSPSolver(model, report_level=1, error_tolarance=0.05)
print "Attempting to compile"
sol.compile()
print "Beginning simulation"
t1 = time.time()
result = sol.run()
print "Simulation complete in {0}s".format(time.time()-t1)
print "Plotting solution"
# Plot of the time-average spatial concentration.
x_vals = model.mesh.coordinates()[:, 0]
A_vals = numpy.mean(result.get_species("A", concentration=True), axis=0)
B_vals = numpy.mean(result.get_species("B", concentration=True), axis=0)
plt.plot(x_vals,A_vals,'.r',x_vals,B_vals,'.b')
plt.legend(['A', 'B'])
plt.show()
|
#include "net/quic/core/quic_time.h"
#include "net/quic/test_tools/mock_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace test {
TEST(QuicTimeDeltaTest, Zero) {
EXPECT_TRUE(QuicTime::Delta::Zero().IsZero());
EXPECT_FALSE(QuicTime::Delta::Zero().IsInfinite());
EXPECT_FALSE(QuicTime::Delta::FromMilliseconds(1).IsZero());
}
TEST(QuicTimeDeltaTest, Infinite) {
EXPECT_TRUE(QuicTime::Delta::Infinite().IsInfinite());
EXPECT_FALSE(QuicTime::Delta::Zero().IsInfinite());
EXPECT_FALSE(QuicTime::Delta::FromMilliseconds(1).IsInfinite());
}
TEST(QuicTimeDeltaTest, FromTo) {
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1),
QuicTime::Delta::FromMicroseconds(1000));
EXPECT_EQ(QuicTime::Delta::FromSeconds(1),
QuicTime::Delta::FromMilliseconds(1000));
EXPECT_EQ(QuicTime::Delta::FromSeconds(1),
QuicTime::Delta::FromMicroseconds(1000000));
EXPECT_EQ(1, QuicTime::Delta::FromMicroseconds(1000).ToMilliseconds());
EXPECT_EQ(2, QuicTime::Delta::FromMilliseconds(2000).ToSeconds());
EXPECT_EQ(1000, QuicTime::Delta::FromMilliseconds(1).ToMicroseconds());
EXPECT_EQ(1, QuicTime::Delta::FromMicroseconds(1000).ToMilliseconds());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(2000).ToMicroseconds(),
QuicTime::Delta::FromSeconds(2).ToMicroseconds());
}
TEST(QuicTimeDeltaTest, Add) {
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2000),
QuicTime::Delta::Zero() + QuicTime::Delta::FromMilliseconds(2));
}
TEST(QuicTimeDeltaTest, Subtract) {
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(1000),
QuicTime::Delta::FromMilliseconds(2) -
QuicTime::Delta::FromMilliseconds(1));
}
TEST(QuicTimeDeltaTest, Multiply) {
int i = 2;
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
QuicTime::Delta::FromMilliseconds(2) * i);
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
i * QuicTime::Delta::FromMilliseconds(2));
double d = 2;
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
QuicTime::Delta::FromMilliseconds(2) * d);
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
d * QuicTime::Delta::FromMilliseconds(2));
// Ensure we are rounding correctly within a single-bit level of precision.
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(5),
QuicTime::Delta::FromMicroseconds(9) * 0.5);
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2),
QuicTime::Delta::FromMicroseconds(12) * 0.2);
}
TEST(QuicTimeDeltaTest, Max) {
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2000),
std::max(QuicTime::Delta::FromMicroseconds(1000),
QuicTime::Delta::FromMicroseconds(2000)));
}
TEST(QuicTimeDeltaTest, NotEqual) {
EXPECT_TRUE(QuicTime::Delta::FromSeconds(0) !=
QuicTime::Delta::FromSeconds(1));
EXPECT_FALSE(QuicTime::Delta::FromSeconds(0) !=
QuicTime::Delta::FromSeconds(0));
}
TEST(QuicTimeDeltaTest, DebugValue) {
const QuicTime::Delta one_us = QuicTime::Delta::FromMicroseconds(1);
const QuicTime::Delta one_ms = QuicTime::Delta::FromMilliseconds(1);
const QuicTime::Delta one_s = QuicTime::Delta::FromSeconds(1);
EXPECT_EQ("3s", (3 * one_s).ToDebugValue());
EXPECT_EQ("3ms", (3 * one_ms).ToDebugValue());
EXPECT_EQ("3us", (3 * one_us).ToDebugValue());
EXPECT_EQ("3001us", (3 * one_ms + one_us).ToDebugValue());
EXPECT_EQ("3001ms", (3 * one_s + one_ms).ToDebugValue());
EXPECT_EQ("3000001us", (3 * one_s + one_us).ToDebugValue());
}
class QuicTimeTest : public ::testing::Test {
protected:
MockClock clock_;
};
TEST_F(QuicTimeTest, Initialized) {
EXPECT_FALSE(QuicTime::Zero().IsInitialized());
EXPECT_TRUE((QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(1))
.IsInitialized());
}
TEST_F(QuicTimeTest, Add) {
QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);
QuicTime::Delta diff = time_2 - time_1;
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1), diff);
EXPECT_EQ(1000, diff.ToMicroseconds());
EXPECT_EQ(1, diff.ToMilliseconds());
}
TEST_F(QuicTimeTest, Subtract) {
QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(1), time_2 - time_1);
}
TEST_F(QuicTimeTest, SubtractDelta) {
QuicTime time = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);
EXPECT_EQ(QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1),
time - QuicTime::Delta::FromMilliseconds(1));
}
TEST_F(QuicTimeTest, Max) {
QuicTime time_1 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(1);
QuicTime time_2 = QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(2);
EXPECT_EQ(time_2, std::max(time_1, time_2));
}
TEST_F(QuicTimeTest, MockClock) {
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
QuicTime now = clock_.ApproximateNow();
QuicTime time = QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(1000);
EXPECT_EQ(now, time);
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
now = clock_.ApproximateNow();
EXPECT_NE(now, time);
time = time + QuicTime::Delta::FromMilliseconds(1);
EXPECT_EQ(now, time);
}
TEST_F(QuicTimeTest, LE) {
const QuicTime zero = QuicTime::Zero();
const QuicTime one = zero + QuicTime::Delta::FromSeconds(1);
EXPECT_TRUE(zero <= zero);
EXPECT_TRUE(zero <= one);
EXPECT_TRUE(one <= one);
EXPECT_FALSE(one <= zero);
}
} // namespace test
} // namespace net
|
#include "melkor.h"
#define BUFF_SIZE 2048
int main(int argc, char *argv[], char *envp[])
{
unsigned short cnt = 0, ndx;
char *env_PATH, *path, env_paths[13][37]; // Only 13 paths taken from $PATH with 37 chars each one, enough to play with ...
char *env_LD_LIBRARY_PATH = malloc(BUFF_SIZE); // Yeah yeah, I prefer to spend time writing this comment than checking the returned value by malloc() :D
char *fuzzed_path;
// Split $PATH
env_PATH = getenv("PATH");
path = strtok(env_PATH, ":");
strncpy(env_paths[cnt], path, 37);
env_paths[cnt++][36] = '\0';
while((path = strtok(NULL, ":")) != NULL && cnt < 13){
strncpy(env_paths[cnt], path, 37);
env_paths[cnt++][36] = '\0';
}
// Split
srand(getseed());
// Overflows and off-by-one's section :D, exploit them !
*env_LD_LIBRARY_PATH = '\0';
while(strlen(env_LD_LIBRARY_PATH) < BUFF_SIZE){
if(rand() % 4 < 3){ // 75% chance of valid paths
ndx = rand() % cnt;
if(strlen(env_LD_LIBRARY_PATH) + strlen(env_paths[ndx]) < BUFF_SIZE)
strcat(env_LD_LIBRARY_PATH, env_paths[ndx]);
else
break;
} else {
fuzzed_path = get_fuzzed_path();
if(strlen(env_LD_LIBRARY_PATH) + strlen(fuzzed_path) < BUFF_SIZE)
strcat(env_LD_LIBRARY_PATH, fuzzed_path);
else
break;
}
if(strlen(env_LD_LIBRARY_PATH) + 1 < BUFF_SIZE)
strcat(env_LD_LIBRARY_PATH, ":");
if(strlen(env_LD_LIBRARY_PATH) == BUFF_SIZE - 1)
break;
}
printf("%s", env_LD_LIBRARY_PATH);
free(env_LD_LIBRARY_PATH);
return 0;
}
|
#include "at_command.h"
#include "commonDef.h"
#include "nas_log.h"
#include "at_error.h"
#include <ctype.h> // isspace, isdigit
#include <stdlib.h> // strtol, malloc, free
#include <string.h> // strncpy, strstr, strchr, strcmp, strncasecmp
// strlen, memmove, strdup, strtok
#include <stdarg.h> // va_start, va_arg, va_end
extern int <API key>;
extern int <API key>;
extern at_error_format_t at_error_format;
/* Handlers used to parse AT commands */
static int parse_e0(const char*, int, at_command_t*);
static int parse_e1(const char*, int, at_command_t*);
static int parse_q0(const char*, int, at_command_t*);
static int parse_q1(const char*, int, at_command_t*);
static int parse_v0(const char*, int, at_command_t*);
static int parse_v1(const char*, int, at_command_t*);
static int parse_cgsn(const char*, int, at_command_t*);
static int parse_cgsn_test(const char*, int, at_command_t*);
static int parse_cgmi(const char*, int, at_command_t*);
static int parse_cgmi_test(const char*, int, at_command_t*);
static int parse_cgmm(const char*, int, at_command_t*);
static int parse_cgmm_test(const char*, int, at_command_t*);
static int parse_cgmr(const char*, int, at_command_t*);
static int parse_cgmr_test(const char*, int, at_command_t*);
static int parse_cimi(const char*, int, at_command_t*);
static int parse_cimi_test(const char*, int, at_command_t*);
static int parse_cfun_set(const char*, int, at_command_t*);
static int parse_cfun_get(const char*, int, at_command_t*);
static int parse_cfun_test(const char*, int, at_command_t*);
static int parse_cpin_set(const char*, int, at_command_t*);
static int parse_cpin_get(const char*, int, at_command_t*);
static int parse_cpin_test(const char*, int, at_command_t*);
static int parse_csq(const char*, int, at_command_t*);
static int parse_csq_test(const char*, int, at_command_t*);
static int parse_cesq(const char*, int, at_command_t*);
static int parse_cesq_test(const char*, int, at_command_t*);
static int parse_clac(const char*, int, at_command_t*);
static int parse_clac_test(const char*, int, at_command_t*);
static int parse_cmee_set(const char*, int, at_command_t*);
static int parse_cmee_get(const char*, int, at_command_t*);
static int parse_cmee_test(const char*, int, at_command_t*);
static int parse_cnum(const char*, int, at_command_t*);
static int parse_cnum_test(const char*, int, at_command_t*);
static int parse_clck_set(const char*, int, at_command_t*);
static int parse_clck_test(const char*, int, at_command_t*);
static int parse_cops_set(const char*, int, at_command_t*);
static int parse_cops_get(const char*, int, at_command_t*);
static int parse_cops_test(const char*, int, at_command_t*);
static int parse_creg_set(const char*, int, at_command_t*);
static int parse_creg_get(const char*, int, at_command_t*);
static int parse_creg_test(const char*, int, at_command_t*);
static int parse_cgatt_set(const char*, int, at_command_t*);
static int parse_cgatt_get(const char*, int, at_command_t*);
static int parse_cgatt_test(const char*, int, at_command_t*);
static int parse_cgreg_set(const char*, int, at_command_t*);
static int parse_cgreg_get(const char*, int, at_command_t*);
static int parse_cgreg_test(const char*, int, at_command_t*);
static int parse_cereg_set(const char*, int, at_command_t*);
static int parse_cereg_get(const char*, int, at_command_t*);
static int parse_cereg_test(const char*, int, at_command_t*);
static int parse_cgdcont_set(const char*, int, at_command_t*);
static int parse_cgdcont_get(const char*, int, at_command_t*);
static int parse_cgdcont_test(const char*, int, at_command_t*);
static int parse_cgact_set(const char*, int, at_command_t*);
static int parse_cgact_get(const char*, int, at_command_t*);
static int parse_cgact_test(const char*, int, at_command_t*);
static int parse_cgpaddr_set(const char*, int, at_command_t*);
static int parse_cgpaddr_test(const char*, int, at_command_t*);
/* List of AT command handlers */
typedef struct {
char *command;
int (*handler)(const char *, int, at_command_t*);
at_command_type_t type;
} <API key>;
static const <API key> _at_command_handler[] = {
/* TE-TA interface commands */
{ "E0", parse_e0, AT_COMMAND_ACT },
{ "E1", parse_e1, AT_COMMAND_ACT },
{ "Q0", parse_q0, AT_COMMAND_ACT },
{ "Q1", parse_q1, AT_COMMAND_ACT },
{ "V0", parse_v0, AT_COMMAND_ACT },
{ "V1", parse_v1, AT_COMMAND_ACT },
{ "E0Q0V0", parse_v0, AT_COMMAND_ACT },
{ "E0Q0V1", parse_v1, AT_COMMAND_ACT },
{ "E1Q0V0", parse_v0, AT_COMMAND_ACT },
{ "E1Q0V1", parse_v1, AT_COMMAND_ACT },
/* Request Product Serial Number identification (IMEI) */
{ "+CGSN", parse_cgsn, AT_COMMAND_ACT },
{ "+CGSN=?", parse_cgsn_test, AT_COMMAND_TST },
/* Request manufacturer identification */
{ "+CGMI", parse_cgmi, AT_COMMAND_ACT },
{ "+CGMI=?", parse_cgmi_test, AT_COMMAND_TST },
/* Request model identification */
{ "+CGMM", parse_cgmm, AT_COMMAND_ACT },
{ "+CGMM=?", parse_cgmm_test, AT_COMMAND_TST },
/* Request revision identification */
{ "+CGMR", parse_cgmr, AT_COMMAND_ACT },
{ "+CGMR=?", parse_cgmr_test, AT_COMMAND_TST },
/* Request International Mobile Subscriber Identity */
{ "+CIMI", parse_cimi, AT_COMMAND_ACT },
{ "+CIMI=?", parse_cimi_test, AT_COMMAND_TST },
/* Set phone functionality */
{ "+CFUN=", parse_cfun_set, AT_COMMAND_SET },
{ "+CFUN?", parse_cfun_get, AT_COMMAND_GET },
{ "+CFUN=?", parse_cfun_test, AT_COMMAND_TST },
/* Enter PIN */
{ "+CPIN=", parse_cpin_set, AT_COMMAND_SET },
{ "+CPIN?", parse_cpin_get, AT_COMMAND_GET },
{ "+CPIN=?", parse_cpin_test, AT_COMMAND_TST },
/* Signal quality */
{ "+CSQ", parse_csq, AT_COMMAND_ACT },
{ "+CSQ=?", parse_csq_test, AT_COMMAND_TST },
/* Extended signal quality */
{ "+CESQ", parse_cesq, AT_COMMAND_ACT },
{ "+CESQ=?", parse_cesq_test, AT_COMMAND_TST },
/* List all available AT commands */
{ "+CLAC", parse_clac, AT_COMMAND_ACT },
{ "+CLAC=?", parse_clac_test, AT_COMMAND_TST },
/* Report mobile termination error */
{ "+CMEE=", parse_cmee_set, AT_COMMAND_SET },
{ "+CMEE?", parse_cmee_get, AT_COMMAND_GET },
{ "+CMEE=?", parse_cmee_test, AT_COMMAND_TST },
/* Subscriber number */
{ "+CNUM", parse_cnum, AT_COMMAND_ACT },
{ "+CNUM=?", parse_cnum_test, AT_COMMAND_TST },
/* Facility lock */
{ "+CLCK=", parse_clck_set, AT_COMMAND_SET },
{ "+CLCK=?", parse_clck_test, AT_COMMAND_TST },
/* PLMN selection */
{ "+COPS=", parse_cops_set, AT_COMMAND_SET },
{ "+COPS?", parse_cops_get, AT_COMMAND_GET },
{ "+COPS=?", parse_cops_test, AT_COMMAND_TST },
/* Network registration */
{ "+CREG=", parse_creg_set, AT_COMMAND_SET },
{ "+CREG?", parse_creg_get, AT_COMMAND_GET },
{ "+CREG=?", parse_creg_test, AT_COMMAND_TST },
/* GPRS service attach/detach */
{ "+CGATT=", parse_cgatt_set, AT_COMMAND_SET },
{ "+CGATT?", parse_cgatt_get, AT_COMMAND_GET },
{ "+CGATT=?", parse_cgatt_test, AT_COMMAND_TST },
/* GPRS network registration status */
{ "+CGREG=", parse_cgreg_set, AT_COMMAND_SET },
{ "+CGREG?", parse_cgreg_get, AT_COMMAND_GET },
{ "+CGREG=?", parse_cgreg_test, AT_COMMAND_TST },
/* EPS network registration status */
{ "+CEREG=", parse_cereg_set, AT_COMMAND_SET },
{ "+CEREG?", parse_cereg_get, AT_COMMAND_GET },
{ "+CEREG=?", parse_cereg_test, AT_COMMAND_TST },
/* Define PDP Context */
{ "+CGDCONT=", parse_cgdcont_set, AT_COMMAND_SET },
{ "+CGDCONT?", parse_cgdcont_get, AT_COMMAND_GET },
{ "+CGDCONT=?", parse_cgdcont_test, AT_COMMAND_TST },
/* PDP context activate or deactivate */
{ "+CGACT=", parse_cgact_set, AT_COMMAND_SET },
{ "+CGACT?", parse_cgact_get, AT_COMMAND_GET },
{ "+CGACT=?", parse_cgact_test, AT_COMMAND_TST },
/* Show PDP address(es) */
{ "+CGPADDR=", parse_cgpaddr_set, AT_COMMAND_SET },
{ "+CGPADDR=?", parse_cgpaddr_test, AT_COMMAND_TST },
{ "null", NULL }
};
static int ParseString(char * at_str, at_command_t* at_command);
static int ParseCommand(const unsigned char *str, const char *format, ...);
static size_t GrabString(const unsigned char *str, char **output);
static unsigned int NumberOfParameters(const unsigned char* str);
static unsigned int IsNumeric(const char* str, size_t len);
int at_command_decode(const char* buffer, int length, at_command_t* at_command)
{
LOG_FUNC_IN;
int rc = RETURNok;
if (length < 3) {
/* Minimum size to carry an AT command is 3 */
LOG_TRACE(ERROR, "USR-API - Input is short of size to carry an AT command!");
return RETURNerror;
} else if (strncasecmp(buffer, "AT", 2) != 0) {
/* There must be AT initials in input... */
LOG_TRACE(ERROR, "USR-API - There is no proper initials (AT) in input!");
return RETURNerror;
} else if (buffer[length - 1] != '\r') {
/* And there must be CR at the end */
LOG_TRACE(ERROR, "USR-API - There is no Carriage Return at the end!");
return RETURNerror;
} else if (strcasecmp(buffer, "AT\r") == 0) {
/* AT command alone; just return OK */
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return (1);
}
/* Parse the AT command line */
int i;
char* buf = strdup(buffer+2);
char* cmd = strtok(buf, ";");
for (i=0; cmd && (rc != RETURNerror); i++) {
rc = ParseString(cmd, &at_command[i]);
cmd = strtok(NULL, ";");
}
free(buf);
if (rc != RETURNerror) {
LOG_FUNC_RETURN (i);
}
LOG_FUNC_RETURN (rc);
}
int at_command_get_list(const char** buffer, int n_max)
{
LOG_FUNC_IN;
int handler_index = 0;
while ( (strcmp(_at_command_handler[handler_index].command, "null") != 0) &&
(handler_index < n_max) ) {
*buffer++ = _at_command_handler[handler_index++].command;
}
LOG_FUNC_RETURN (handler_index);
}
static int ParseString(char * at_str, at_command_t* at_command)
{
char* <API key> = NULL;
int <API key> = -1;
int handler_index;
int handler_found = FALSE;
int <API key> = 0;
/*
* Find the number of characters we should be comparing against
* the command list
*/
if ((<API key> = strstr(at_str, "=?")) != NULL) {
/* `test' command */
<API key> = <API key> - at_str + 2;
<API key> = 1;
at_command->type = AT_COMMAND_TST;
} else if ((<API key> = strchr(at_str, '?')) != NULL) {
/* `read' command */
<API key> = <API key> - at_str + 1;
<API key> = 1;
at_command->type = AT_COMMAND_GET;
} else if ((<API key> = strchr(at_str, '=')) != NULL) {
/* `set' command */
<API key> = <API key> - at_str + 1;
at_command->type = AT_COMMAND_SET;
} else if ((<API key> = strchr(at_str, '\r')) != NULL) {
/* Basic/action command */
<API key> = <API key> - at_str;
<API key> = 1;
at_command->type = AT_COMMAND_ACT;
} else {
/* One action command among many commands */
<API key> = strchr(at_str, '\0') - at_str;
at_command->type = AT_COMMAND_ACT;
}
/*
* The AT command strings in `Commands' list (that we compare the incoming
* command against) don't have CR at the end. So we have to ensure that CR
* comes just after characters like = and ?
*/
if (<API key> == 1) {
if ( (at_str[<API key>] != '\0') &&
(at_str[<API key>] != '\r') ) {
LOG_TRACE(ERROR, "USR-API - Carriage return is not at where it should be!");
return RETURNerror;
}
}
/* Check if this command has a relevant command handler */
for (handler_index=0;
strcmp(_at_command_handler[handler_index].command, "null") != 0;
handler_index++) {
/* First match the command types... */
if (at_command->type != _at_command_handler[handler_index].type)
continue;
/* Match the command length... */
if (strlen(_at_command_handler[handler_index].command) !=
<API key>) continue;
/* Now do string comparison... */
if (strncasecmp(at_str, _at_command_handler[handler_index].command,
<API key>) != 0) continue;
handler_found = TRUE;
break;
}
/* Call the relevant handler or return with error */
if (!handler_found) {
LOG_TRACE(ERROR, "USR-API - Unsupported or invalid command!");
return RETURNerror;
}
return _at_command_handler[handler_index].handler(at_str,
<API key>,
at_command);
}
static int ParseCommand(const unsigned char *str, const char *format, ...)
{
const unsigned char *fmt = (unsigned char*) format;
const char *inp = (char*) str;
char *endptr;
char *out_us;
char *buffer;
size_t length;
size_t storage_size;
int *out_i;
long int *out_l;
va_list ap;
int error = RETURNok;
va_start(ap, format);
while (*fmt) {
switch (*fmt++) {
case '@':
if (*fmt == 0) {
/* Invalid format string */
LOG_TRACE(ERROR, "USR-API - Invalid format string!");
error = RETURNerror;
goto end;
}
switch (*fmt++) {
case 'i':
out_i = va_arg(ap, int *);
*out_i = strtol(inp, &endptr, 10);
if (endptr == inp) {
error = RETURNerror;
goto end;
}
inp = endptr;
break;
case 'I':
out_i = va_arg(ap, int *);
*out_i = strtol(inp, &endptr, 10);
if (endptr == inp) {
/* Number empty */
/* optional parameter ??? */
LOG_TRACE(WARNING, "USR-API - Number empty!");
*out_i = 0;
} else {
inp = endptr;
}
break;
case 'l':
out_l = va_arg(ap, long int *);
*out_l = strtol(inp, &endptr, 10);
if (endptr == inp) {
error = RETURNerror;
goto end;
}
inp = endptr;
break;
case 'r':
out_us = va_arg(ap, char *);
storage_size = va_arg(ap, size_t);
length = GrabString((unsigned char*) inp, &buffer);
if (strlen(buffer) > storage_size) {
free(buffer);
error = RETURNerror;
goto end;
}
strcpy(out_us, buffer);
free(buffer);
inp += length;
break;
case '@':
if (*inp++ != '@') {
error = RETURNerror;
goto end;
}
break;
case '0':
/* Just skip the rest */
goto end;
default:
/* Invalid format string */
error = RETURNerror;
goto end;
}
break;
case ' ':
while (isspace(*inp))
inp++;
break;
default:
if (*inp++ != *(fmt - 1)) {
error = RETURNerror;
goto end;
}
break;
}
}
/* Ignore trailing spaces */
while (isspace(*inp))
inp++;
if (*inp != 0) {
error = RETURNerror;
goto end;
}
end:
va_end(ap);
return error;
}
static size_t GrabString(const unsigned char *str, char **output)
{
size_t size = 4, position = 0;
int inside_quotes = 0;
/* Allocate initial buffer in case string is empty */
*output = malloc(size);
if (*output == NULL) {
return 0;
}
while (inside_quotes || (*str != ',' && *str != ')' &&
*str != 0x0d && *str != 0x0a && *str != 0x00)) {
/* Check for quotes */
if (*str == '"') {
inside_quotes = !inside_quotes;
}
/* We also allocate space for trailing zero */
if (position + 2 > size) {
size += 10;
*output = realloc(*output, size);
if (*output == NULL) {
return 0;
}
}
/* Copy to output */
(*output)[position] = *str;
position++;
str++;
}
(*output)[position] = 0;
/* Strip quotes */
if ((*output)[0] == '"' && (*output)[position - 1]) {
memmove(*output, (*output) + 1, position - 2);
(*output)[position - 2] = 0;
}
return position;
}
static unsigned int NumberOfParameters(const unsigned char* str)
{
if (*str == '\r')
return 0;
int count = 1;
while (*str) {
if (*str++ == ',') {
++count;
}
}
return count;
}
static unsigned int IsNumeric(const char* str, size_t len)
{
while (len
if (!isdigit(str[len])) {
return FALSE;
}
}
return TRUE;
}
static int parse_e0(const char* string, int position, at_command_t* at_command)
{
/* Command echo E0 */
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_e1(const char* string, int position, at_command_t* at_command)
{
/* Command echo E1 */
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_q0(const char* string, int position, at_command_t* at_command)
{
/* Result code suppression Q0 */
<API key> = FALSE;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_q1(const char* string, int position, at_command_t* at_command)
{
/* Result code suppression Q1 */
<API key> = TRUE;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_v0(const char* string, int position, at_command_t* at_command)
{
/* Response format V0 (numeric result code + limited header) */
at_error_format = AT_ERROR_NUMERIC;
<API key> = FALSE;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_v1(const char* string, int position, at_command_t* at_command)
{
/* Response format V1 (verbose result code + full header) */
at_error_format = AT_ERROR_VERBOSE;
<API key> = TRUE;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
}
static int parse_cgsn(const char* string, int position, at_command_t* at_command)
{
/* CGSN action command - No parameter */
at_command->id = AT_CGSN;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cgsn_test(const char* string, int position, at_command_t* at_command)
{
/* CGSN test command - No parameter */
at_command->id = AT_CGSN;
return at_command->id;
}
static int parse_cgmi(const char* string, int position, at_command_t* at_command)
{
/* CGMI action command - No parameter */
at_command->id = AT_CGMI;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cgmi_test(const char* string, int position, at_command_t* at_command)
{
/* CGMI test command - No parameter */
at_command->id = AT_CGMI;
return at_command->id;
}
static int parse_cgmm(const char* string, int position, at_command_t* at_command)
{
/* CGMM action command - No parameter */
at_command->id = AT_CGMM;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cgmm_test(const char* string, int position, at_command_t* at_command)
{
/* CGMM test command - No parameter */
at_command->id = AT_CGMM;
return at_command->id;
}
static int parse_cgmr(const char* string, int position, at_command_t* at_command)
{
/* CGMR action command - No parameter */
at_command->id = AT_CGMR;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cgmr_test(const char* string, int position, at_command_t* at_command)
{
/* CGMR test command - No parameter */
at_command->id = AT_CGMR;
return at_command->id;
}
static int parse_cimi(const char* string, int position, at_command_t* at_command)
{
/* CIMI action command - No parameter */
at_command->id = AT_CIMI;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cimi_test(const char* string, int position, at_command_t* at_command)
{
/* CIMI test command - No parameter */
at_command->id = AT_CIMI;
return at_command->id;
}
static int parse_cfun_set(const char* string, int position, at_command_t* at_command)
{
/* CFUN parameter command - Parameters [<fun>[,<rst>]] */
at_command->id = AT_CFUN;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CFUN= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <fun> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cfun.fun) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CFUN=<fun> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CFUN=<fun> command succeed (fun:%d)", at_command->command.cfun.fun);
at_command->mask = AT_CFUN_FUN_MASK;
break;
case 2: // <fun>,<rst> parameters are present
if (ParseCommand(<API key>, "@i,@i",
&at_command->command.cfun.fun,
&at_command->command.cfun.rst) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CFUN=<fun>,<rst> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CFUN=<fun>,<rst> command succeed (fun:%d, rst:%d)", at_command->command.cfun.fun, at_command->command.cfun.rst);
at_command->mask = AT_CFUN_FUN_MASK | AT_CFUN_RST_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cfun_get(const char* string, int position, at_command_t* at_command)
{
/* CFUN action command - No parameter */
at_command->id = AT_CFUN;
return at_command->id;
}
static int parse_cfun_test(const char* string, int position, at_command_t* at_command)
{
/* CFUN test command - No parameter */
at_command->id = AT_CFUN;
return at_command->id;
}
static int parse_cpin_set(const char* string, int position, at_command_t* at_command)
{
/* CPIN parameter command - Parameters <pin>[,<newpin>] */
at_command->id = AT_CPIN;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 1: // Only <pin> parameter is present
if (ParseCommand(<API key>, "@r",
at_command->command.cpin.pin, AT_CPIN_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CPIN=<pin> command failed");
return RETURNerror;
}
if (!IsNumeric(at_command->command.cpin.pin, AT_CPIN_SIZE)) {
LOG_TRACE(ERROR, "USR-API - Incoming parameter is not a valid PIN code!");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CPIN=<pin> command succeed (pin:%s)", at_command->command.cpin.pin);
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 2: // <pin>,<newpin> parameters are present
if (ParseCommand(<API key>, "@r,@r",
at_command->command.cpin.pin, AT_CPIN_SIZE,
at_command->command.cpin.newpin, AT_CPIN_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CPIN=<pin>,<newpin> command failed");
return RETURNerror;
}
if (!IsNumeric(at_command->command.cpin.pin, AT_CPIN_SIZE) ||
!IsNumeric(at_command->command.cpin.newpin, AT_CPIN_SIZE)) {
LOG_TRACE(ERROR, "USR-API - Incoming parameter is not a valid PIN code!");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CPIN=<pin>,<newpin> command succeed (pin:%s, newpin:%s)", at_command->command.cpin.pin, at_command->command.cpin.newpin);
at_command->mask = AT_CPIN_NEWPIN_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cpin_get(const char* string, int position, at_command_t* at_command)
{
/* CPIN action command - No parameter */
at_command->id = AT_CPIN;
return at_command->id;
}
static int parse_cpin_test(const char* string, int position, at_command_t* at_command)
{
/* CPIN test command - No parameter */
at_command->id = AT_CPIN;
return at_command->id;
}
static int parse_csq(const char* string, int position, at_command_t* at_command)
{
/* CSQ action command - No parameter */
at_command->id = AT_CSQ;
at_command->mask = AT_COMMAND_CSQ_MASK;
return at_command->id;
}
static int parse_csq_test(const char* string, int position, at_command_t* at_command)
{
/* CSQ test command - No parameter */
at_command->id = AT_CSQ;
return at_command->id;
}
static int parse_cesq(const char* string, int position, at_command_t* at_command)
{
/* CESQ action command - No parameter */
at_command->id = AT_CESQ;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cesq_test(const char* string, int position, at_command_t* at_command)
{
/* CESQ test command - No parameter */
at_command->id = AT_CESQ;
return at_command->id;
}
static int parse_clac(const char* string, int position, at_command_t* at_command)
{
/* CLAC action command - No parameter */
at_command->id = AT_CLAC;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_clac_test(const char* string, int position, at_command_t* at_command)
{
/* CLAC test command - No parameter */
at_command->id = AT_CLAC;
return at_command->id;
}
static int parse_cmee_set(const char* string, int position, at_command_t* at_command)
{
/* CMEE parameter command - Parameter [<n>] */
at_command->id = AT_CMEE;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CMEE= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <n> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cmee.n) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CMEE=<n> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CMEE=<n> command succeed (n:%d)", at_command->command.cmee.n);
at_command->mask = AT_CMEE_N_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cmee_get(const char* string, int position, at_command_t* at_command)
{
/* CMEE read command - No parameter */
at_command->id = AT_CMEE;
return at_command->id;
}
static int parse_cmee_test(const char* string, int position, at_command_t* at_command)
{
/* CMEE test command - No parameter */
at_command->id = AT_CMEE;
return at_command->id;
}
static int parse_cnum(const char* string, int position, at_command_t* at_command)
{
/* CNUM action command - No parameter */
at_command->id = AT_CNUM;
at_command->mask = <API key>;
return at_command->id;
}
static int parse_cnum_test(const char* string, int position, at_command_t* at_command)
{
/* CNUM test command - No parameter */
at_command->id = AT_CNUM;
return at_command->id;
}
static int parse_clck_set(const char* string, int position, at_command_t* at_command)
{
/* CLCK action command - Parameters <fac>,<mode>[,<passwd>] */
at_command->id = AT_CLCK;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
switch (<API key>) {
case 2: // <fac>,<mode> parameters are present
if (ParseCommand(<API key>, "@r,@i",
&at_command->command.clck.fac, AT_CLCK_FAC_SIZE,
&at_command->command.clck.mode) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CLCK=<fac>,<mode> "
"failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CLCK=<fac>,<mode> "
"succeed (fac:%s, mode:%d)",
at_command->command.clck.fac,
at_command->command.clck.mode);
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 3: // <fac>,<mode>,<passwd> parameters are present
if (ParseCommand(<API key>, "@r,@i,@r",
&at_command->command.clck.fac, AT_CLCK_FAC_SIZE,
&at_command->command.clck.mode,
&at_command->command.clck.passwd,
AT_CLCK_PASSWD_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CLCK=<fac>,<mode>"
"<passwd> failed");
return RETURNerror;
}
if (!IsNumeric(at_command->command.clck.passwd,AT_CLCK_PASSWD_SIZE)) {
LOG_TRACE(ERROR, "USR-API - Incoming parameter is not a valid password!");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CLCK=<fac>,<mode>"
"<passwd> succeed (fac:%s, mode:%d, passwd:%s)",
at_command->command.clck.fac,
at_command->command.clck.mode,
at_command->command.clck.passwd);
at_command->mask = AT_CLCK_PASSWD_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return -1;
}
return at_command->id;
}
static int parse_clck_test(const char* string, int position, at_command_t* at_command)
{
/* CLCK test command - No parameter */
at_command->id = AT_CLCK;
return at_command->id;
}
static int parse_cops_set(const char* string, int position, at_command_t* at_command)
{
/* COPS parameter command - Parameters [<mode>[,<format>[,<oper>[,<AcT>]]]] */
at_command->id = AT_COPS;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
char oper_value[AT_COPS_NUM_SIZE];
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <mode> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cops.mode) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode> command succeed (mode:%d)", at_command->command.cops.mode);
at_command->mask = AT_COPS_MODE_MASK;
break;
case 2: // <mode>,<format> parameters are present
if (ParseCommand(<API key>, "@i,@i",
&at_command->command.cops.mode,
&at_command->command.cops.format) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format> command succeed (mode:%d, format:%d)", at_command->command.cops.mode, at_command->command.cops.format);
at_command->mask = AT_COPS_MODE_MASK | AT_COPS_FORMAT_MASK;
break;
case 3: // <mode>,<format>,<oper> parameters are present
if (ParseCommand(<API key>, "@i,@i,@r",
&at_command->command.cops.mode,
&at_command->command.cops.format,
oper_value, NET_FORMAT_MAX_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper> command succeed (mode:%d, format:%d)", at_command->command.cops.mode, at_command->command.cops.format);
/* Now, process <oper> parameter according to the specified <format> parameter */
switch (at_command->command.cops.format) {
case AT_COPS_LONG: /* long format alphanumeric <oper> */
strncpy((char*) at_command->command.cops.plmn.id.alpha_long,
oper_value, AT_COPS_LONG_SIZE);
LOG_TRACE(INFO, "USR-API - <oper> parameter's value is '%s'", at_command->command.cops.plmn.id.alpha_long);
break;
case AT_COPS_SHORT: /* short format alphanumeric <oper> */
strncpy((char*) at_command->command.cops.plmn.id.alpha_short, oper_value, AT_COPS_SHORT_SIZE);
LOG_TRACE(INFO, "USR-API - <oper> parameter's value is '%s'", at_command->command.cops.plmn.id.alpha_short);
break;
case AT_COPS_NUM: /* numeric <oper> */
strncpy((char*) at_command->command.cops.plmn.id.num,
oper_value, AT_COPS_NUM_SIZE);
LOG_TRACE(INFO, "USR-API - <oper> parameter's value is '%s'", at_command->command.cops.plmn.id.num);
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid format value (%d)",
at_command->command.cops.format);
return RETURNerror;
}
at_command->mask = AT_COPS_MODE_MASK | AT_COPS_FORMAT_MASK | AT_COPS_OPER_MASK;
break;
case 4: // <mode>,<format>,<oper>,<AcT> parameters are present
if (ParseCommand(<API key>, "@i,@i,@0",
&at_command->command.cops.mode,
&at_command->command.cops.format) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format> command failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper> command succeed (mode:%d, format:%d)", at_command->command.cops.mode, at_command->command.cops.format);
/* Now, process <oper> parameter according to the specified <format> parameter */
switch (at_command->command.cops.format) {
case AT_COPS_LONG: /* long format alphanumeric <oper> */
if (ParseCommand(<API key>, "@i,@i,@r,@i",
&at_command->command.cops.mode,
&at_command->command.cops.format,
oper_value, AT_COPS_LONG_SIZE,
&at_command->command.cops.AcT) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command failed");
return RETURNerror;
}
strncpy((char*) at_command->command.cops.plmn.id.alpha_long,
oper_value, AT_COPS_LONG_SIZE);
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command succeed (oper:%s, Act:%d)", at_command->command.cops.plmn.id.alpha_long, at_command->command.cops.AcT);
break;
case AT_COPS_SHORT: /* short format alphanumeric <oper> */
if (ParseCommand(<API key>, "@i,@i,@r,@i",
&at_command->command.cops.mode,
&at_command->command.cops.format,
oper_value, AT_COPS_SHORT_SIZE,
&at_command->command.cops.AcT) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command failed");
return RETURNerror;
}
strncpy((char*) at_command->command.cops.plmn.id.alpha_short,
oper_value, AT_COPS_SHORT_SIZE);
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command succeed (oper:%s, Act:%d)",
at_command->command.cops.plmn.id.alpha_short,
at_command->command.cops.AcT);
break;
case AT_COPS_NUM: /* numeric <oper> */
if (ParseCommand(<API key>, "@i,@i,@r,@i",
&at_command->command.cops.mode,
&at_command->command.cops.format,
oper_value, AT_COPS_NUM_SIZE,
&at_command->command.cops.AcT) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command failed");
return RETURNerror;
}
strncpy((char*) at_command->command.cops.plmn.id.num,
oper_value, AT_COPS_NUM_SIZE);
LOG_TRACE(INFO, "USR-API - Parsing of AT+COPS=<mode>,<format>,<oper>,<AcT> command succeed (oper:%s, Act:%d)",
at_command->command.cops.plmn.id.num,
at_command->command.cops.AcT);
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid format value (%d)",
at_command->command.cops.format);
return RETURNerror;
}
at_command->mask = AT_COPS_MODE_MASK | AT_COPS_FORMAT_MASK | AT_COPS_OPER_MASK | AT_COPS_ACT_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cops_get(const char* string, int position, at_command_t* at_command)
{
/* COPS test command - No parameter */
at_command->id = AT_COPS;
return at_command->id;
}
static int parse_cops_test(const char* string, int position, at_command_t* at_command)
{
/* COPS test command - No parameter */
at_command->id = AT_COPS;
return at_command->id;
}
static int parse_creg_set(const char* string, int position, at_command_t* at_command)
{
/* CREG parameter command - Parameter [<n>] */
at_command->id = AT_CREG;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CREG= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <n> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.creg.n) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CREG=<n> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CREG=<n> command succeed (n:%d)", at_command->command.creg.n);
at_command->mask = AT_CREG_N_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_creg_get(const char* string, int position, at_command_t* at_command)
{
/* CREG read command - No parameter */
at_command->id = AT_CREG;
return at_command->id;
}
static int parse_creg_test(const char* string, int position, at_command_t* at_command)
{
/* CREG test command - No parameter */
at_command->id = AT_CREG;
return at_command->id;
}
static int parse_cgatt_set(const char* string, int position, at_command_t* at_command)
{
/* CGATT parameter command - Parameter [<state>] */
at_command->id = AT_CGATT;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGATT= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <state> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cgatt.state) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGATT=<state> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGATT=<state> command succeed (state:%d)", at_command->command.cgatt.state);
at_command->mask = AT_CGATT_STATE_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cgatt_get(const char* string, int position, at_command_t* at_command)
{
/* CGATT read command - No parameter */
at_command->id = AT_CGATT;
return at_command->id;
}
static int parse_cgatt_test(const char* string, int position, at_command_t* at_command)
{
/* CGATT test command - No parameter */
at_command->id = AT_CGATT;
return at_command->id;
}
static int parse_cgreg_set(const char* string, int position, at_command_t* at_command)
{
/* CGREG parameter command - Parameter [<n>] */
at_command->id = AT_CGREG;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGREG= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <n> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cgreg.n) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGREG=<n> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGREG=<n> command succeed (n:%d)", at_command->command.cgreg.n);
at_command->mask = AT_CGREG_N_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cgreg_get(const char* string, int position, at_command_t* at_command)
{
/* CGREG read command - No parameter */
at_command->id = AT_CGREG;
return at_command->id;
}
static int parse_cgreg_test(const char* string, int position, at_command_t* at_command)
{
/* CGREG test command - No parameter */
at_command->id = AT_CGREG;
return at_command->id;
}
static int parse_cereg_set(const char* string, int position, at_command_t* at_command)
{
/* CEREG parameter command - Parameter [<n>] */
at_command->id = AT_CEREG;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CEREG= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <n> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cereg.n) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CEREG=<n> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CEREG=<n> command succeed (n:%d)", at_command->command.cereg.n);
at_command->mask = AT_CEREG_N_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cereg_get(const char* string, int position, at_command_t* at_command)
{
/* CEREG read command - No parameter */
at_command->id = AT_CEREG;
return at_command->id;
}
static int parse_cereg_test(const char* string, int position, at_command_t* at_command)
{
/* CEREG test command - No parameter */
at_command->id = AT_CEREG;
return at_command->id;
}
static int parse_cgdcont_set(const char* string, int position, at_command_t* at_command)
{
/* CGDCONT parameter command - Parameters [<cid>[,<PDP_type>[,<APN>[,<PDP_addr>[,<d_comp>[,<h_comp>[,<IPv4AddrAlloc>[,<emergency indication>[,<P-CSCF_discovery>[,<<API key>>]]]]]]]]]] */
at_command->id = AT_CGDCONT;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
/* Parse the parameters */
switch (<API key>) {
case 1: // Only <cid> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cgdcont.cid) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid> command succeed (cid:%d)", at_command->command.cgdcont.cid);
at_command->mask = AT_CGDCONT_CID_MASK;
break;
case 2: // <cid>,<PDP_type> parameters are present
if (ParseCommand(<API key>, "@i,@r",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type> succeed (cid:%d, pdp_type:%s)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type);
at_command->mask = AT_CGDCONT_CID_MASK | <API key>;
break;
case 3: // <cid>,<PDP_type>,<APN> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN> succeed (cid:%d, pdp_type:%s, apn:%s)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK;
break;
case 4: // <cid>,<PDP_type>,<APN>,<PDP_addr> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r,@r",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key>;
break;
case 5: // <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key>;
break;
case 6: // <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp,
&at_command->command.cgdcont.h_comp) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d, h_comp:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp,
at_command->command.cgdcont.h_comp);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key> | <API key>;
break;
case 7: // <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i,@i,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp,
&at_command->command.cgdcont.h_comp,
&at_command->command.cgdcont.IPv4AddrAlloc) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc> failed");
return RETURNerror;
}
LOG_TRACE(INFO,
"USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d, h_comp:%d, ipv4addralloc:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp,
at_command->command.cgdcont.h_comp,
at_command->command.cgdcont.IPv4AddrAlloc);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key> | <API key> | <API key>;
break;
case 8: // <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication> parameters are present
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i,@i,@i,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp,
&at_command->command.cgdcont.h_comp,
&at_command->command.cgdcont.IPv4AddrAlloc,
&at_command->command.cgdcont.<API key>) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication> failed");
return RETURNerror;
}
LOG_TRACE(INFO,
"USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d, h_comp:%d, ipv4addralloc:%d, <API key>:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp,
at_command->command.cgdcont.h_comp,
at_command->command.cgdcont.IPv4AddrAlloc,
at_command->command.cgdcont.<API key>);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key> | <API key> | <API key> |
<API key>;
break;
case 9: /* <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,
* <IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery>
* parameters are present */
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i,@i,@i,@i,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp,
&at_command->command.cgdcont.h_comp,
&at_command->command.cgdcont.IPv4AddrAlloc,
&at_command->command.cgdcont.<API key>,
&at_command->command.cgdcont.P_CSCF_discovery) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery> failed");
return RETURNerror;
}
LOG_TRACE(INFO,
"USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d, h_comp:%d, ipv4addralloc:%d, <API key>:%d, p_cscf_discovery:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp,
at_command->command.cgdcont.h_comp,
at_command->command.cgdcont.IPv4AddrAlloc,
at_command->command.cgdcont.<API key>,
at_command->command.cgdcont.P_CSCF_discovery);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key> | <API key> | <API key> |
<API key> | <API key>;
break;
case 10: /* <cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,
* <IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery>,
* <<API key>> parameters are present */
if (ParseCommand(<API key>, "@i,@r,@r,@r,@i,@i,@i,@i,@i,@i",
&at_command->command.cgdcont.cid,
&at_command->command.cgdcont.PDP_type, AT_CGDCONT_PDP_SIZE,
&at_command->command.cgdcont.APN, AT_CGDCONT_APN_SIZE,
&at_command->command.cgdcont.PDP_addr, <API key>,
&at_command->command.cgdcont.d_comp,
&at_command->command.cgdcont.h_comp,
&at_command->command.cgdcont.IPv4AddrAlloc,
&at_command->command.cgdcont.<API key>,
&at_command->command.cgdcont.P_CSCF_discovery,
&at_command->command.cgdcont.<API key>) != RETURNok) {
LOG_TRACE(ERROR,
"USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery>, <<API key>> failed");
return RETURNerror;
}
LOG_TRACE(INFO,
"USR-API - Parsing of AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<d_comp>,<h_comp>,<IPv4AddrAlloc>,<emergency indication>,<P-CSCF_discovery>, <<API key>> succeed (cid:%d, pdp_type:%s, apn:%s, pdp_addr:%s, d_comp:%d, h_comp:%d, ipv4addralloc:%d, <API key>:%d, p_cscf_discovery:%d, <API key>:%d)",
at_command->command.cgdcont.cid,
at_command->command.cgdcont.PDP_type,
at_command->command.cgdcont.APN,
at_command->command.cgdcont.PDP_addr,
at_command->command.cgdcont.d_comp,
at_command->command.cgdcont.h_comp,
at_command->command.cgdcont.IPv4AddrAlloc,
at_command->command.cgdcont.<API key>,
at_command->command.cgdcont.P_CSCF_discovery,
at_command->command.cgdcont.<API key>);
at_command->mask = AT_CGDCONT_CID_MASK | <API key> | AT_CGDCONT_APN_MASK | <API key> | <API key> | <API key> | <API key> |
<API key> | <API key> | <API key>;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return RETURNerror;
}
return at_command->id;
}
static int parse_cgdcont_get(const char* string, int position, at_command_t* at_command)
{
/* CGDCONT read command - No parameter */
at_command->id = AT_CGDCONT;
return at_command->id;
}
static int parse_cgdcont_test(const char* string, int position, at_command_t* at_command)
{
/* CGDCONT test command - No parameter */
at_command->id = AT_CGDCONT;
return at_command->id;
}
static int parse_cgact_set(const char* string, int position, at_command_t* at_command)
{
/* CGACT parameter command - Parameters <state>[,<cid>] */
at_command->id = AT_CGACT;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
switch (<API key>) {
case 1: // Only <state> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cgact.state) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGACT=<state> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGACT=<state> succeed (state:%d)", at_command->command.cgact.state);
at_command->mask = AT_CGACT_STATE_MASK;
break;
case 2: // <state>,<cid> parameters are present
if (ParseCommand(<API key>, "@i,@i",
&at_command->command.cgact.state,
&at_command->command.cgact.cid) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGACT=<state>,<cid> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGACT=<state>,<cid> succeed (state:%d, cid:%d)",
at_command->command.cgact.state,
at_command->command.cgact.cid);
at_command->mask = AT_CGACT_STATE_MASK | AT_CGACT_CID_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return -1;
}
return at_command->id;
}
static int parse_cgact_get(const char* string, int position, at_command_t* at_command)
{
/* CGACT read command - No parameter */
at_command->id = AT_CGACT;
return at_command->id;
}
static int parse_cgact_test(const char* string, int position, at_command_t* at_command)
{
/* CGACT test command - No parameter */
at_command->id = AT_CGACT;
return at_command->id;
}
static int parse_cgpaddr_set(const char* string, int position, at_command_t* at_command)
{
/* CGPADDR parameter command - Parameters [<cid>] */
at_command->id = AT_CGPADDR;
unsigned char* <API key> = (unsigned char*) string + position;
/* Check the number of parameters */
unsigned <API key> = NumberOfParameters(<API key>);
switch (<API key>) {
case 0: // No any parameter
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGPADDR= command succeed");
at_command->mask = AT_COMMAND_NO_PARAM;
break;
case 1: // Only <cid> parameter is present
if (ParseCommand(<API key>, "@i",
&at_command->command.cgpaddr.cid) != RETURNok) {
LOG_TRACE(ERROR, "USR-API - Parsing of AT+CGPADDR=<state> failed");
return RETURNerror;
}
LOG_TRACE(INFO, "USR-API - Parsing of AT+CGPADDR=<cid> succeed (cid:%d)", at_command->command.cgpaddr.cid);
at_command->mask = AT_CGPADDR_CID_MASK;
break;
default:
LOG_TRACE(ERROR, "USR-API - Invalid number of parameters (%d)", <API key>);
return -1;
}
return at_command->id;
}
static int parse_cgpaddr_test(const char* string, int position, at_command_t* at_command)
{
/* CGPADDR test command - No parameter */
at_command->id = AT_CGPADDR;
return at_command->id;
}
|
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils.chat_formatting import <API key>
from .utils import checks
from collections import defaultdict
from string import ascii_letters
from random import choice
import discord
import os
import re
import aiohttp
import asyncio
import logging
import json
class StreamsError(Exception):
pass
class StreamNotFound(StreamsError):
pass
class APIError(StreamsError):
pass
class InvalidCredentials(StreamsError):
pass
class OfflineStream(StreamsError):
pass
class Streams:
"""Streams
Alerts for a variety of streaming services"""
def __init__(self, bot):
self.bot = bot
self.twitch_streams = dataIO.load_json("data/streams/twitch.json")
self.hitbox_streams = dataIO.load_json("data/streams/hitbox.json")
self.mixer_streams = dataIO.load_json("data/streams/beam.json")
self.picarto_streams = dataIO.load_json("data/streams/picarto.json")
settings = dataIO.load_json("data/streams/settings.json")
self.settings = defaultdict(dict, settings)
self.messages_cache = defaultdict(list)
@commands.command()
async def hitbox(self, stream: str):
"""Checks if hitbox stream is online"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(hitbox\.tv\/)'
stream = re.sub(regex, '', stream)
try:
embed = await self.hitbox_online(stream)
except OfflineStream:
await self.bot.say(stream + " is offline.")
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
except APIError:
await self.bot.say("Error contacting the API.")
else:
await self.bot.say(embed=embed)
@commands.command(pass_context=True)
async def twitch(self, ctx, stream: str):
"""Checks if twitch stream is online"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(twitch\.tv\/)'
stream = re.sub(regex, '', stream)
try:
data = await self.fetch_twitch_ids(stream, raise_if_none=True)
embed = await self.twitch_online(data[0]["_id"])
except OfflineStream:
await self.bot.say(stream + " is offline.")
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
except APIError:
await self.bot.say("Error contacting the API.")
except InvalidCredentials:
await self.bot.say("Owner: Client-ID is invalid or not set. "
"See `{}streamset twitchtoken`"
"".format(ctx.prefix))
else:
await self.bot.say(embed=embed)
@commands.command()
async def mixer(self, stream: str):
"""Checks if mixer stream is online"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(mixer\.com\/)'
stream = re.sub(regex, '', stream)
try:
embed = await self.mixer_online(stream)
except OfflineStream:
await self.bot.say(stream + " is offline.")
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
except APIError:
await self.bot.say("Error contacting the API.")
else:
await self.bot.say(embed=embed)
@commands.command()
async def picarto(self, stream: str):
"""Checks if picarto stream is online"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(picarto\.tv\/)'
stream = re.sub(regex, '', stream)
try:
embed = await self.picarto_online(stream)
except OfflineStream:
await self.bot.say(stream + " is offline.")
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
except APIError:
await self.bot.say("Error contacting the API.")
else:
await self.bot.say(embed=embed)
@commands.group(pass_context=True, no_pm=True)
@checks.mod_or_permissions(manage_server=True)
async def streamalert(self, ctx):
"""Adds/removes stream alerts from the current channel"""
if ctx.invoked_subcommand is None:
await self.bot.send_cmd_help(ctx)
@streamalert.command(name="twitch", pass_context=True)
async def twitch_alert(self, ctx, stream: str):
"""Adds/removes twitch alerts from the current channel"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(twitch\.tv\/)'
stream = re.sub(regex, '', stream)
channel = ctx.message.channel
try:
data = await self.fetch_twitch_ids(stream, raise_if_none=True)
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
return
except APIError:
await self.bot.say("Error contacting the API.")
return
except InvalidCredentials:
await self.bot.say("Owner: Client-ID is invalid or not set. "
"See `{}streamset twitchtoken`"
"".format(ctx.prefix))
return
enabled = self.<API key>(self.twitch_streams,
stream,
channel,
_id=data[0]["_id"])
if enabled:
await self.bot.say("Alert activated. I will notify this channel "
"when {} is live.".format(stream))
else:
await self.bot.say("Alert has been removed from this channel.")
dataIO.save_json("data/streams/twitch.json", self.twitch_streams)
@streamalert.command(name="hitbox", pass_context=True)
async def hitbox_alert(self, ctx, stream: str):
"""Adds/removes hitbox alerts from the current channel"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(hitbox\.tv\/)'
stream = re.sub(regex, '', stream)
channel = ctx.message.channel
try:
await self.hitbox_online(stream)
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
return
except APIError:
await self.bot.say("Error contacting the API.")
return
except OfflineStream:
pass
enabled = self.<API key>(self.hitbox_streams,
stream,
channel)
if enabled:
await self.bot.say("Alert activated. I will notify this channel "
"when {} is live.".format(stream))
else:
await self.bot.say("Alert has been removed from this channel.")
dataIO.save_json("data/streams/hitbox.json", self.hitbox_streams)
@streamalert.command(name="mixer", pass_context=True)
async def mixer_alert(self, ctx, stream: str):
"""Adds/removes mixer alerts from the current channel"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(mixer\.com\/)'
stream = re.sub(regex, '', stream)
channel = ctx.message.channel
try:
await self.mixer_online(stream)
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
return
except APIError:
await self.bot.say("Error contacting the API.")
return
except OfflineStream:
pass
enabled = self.<API key>(self.mixer_streams,
stream,
channel)
if enabled:
await self.bot.say("Alert activated. I will notify this channel "
"when {} is live.".format(stream))
else:
await self.bot.say("Alert has been removed from this channel.")
dataIO.save_json("data/streams/beam.json", self.mixer_streams)
@streamalert.command(name="picarto", pass_context=True)
async def picarto_alert(self, ctx, stream: str):
"""Adds/removes picarto alerts from the current channel"""
stream = <API key>(stream)
regex = r'^(https?\:\/\/)?(www\.)?(picarto\.tv\/)'
stream = re.sub(regex, '', stream)
channel = ctx.message.channel
try:
await self.picarto_online(stream)
except StreamNotFound:
await self.bot.say("That stream doesn't exist.")
return
except APIError:
await self.bot.say("Error contacting the API.")
return
except OfflineStream:
pass
enabled = self.<API key>(self.picarto_streams,
stream,
channel)
if enabled:
await self.bot.say("Alert activated. I will notify this channel "
"when {} is live.".format(stream))
else:
await self.bot.say("Alert has been removed from this channel.")
dataIO.save_json("data/streams/picarto.json", self.picarto_streams)
@streamalert.command(name="stop", pass_context=True)
async def stop_alert(self, ctx):
"""Stops all streams alerts in the current channel"""
channel = ctx.message.channel
streams = (
self.hitbox_streams,
self.twitch_streams,
self.mixer_streams,
self.picarto_streams
)
for stream_type in streams:
to_delete = []
for s in stream_type:
if channel.id in s["CHANNELS"]:
s["CHANNELS"].remove(channel.id)
if not s["CHANNELS"]:
to_delete.append(s)
for s in to_delete:
stream_type.remove(s)
dataIO.save_json("data/streams/twitch.json", self.twitch_streams)
dataIO.save_json("data/streams/hitbox.json", self.hitbox_streams)
dataIO.save_json("data/streams/beam.json", self.mixer_streams)
dataIO.save_json("data/streams/picarto.json", self.picarto_streams)
await self.bot.say("There will be no more stream alerts in this "
"channel.")
@commands.group(pass_context=True)
async def streamset(self, ctx):
"""Stream settings"""
if ctx.invoked_subcommand is None:
await self.bot.send_cmd_help(ctx)
@streamset.command()
@checks.is_owner()
async def twitchtoken(self, token : str):
self.settings["TWITCH_TOKEN"] = token
dataIO.save_json("data/streams/settings.json", self.settings)
await self.bot.say('Twitch Client-ID set.')
@streamset.command(pass_context=True, no_pm=True)
@checks.admin()
async def mention(self, ctx, *, mention_type : str):
"""Sets mentions for stream alerts
Types: everyone, here, none"""
server = ctx.message.server
mention_type = mention_type.lower()
if mention_type in ("everyone", "here"):
self.settings[server.id]["MENTION"] = "@" + mention_type
await self.bot.say("When a stream is online @\u200b{} will be "
"mentioned.".format(mention_type))
elif mention_type == "none":
self.settings[server.id]["MENTION"] = ""
await self.bot.say("Mentions disabled.")
else:
await self.bot.send_cmd_help(ctx)
dataIO.save_json("data/streams/settings.json", self.settings)
@streamset.command(pass_context=True, no_pm=True)
@checks.admin()
async def autodelete(self, ctx):
"""Toggles automatic notification deletion for streams that go offline"""
server = ctx.message.server
settings = self.settings[server.id]
current = settings.get("AUTODELETE", True)
settings["AUTODELETE"] = not current
if settings["AUTODELETE"]:
await self.bot.say("Notifications will be automatically deleted "
"once the stream goes offline.")
else:
await self.bot.say("Notifications won't be deleted anymore.")
dataIO.save_json("data/streams/settings.json", self.settings)
async def hitbox_online(self, stream):
url = "https://api.hitbox.tv/media/live/" + stream
async with aiohttp.get(url) as r:
data = await r.json(encoding='utf-8')
if "livestream" not in data:
raise StreamNotFound()
elif data["livestream"][0]["media_is_live"] == "0":
raise OfflineStream()
elif data["livestream"][0]["media_is_live"] == "1":
return self.hitbox_embed(data)
raise APIError()
async def twitch_online(self, stream):
session = aiohttp.ClientSession()
url = "https://api.twitch.tv/kraken/streams/" + stream
header = {
'Client-ID': self.settings.get("TWITCH_TOKEN", ""),
'Accept': 'application/vnd.twitchtv.v5+json'
}
async with session.get(url, headers=header) as r:
data = await r.json(encoding='utf-8')
await session.close()
if r.status == 200:
if data["stream"] is None:
raise OfflineStream()
return self.twitch_embed(data)
elif r.status == 400:
raise InvalidCredentials()
elif r.status == 404:
raise StreamNotFound()
else:
raise APIError()
async def mixer_online(self, stream):
url = "https://mixer.com/api/v1/channels/" + stream
async with aiohttp.get(url) as r:
data = await r.json(encoding='utf-8')
if r.status == 200:
if data["online"] is True:
return self.mixer_embed(data)
else:
raise OfflineStream()
elif r.status == 404:
raise StreamNotFound()
else:
raise APIError()
async def picarto_online(self, stream):
url = "https://api.picarto.tv/v1/channel/name/" + stream
async with aiohttp.get(url) as r:
data = await r.text(encoding='utf-8')
if r.status == 200:
data = json.loads(data)
if data["online"] is True:
return self.picarto_embed(data)
else:
raise OfflineStream()
elif r.status == 404:
raise StreamNotFound()
else:
raise APIError()
async def fetch_twitch_ids(self, *streams, raise_if_none=False):
def chunks(l):
for i in range(0, len(l), 100):
yield l[i:i + 100]
base_url = "https://api.twitch.tv/kraken/users?login="
header = {
'Client-ID': self.settings.get("TWITCH_TOKEN", ""),
'Accept': 'application/vnd.twitchtv.v5+json'
}
results = []
for streams_list in chunks(streams):
session = aiohttp.ClientSession()
url = base_url + ",".join(streams_list)
async with session.get(url, headers=header) as r:
data = await r.json(encoding='utf-8')
if r.status == 200:
results.extend(data["users"])
elif r.status == 400:
raise InvalidCredentials()
else:
raise APIError()
await session.close()
if not results and raise_if_none:
raise StreamNotFound()
return results
def twitch_embed(self, data):
channel = data["stream"]["channel"]
url = channel["url"]
logo = channel["logo"]
if logo is None:
logo = "https://static-cdn.jtvnw.net/jtv_user_pictures/xarth/404_user_70x70.png"
status = channel["status"]
if not status:
status = "Untitled broadcast"
embed = discord.Embed(title=status, url=url)
embed.set_author(name=channel["display_name"])
embed.add_field(name="Followers", value=channel["followers"])
embed.add_field(name="Total views", value=channel["views"])
embed.set_thumbnail(url=logo)
if data["stream"]["preview"]["medium"]:
embed.set_image(url=data["stream"]["preview"]["medium"] + self.rnd_attr())
if channel["game"]:
embed.set_footer(text="Playing: " + channel["game"])
embed.color = 0x6441A4
return embed
def hitbox_embed(self, data):
base_url = "https://edge.sf.hitbox.tv"
livestream = data["livestream"][0]
channel = livestream["channel"]
url = channel["channel_link"]
embed = discord.Embed(title=livestream["media_status"], url=url)
embed.set_author(name=livestream["media_name"])
embed.add_field(name="Followers", value=channel["followers"])
#embed.add_field(name="Views", value=channel["views"])
embed.set_thumbnail(url=base_url + channel["user_logo"])
if livestream["media_thumbnail"]:
embed.set_image(url=base_url + livestream["media_thumbnail"] + self.rnd_attr())
embed.set_footer(text="Playing: " + livestream["category_name"])
embed.color = 0x98CB00
return embed
def mixer_embed(self, data):
default_avatar = ("https://mixer.com/_latest/assets/images/main/"
"avatars/default.jpg")
user = data["user"]
url = "https://mixer.com/" + data["token"]
embed = discord.Embed(title=data["name"], url=url)
embed.set_author(name=user["username"])
embed.add_field(name="Followers", value=data["numFollowers"])
embed.add_field(name="Total views", value=data["viewersTotal"])
if user["avatarUrl"]:
embed.set_thumbnail(url=user["avatarUrl"])
else:
embed.set_thumbnail(url=default_avatar)
if data["thumbnail"]:
embed.set_image(url=data["thumbnail"]["url"] + self.rnd_attr())
embed.color = 0x4C90F3
if data["type"] is not None:
embed.set_footer(text="Playing: " + data["type"]["name"])
return embed
def picarto_embed(self, data):
avatar = ("https://picarto.tv/user_data/usrimg/{}/dsdefault.jpg{}"
"".format(data["name"].lower(), self.rnd_attr()))
url = "https://picarto.tv/" + data["name"]
thumbnail = data["thumbnails"]["web"]
embed = discord.Embed(title=data["title"], url=url)
embed.set_author(name=data["name"])
embed.set_image(url=thumbnail + self.rnd_attr())
embed.add_field(name="Followers", value=data["followers"])
embed.add_field(name="Total views", value=data["viewers_total"])
embed.set_thumbnail(url=avatar)
embed.color = 0x132332
data["tags"] = ", ".join(data["tags"])
if not data["tags"]:
data["tags"] = "None"
if data["adult"]:
data["adult"] = "NSFW | "
else:
data["adult"] = ""
embed.color = 0x4C90F3
embed.set_footer(text="{adult}Category: {category} | Tags: {tags}"
"".format(**data))
return embed
def <API key>(self, streams, stream, channel, _id=None):
"""Returns True if enabled or False if disabled"""
for i, s in enumerate(streams):
stream_id = s.get("ID")
if stream_id and _id: # ID is available, matching by ID is
if stream_id != _id: # preferable
continue
else: # ID unavailable, matching by name
if s["NAME"] != stream:
continue
if channel.id in s["CHANNELS"]:
streams[i]["CHANNELS"].remove(channel.id)
if not s["CHANNELS"]:
streams.remove(s)
return False
else:
streams[i]["CHANNELS"].append(channel.id)
return True
data = {"CHANNELS": [channel.id],
"NAME": stream,
"ALREADY_ONLINE": False}
if _id:
data["ID"] = _id
streams.append(data)
return True
async def stream_checker(self):
CHECK_DELAY = 60
try:
await self.<API key>()
except InvalidCredentials:
print("Error during convertion of twitch usernames to IDs: "
"invalid token")
except Exception as e:
print("Error during convertion of twitch usernames to IDs: "
"{}".format(e))
while self == self.bot.get_cog("Streams"):
save = False
streams = ((self.twitch_streams, self.twitch_online),
(self.hitbox_streams, self.hitbox_online),
(self.mixer_streams, self.mixer_online),
(self.picarto_streams, self.picarto_online))
for streams_list, parser in streams:
if parser == self.twitch_online:
_type = "ID"
else:
_type = "NAME"
for stream in streams_list:
if _type not in stream:
continue
key = (parser, stream[_type])
try:
embed = await parser(stream[_type])
except OfflineStream:
if stream["ALREADY_ONLINE"]:
stream["ALREADY_ONLINE"] = False
save = True
await self.<API key>(key)
except: # We don't want our task to die
continue
else:
if stream["ALREADY_ONLINE"]:
continue
save = True
stream["ALREADY_ONLINE"] = True
messages_sent = []
for channel_id in stream["CHANNELS"]:
channel = self.bot.get_channel(channel_id)
if channel is None:
continue
mention = self.settings.get(channel.server.id, {}).get("MENTION", "")
can_speak = channel.permissions_for(channel.server.me).send_messages
message = mention + " {} is live!".format(stream["NAME"])
if channel and can_speak:
m = await self.bot.send_message(channel, message, embed=embed)
messages_sent.append(m)
self.messages_cache[key] = messages_sent
await asyncio.sleep(0.5)
if save:
dataIO.save_json("data/streams/twitch.json", self.twitch_streams)
dataIO.save_json("data/streams/hitbox.json", self.hitbox_streams)
dataIO.save_json("data/streams/beam.json", self.mixer_streams)
dataIO.save_json("data/streams/picarto.json", self.picarto_streams)
await asyncio.sleep(CHECK_DELAY)
async def <API key>(self, key):
for message in self.messages_cache[key]:
server = message.server
settings = self.settings.get(server.id, {})
is_enabled = settings.get("AUTODELETE", True)
try:
if is_enabled:
await self.bot.delete_message(message)
except:
pass
del self.messages_cache[key]
def rnd_attr(self):
"""Avoids Discord's caching"""
return "?rnd=" + "".join([choice(ascii_letters) for i in range(6)])
async def <API key>(self):
# Migration of old twitch streams to API v5
to_convert = []
for stream in self.twitch_streams:
if "ID" not in stream:
to_convert.append(stream["NAME"])
if not to_convert:
return
results = await self.fetch_twitch_ids(*to_convert)
for stream in self.twitch_streams:
for result in results:
if stream["NAME"].lower() == result["name"].lower():
stream["ID"] = result["_id"]
# We might as well delete the invalid / renamed ones
self.twitch_streams = [s for s in self.twitch_streams if "ID" in s]
dataIO.save_json("data/streams/twitch.json", self.twitch_streams)
def check_folders():
if not os.path.exists("data/streams"):
print("Creating data/streams folder...")
os.makedirs("data/streams")
def check_files():
stream_files = (
"twitch.json",
"hitbox.json",
"beam.json",
"picarto.json"
)
for filename in stream_files:
if not dataIO.is_valid_json("data/streams/" + filename):
print("Creating empty {}...".format(filename))
dataIO.save_json("data/streams/" + filename, [])
f = "data/streams/settings.json"
if not dataIO.is_valid_json(f):
print("Creating empty settings.json...")
dataIO.save_json(f, {})
def setup(bot):
logger = logging.getLogger('aiohttp.client')
logger.setLevel(50) # Stops warning spam
check_folders()
check_files()
n = Streams(bot)
loop = asyncio.get_event_loop()
loop.create_task(n.stream_checker())
bot.add_cog(n)
|
#ifndef AVUTIL_INTFLOAT_H
#define AVUTIL_INTFLOAT_H
#include <stdint.h>
#include "attributes.h"
union av_intfloat32 {
uint32_t i;
float f;
};
union av_intfloat64 {
uint64_t i;
double f;
};
/**
* Reinterpret a 32-bit integer as a float.
*/
static av_always_inline float av_int2float(uint32_t i)
{
union av_intfloat32 v;
v.i = i;
return v.f;
}
/**
* Reinterpret a float as a 32-bit integer.
*/
static av_always_inline uint32_t av_float2int(float f)
{
union av_intfloat32 v;
v.f = f;
return v.i;
}
/**
* Reinterpret a 64-bit integer as a double.
*/
static av_always_inline double av_int2double(uint64_t i)
{
union av_intfloat64 v;
v.i = i;
return v.f;
}
/**
* Reinterpret a double as a 64-bit integer.
*/
static av_always_inline uint64_t av_double2int(double f)
{
union av_intfloat64 v;
v.f = f;
return v.i;
}
#endif /* AVUTIL_INTFLOAT_H */
|
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster
class CyberlockerCh(DeadHoster):
__name__ = "CyberlockerCh"
__type__ = "hoster"
__version__ = "0.06"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?cyberlocker\.ch/\w+'
__config__ = [] #@TODO: Remove in 0.4.10
__description__ = """Cyberlocker.ch hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
|
% -*- mode: LaTeX -*-
% $Id: keywords.tex,v 1.6 2006/03/22 12:48:58 entner Exp $
% Specific text elements
\newcommand{\specific}[1] {\textit{
\newcommand{\extension}[1] {\textit{.
\newcommand{\email}[1] {
% Keywords and Indexing
%%%%%%%%%%%%%%%%%%%%%%%
% Enter keyword into keyword index
\newcommand{\keywordidx}[1] {\index[idxkey]{#1@\texttt{#1}}}
% Print keyword within paragraph
\newcommand{\keyword}[1] {\texttt{
% Print keyword and enter to keyword index
\newcommand{\keywordI}[1] {\texttt{#1}{\keywordidx{#1}}}
% Print material parameter and enter to the mat.par.index
\newcommand{\ipdkeywordI}[1] {\texttt{#1}{\index[idxipd]{#1@\texttt{#1}}}}
% Print bold keyword and enter to the keyword index
%\newcommand{\bold}[1] {{\bf \hyperpage{
\newcommand{\keywordIB}[1] {\texttt{#1}{\keywordidx{#1}}}
% Enter bold keyword to general index
\newcommand{\indexbold}[1] {\index{#1|bold}}
% Print keyword and add to a second keyword in the keyword index:
\newcommand{\keywordII}[2] {\texttt{#2}{\index[idxkey]{#1@\texttt{#2}}}}
% Environments for the model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\psin}[1] {\varphi_{\mathrm{
\newcommand{\IR}[1] {I^R_\mathrm{N_#1}(\psin{1},\psin{2})}
\newcommand{\rhs}[1] {\mathrm{rhs[N_
\newcommand{\Y}[2] {\mathrm{Y[N_#1][N_#2]}}
\newcommand{\mdlalphachar}{\mbox{\mdltt{[a-zA-Z]}}}
\newcommand{\mdlextendchar}{\mbox{\mdltt{[a-zA-Z0-9\_{\mdlbackslash}]}}}
\newcommand{\MdlBool}{\mdltt{Mdl\-Bool}}
\newcommand{\MdlString}{\mdltt{Mdl\-String}}
\newcommand{\MmuMdlKeyword}{\mdltt{Mmu\-Mdl\-Key\-word}}
\newcommand{\MmuMdlKeywordList}{\mdltt{MmuMdlKeywordList}}
\newcommand{\mdlAliasedModel}{\mdlkeyw{AliasedModel}}
\newcommand{\mdlEnd}{\mdlkeyw{End}}
\newcommand{\mdlinclude}{\mdlkeyw{\#include}}
\newcommand{\mdlInstance}{\mdlkeyw{Instance}}
\newcommand{\mdlinstantiate}{\mdlkeyw{instantiate}}
\newcommand{\mdlInterface}{\mdlkeyw{Interface}}
\newcommand{\mdlLinkMap}{\mdlkeyw{LinkMap}}
\newcommand{\<API key>}{\mdlkeyw{LoadObjectLibrary}}
\newcommand{\mdlLocal}{\mdlkeyw{Local}}
\newcommand{\mdlModel}{\mdlkeyw{Model}}
\newcommand{\mdlNewModel}{\mdlkeyw{New\-Model}}
\newcommand{\mdlParameter}{\mdlkeyw{Parameter}}
\newcommand{\mdlParameters}{\mdlkeyw{Parameters}}
\newcommand{\mdlAnyParameter}{\mdlkeyw{AnyParameter}}
\newcommand{\mdlSelect}{\mdlkeyw{Select}}
\newcommand{\mdlStatic}{\mdlkeyw{Static}}
\newcommand{\mdlbreak}{\mdlkeyw{break}}
\newcommand{\mdlcalc}{\mdlkeyw{calc}}
\newcommand{\mdlcall}{\mdlkeyw{call}}
\newcommand{\mdlconstruct}{\mdlkeyw{construct}}
\newcommand{\mdlcontinue}{\mdlkeyw{continue}}
\newcommand{\mdldestruct}{\mdlkeyw{destruct}}
\newcommand{\mdldo}{\mdlkeyw{do}}
\newcommand{\mdlelse}{\mdlkeyw{else}}
\newcommand{\mdlerrors}{\mdlkeyw{errors}}
\newcommand{\mdlevaluate}{\mdlkeyw{evaluate}}
\newcommand{\mdlfalse}{\mdlkeyw{false}}
\newcommand{\mdlfor}{\mdlkeyw{for}}
\newcommand{\mdlgenLibrary}{\mdlkeyw{genLibrary}}
\newcommand{\mdlif}{\mdlkeyw{if}}
\newcommand{\mdlinitialize}{\mdlkeyw{initialize}}
\newcommand{\mdllink}{\mdlkeyw{link}}
\newcommand{\mdllistModels}{\mdlkeyw{listModels}}
\newcommand{\mdlmdlLibraryName}{\mdlkeyw{mdlLibraryName}}
\newcommand{\mdlmethod}{\mdlkeyw{method}}
\newcommand{\mdlof}{\mdlkeyw{of}}
\newcommand{\mdlparser}{\mdlkeyw{parser}}
\newcommand{\mdlprivate}{\mdlkeyw{private}}
\newcommand{\mdlprotected}{\mdlkeyw{protected}}
\newcommand{\mdlquiet}{\mdlkeyw{quiet}}
\newcommand{\mdlreturn}{\mdlkeyw{return}}
\newcommand{\mdlscanner}{\mdlkeyw{scanner}}
\newcommand{\mdlset}{\mdlkeyw{set}}
\newcommand{\mdlto}{\mdlkeyw{to}}
\newcommand{\mdltrue}{\mdlkeyw{true}}
\newcommand{\mdlverbose}{\mdlkeyw{verbose}}
\newcommand{\mdlwhile}{\mdlkeyw{while}}
\newcommand{\mdlCompilerProject}{\mdlkeyw{CompilerProject}}
\newcommand{\mdlcompile}{\mdlkeyw{compile}}
\newcommand{\mdlInfo}{\mdlkeyw{Info}}
\newcommand{\mdlundef}{\mdlkeyw{undef}}
\newcommand{\<API key>}{\mdltt{MODEL\_CLASS\_DEF\-INIT\-ION\_EX\-TENS\-IONS}}
\newcommand{\<API key>}{\mdltt{Model\-Class\-Std\-Con\-struc\-tor}}
\newcommand{\<API key>}{\mdltt{Model\-Class\-Std\-De\-struc\-tor}}
\newcommand{\<API key>}{\mdltt{Model\-Class\-Std\-Dec\-larat\-ions}}
\newcommand{\<API key>}{\mdltt{MODEL\_\-CLASS\_\-INIT\_\-EXT\-ENSION}}
\newcommand{\MDLPREFIXSTRING}{\mdltt{MDL\-PRE\-FIX\-STRING}}
\newcommand{\Model}{\mdltt{Model}}
\newcommand{\Parameter}{\mdltt{Parameter}}
\newcommand{\Interface}{\mdltt{Interface}}
\newcommand{\mdlbackslash}{\ensuremath{\mathtt{\backslash}}}
\newcommand{\divop}{\mathop{\rm div}}
\newcommand{\gradop}{\mathop{\rm grad}}
\newcommand{\asinh}{\mathop{\rm asinh}}
\newcommand{\unix}{\progname{Unix}}
\newcommand{\windows}{\progname{Windows-NT}}
% Some derived tables
\newenvironment{fixedwidthtable} [2] {\begin{mmnttable} {|l|p{10cm}|} {#1} {#2}} {\end{mmnttable}}
\newenvironment{fixedwidthtablep} [3] {\begin{mmnttable} {|l|p{#3}|} {#1} {#2}} {\end{mmnttable}}
\newenvironment{fixedwidthtableL} [3] {\begin{mmnttableL} {|l|p{10cm}|} {#1} {#2}{#3}} {\end{mmnttableL}}
\newenvironment{fixedwidthTablep} [3] {\begin{mmntTable} {|l|p{#3}|} {#1} {#2}} {\end{mmntTable}}
\newenvironment{fixedwidthTableL} [3] {\begin{mmntTableL} {|l|p{10cm}|} {#1} {#2}{#3}} {\end{mmntTableL}}
\newenvironment{keydesctableII} [1] {\begin{mmnttable} {|l|p{10cm}|} {Keyword & Description} {#1}} {\end{mmnttable}}
\newenvironment{keydesctableIIL} [2] {\begin{mmnttableL} {|l|p{10cm}|} {Keyword & Description} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keydesctableIILp} [3] {\begin{mmnttableL} {|l|p{#3}|} {Keyword & Description} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keydesctableIII} [1] {\begin{mmnttable} {|l|l|l|} {Keyword & Type & Description} {#1}} {\end{mmnttable}}
\newenvironment{keydesctableIIIL} [2] {\begin{mmnttableL} {|l|l|l|} {Keyword & Type & Description} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keydesctableIIILp} [3] {\begin{mmnttableL} {|l|l|p{#3}|} {Keyword & Type & Description} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keydesctableIV} [1] {\begin{mmnttable} {|l|l|l|l|} {Keyword & Type & Description & Unit} {#1}} {\end{mmnttable}}
\newenvironment{keydesctableIVL} [2] {\begin{mmnttableL} {|l|l|l|l|} {Keyword & Type & Description & Unit} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keydescTableII} [1] {\begin{mmntTable} {|l|p{10cm}|} {Keyword & Description} {#1}} {\end{mmntTable}}
\newenvironment{keydescTableIIL} [2] {\begin{mmntTableL} {|l|p{10cm}|} {Keyword & Description} {#1}{#2}} {\end{mmntTableL}}
\newenvironment{keydescTableIII} [1] {\begin{mmntTable} {|l|l|l|} {Keyword & Type & Description} {#1}} {\end{mmntTable}}
\newenvironment{keydescTableIIIL} [2] {\begin{mmntTableL} {|l|l|l|} {Keyword & Type & Description} {#1}{#2}} {\end{mmntTableL}}
\newenvironment{keydescTableIIILp} [3] {\begin{mmntTableL} {|l|l|p{#3}|} {Keyword & Type & Description} {#1}{#2}} {\end{mmntTableL}}
\newenvironment{keydescTableIV} [1] {\begin{mmntTable} {|l|l|l|l|} {Keyword & Type & Description & Unit} {#1}} {\end{mmntTable}}
\newenvironment{keydescTableIVL} [2] {\begin{mmntTableL} {|l|l|l|l|} {Keyword & Type & Description & Unit} {#1}{#2}} {\end{mmntTableL}}
\newenvironment{keytypetableII} [1] {\begin{mmnttable} {|l|l|} {Keyword & Type} {#1}} {\end{mmnttable}}
\newenvironment{keytypetableIIL} [2] {\begin{mmnttableL} {|l|l|} {Keyword & Type} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{keyunittableI} [1] {\begin{mmnttable} {|l|l|l|} {Keyword & Type & Unit} {#1}} {\end{mmnttable}}
\newenvironment{parameterdescrtable} [1] {\begin{mmnttable} {|l|l|} {Parameter & Description} {#1}} {\end{mmnttable}}
\newenvironment{<API key>}[2] {\begin{mmnttableL} {|l|l|} {Parameter & Description} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{symbolkeytableII} [1] {\begin{mmnttable} {|l|l|} {Symbol & Keyword} {#1}} {\end{mmnttable}}
\newenvironment{symbolkeytableIIL} [2] {\begin{mmnttableL} {|l|l|} {Symbol & Keyword} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{symbolkeytableIII} [1] {\begin{mmnttable} {|l|l|l|} {Symbol & Keyword & Type} {#1}} {\end{mmnttable}}
\newenvironment{symbolkeyTableIII} [1] {\begin{mmntTable} {|l|l|l|} {Symbol & Keyword & Type} {#1}} {\end{mmntTable}}
\newenvironment{symbolkeytableIIIL} [2] {\begin{mmnttableL} {|l|l|l|} {Symbol & Keyword & Type} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{symbolkeytableIV} [1] {\begin{mmnttable} {|l|l|l|l|} {Symbol & Keyword & Type & Unit} {#1}} {\end{mmnttable}}
\newenvironment{symbolkeyTableIV} [1] {\begin{mmntTable} {|l|l|l|l|} {Symbol & Keyword & Type & Unit} {#1}} {\end{mmntTable}}
\newenvironment{symbolkeytableIVL} [2] {\begin{mmnttableL} {|l|l|l|l|} {Symbol & Keyword & Type & Unit} {#1}{#2}} {\end{mmnttableL}}
\newenvironment{symbolkeytableV} [1] {\begin{mmnttable} {|l|l|l|} {Symbol & Keyword & Type} {#1}} {\end{mmnttable}}
\newenvironment{valuekeytableIII} [1] {\begin{mmnttable} {|l|l|l|} {Keyword & Type & Values} {#1}} {\end{mmnttable}}
\newenvironment{valuekeytableIIIL} [2] {\begin{mmnttableL} {|l|l|l|} {Keyword & Type & Values} {#1}{#2}} {\end{mmnttableL}}
\newcommand{\gcc} {GCC}
% File name
\newcommand{\file}[1] {\stdin{
\newcommand{\fileI}[1] {\file{#1}\index{#1}}
\newcommand{\fileIB}[1] {{\file{#1}}{\index{#1|bold}}}
% Some frequently used program names
\newcommand{\progname}[1]{\textsc{
\newcommand{\alib}{\progname{Algorithm Library}}
\newcommand{\cgg}{\progname{Cgg}}
\newcommand{\cpp}{\progname{C++}}
\newcommand{\C}{\progname{c}}
\newcommand{\tcl} {\progname{Tcl}}
\newcommand{\perl} {\progname{Perl}}
\newcommand{\ANSI}{\progname{Ansi}}
\newcommand{\ansic}{\progname{Ansi~c}}
\newcommand{\ansicpp}{\progname{nsi~\cpp}}
\newcommand{\posix}{\progname{Posix}}
\newcommand{\STL}{\progname{Stl}}
\newcommand{\emacs}{\progname{Emacs}}
\newcommand{\geo}{\progname{Geo2ps}}
\newcommand{\geotops}{\progname{Geo2ps}}
\newcommand{\inp}{\progname{Inp}}
\newcommand{\make}{\progname{Make}}
\newcommand{\makedevice}{\progname{makedevice}}
\newcommand{\MDL}{\progname{Model Definition Language}}
\newcommand{\mdl}{\progname{Mdl}}
\newcommand{\mkdev}{\progname{Makedevice}}
\newcommand{\python}{\progname{Python}}
\newcommand{\xmgrace}{\progname{Xmgrace}}
\newcommand{\xcrv}{\progname{Xcrv}}
\newcommand{\minimos}{\progname{Minimos~6}}
\newcommand{\mmnt}{\progname{Minimos-NT}}
\newcommand{\mdlprog}{\mmnt}
\newcommand{\mmtont}{\progname{Mm62nt}}
\newcommand{\pbf}{\progname{Pbf}}
\newcommand{\pbfm}{\progname{Pbfm}}
\newcommand{\pif}{\progname{Pif}}
\newcommand{\pifcopy}{\progname{Pifcopy}}
\newcommand{\pifrm}{\progname{Pifrm}}
\newcommand{\pifmaid}{\progname{Pifmaid}}
\newcommand{\prost}{\progname{Prost2d}}
\newcommand{\punch}{\progname{Punch}}
\newcommand{\rul}{\progname{Rul}}
\newcommand{\Siesta}{\progname{Siesta}}
\newcommand{\sketch}{\progname{Sketch}}
\newcommand{\spice}{\progname{Spice}}
\newcommand{\splitseg}{\progname{Splitseg}}
\newcommand{\svg}{\progname{Svg}}
\newcommand{\svgtops}{\progname{Svg2ps}}
\newcommand{\tif}{\progname{Tif}}
\newcommand{\str}{\progname{Str}}
\newcommand{\devedit}{\progname{Devedit}}
\newcommand{\silvaco}{\progname{Silvaco}}
\newcommand{\iseToPif}{\progname{Ise2pif}}
\newcommand{\synopsys}{\progname{Synopsys}}
\newcommand{\tifwrap}{\progname{Tifwrap}}
\newcommand{\tiftopif}{\progname{Tif2pbf.sh}}
\newcommand{\tsuprem}{\progname{Tsuprem4}}
\newcommand{\athena}{\progname{Athena}}
\newcommand{\xpif}{\progname{Xpif2d}}
\newcommand{\xsvg}{\progname{Xsvg}}
\newcommand{\vmake}{\progname{Vmake}}
\newcommand{\eas}{\progname{Eas}}
\newcommand{\pai}{\progname{Pai}}
\newcommand{\PAI}{\progname{Pai}}
\newcommand{\vista}{\progname{Vista}}
\newcommand{\PBF}{\progname{Pbf}}
\newcommand{\PBL}{\progname{Pbl}}
\newcommand{\PLB}{\progname{Plb}}
\newcommand{\PAL}{\progname{Pal}}
\newcommand{\FORTRAN}{\progname{Fortran}}
\newcommand{\LISP}{\progname{Lisp}}
\newcommand{\PIL}{\progname{Pil}}
\newcommand{\PCL}{\progname{Pcl}}
\newcommand{\PFL}{\progname{Pfl}}
\newcommand{\UNFUG}{\progname{Unfug}}
\newcommand{\DIOS}{\progname{Dios}}
\newcommand{\bison}{\progname{Bison}}
\newcommand{\flex}{\progname{Flex}}
\newcommand{\ipl}{ViennaIPD}
\newcommand{\inputdeck} {ViennaIPD}
\newcommand{\Inputdeck} {ViennaIPD}
%\newcommand{\inputdeck} {input-deck} % word within a paragraph
%\newcommand{\Inputdeck} {Input-deck} % at the beginning of a paragraph
%\newcommand{\InputDeck} {Input-Deck} % in headings
\newcommand{\curve} {\sc{Curve}}
% simulation modes
\newcommand{\sm}{\sc{Single-Mode}}
\newcommand{\mm}{\sc{Mixed-Mode}}
\newcommand{\MM}{\sc{Mixed-Mode}}
\newcommand{\DC}{\sc{dc}}
\newcommand{\AC}{\sc{ac}}
\newcommand{\DD}{\sc{dd}}
\newcommand{\HD}{\sc{hd}}
% Name of a person (e.g. Maxwell)
\newcommand{\persname}[1]{\textsl{
\newcommand{\srh}{\persname{Shockley-Read-Hall}}
\newcommand{\key}[1]{\texttt{<
\newcommand{\menu}[1]{\textsf{
\newcommand{\window}[1]{\textsl{\textsf{
% Differential Operators: grad, div, rot, error function
\newcommand{\GRAD}{\mathrm{grad}}
\newcommand{\DIV}{\mathrm{div}}
\newcommand{\ROT}{\mathrm{rot}}
\newcommand{\erfc}{\mathrm{erfc}}
% Partial Derivative
\newcommand{\PD}[2]{\frac{\partial #1}{\partial #2}}
% Total Derivative
\newcommand{\TD}[2]{\frac{{\mathrm{d}} #1}{{\mathrm{d}} #2}}
% References to Equations, Tables, Figures, Sections
\newcommand{\Eq}[1]{(\ref{
\newcommand{\Fig}[1]{Fig.~\ref{
\newcommand{\Sec}[1]{Section~\ref{
\newcommand{\Chapter}[1]{Chapter~\ref{
\newcommand{\Appendix}[1]{Appendix~\ref{
\newcommand{\Table}[1]{Table~\ref{
% Vector
\newcommand{\vect}[1]{\mathbf{
% Bernoulli function
\newcommand{\bern}{\mathrm{B}}
% average D
\newcommand{\dav}{\overline{D}}
\newcommand{\ToKmO}{\left(\frac{\TL}{\mathrm{300\ K}} - 1\right)}
\newcommand{\ToK}{\left(\frac{\TL}{\mathrm{300\ K}}\right)}
\newcommand{\LToK}{\left(\frac{\TL}{\mathrm{77\ K}}\right)}
\newcommand{\LToKTH}{\left(\frac{\TL}{\mathrm{300\ K}}\right)}
\newcommand{\TK}{\left(\frac{T}{K}\right)}
\newcommand{\KoT}{\left(\frac{\mathrm{300\ K}}{\TL}\right)}
\newcommand{\KoLT}{\left(\frac{\mathrm{77\ K}}{\TL}\right)}
\newcommand{\dop}[2] {\ensuremath{#1\times 10^{#2} \, \textrm{cm}^{-3}}}
\newcommand{\dopOne}[1] {\ensuremath{10^{#1} \, \textrm{cm}^{-3}}}
\newcommand{\kL} {\ensuremath{\kappa_\mathrm{L}}}
\newcommand{\nrg} {\mathcal{E}}
\newcommand{\lth} {\lambda_\mathrm{TH}}
\newcommand{\hc} {h_\mathrm{corr}}
\newcommand{\Qi} {Q_\mathrm{i}}
\newcommand{\fB} {f_\mathrm{B}}
\newcommand{\kdiel} {\ensuremath{\kappa_\mathrm{diel}}}
\newcommand{\tdiel} {\ensuremath{t_\mathrm{diel}}}
\newcommand{\mdiel} {\ensuremath{m_\mathrm{diel}}}
\newcommand{\mOx} {\ensuremath{m_\mathrm{ox}}}
\newcommand{\meff} {\ensuremath{m_\mathrm{eff}}}
\newcommand{\kme} {\ensuremath{\kappa_\mathrm{metal}}}
\newcommand{\ksi} {\ensuremath{\kappa_\mathrm{si}}}
\newcommand{\epsr}[1]{\varepsilon_{\mathrm{r}}^{\mathrm{
\newcommand{\q}{\mathrm{q}}
\newcommand{\kB}{\mathrm{k_B}}
\newcommand{\Ed} {\nrg_\mathrm{d}}
\newcommand{\Ea} {\nrg_\mathrm{a}}
\newcommand{\ED} {\nrg_\mathrm{D}}
\newcommand{\EA} {\nrg_\mathrm{A}}
\newcommand{\Ec} {\nrg_\mathrm{C}}
\newcommand{\Eci}[1]{\nrg_\mathrm{C
\newcommand{\Ev} {\nrg_\mathrm{V}}
\newcommand{\Evi}[1]{\nrg_\mathrm{V
\newcommand{\ET} {\nrg_{\mathrm{T}}}
\newcommand{\rt} {r_{\mathrm{t}}}
\newcommand{\ft} {\ensuremath{f_{\mathrm{t}}}}
\newcommand{\Qt} {\ensuremath{Q_{\mathrm{t}}}}
\newcommand{\Ei} {\nrg_{\mathrm{i}}}
\newcommand{\Eref} {\ensuremath{\nrg_{\mathrm{ref}}}}
\newcommand{\Ethr} {\nrg_{\mathrm{thr}}}
\newcommand{\Eg} {\nrg_{\mathrm{g}}}
\newcommand{\Egz} {\nrg_{\mathrm{g,0}}}
\newcommand{\Eoff} {\nrg_{\mathrm{off}}}
\newcommand{\GnII}{G_{n}^{\mathrm{II}}}
\newcommand{\GpII}{G_{p}^{\mathrm{II}}}
\newcommand{\NA}{N_\mathrm{A}}
\newcommand{\ND}{N_\mathrm{D}}
\newcommand{\Nc}{N_\mathrm{C}}
\newcommand{\Nv}{N_\mathrm{V}}
\newcommand{\Ncv}{N_\mathrm{C,V}}
\newcommand{\Ncz}{N_\mathrm{C,0}}
\newcommand{\Nvz}{N_\mathrm{V,0}}
\newcommand{\Ni}{N_{\mathrm{i}}}
\newcommand{\NT}{N_{\mathrm{T}}}
\newcommand{\Ntot}{N_{\mathrm{tot}}}
\newcommand{\TC}{T_{\mathrm{C}}}
\newcommand{\RDIR}{R^{\mathrm{DIR}}}
\newcommand{\RAU}{R^{\mathrm{AU}}}
\newcommand{\RBB}{R^{\mathrm{BB}}}
\newcommand{\RII}{R^{\mathrm{II}}}
\newcommand{\RSRH}{R^{\mathrm{SRH}}}
\newcommand{\RT}{R_{\mathrm{T}}}
\newcommand{\TL}{T_\mathrm{L}}
\newcommand{\TLo}{T_{L,\mathrm{old}}}
\newcommand{\tauen}{\tau_{\epsilon,n}}
\newcommand{\tauep}{\tau_{\epsilon,p}}
\newcommand{\taue}[1]{\tau_{\epsilon,
\newcommand{\TCoK}{\left(\frac{T_n}{\mathrm{300\ K}}+C_0\right)}
\newcommand{\PhiB} {\ensuremath{\Phi_\mathrm{B}}}
\newcommand{\Phit} {\ensuremath{\Phi_\mathrm{t}}}
\newcommand{\deriv} {\ensuremath {\mathrm{d}}}
\newcommand{\Schro} {\persname{Schr{\"o}\-dinger}}
\newcommand{\Emin} {\ensuremath{\nrg_\mathrm{min}}}
\newcommand{\Emax} {\ensuremath{\nrg_\mathrm{max}}}
\newcommand{\Ef} {\ensuremath{\nrg_\mathrm{F}}}
\newcommand{\Efi} {\ensuremath{\nrg_{\mathrm{F},i}}}
\newcommand{\ef}[1] {\ensuremath{\nrg_\mathrm{F
\newcommand{\VEold}{\vect{E}_{\mathrm{old}}}
\newcommand{\VEoldi}[1]{\vect{E}_{\mathrm{old}
\newcommand{\VPold}{\vect{P}_{\mathrm{old}}}
\newcommand{\VPoldi}[1]{\vect{P}_{\mathrm{old}
\newcommand{\VP}[1]{\vect{P}_{
\newcommand{\Vg} {\ensuremath{V_\mathrm{G}}}
\newcommand{\Iin} {\ensuremath{I_\mathrm{in}}}
\newcommand{\Iout} {\ensuremath{I_\mathrm{out}}}
\newcommand{\Vin} {\ensuremath{V_\mathrm{in}}}
\newcommand{\Vout} {\ensuremath{V_\mathrm{out}}}
\newcommand{\Vox} {\ensuremath{V_\mathrm{ox}}}
\newcommand{\VDS} {\ensuremath{V_\mathrm{DS}}}
\newcommand{\Id} {\ensuremath{I_\mathrm{d}}}
\newcommand{\Vd} {\ensuremath{V_\mathrm{d}}}
\newcommand{\Is} {\ensuremath{I_\mathrm{s}}}
\newcommand{\te} {\ensuremath{\tau_\mathrm{e}}}
\newcommand{\tc} {\ensuremath{\tau_\mathrm{c}}}
\newcommand{\Nt} {\ensuremath{N_\mathrm{t}}}
\newcommand{\Et} {\ensuremath{\nrg_\mathrm{t}}}
\newcommand{\tox}{\ensuremath{t_\mathrm{ox}}}
\newcommand{\Di} {\ensuremath{D_\mathrm{i}}}
% install screen-shots
%% \newcommand{\leftpic}[3]{%
%% \parpic[l]{%
%% \psblurbox[linecolor=white,linewidth=0,framesep=-0.04,shadowsize=0.2cm,blurradius=0.1cm]{%
%% \includegraphics[width=#1]{#2}} } #3
%% \picskip{0}
%% \bigskip
%% }
%% \newcommand{\rightpic}[3]{%
%% \parpic[r]{%
%% \psblurbox[linecolor=white,linewidth=0,framesep=-0.04,shadowsize=0.2cm,blurradius=0.1cm]{%
%% \includegraphics[width=#1]{#2}} } #3
%% \picskip{0}
%% \bigskip
%% }
\newcommand{\leftpic}[3]{%
\begin{minipage}{0.48\linewidth}
\includegraphics[width=\linewidth]{
\end{minipage}
\hfill
\begin{minipage}{0.48\linewidth}
\end{minipage}
}
\newcommand{\rightpic}[3]{%
\begin{minipage}{0.48\linewidth}
\end{minipage}
\hfill
\begin{minipage}{0.48\linewidth}
\includegraphics[width=\linewidth]{
\end{minipage}
}
% makedevice
\newcommand{\SiO}{SiO$_2$}
\newcommand{\SiN}{Si$_3$N$_4$}
% abbreviations
\newcommand{\AIX} {\sc Aix}
\newcommand{\ASCII} {\sc Ascii}
\newcommand{\BICGSTAB} {\sc Bicg-stab}
\newcommand{\BJT} {\sc Bjt}
\newcommand{\case} {\sc Case}
\newcommand{\CNT} {\sc Cnt}
\newcommand{\cpu} {\sc Cpu}
\newcommand{\EEPROM} {\sc Eeprom}
\newcommand{\EKV} {\sc Ekv}
\newcommand{\FET} {\sc Fet}
\newcommand{\GMRES} {{\sc Gmres}(m)}
\newcommand{\HBT} {\sc Hbt}
\newcommand{\HEMT} {\sc Hemt}
\newcommand{\IBM} {\sc Ibm}
\newcommand{\ILU} {\sc Ilu}
\newcommand{\ILUFAC} {Incomplete-{\LU} factorization}
\newcommand{\IUE} {Institute for Microelectronics}
\newcommand{\LU} {\sc Lu}
\newcommand{\MOS} {\sc Mos}
\newcommand{\MOSFET} {\sc Mosfet}
\newcommand{\NMOS} {\sc Nmos}
\newcommand{\OSF} {\sc Osf}
\newcommand{\PMOS} {\sc Pmos}
\newcommand{\SOI} {{\sc Soi}}
\newcommand{\SOIFET} {\sc Soifet}
\newcommand{\TBB} {\sc Tbb}
\newcommand{\TUV} {Technical University Vienna}
\newcommand{\mydollar} {\$} %$
\newcommand{\mytilde} {{\ensuremath{{\sim}}}}
\newcommand{\MISSING}[1]{${}^*$\marginpar{${}^*$\textbf{Missing {
\newcommand{\NI}{${}^*$\marginpar{${}^*$\textbf{Not implemented!}}}
\newcommand{\BUG}{\marginpar{\includegraphics[width=1cm]{figures/bug.ps}}}
% Mobility functions
\newcommand{\mob}[1]{\mu^{\mathrm{
\newcommand{\con}[1]{C^{\mathrm{
\newcommand{\vs}{v^{\mathrm{sat}}}
\newcommand{\phis}[1]{\varphi_{\mathrm{s
\newcommand{\psis} {\varphi_{\mathrm{s}}}
\newcommand{\psim} {\varphi_{\mathrm{m}}}
\newcommand{\psibi}{\psi_{\mathrm{bi}}}
\newcommand{\psiwf}{\varphi_{\mathrm{wf}}}
\newcommand{\psiox}{\varphi_{\mathrm{ins}}}
\newcommand{\psiqfl}{\varphi_{\mathrm{qfl}}}
\newcommand{\Ewf}{\nrg_{\mathrm{w}}}
\newcommand{\eps}[1]{\varepsilon_{\mathrm{
\newcommand{\mL}{{\mathrm{L}}}
\newcommand{\qf} {quasi-\persname{Fermi}} % is not coupled to index entries
\newcommand{\BB} {\sc bb}
\newcommand{\BGN} {\sc Bgn}
\newcommand{\BNF} {\sc Bnf}
\newcommand{\CQFL} {\sc Cqfl}
\newcommand{\QTBM} {\sc Qtbm}
\newcommand{\WKB} {\sc Wkb}
\newcommand{\TFE} {\sc Tfe}
\newcommand{\TE} {\sc Te}
\newcommand{\SI} {\sc si}
\newcommand{\Nit} {\ensuremath{N_\mathrm{it}}}
\newcommand{\Nz} {\ensuremath{N_0}}
\newcommand{\kf} {\ensuremath{k_\mathrm{f}}}
\newcommand{\kfz} {\ensuremath{k_\mathrm{f,0}}}
\newcommand{\kr} {\ensuremath{k_\mathrm{r}}}
\newcommand{\NXz} {\ensuremath{N_{X,\mathrm{it}}}}
\newcommand{\ps} {\ensuremath{p_\mathrm{s}}}
\newcommand{\Eox} {\ensuremath{E_\mathrm{ox}}}
\newcommand{\pref} {\ensuremath{p_\mathrm{ref}}}
\newcommand{\Qit} {\ensuremath{Q_\mathrm{it}}}
\newcommand{\Qitsimple} {\ensuremath{Q_\mathrm{it}^\mathrm{simple}}}
\newcommand{\Dt} {\ensuremath{D_\mathrm{t}}}
\newcommand{\Qf} {\ensuremath{Q_\mathrm{f}}}
\newcommand{\EF} {E_{\mathrm{F}}}
\newcommand{\Vth} {V_\mathrm{th}}
\newcommand{\Cox} {\ensuremath{C_\mathrm{ox}}}
\newcommand{\NX} {\ensuremath{N_X}}
\newcommand{\DX} {\ensuremath{D_X}}
\newcommand{\DXz} {\ensuremath{D_{X,0}}}
\newcommand{\PhiX} {\ensuremath{\Phi_X}}
|
package eu.excitementproject.eop.util.runner;
import java.io.File;
import java.io.<API key>;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.<API key>;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.apache.uima.cas.impl.XmiCasSerializer;
import org.apache.uima.jcas.JCas;
import org.apache.uima.util.XMLSerializer;
import org.xml.sax.SAXException;
import eu.excitementproject.eop.common.configuration.CommonConfig;
import eu.excitementproject.eop.common.exception.<API key>;
import eu.excitementproject.eop.common.utilities.configuration.ImplCommonConfig;
import eu.excitementproject.eop.lap.LAPAccess;
import eu.excitementproject.eop.lap.LAPException;
import eu.excitementproject.eop.lap.PlatformCASProber;
@SuppressWarnings("unused")
public class LAPRunner {
private LAPAccess lap = null;
private String language;
// private String lapAnnotDir = "/tmp/";
private Logger logger;
/**
* LAPRunner constructor -- initializes a lap from the given name and language
*
* @param lapName -- name of the LAP (e.g. treetagger, opennlp, ... -- given as full class names or partial)
* @param language -- the language parameter for the LAP
*/
public LAPRunner(String lapName, String language) {
logger = Logger.getLogger("eu.excitementproject.eop.util.runner.LAPRunner");
this.language = language;
initializeLAP(getLAPClass(lapName));
}
/**
* LAPRunner constructor -- initializes a lap from information in an EDA configuration file
*
* @param configFile -- EDA configuration file
*/
public LAPRunner(File configFile) {
logger = Logger.getLogger("eu.excitementproject.eop.util.runner.LAPRunner");
language = ConfigFileUtils.getAttribute(configFile, "language");
Pattern biuteeP = Pattern.compile(".*biutee.*",Pattern.CASE_INSENSITIVE);
Matcher biuteeM = biuteeP.matcher(configFile.getName());
if (biuteeM.matches()) {
initializeLAP(getLAPClass(configFile), configFile);
} else {
initializeLAP(getLAPClass(configFile));
}
}
/**
* LAPRunner constructor -- initalizes a default LAP for the given language (OpenNLP)
*
* @param language
*/
public LAPRunner(String language) {
logger = Logger.getLogger("eu.excitementproject.eop.util.runner.LAPRunner");
this.language = language;
initializeLAP(getDefaultLAPClass());
logger.info("\t LAP initialized: " + lap.getClass());
}
/**
* Initializes the LAP based on the lap parameter (if given) and the language information in the configuration file
*
* @param option -- (parsed) command arguments
*/
public void initializeLAP(String lapClassName) {
logger.info("LAP initialized from class " + lapClassName);
try {
Class<?> lapClass = Class.forName(lapClassName);
Constructor<?> lapClassConstructor = lapClass.getConstructor();
lap = (LAPAccess) lapClassConstructor.newInstance();
} catch (<API key> | <API key> | SecurityException | <API key> | <API key> | <API key> | <API key> e) {
logger.error("Error initializing LAP : " + e.getClass());
e.printStackTrace();
}
}
/**
* Initializes the LAP based on the lap parameter (if given) and the language information in the configuration file
*
* @param option -- (parsed) command arguments
*/
public void initializeLAP(String lapClassName, File configFile) {
logger.info("LAP initialized from class " + lapClassName);
try {
// CommonConfig config = new ImplCommonConfig(configFile);
Class<?> lapClass = Class.forName(lapClassName);
Constructor<?> lapClassConstructor = lapClass.getConstructor(CommonConfig.class);
lap = (LAPAccess) lapClassConstructor.newInstance(new ImplCommonConfig(configFile));
// lap = (LAPAccess) lapClassConstructor.newInstance(config);
} catch (<API key> | <API key> | SecurityException | <API key> | <API key> | <API key> | <API key> | <API key> e) {
logger.error("Error initializing LAP : " + e.getClass());
e.printStackTrace();
}
}
/**
* Determine the class of the chosen LAP tool
*
* @param option -- command-line arguments
* @param language -- language option
* @return -- the name of the class for the chosen LAP
*/
private String getLAPClass(String lapName) {
String classStem = "eu.excitementproject.eop.lap";
String lapClass = null;
if (lapName.matches("eu.excitementproject.*")) {
lapClass = lapName;
} else {
if (lapName.matches("(?i).*textpro.*")) {
// there is TextPro only for Italian
lapClass = classStem + ".textpro.TextProTaggerIT";
} else {
if (lapName.matches("(?i).*opennlp.*")) {
lapClass = classStem + ".dkpro.OpenNLPTagger" + language;
} else {
if (lapName.matches("(?i).*treetagger.*")) {
lapClass = classStem + ".dkpro.TreeTagger" + language;
}
}
}
}
return lapClass;
}
/**
* Get the lap class from the configuration file
*
* @param configFile
* @return -- the activated LAP specified in the configuration file
*/
private String getLAPClass(File configFile) {
return ConfigFileUtils.getAttribute(configFile, "activatedLAP");
}
/**
* The class for the default LAP (OpenNLP)
* @return
*/
private String getDefaultLAPClass() {
return "eu.excitementproject.eop.lap.dkpro.OpenNLPTagger" + language;
}
/**
* When the input consists of a file (as opposed to a test/hypothesis pair)
* it is processed through the LAP
*
* @param inputFile -- input (RTE formatted) file
* @param outDir -- directory for writing the serialized CAS objects produced from the test/hypothesis pairs in the input data
*/
public void runLAPOnFile(String inputFile, String outDir) {
logger.info("Running lap on file: " + inputFile + " // writing output to directory " + outDir);
try {
File dir = new File(outDir);
if (! dir.exists() || !dir.isDirectory()) {
dir.mkdirs();
} else {
FileUtils.cleanDirectory(dir);
}
lap.<API key>(new File(inputFile), dir);
} catch (LAPException e) {
System.err.println("Error running the LAP");
e.printStackTrace();
System.exit(1);
} catch (IOException e) {
System.err.println("Could not clean up LAP output directory " + outDir);
e.printStackTrace();
System.exit(1);
}
}
/**
* Run the LAP on a given text/hypothesis pair
*
* @param text -- text portion of the entailment pair
* @param hypothesis -- hypothesis portion of the entailment pair
* @return -- a CAS object for the given text/hypothesis pair
*/
public JCas runLAP(String text, String hypothesis) {
JCas aJCas = null;
try {
aJCas = lap.<API key>(text, hypothesis);
PlatformCASProber.<API key>(aJCas, System.out);
// serializeCAS(aJCas);
} catch (LAPException e) {
logger.error("Error running the LAP");
e.printStackTrace();
}
return aJCas;
}
/*
// code copied from LAP_ImplBase.java, just for testing the LAP when processing one pair from the command line
private void serializeCAS(JCas aJCas) throws LAPException {
// serialize
String xmiName = "1.from_commandLine.xmi";
File xmiOutFile = new File("/tmp/", xmiName);
try {
FileOutputStream out = new FileOutputStream(xmiOutFile);
XmiCasSerializer ser = new XmiCasSerializer(aJCas.getTypeSystem());
XMLSerializer xmlSer = new XMLSerializer(out, false);
ser.serialize(aJCas.getCas(), xmlSer.getContentHandler());
out.close();
} catch (<API key> e) {
throw new LAPException("Unable to create/open the file" + xmiOutFile.toString(), e);
} catch (SAXException e) {
throw new LAPException("Failed to serialize the CAS into XML", e);
} catch (IOException e) {
throw new LAPException("Unable to access/close the file" + xmiOutFile.toString(), e);
}
logger.info("Pair written as " + xmiOutFile.toString() );
}
*/
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
|
(function(c){function f(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var d=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),i=c.extend;i(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"},attr:{},style:{fontWeight:"bold",fontSize:"12px",color:"#60606a"}};if(d.pie)d.pie.prototype.hasData=f;if(d.gauge)d.gauge.prototype.hasData=f;if(d.waterfall)d.waterfall.prototype.hasData=f;c.Series.prototype.hasData=
function(){return this.dataMax!==void 0&&this.dataMin!==void 0};e.showNoData=function(a){var b=this.options,a=a||b.lang.noData,b=b.noData;if(!this.noDataLabel)this.noDataLabel=this.renderer.label(a,0,0,null,null,null,null,null,"no-data").attr(b.attr).css(b.style).add(),this.noDataLabel.align(i(this.noDataLabel.getBBox(),b.position),!1,"plotBox")};e.hideNoData=function(){if(this.noDataLabel)this.noDataLabel=this.noDataLabel.destroy()};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&
!a[b].options.isInternal)return!0;return!1};e.callbacks.push(function(a){c.addEvent(a,"load",g);c.addEvent(a,"redraw",g)})})(Highcharts);
|
#include <common.h>
#include <malloc.h>
#include <mmc.h>
#include "mmc_private.h"
static struct list_head mmc_devices;
static int cur_dev_num = -1;
struct mmc *find_mmc_device(int dev_num)
{
struct mmc *m;
struct list_head *entry;
list_for_each(entry, &mmc_devices) {
m = list_entry(entry, struct mmc, link);
if (m->block_dev.devnum == dev_num)
return m;
}
#if !defined(CONFIG_SPL_BUILD) || defined(<API key>)
printf("MMC Device %d not found\n", dev_num);
#endif
return NULL;
}
int mmc_get_next_devnum(void)
{
return cur_dev_num++;
}
struct blk_desc *mmc_get_blk_desc(struct mmc *mmc)
{
return &mmc->block_dev;
}
int get_mmc_num(void)
{
return cur_dev_num;
}
void mmc_do_preinit(void)
{
struct mmc *m;
struct list_head *entry;
list_for_each(entry, &mmc_devices) {
m = list_entry(entry, struct mmc, link);
#ifdef <API key>
mmc_set_preinit(m, 1);
#endif
if (m->preinit)
mmc_start_init(m);
}
}
void mmc_list_init(void)
{
INIT_LIST_HEAD(&mmc_devices);
cur_dev_num = 0;
}
void mmc_list_add(struct mmc *mmc)
{
INIT_LIST_HEAD(&mmc->link);
list_add_tail(&mmc->link, &mmc_devices);
}
#if !defined(CONFIG_SPL_BUILD) || defined(<API key>)
void print_mmc_devices(char separator)
{
struct mmc *m;
struct list_head *entry;
char *mmc_type;
list_for_each(entry, &mmc_devices) {
m = list_entry(entry, struct mmc, link);
if (m->has_init)
mmc_type = IS_SD(m) ? "SD" : "eMMC";
else
mmc_type = NULL;
printf("%s: %d", m->cfg->name, m->block_dev.devnum);
if (mmc_type)
printf(" (%s)", mmc_type);
if (entry->next != &mmc_devices) {
printf("%c", separator);
if (separator != '\n')
puts(" ");
}
}
printf("\n");
}
#else
void print_mmc_devices(char separator) { }
#endif
struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
{
struct blk_desc *bdesc;
struct mmc *mmc;
/* quick validation */
if (cfg == NULL || cfg->f_min == 0 ||
cfg->f_max == 0 || cfg->b_max == 0)
return NULL;
#ifndef CONFIG_DM_MMC_OPS
if (cfg->ops == NULL || cfg->ops->send_cmd == NULL)
return NULL;
#endif
mmc = calloc(1, sizeof(*mmc));
if (mmc == NULL)
return NULL;
mmc->cfg = cfg;
mmc->priv = priv;
/* the following chunk was mmc_register() */
/* Setup dsr related values */
mmc->dsr_imp = 0;
mmc->dsr = 0xffffffff;
/* Setup the universal parts of the block interface just once */
bdesc = mmc_get_blk_desc(mmc);
bdesc->if_type = IF_TYPE_MMC;
bdesc->removable = 1;
bdesc->devnum = mmc_get_next_devnum();
bdesc->block_read = mmc_bread;
bdesc->block_write = mmc_bwrite;
bdesc->block_erase = mmc_berase;
/* setup initial part type */
bdesc->part_type = mmc->cfg->part_type;
mmc_list_add(mmc);
return mmc;
}
void mmc_destroy(struct mmc *mmc)
{
/* only freeing memory for now */
free(mmc);
}
static int mmc_select_hwpartp(struct blk_desc *desc, int hwpart)
{
struct mmc *mmc = find_mmc_device(desc->devnum);
int ret;
if (!mmc)
return -ENODEV;
if (mmc->block_dev.hwpart == hwpart)
return 0;
if (mmc->part_config == MMCPART_NOAVAILABLE)
return -EMEDIUMTYPE;
ret = mmc_switch_part(mmc, hwpart);
if (ret)
return ret;
return 0;
}
static int mmc_get_dev(int dev, struct blk_desc **descp)
{
struct mmc *mmc = find_mmc_device(dev);
int ret;
if (!mmc)
return -ENODEV;
ret = mmc_init(mmc);
if (ret)
return ret;
*descp = &mmc->block_dev;
return 0;
}
U_BOOT_LEGACY_BLK(mmc) = {
.if_typename = "mmc",
.if_type = IF_TYPE_MMC,
.max_devs = -1,
.get_dev = mmc_get_dev,
.select_hwpart = mmc_select_hwpartp,
};
|
package be.fedict.eid.applet.service.signer.facets;
import javax.xml.crypto.dsig.XMLSignature;
import com.sun.xml.bind.marshaller.<API key>;
/**
* JAXB RI namespace prefix mapper for XAdES.
*
* @author Frank Cornelis
*
*/
public class <API key> extends <API key> {
private String <API key>;
public <API key>() {
this("xades");
}
public <API key>(String <API key>) {
this.<API key> = <API key>;
}
public void <API key>(String <API key>) {
this.<API key> = <API key>;
}
@Override
public String getPreferredPrefix(String namespaceUri, String suggestion,
boolean requirePrefix) {
if (XMLSignature.XMLNS.equals(namespaceUri)) {
return "ds";
}
if (<API key>.XADES_NAMESPACE.equals(namespaceUri)) {
return this.<API key>;
}
if (<API key>.XADES141_NAMESPACE.equals(namespaceUri)) {
return "xadesv141";
}
return suggestion;
}
}
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<TITLE>
Uses of Class org.apache.poi.ss.formula.functions.Complex (POI API Documentation)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.poi.ss.formula.functions.Complex (POI API Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/poi/ss/formula/functions/Complex.html" title="class in org.apache.poi.ss.formula.functions"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/poi/ss/formula/functions//class-useComplex.html" target="_top"><B>FRAMES</B></A>
<A HREF="Complex.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.poi.ss.formula.functions.Complex</B></H2>
</CENTER>
No usage of org.apache.poi.ss.formula.functions.Complex
<P>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/poi/ss/formula/functions/Complex.html" title="class in org.apache.poi.ss.formula.functions"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/poi/ss/formula/functions//class-useComplex.html" target="_top"><B>FRAMES</B></A>
<A HREF="Complex.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
<i>Copyright 2017 The Apache Software Foundation or
its licensors, as applicable.</i>
</BODY>
</HTML>
|
.entry.cursor-handle,
.cursor-handle {
background-color: transparent;
background-image: none;
box-shadow: none;
border-style: none;
}
.entry.cursor-handle.top,
.cursor-handle.top {
-gtk-icon-source: -gtk-icontheme("<API key>");
}
.entry.cursor-handle.bottom,
.cursor-handle.bottom {
-gtk-icon-source: -gtk-icontheme("<API key>");
}
|
'use strict';
// Load modules
const Crypto = require('crypto');
const Boom = require('boom');
const Hoek = require('hoek');
const Cryptiles = require('cryptiles');
// Declare internals
const internals = {};
// Common defaults
exports.defaults = {
encryption: {
saltBits: 256,
algorithm: 'aes-256-cbc',
iterations: 1,
minPasswordlength: 32
},
integrity: {
saltBits: 256,
algorithm: 'sha256',
iterations: 1,
minPasswordlength: 32
},
ttl: 0, // Milliseconds, 0 means forever
timestampSkewSec: 60, // Seconds of permitted clock skew for incoming expirations
localtimeOffsetMsec: 0 // Local clock time offset express in a number of milliseconds (positive or negative)
};
// Algorithm configuration
exports.algorithms = {
'aes-128-ctr': { keyBits: 128, ivBits: 128 }, // Requires node 0.10.x
'aes-256-cbc': { keyBits: 256, ivBits: 128 },
'sha256': { keyBits: 256 }
};
// MAC normalization format version
exports.macFormatVersion = '2'; // Prevent comparison of mac values generated with different normalized string formats
exports.macPrefix = 'Fe26.' + exports.macFormatVersion;
// Generate a unique encryption key
/*
const options = {
saltBits: 256, // Ignored if salt is set
salt: '<API key>',
algorithm: 'aes-128-ctr',
iterations: 10000,
iv: '<API key>', // Optional
minPasswordlength: 32
};
*/
exports.generateKey = function (password, options, callback) {
const callbackTick = Hoek.nextTick(callback);
if (!password) {
return callbackTick(Boom.internal('Empty password'));
}
if (!options ||
typeof options !== 'object') {
return callbackTick(Boom.internal('Bad options'));
}
const algorithm = exports.algorithms[options.algorithm];
if (!algorithm) {
return callbackTick(Boom.internal('Unknown algorithm: ' + options.algorithm));
}
const generate = () => {
if (Buffer.isBuffer(password)) {
if (password.length < algorithm.keyBits / 8) {
return callbackTick(Boom.internal('Key buffer (password) too small'));
}
const result = {
key: password,
salt: ''
};
return generateIv(result);
}
if (password.length < options.minPasswordlength) {
return callbackTick(Boom.internal('Password string too short (min ' + options.minPasswordlength + ' characters required)'));
}
if (options.salt) {
return generateKey(options.salt);
}
if (options.saltBits) {
return generateSalt();
}
return callbackTick(Boom.internal('Missing salt or saltBits options'));
};
const generateSalt = () => {
const randomSalt = Cryptiles.randomBits(options.saltBits);
if (randomSalt instanceof Error) {
return callbackTick(randomSalt);
}
const salt = randomSalt.toString('hex');
return generateKey(salt);
};
const generateKey = (salt) => {
Crypto.pbkdf2(password, salt, options.iterations, algorithm.keyBits / 8, 'sha1', (err, derivedKey) => {
if (err) {
return callback(err);
}
const result = {
key: derivedKey,
salt
};
return generateIv(result);
});
};
const generateIv = (result) => {
if (algorithm.ivBits &&
!options.iv) {
const randomIv = Cryptiles.randomBits(algorithm.ivBits);
if (randomIv instanceof Error) {
return callbackTick(randomIv);
}
result.iv = randomIv;
return callbackTick(null, result);
}
if (options.iv) {
result.iv = options.iv;
}
return callbackTick(null, result);
};
generate();
};
// Encrypt data
// options: see exports.generateKey()
exports.encrypt = function (password, options, data, callback) {
exports.generateKey(password, options, (err, key) => {
if (err) {
return callback(err);
}
const cipher = Crypto.createCipheriv(options.algorithm, key.key, key.iv);
const enc = Buffer.concat([cipher.update(data, 'utf8'), cipher.final()]);
callback(null, enc, key);
});
};
// Decrypt data
// options: see exports.generateKey()
exports.decrypt = function (password, options, data, callback) {
exports.generateKey(password, options, (err, key) => {
if (err) {
return callback(err);
}
const decipher = Crypto.createDecipheriv(options.algorithm, key.key, key.iv);
let dec = decipher.update(data, null, 'utf8');
dec = dec + decipher.final('utf8');
callback(null, dec);
});
};
// HMAC using a password
// options: see exports.generateKey()
exports.hmacWithPassword = function (password, options, data, callback) {
exports.generateKey(password, options, (err, key) => {
if (err) {
return callback(err);
}
const hmac = Crypto.createHmac(options.algorithm, key.key).update(data);
const digest = hmac.digest('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
const result = {
digest,
salt: key.salt
};
return callback(null, result);
});
};
// Normalizes a password parameter into a { id, encryption, integrity } object
// password: string, buffer or object with { id, secret } or { id, encryption, integrity }
internals.normalizePassword = function (password) {
const obj = {};
if (password instanceof Object &&
!Buffer.isBuffer(password)) {
obj.id = password.id;
obj.encryption = password.secret || password.encryption;
obj.integrity = password.secret || password.integrity;
}
else {
obj.encryption = password;
obj.integrity = password;
}
return obj;
};
// Encrypt and HMAC an object
// password: string, buffer or object with { id, secret } or { id, encryption, integrity }
// options: see exports.defaults
exports.seal = function (object, password, options, callback) {
const now = Date.now() + (options.localtimeOffsetMsec || 0); // Measure now before any other processing
const callbackTick = Hoek.nextTick(callback);
// Serialize object
const objectString = internals.stringify(object);
if (objectString instanceof Error) {
return callbackTick(objectString);
}
// Obtain password
let passwordId = '';
password = internals.normalizePassword(password);
if (password.id) {
if (!/^\w+$/.test(password.id)) {
return callbackTick(Boom.internal('Invalid password id'));
}
passwordId = password.id;
}
// Encrypt object string
exports.encrypt(password.encryption, options.encryption, objectString, (err, encrypted, key) => {
if (err) {
return callback(err);
}
// Base64url the encrypted value
const encryptedB64 = Hoek.base64urlEncode(encrypted);
const iv = Hoek.base64urlEncode(key.iv);
const expiration = (options.ttl ? now + options.ttl : '');
const macBaseString = exports.macPrefix + '*' + passwordId + '*' + key.salt + '*' + iv + '*' + encryptedB64 + '*' + expiration;
// Mac the combined values
exports.hmacWithPassword(password.integrity, options.integrity, macBaseString, (err, mac) => {
if (err) {
return callback(err);
}
// Put it all together
// prefix*[password-id]*encryption-salt*encryption-iv*encrypted*[expiration]*hmac-salt*hmac
// Allowed URI query name/value characters: *-. \d \w
const sealed = macBaseString + '*' + mac.salt + '*' + mac.digest;
return callback(null, sealed);
});
});
};
// Decrypt and validate sealed string
// password: string, buffer or object with { id: secret } or { id: { encryption, integrity } }
// options: see exports.defaults
exports.unseal = function (sealed, password, options, callback) {
const now = Date.now() + (options.localtimeOffsetMsec || 0); // Measure now before any other processing
const callbackTick = Hoek.nextTick(callback);
// Break string into components
const parts = sealed.split('*');
if (parts.length !== 8) {
return callbackTick(Boom.internal('Incorrect number of sealed components'));
}
const macPrefix = parts[0];
const passwordId = parts[1];
const encryptionSalt = parts[2];
const encryptionIv = parts[3];
const encryptedB64 = parts[4];
const expiration = parts[5];
const hmacSalt = parts[6];
const hmac = parts[7];
const macBaseString = macPrefix + '*' + passwordId + '*' + encryptionSalt + '*' + encryptionIv + '*' + encryptedB64 + '*' + expiration;
// Check prefix
if (macPrefix !== exports.macPrefix) {
return callbackTick(Boom.internal('Wrong mac prefix'));
}
// Check expiration
if (expiration) {
if (!expiration.match(/^\d+$/)) {
return callbackTick(Boom.internal('Invalid expiration'));
}
const exp = parseInt(expiration, 10);
if (exp <= (now - (options.timestampSkewSec * 1000))) {
return callbackTick(Boom.internal('Expired seal'));
}
}
// Obtain password
if (password instanceof Object &&
!(Buffer.isBuffer(password))) {
password = password[passwordId || 'default'];
if (!password) {
return callbackTick(Boom.internal('Cannot find password: ' + passwordId));
}
}
password = internals.normalizePassword(password);
// Check hmac
const macOptions = Hoek.clone(options.integrity);
macOptions.salt = hmacSalt;
exports.hmacWithPassword(password.integrity, macOptions, macBaseString, (err, mac) => {
if (err) {
return callback(err);
}
if (!Cryptiles.fixedTimeComparison(mac.digest, hmac)) {
return callback(Boom.internal('Bad hmac value'));
}
// Decrypt
const encrypted = Hoek.base64urlDecode(encryptedB64, 'buffer');
if (encrypted instanceof Error) {
return callback(encrypted);
}
const decryptOptions = Hoek.clone(options.encryption);
decryptOptions.salt = encryptionSalt;
decryptOptions.iv = Hoek.base64urlDecode(encryptionIv, 'buffer');
if (decryptOptions.iv instanceof Error) {
return callback(decryptOptions.iv);
}
exports.decrypt(password.encryption, decryptOptions, encrypted, (ignoreErr, decrypted) => { // Cannot fail since all errors covered by hmacWithPassword()
// Parse JSON
let object = null;
try {
object = JSON.parse(decrypted);
}
catch (err) {
return callback(Boom.internal('Failed parsing sealed object JSON: ' + err.message));
}
return callback(null, object);
});
});
};
internals.stringify = function (object) {
try {
return JSON.stringify(object);
}
catch (err) {
return Boom.internal('Failed to stringify object: ' + err.message);
}
};
|
caption { border: 1px solid #b94a48 !important; }
table { border-collapse: separate !important; }
|
#include "u8g.h"
const u8g_fntpgm_uint8_t u8g_font_osr18[7816] U8G_FONT_SECTION("u8g_font_osr18") = {
0,68,33,235,248,18,4,197,10,125,32,255,250,25,249,19,
250,0,0,0,7,0,0,3,18,18,7,2,0,224,224,224,
224,224,224,64,64,64,64,64,64,64,64,0,224,224,224,6,
5,5,10,2,13,204,204,204,204,72,14,18,36,18,2,0,
4,32,4,32,4,32,4,32,4,32,255,252,8,64,8,64,
8,64,8,64,8,64,24,64,255,252,16,128,16,128,16,128,
16,128,16,128,11,22,44,15,2,254,9,0,9,0,31,128,
41,64,73,32,73,32,73,96,73,96,105,0,61,0,31,128,
15,192,9,192,9,96,233,32,233,32,201,32,201,64,105,64,
31,128,9,0,9,0,18,18,54,22,2,0,56,2,0,68,
4,0,198,8,0,198,8,0,198,16,0,198,32,0,198,32,
0,68,64,0,56,64,0,0,134,0,1,25,128,1,48,128,
2,48,192,4,48,192,4,48,192,8,48,192,8,24,128,16,
15,0,18,18,54,20,1,0,7,128,0,8,64,0,24,64,
0,24,64,0,24,192,0,28,128,0,15,0,0,6,31,192,
15,6,0,23,6,0,35,132,0,97,196,0,192,232,0,192,
240,0,192,112,0,224,120,128,96,220,128,63,15,0,2,5,
5,7,2,13,192,192,192,192,64,6,23,23,10,3,252,8,
16,48,32,64,64,192,128,128,128,128,128,128,128,128,192,64,
64,96,32,16,24,12,6,23,23,9,1,252,64,32,48,16,
24,8,8,12,4,4,4,4,4,4,12,8,8,8,16,16,
32,64,192,10,10,20,14,2,8,12,0,12,0,204,192,201,
192,43,0,28,0,123,128,201,192,12,0,12,0,22,22,66,
24,1,252,0,16,0,0,16,0,0,16,0,0,16,0,0,
16,0,0,16,0,0,16,0,0,16,0,0,16,0,0,16,
0,255,255,252,0,16,0,0,16,0,0,16,0,0,16,0,
0,16,0,0,16,0,0,16,0,0,16,0,0,16,0,0,
16,0,0,16,0,3,8,8,7,2,252,192,224,224,32,32,
64,64,128,7,1,1,11,2,6,254,3,3,3,7,2,0,
224,224,224,8,24,24,12,2,250,1,1,2,2,2,4,4,
4,12,8,8,24,16,16,16,32,32,32,64,64,64,128,128,
128,12,18,36,15,1,0,15,0,16,192,32,64,96,96,96,
32,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192,
48,96,32,96,96,32,64,16,192,15,0,9,18,36,15,3,
0,8,0,8,0,24,0,248,0,24,0,24,0,24,0,24,
0,24,0,24,0,24,0,24,0,24,0,24,0,24,0,24,
0,24,0,255,128,10,18,36,15,2,0,30,0,99,128,129,
192,128,192,128,192,224,192,240,192,32,192,1,128,3,0,6,
0,8,0,16,0,32,0,64,64,192,64,255,192,255,192,11,
18,36,15,2,0,63,0,97,128,192,192,224,192,240,192,0,
192,0,192,1,128,62,0,1,128,0,192,0,96,96,96,240,
96,240,96,192,192,65,128,63,0,12,18,36,15,2,0,1,
0,3,0,3,0,7,0,15,0,11,0,19,0,51,0,35,
0,67,0,195,0,131,0,255,224,3,0,3,0,3,0,3,
0,31,240,11,18,36,15,2,0,96,192,127,128,126,0,64,
0,64,0,64,0,95,0,97,128,64,192,64,224,0,96,0,
96,96,96,240,96,224,192,192,192,65,128,62,0,11,18,36,
15,2,0,15,0,24,128,48,64,96,192,96,192,64,0,192,
0,207,0,209,192,224,192,224,224,224,96,224,96,224,96,96,
224,96,192,49,128,15,0,10,18,36,15,3,0,255,192,255,
192,128,64,128,64,128,128,0,128,1,0,1,0,2,0,6,
0,6,0,12,0,12,0,30,0,30,0,30,0,30,0,14,
0,12,18,36,15,2,0,31,128,48,224,96,96,192,48,192,
48,224,48,240,32,124,64,63,128,55,224,96,240,192,112,192,
48,192,48,192,48,96,96,112,192,31,128,11,18,36,15,2,
0,30,0,49,128,96,192,224,192,192,64,192,96,192,96,192,
224,96,224,113,96,30,96,0,96,0,64,96,192,96,192,64,
128,65,0,62,0,3,12,12,7,2,0,224,224,224,0,0,
0,0,0,0,224,224,224,4,16,16,8,2,252,240,240,240,
0,0,0,0,0,96,240,240,16,16,32,32,64,20,21,63,
24,2,253,0,0,48,0,0,192,0,3,0,0,12,0,0,
48,0,0,224,0,3,128,0,14,0,0,24,0,0,96,0,
0,192,0,0,48,0,0,12,0,0,7,0,0,1,192,0,
0,112,0,0,24,0,0,6,0,0,1,128,0,0,96,0,
0,16,22,6,18,24,1,4,255,255,252,0,0,0,0,0,
0,0,0,0,0,0,0,255,255,252,20,21,63,24,2,253,
192,0,0,48,0,0,12,0,0,3,0,0,0,192,0,0,
112,0,0,28,0,0,7,0,0,1,128,0,0,96,0,0,
48,0,0,192,0,3,0,0,14,0,0,56,0,0,224,0,
1,128,0,6,0,0,24,0,0,96,0,0,128,0,0,9,
18,36,12,2,0,62,0,67,0,129,128,129,128,225,128,97,
128,3,0,6,0,12,0,16,0,48,0,34,0,34,0,28,
0,0,0,28,0,28,0,28,0,18,18,54,20,1,0,3,
248,0,12,6,0,16,109,0,33,156,128,67,12,128,70,8,
64,142,8,64,142,24,64,140,24,64,140,16,64,140,48,128,
140,48,128,140,241,0,71,30,0,96,0,0,32,0,0,24,
12,0,7,240,0,18,18,54,20,2,0,0,128,0,0,192,
0,1,192,0,1,192,0,1,224,0,3,224,0,2,96,0,
2,112,0,6,112,0,4,48,0,4,56,0,12,56,0,15,
248,0,24,28,0,16,12,0,16,12,0,48,14,0,254,63,
192,15,18,36,17,1,0,255,240,24,28,24,12,24,6,24,
6,24,6,24,12,24,24,31,224,24,24,24,12,24,6,24,
6,24,6,24,6,24,12,24,28,255,240,14,18,36,18,2,
0,7,132,24,108,32,60,96,28,96,12,192,12,192,4,192,
0,192,0,192,0,192,0,192,4,96,4,96,4,32,8,48,
24,24,48,7,192,17,18,54,20,1,0,255,240,0,24,12,
0,24,6,0,24,3,0,24,3,0,24,1,128,24,1,128,
24,1,128,24,1,128,24,1,128,24,1,128,24,1,128,24,
1,128,24,3,0,24,3,0,24,6,0,24,12,0,255,240,
0,15,18,36,18,1,0,255,254,24,6,24,2,24,2,24,
2,24,34,24,32,24,96,31,224,24,96,24,32,24,32,24,
34,24,2,24,2,24,6,24,14,255,254,15,18,36,17,1,
0,255,254,24,6,24,2,24,2,24,2,24,34,24,32,24,
96,31,224,24,96,24,32,24,32,24,32,24,0,24,0,24,
0,24,0,127,0,17,18,54,19,2,0,7,196,0,24,100,
0,48,28,0,96,28,0,96,12,0,96,4,0,192,4,0,
192,0,0,192,127,128,192,28,0,192,28,0,192,28,0,192,
28,0,96,28,0,96,28,0,48,52,0,24,100,0,7,132,
0,18,18,54,20,1,0,255,63,192,24,6,0,24,6,0,
24,6,0,24,6,0,24,6,0,24,6,0,24,6,0,31,
254,0,24,6,0,24,6,0,24,6,0,24,6,0,24,6,
0,24,6,0,24,6,0,24,6,0,255,63,192,8,18,18,
10,1,0,255,24,24,24,24,24,24,24,24,24,24,24,24,
24,24,24,24,255,12,18,36,14,1,0,7,240,1,128,1,
128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,
128,1,128,97,128,241,128,225,128,193,128,67,0,62,0,17,
18,54,19,1,0,255,63,128,24,14,0,24,8,0,24,16,
0,24,32,0,24,64,0,24,128,0,25,192,0,26,192,0,
28,224,0,24,96,0,24,112,0,24,56,0,24,56,0,24,
28,0,24,28,0,24,14,0,255,127,128,15,18,36,17,1,
0,255,0,24,0,24,0,24,0,24,0,24,0,24,0,24,
0,24,0,24,0,24,0,24,2,24,2,24,2,24,6,24,
6,24,14,255,254,20,18,54,22,1,0,252,3,240,28,3,
128,30,5,128,22,5,128,22,5,128,23,5,128,19,9,128,
19,9,128,19,137,128,19,145,128,17,145,128,17,209,128,17,
209,128,16,225,128,16,225,128,16,225,128,16,65,128,254,79,
240,18,18,54,19,1,0,252,15,192,28,2,0,30,2,0,
22,2,0,23,2,0,19,130,0,17,130,0,17,194,0,16,
226,0,16,226,0,16,114,0,16,50,0,16,58,0,16,30,
0,16,14,0,16,14,0,16,6,0,254,2,0,15,18,36,
18,2,0,7,192,24,48,48,24,32,8,96,12,96,12,192,
6,192,6,192,6,192,6,192,6,192,6,96,12,96,12,32,
8,48,24,24,48,7,192,15,18,36,17,1,0,255,240,24,
28,24,12,24,6,24,6,24,6,24,12,24,24,31,240,24,
0,24,0,24,0,24,0,24,0,24,0,24,0,24,0,255,
0,15,22,44,18,2,252,7,192,24,48,48,24,32,8,96,
12,96,12,192,6,192,6,192,6,192,6,192,6,192,6,96,
12,99,140,36,76,52,120,28,114,7,226,0,98,0,118,0,
60,0,24,17,18,54,19,1,0,255,240,0,24,24,0,24,
12,0,24,12,0,24,12,0,24,12,0,24,24,0,31,224,
0,24,48,0,24,56,0,24,24,0,24,24,0,24,24,0,
24,28,128,24,28,128,24,28,128,24,31,0,255,15,0,13,
18,36,16,2,0,30,32,97,160,192,96,192,96,192,32,192,
32,224,0,124,0,63,128,15,224,129,240,128,112,128,24,192,
24,192,24,224,16,152,32,135,192,15,18,36,18,2,0,255,
254,195,14,131,6,131,2,3,2,3,2,3,2,3,0,3,
0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,
0,31,240,19,18,54,21,1,0,255,15,224,24,1,0,24,
1,0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,
0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,
24,1,0,12,1,0,12,2,0,6,4,0,1,248,0,18,
18,54,20,1,0,255,31,192,28,3,0,28,2,0,12,2,
0,14,6,0,6,4,0,7,4,0,7,8,0,3,8,0,
3,136,0,3,144,0,1,144,0,1,208,0,0,224,0,0,
224,0,0,224,0,0,64,0,0,64,0,26,18,72,28,1,
0,255,63,159,192,28,14,3,0,12,6,2,0,12,14,2,
0,14,15,6,0,14,15,4,0,6,19,4,0,7,19,140,
0,7,19,136,0,3,49,136,0,3,161,216,0,3,161,208,
0,1,160,208,0,1,192,240,0,1,192,224,0,0,192,96,
0,0,128,96,0,0,128,64,0,18,18,54,20,1,0,127,
191,128,14,12,0,14,12,0,7,8,0,7,16,0,3,176,
0,1,160,0,1,192,0,0,192,0,0,224,0,1,96,0,
3,112,0,2,56,0,4,56,0,12,28,0,8,12,0,24,
14,0,254,63,192,17,18,54,19,1,0,255,31,128,28,6,
0,28,4,0,14,4,0,6,8,0,7,8,0,3,144,0,
3,160,0,1,224,0,0,192,0,0,192,0,0,192,0,0,
192,0,0,192,0,0,192,0,0,192,0,0,192,0,7,252,
0,14,18,36,17,2,0,127,252,112,56,96,48,64,112,64,
224,128,192,1,192,3,128,3,0,7,0,14,0,12,4,28,
4,56,4,48,12,112,28,224,56,255,248,5,23,23,10,3,
251,248,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,192,192,192,192,192,248,8,24,24,12,2,250,128,128,
128,64,64,64,32,32,32,16,16,16,16,8,8,8,4,4,
4,2,2,2,1,1,5,23,23,10,2,251,248,24,24,24,
24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
24,24,248,11,9,18,15,2,9,4,0,14,0,10,0,17,
0,49,128,32,128,64,64,64,96,128,32,14,1,2,14,0,
252,255,252,4,4,4,11,2,13,192,224,96,16,11,12,24,
13,1,0,30,0,99,0,65,128,97,128,33,128,15,128,113,
128,193,128,195,160,195,160,197,160,121,192,11,18,36,13,0,
0,240,0,48,0,48,0,48,0,48,0,48,0,51,128,52,
192,56,96,56,96,48,96,48,96,48,96,48,96,48,96,56,
96,40,192,39,128,9,12,24,11,1,0,30,0,33,0,96,
128,193,128,193,128,192,0,192,0,192,0,192,128,96,128,33,
0,30,0,12,18,36,14,1,0,7,192,0,192,0,192,0,
192,0,192,0,192,28,192,98,192,97,192,193,192,192,192,192,
192,192,192,192,192,192,192,97,192,97,192,30,240,9,12,24,
12,1,0,30,0,35,0,97,128,193,128,193,128,255,128,192,
0,192,0,192,128,96,128,33,0,30,0,9,18,36,9,1,
0,15,0,24,128,49,128,49,0,48,0,48,0,254,0,48,
0,48,0,48,0,48,0,48,0,48,0,48,0,48,0,48,
0,48,0,254,0,12,18,36,15,2,250,30,112,97,176,225,
240,192,192,192,192,192,192,225,128,97,128,30,0,224,0,255,
0,127,192,64,96,128,32,128,32,128,32,192,64,63,128,13,
18,36,15,1,0,240,0,48,0,48,0,48,0,48,0,48,
0,51,192,52,192,56,96,56,96,48,96,48,96,48,96,48,
96,48,96,48,96,48,96,253,248,6,18,18,8,1,0,112,
112,32,0,0,0,240,48,48,48,48,48,48,48,48,48,48,
252,7,24,24,8,255,250,6,6,0,0,0,0,62,6,6,
6,6,6,6,6,6,6,6,6,6,6,198,198,140,120,12,
18,36,14,1,0,240,0,48,0,48,0,48,0,48,0,48,
0,49,240,48,128,49,0,50,0,50,0,54,0,59,0,51,
0,49,128,49,192,48,224,253,240,6,18,18,8,1,0,240,
48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,
252,19,12,36,21,1,0,243,199,0,52,249,128,56,113,192,
56,97,192,48,97,192,48,97,192,48,97,192,48,97,192,48,
97,192,48,97,192,48,97,192,253,251,224,13,12,24,15,1,
0,243,192,52,192,56,96,56,96,48,96,48,96,48,96,48,
96,48,96,48,96,48,96,253,248,10,12,24,13,1,0,30,
0,33,128,97,128,192,192,192,192,192,192,192,192,192,192,192,
192,97,128,33,128,30,0,11,18,36,14,1,250,243,128,52,
192,56,96,56,96,48,96,48,96,48,96,48,96,48,96,56,
96,56,192,55,128,48,0,48,0,48,0,48,0,48,0,252,
0,12,18,36,13,1,250,28,64,98,64,97,192,192,192,192,
192,192,192,192,192,192,192,192,192,97,192,97,192,30,192,0,
192,0,192,0,192,0,192,0,192,3,240,9,12,24,11,1,
0,243,128,52,128,57,128,56,128,56,0,48,0,48,0,48,
0,48,0,48,0,48,0,252,0,9,12,24,11,1,0,125,
0,131,0,129,0,193,0,240,0,124,0,31,0,131,128,128,
128,192,128,224,128,159,0,8,17,17,10,1,0,16,16,16,
48,48,254,48,48,48,48,48,48,48,49,49,51,30,13,12,
24,14,0,0,241,224,48,96,48,96,48,96,48,96,48,96,
48,96,48,96,48,224,48,224,57,96,30,120,13,12,24,14,
1,0,252,248,48,96,48,64,24,64,24,128,12,128,12,128,
13,0,7,0,7,0,2,0,2,0,19,12,36,21,1,0,
253,251,224,48,96,128,48,96,128,24,113,0,24,177,0,12,
177,0,12,154,0,13,26,0,7,28,0,7,12,0,2,12,
0,2,8,0,12,12,24,14,1,0,249,224,48,128,57,0,
25,0,14,0,14,0,6,0,11,0,19,0,17,128,33,192,
243,240,13,18,36,14,0,250,252,248,56,32,24,32,24,64,
12,64,12,64,12,128,6,128,6,128,7,0,3,0,3,0,
2,0,2,0,34,0,98,0,100,0,56,0,9,12,24,12,
1,0,255,128,195,128,131,0,134,0,142,0,12,0,24,0,
56,0,48,128,96,128,96,128,255,128,6,23,23,12,3,251,
12,16,48,48,48,48,56,24,24,24,16,224,48,16,24,24,
56,48,48,48,48,16,12,1,24,24,7,3,250,128,128,128,
128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
128,128,128,128,128,6,23,23,11,3,251,192,32,48,48,48,
112,96,96,96,96,32,28,48,96,96,96,96,112,48,48,48,
32,192,15,5,10,17,1,4,32,4,254,2,143,194,129,254,
64,124,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,0,0,0,7,0,0,3,18,18,7,2,250,224,
224,224,0,64,64,64,64,64,64,64,64,224,224,224,224,224,
224,9,18,36,15,3,253,4,0,4,0,4,0,31,0,53,
0,100,128,229,128,197,128,196,0,196,0,196,0,228,128,100,
128,53,0,31,0,4,0,4,0,4,0,14,18,36,19,2,
0,0,248,1,132,3,4,2,12,6,0,6,0,6,0,62,
0,7,224,6,0,6,0,6,0,6,0,6,0,116,4,140,
4,139,248,112,240,11,11,22,15,2,2,159,32,113,192,64,
64,128,96,128,32,128,32,128,32,128,32,64,64,96,192,159,
32,15,18,36,15,0,0,252,126,56,24,24,16,28,16,12,
32,14,64,6,64,7,128,3,128,63,240,3,0,3,0,63,
240,3,0,3,0,3,0,3,0,31,224,1,23,23,7,3,
251,128,128,128,128,128,128,128,128,128,0,0,0,0,0,128,
128,128,128,128,128,128,128,128,10,23,46,17,3,251,30,0,
33,0,35,0,35,0,32,0,48,0,28,0,46,0,71,0,
131,128,129,192,192,192,224,64,112,64,56,128,29,0,6,0,
3,0,3,0,49,0,49,0,34,0,28,0,7,2,2,11,
2,15,198,198,19,18,54,21,1,0,3,248,0,12,6,0,
16,225,0,33,28,128,67,12,64,70,4,64,134,4,32,134,
0,32,134,0,32,134,0,32,134,0,32,134,8,32,67,8,
64,67,8,64,32,240,128,16,1,0,12,6,0,3,248,0,
7,8,8,11,2,10,240,200,24,104,136,154,100,252,6,10,
10,12,3,1,32,68,136,136,136,136,136,136,68,32,13,6,
12,15,1,3,255,248,0,8,0,8,0,8,0,8,0,8,
7,1,1,11,2,6,254,19,18,54,21,1,0,3,248,0,
12,6,0,31,225,0,35,24,128,67,24,64,67,24,64,131,
24,32,131,24,32,131,224,32,131,16,32,131,24,32,131,24,
32,67,26,64,67,26,64,47,142,128,16,1,0,12,6,0,
3,248,0,7,1,1,11,2,15,254,7,7,7,15,4,11,
56,68,130,130,130,68,56,22,18,54,24,1,255,0,16,0,
0,16,0,0,16,0,0,16,0,0,16,0,0,16,0,0,
16,0,255,255,252,0,16,0,0,16,0,0,16,0,0,16,
0,0,16,0,0,16,0,0,16,0,0,0,0,0,0,0,
255,255,252,7,10,10,11,2,8,124,134,134,230,6,8,16,
96,66,254,7,11,11,12,3,7,120,132,198,198,4,120,14,
70,198,134,120,4,4,4,11,5,13,48,48,96,128,14,19,
38,17,2,249,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,64,192,64,128,64,132,163,252,158,56,128,0,128,0,
192,0,192,0,192,0,224,0,64,0,11,22,44,14,2,252,
63,224,120,128,248,128,248,128,248,128,248,128,248,128,120,128,
8,128,8,128,8,128,8,128,8,128,8,128,8,128,8,128,
8,128,8,128,8,128,8,128,8,128,8,128,3,3,3,7,
2,7,224,224,224,5,5,5,11,3,251,64,48,24,24,240,
6,11,11,12,3,7,16,16,240,48,48,48,48,48,48,48,
252,6,9,9,10,2,9,112,136,132,132,132,132,72,48,252,
7,10,10,13,3,1,8,68,68,34,34,34,34,68,68,136,
18,18,54,23,3,0,16,4,0,240,12,0,48,8,0,48,
16,0,48,16,0,48,32,0,48,96,0,48,67,0,48,135,
0,48,139,0,253,11,0,3,19,0,2,19,0,6,35,0,
4,63,192,8,3,0,24,3,0,16,15,192,17,18,54,22,
3,0,16,4,0,240,8,0,48,8,0,48,16,0,48,16,
0,48,32,0,48,64,0,48,78,0,48,179,128,48,161,128,
253,49,128,3,17,128,2,3,0,4,6,0,4,8,0,8,
16,128,24,49,128,16,63,128,18,18,54,23,3,0,120,4,
0,134,12,0,198,8,0,4,16,0,120,16,0,12,32,0,
6,96,0,198,67,0,198,135,0,142,139,0,121,11,0,2,
19,0,2,19,0,4,35,0,12,63,192,8,3,0,16,3,
0,16,15,192,9,18,36,12,1,250,28,0,28,0,28,0,
0,0,28,0,34,0,34,0,6,0,4,0,24,0,48,0,
96,0,227,0,195,128,192,128,224,128,97,0,62,0,18,24,
72,20,2,0,6,0,0,6,0,0,3,0,0,0,128,0,
0,0,0,0,0,0,0,128,0,0,192,0,1,192,0,1,
192,0,1,224,0,3,224,0,2,96,0,2,112,0,6,112,
0,4,48,0,4,56,0,12,24,0,15,248,0,24,28,0,
16,12,0,16,14,0,48,14,0,254,63,192,18,24,72,20,
2,0,0,16,0,0,48,0,0,96,0,0,64,0,0,128,
0,0,0,0,0,128,0,0,192,0,1,192,0,1,192,0,
1,224,0,3,224,0,2,96,0,2,112,0,6,112,0,4,
48,0,4,56,0,12,56,0,15,248,0,24,28,0,16,12,
0,16,14,0,48,14,0,254,63,192,18,24,72,20,2,0,
0,128,0,0,192,0,1,96,0,2,48,0,4,8,0,0,
0,0,0,128,0,0,192,0,1,192,0,1,192,0,1,224,
0,3,224,0,2,96,0,2,112,0,6,112,0,4,48,0,
4,56,0,12,56,0,15,248,0,24,28,0,16,12,0,16,
12,0,48,14,0,254,63,192,18,23,69,20,2,0,3,144,
0,5,240,0,0,0,0,0,0,0,0,0,0,0,128,0,
0,128,0,1,192,0,1,192,0,1,224,0,3,224,0,2,
96,0,2,112,0,6,112,0,4,48,0,12,56,0,12,56,
0,15,248,0,24,28,0,16,28,0,16,12,0,48,14,0,
254,63,192,18,23,69,20,1,0,6,24,0,6,24,0,2,
16,0,0,0,0,0,0,0,0,192,0,0,192,0,0,192,
0,1,224,0,1,224,0,1,96,0,2,112,0,2,112,0,
2,48,0,4,56,0,4,24,0,12,24,0,15,252,0,8,
12,0,24,12,0,24,14,0,56,6,0,254,63,192,17,24,
72,20,2,0,1,192,0,2,32,0,2,32,0,2,32,0,
1,192,0,0,0,0,0,128,0,0,128,0,1,192,0,1,
192,0,1,192,0,2,224,0,2,96,0,2,96,0,4,112,
0,4,112,0,12,48,0,8,56,0,15,248,0,24,28,0,
16,28,0,16,12,0,48,14,0,254,127,128,24,18,54,26,
0,0,0,127,255,0,28,7,0,28,3,0,44,1,0,44,
1,0,76,17,0,76,16,0,140,48,0,143,240,1,12,48,
3,12,16,2,12,17,7,252,17,4,12,1,8,12,1,8,
12,3,24,12,7,254,63,255,14,24,48,18,2,250,7,132,
24,108,32,60,96,28,96,12,192,12,192,4,192,0,192,0,
192,0,192,0,192,4,96,4,96,4,96,8,48,24,24,48,
7,192,2,0,3,128,0,192,0,192,8,192,7,128,15,24,
48,18,1,0,4,0,6,0,3,0,1,128,0,0,0,0,
255,254,24,6,24,2,24,2,24,2,24,34,24,32,24,96,
31,224,24,96,24,32,24,32,24,34,24,2,24,2,24,6,
24,14,255,254,15,24,48,18,1,0,0,48,0,48,0,96,
0,192,0,0,0,0,255,254,24,14,24,6,24,2,24,2,
24,34,24,32,24,96,31,224,24,96,24,32,24,32,24,34,
24,2,24,2,24,6,24,14,255,254,15,24,48,18,1,0,
0,128,1,192,3,64,6,48,8,8,0,0,255,254,24,6,
24,2,24,2,24,2,24,34,24,32,24,96,31,224,24,96,
24,32,24,32,24,34,24,2,24,2,24,6,24,14,255,254,
15,23,46,18,1,0,6,48,6,48,4,16,0,0,0,0,
255,254,24,14,24,6,24,2,24,2,24,34,24,32,24,96,
31,224,24,96,24,32,24,32,24,34,24,2,24,2,24,6,
24,14,255,254,8,24,24,10,1,0,64,96,48,16,8,0,
255,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
24,255,8,24,24,10,1,0,3,3,6,8,0,0,255,24,
24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,255,
8,24,24,10,1,0,8,24,52,66,129,0,255,24,24,24,
24,24,24,24,24,24,24,24,24,24,24,24,24,255,8,23,
23,10,1,0,195,195,66,0,0,255,24,24,24,24,24,24,
24,24,24,24,24,24,24,24,24,24,255,17,18,54,19,1,
0,255,240,0,24,12,0,24,6,0,24,3,0,24,3,0,
24,1,128,24,1,128,24,1,128,127,1,128,24,1,128,24,
1,128,24,1,128,24,1,128,24,3,0,24,3,0,24,6,
0,24,12,0,255,240,0,18,24,72,19,1,0,3,200,0,
2,248,0,0,0,0,0,0,0,0,0,0,0,0,0,252,
15,192,28,2,0,30,2,0,22,2,0,23,2,0,19,130,
0,17,130,0,17,194,0,16,226,0,16,226,0,16,114,0,
16,50,0,16,58,0,16,30,0,16,14,0,16,14,0,16,
6,0,252,2,0,15,24,48,18,2,1,28,0,12,0,6,
0,2,0,1,0,0,0,7,192,24,48,48,24,32,8,96,
12,96,12,192,6,192,6,192,6,192,6,192,6,192,6,96,
12,96,12,32,8,48,24,24,48,7,192,15,24,48,18,2,
1,0,112,0,96,0,192,0,128,1,0,0,0,7,192,24,
48,48,24,32,8,96,12,96,12,192,6,192,6,192,6,192,
6,192,6,192,6,96,12,96,12,32,8,48,24,24,48,7,
192,15,24,48,18,2,0,1,0,3,128,6,192,12,96,16,
16,0,0,7,192,24,48,48,24,32,8,96,12,96,12,192,
6,192,6,192,6,192,6,192,6,192,6,96,12,96,12,32,
8,48,24,24,48,7,192,15,24,48,18,2,0,15,16,19,
224,0,0,0,0,0,0,0,0,7,192,24,48,48,24,32,
8,96,12,96,12,192,6,192,6,192,6,192,6,192,6,192,
6,96,12,96,12,32,8,48,24,24,48,7,192,15,24,48,
18,2,0,8,0,12,96,12,96,0,0,0,0,0,0,7,
192,24,48,48,24,32,8,96,12,96,12,192,6,192,6,192,
6,192,6,192,6,192,6,96,12,96,12,32,8,48,24,24,
48,7,192,16,16,32,24,4,255,0,1,64,3,32,6,16,
12,8,24,4,48,2,96,1,192,1,128,3,64,6,32,12,
16,24,8,48,4,96,2,192,1,15,18,36,18,2,0,7,
194,24,52,48,28,32,12,96,28,96,44,192,70,192,198,193,
134,195,6,198,6,196,6,232,12,112,12,96,8,112,24,88,
48,135,192,19,24,72,21,1,1,3,0,0,3,128,0,0,
128,0,0,64,0,0,0,0,0,0,0,255,15,224,24,1,
0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,
24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,24,
1,0,24,1,0,12,1,0,12,2,0,6,4,0,1,248,
0,19,24,72,21,1,1,0,28,0,0,24,0,0,48,0,
0,32,0,0,64,0,0,0,0,255,15,224,24,1,0,24,
1,0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,
0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,
24,1,0,12,1,0,12,2,0,6,4,0,1,248,0,19,
24,72,21,1,0,0,96,0,0,224,0,1,176,0,3,8,
0,0,4,0,0,0,0,255,15,224,24,1,0,24,1,0,
24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,24,
1,0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,
0,12,1,0,12,2,0,6,4,0,1,248,0,19,23,69,
21,1,1,3,24,0,3,24,0,0,0,0,0,0,0,0,
0,0,255,15,224,24,1,0,24,1,0,24,1,0,24,1,
0,24,1,0,24,1,0,24,1,0,24,1,0,24,1,0,
24,1,0,24,1,0,24,1,0,24,1,0,12,1,0,12,
2,0,6,4,0,1,248,0,17,24,72,19,1,0,0,24,
0,0,56,0,0,48,0,0,64,0,0,0,0,0,0,0,
255,31,128,28,6,0,28,4,0,14,4,0,6,8,0,7,
8,0,3,144,0,3,160,0,1,224,0,0,192,0,0,192,
0,0,192,0,0,192,0,0,192,0,0,192,0,0,192,0,
0,192,0,7,252,0,15,18,36,17,1,0,255,0,24,0,
24,0,31,224,24,24,24,12,24,6,24,6,24,6,24,14,
24,12,24,24,31,240,24,0,24,0,24,0,24,0,255,0,
12,18,36,14,1,0,7,128,24,224,24,96,48,96,48,192,
48,128,55,0,49,128,48,64,48,96,48,112,48,48,48,48,
48,48,54,48,54,112,52,96,243,192,11,18,36,13,1,0,
96,0,96,0,48,0,24,0,8,0,0,0,30,0,99,0,
65,128,97,128,33,128,15,128,113,128,193,128,195,160,195,160,
197,160,121,192,11,18,36,13,1,0,1,128,3,128,3,0,
4,0,8,0,0,0,62,0,65,0,65,128,97,128,33,128,
15,128,113,128,193,128,193,160,195,160,197,160,120,192,11,18,
36,13,1,0,8,0,12,0,28,0,50,0,65,0,0,0,
30,0,99,0,65,128,97,128,33,128,15,128,113,128,193,128,
195,160,195,160,197,160,121,192,11,17,34,13,1,0,56,128,
79,0,0,0,0,0,0,0,30,0,99,0,65,128,97,128,
33,128,15,128,113,128,193,128,195,160,195,160,197,160,121,192,
11,17,34,13,1,0,99,0,99,0,1,0,0,0,0,0,
60,0,67,0,67,0,99,0,3,0,15,0,115,0,195,0,
195,32,199,32,203,32,121,192,11,18,36,13,1,0,28,0,
34,0,34,0,34,0,28,0,0,0,60,0,67,0,67,0,
99,0,35,0,15,0,115,0,195,0,195,32,199,32,199,32,
121,192,16,12,24,18,1,0,30,120,99,198,65,134,97,131,
1,131,31,255,97,128,193,128,195,129,195,130,196,194,120,124,
9,18,36,11,1,250,30,0,33,0,96,128,193,128,193,128,
192,0,192,0,192,0,192,0,96,128,33,0,30,0,8,0,
12,0,2,0,3,0,3,0,30,0,9,18,36,12,1,0,
96,0,112,0,48,0,8,0,0,0,0,0,30,0,35,0,
97,128,193,128,193,128,255,128,192,0,192,0,192,128,96,128,
33,0,30,0,9,18,36,12,1,0,1,0,3,0,2,0,
4,0,8,0,0,0,30,0,35,0,97,128,193,128,193,128,
255,128,192,0,192,0,192,128,96,128,33,0,30,0,9,18,
36,12,1,0,8,0,12,0,28,0,18,0,33,0,0,0,
30,0,35,0,97,128,193,128,193,128,255,128,192,0,192,0,
192,128,96,128,33,0,30,0,9,17,34,12,1,0,51,0,
51,0,1,0,0,0,0,0,30,0,35,0,97,128,193,128,
193,128,255,128,192,0,192,0,192,128,96,128,33,0,30,0,
7,18,18,8,0,0,192,224,96,16,8,0,120,24,24,24,
24,24,24,24,24,24,24,126,6,18,18,7,1,0,4,12,
24,16,32,0,240,48,48,48,48,48,48,48,48,48,48,252,
8,17,17,8,0,0,24,56,36,195,0,120,24,24,24,24,
24,24,24,24,24,24,126,7,17,17,9,1,0,4,198,198,
0,0,120,24,24,24,24,24,24,24,24,24,24,124,10,18,
36,13,1,0,56,128,27,0,12,0,22,0,35,0,3,0,
31,128,33,128,97,192,192,192,192,192,192,192,192,192,192,192,
192,192,97,128,33,128,30,0,13,17,34,15,1,0,14,64,
19,192,0,0,0,0,0,0,243,192,52,192,56,96,56,96,
48,96,48,96,48,96,48,96,48,96,48,96,48,96,253,248,
10,18,36,13,1,0,96,0,48,0,16,0,8,0,4,0,
0,0,30,0,33,128,97,128,192,192,192,192,192,192,192,192,
192,192,192,192,97,128,33,128,30,0,10,18,36,13,1,0,
1,128,3,128,3,0,4,0,0,0,0,0,30,0,33,128,
97,128,192,192,192,192,192,192,192,192,192,192,192,192,97,128,
33,128,30,0,10,18,36,13,1,0,4,0,12,0,14,0,
18,0,33,0,0,0,30,0,33,128,97,128,192,192,192,192,
192,192,192,192,192,192,192,192,97,128,33,128,30,0,10,17,
34,13,1,0,60,128,47,0,0,0,0,0,0,0,30,0,
33,128,97,128,192,192,192,192,192,192,192,192,192,192,192,192,
97,128,33,128,30,0,10,17,34,13,1,0,49,128,49,128,
1,0,0,0,0,0,30,0,33,128,97,128,192,192,192,192,
192,192,192,192,192,192,192,192,97,128,33,128,30,0,22,16,
48,24,1,255,0,112,0,0,112,0,0,112,0,0,0,0,
0,0,0,0,0,0,0,0,0,255,255,252,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,112,
0,0,112,0,10,12,24,13,1,0,30,64,33,128,96,128,
193,192,194,192,196,192,200,192,208,192,208,192,97,128,97,128,
158,0,13,18,36,14,0,0,16,0,24,0,12,0,4,0,
2,0,0,0,241,224,48,96,48,96,48,96,48,96,48,96,
48,96,48,96,48,224,48,224,57,96,30,120,13,18,36,14,
0,0,0,192,0,192,1,128,2,0,0,0,0,0,241,224,
48,96,48,96,48,96,48,96,48,96,48,96,48,96,48,224,
48,224,57,96,30,120,13,18,36,14,0,0,2,0,6,0,
5,0,8,128,16,0,0,0,241,224,48,96,48,96,48,96,
48,96,48,96,48,96,48,96,48,224,48,224,57,96,30,120,
13,17,34,14,0,0,24,192,24,192,0,0,0,0,0,0,
240,224,48,96,48,96,48,96,48,96,48,96,48,96,48,96,
48,224,48,224,57,96,30,120,13,24,48,14,0,250,0,96,
0,224,0,192,1,0,0,0,0,0,252,248,56,32,24,32,
24,64,12,64,12,64,12,128,6,128,6,128,7,0,3,0,
3,0,3,0,2,0,34,0,98,0,100,0,56,0,11,24,
48,14,1,250,48,0,240,0,48,0,48,0,48,0,48,0,
49,192,54,224,52,96,56,96,56,96,48,96,48,192,48,192,
49,128,49,0,50,0,60,0,48,0,48,0,48,0,48,0,
48,0,96,0,13,23,46,14,0,250,8,64,12,96,12,96,
0,0,0,0,252,120,24,32,24,32,24,64,12,64,12,64,
14,128,6,128,6,128,7,0,3,0,3,0,2,0,2,0,
34,0,114,0,100,0,56,0};
|
// tion, are permitted provided that the following conditions are met:
// and/or other materials provided with the distribution.
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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
// APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
// DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef <API key>
#define <API key>
#include <stdexcept>
#include <log4cplus/config.hxx>
#if defined (<API key>)
# include <errno.h>
# include <pthread.h>
# include <semaphore.h>
# include <log4cplus/helpers/timehelper.h>
#elif defined (<API key>)
# undef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
namespace log4cplus { namespace thread {
namespace detail
{
LOG4CPLUS_EXPORT void <API key> (char const * const msg,
char const * const file, int line);
} // namespace detail
template <typename SP>
class SyncGuard
{
public:
SyncGuard (SP const &);
~SyncGuard ();
void lock ();
void unlock ();
void attach (SP const &);
void detach ();
private:
SP const * sp;
SyncGuard (SyncGuard const &);
SyncGuard & operator = (SyncGuard const &);
};
class ManualResetEvent;
class Mutex
{
public:
enum Type
{
DEFAULT,
RECURSIVE
};
explicit Mutex (Type = RECURSIVE);
~Mutex ();
void lock () const;
void unlock () const;
private:
#if defined (<API key>)
mutable pthread_mutex_t mtx;
friend class ManualResetEvent;
#elif defined (<API key>)
mutable CRITICAL_SECTION cs;
#endif
Mutex (Mutex const &);
Mutex & operator = (Mutex &);
};
typedef SyncGuard<Mutex> MutexGuard;
class Semaphore
{
public:
Semaphore (unsigned max, unsigned initial);
~Semaphore ();
void lock () const;
void unlock () const;
private:
#if defined (<API key>)
mutable sem_t sem;
#elif defined (<API key>)
HANDLE sem;
#endif
Semaphore (Semaphore const &);
Semaphore & operator = (Semaphore const &);
};
typedef SyncGuard<Semaphore> SemaphoreGuard;
class ManualResetEvent
{
public:
ManualResetEvent (bool = false);
~ManualResetEvent ();
void signal () const;
void wait () const;
bool timed_wait (unsigned long msec) const;
void reset () const;
private:
#if defined (<API key>)
mutable pthread_cond_t cv;
mutable Mutex mtx;
mutable volatile unsigned sigcount;
mutable volatile bool signaled;
#elif defined (<API key>)
HANDLE ev;
#endif
ManualResetEvent (ManualResetEvent const &);
ManualResetEvent & operator = (ManualResetEvent const &);
};
} } // namespace log4cplus { namespace thread {
// Include the appropriate implementations of the classes declared
// above.
#if defined (<API key>)
# include <log4cplus/helpers/syncprims-pthreads.h>
#elif defined (<API key>)
# include <log4cplus/helpers/syncprims-win32.h>
#endif
namespace log4cplus { namespace thread {
template <typename SP>
inline
SyncGuard<SP>::SyncGuard (SP const & m)
: sp (&m)
{
sp->lock ();
}
template <typename SP>
inline
SyncGuard<SP>::~SyncGuard ()
{
if (sp)
sp->unlock ();
}
template <typename SP>
inline
void
SyncGuard<SP>::lock ()
{
sp->lock ();
}
template <typename SP>
inline
void
SyncGuard<SP>::unlock ()
{
sp->unlock ();
}
template <typename SP>
inline
void
SyncGuard<SP>::attach (SP const & m)
{
sp = &m;
}
template <typename SP>
inline
void
SyncGuard<SP>::detach ()
{
sp = 0;
}
} } // namespace log4cplus { namespace thread {
#endif // <API key>
|
#ifndef <API key>
#define <API key>
#include <boost/network/tags.hpp>
namespace boost { namespace network { namespace http { namespace tags {
struct http { typedef mpl::true_::type is_http; };
struct keepalive { typedef mpl::true_::type is_keepalive; };
struct simple { typedef mpl::true_::type is_simple; };
struct server { typedef mpl::true_::type is_server; };
struct client { typedef mpl::true_::type is_client; };
using namespace boost::network::tags;
template <class Tag>
struct components;
typedef mpl::vector<http, client, simple, sync, tcp, default_string> <API key>;
typedef mpl::vector<http, client, simple, sync, udp, default_string> <API key>;
typedef mpl::vector<http, client, keepalive, sync, tcp, default_string> <API key>;
typedef mpl::vector<http, client, keepalive, sync, udp, default_string> <API key>;
typedef mpl::vector<http, client, simple, async, udp, default_string> <API key>;
typedef mpl::vector<http, client, simple, async, tcp, default_string> <API key>;
typedef mpl::vector<http, simple, sync, pod, default_string, server> http_server_tags;
typedef mpl::vector<http, simple, async, pod, default_string, server> <API key>;
<API key>(<API key>);
<API key>(<API key>);
<API key>(<API key>);
<API key>(<API key>);
<API key>(<API key>);
<API key>(<API key>);
<API key>(http_server);
<API key>(http_async_server);
} /* tags */
} /* http */
} /* network */
} /* boost */
#endif /* <API key> */
|
package org.transdroid.daemon;
import java.util.HashMap;
import java.util.Map;
import org.transdroid.daemon.util.FileSizeConverter;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Represents a single file contained in a torrent.
*
* @author erickok
*
*/
public final class TorrentFile implements Parcelable, Comparable<TorrentFile> {
private final String key;
private final String name;
private final String relativePath;
private final String fullPath;
private final long totalSize;
private final long downloaded;
private Priority priority;
public TorrentFile(String key, String name, String relativePath, String fullPath, long size, long done, Priority priority) {
this.key = key;
this.name = name;
this.relativePath = relativePath;
this.fullPath = fullPath;
this.totalSize = size;
this.downloaded = done;
this.priority = priority;
}
private TorrentFile(Parcel in) {
this.key = in.readString();
this.name = in.readString();
this.relativePath = in.readString();
this.fullPath = in.readString();
this.totalSize = in.readLong();
this.downloaded = in.readLong();
this.priority = Priority.getPriority(in.readInt());
}
public String getKey() {
return this.key;
}
public String getName() {
return this.name;
}
public String getRelativePath() {
return this.relativePath;
}
public String getFullPath() {
return this.fullPath;
}
public long getTotalSize() {
return this.totalSize;
}
public long getDownloaded() {
return this.downloaded;
}
public Priority getPriority() {
return priority;
}
public float getPartDone() {
return (float)downloaded / (float)totalSize;
}
/**
* Returns a text showing the percentage that is already downloaded of this file
* @return A string indicating the progress, e.g. '85%'
*/
public String getProgressText() {
return String.format("%.1f", getPartDone() * 100) + "%";
}
/**
* Returns a text showing the downloaded and total sizes of this file
* @return A string with the sizes, e.g. '125.3 of 251.2 MB'
*/
public String <API key>() {
return FileSizeConverter.getSize(getDownloaded()) + " / " + FileSizeConverter.getSize(getTotalSize());
}
/**
* Returns if the download for this file is complete
* @return True if the downloaded size equals the total size, i.e. if it is completed
*/
public boolean isComplete() {
return getDownloaded() == getTotalSize();
}
/**
* Returns the full path of this file as it should be located on the remote server
* @return The full path, as String
*/
public String getFullPathUri() {
return "file://" + getFullPath();
}
/**
* Try to infer the mime type of this file
* @return The mime type of this file, or null if it could not be inferred
*/
public String getMimeType() {
// TODO: Test if this still works
if (getFullPath() != null && getFullPath().contains(".")) {
final String ext = getFullPath().substring(getFullPath().lastIndexOf('.') + 1);
if (mimeTypes.containsKey(ext)) {
// One of the known extensions: return logical mime type
return mimeTypes.get(ext);
}
}
// Unknown/none/unregistered extension: return null
return null;
}
@Override
public String toString() {
return name;
}
@Override
public int compareTo(TorrentFile another) {
// Compare file objects on their name (used for sorting only!)
return name.compareTo(another.getName());
}
private static final Map<String, String> mimeTypes = fillMimeTypes();
private static Map<String, String> fillMimeTypes() {
// We use a selection of the most popular/obvious ones
HashMap<String, String> types = new HashMap<String, String>();
// Application
types.put("m4a", "application/x-extension-m4a");
types.put("flac", "application/x-flac");
types.put("mkv", "application/x-matroska");
types.put("ogg", "application/x-ogg");
// Audio
types.put("m3u", "audio/mpegurl");
types.put("mp3", "audio/mpeg");
types.put("mpa", "audio/mpeg");
types.put("mpc", "audio/x-musepack");
types.put("wav", "audio/x-wav");
types.put("wma", "audio/x-ms-wma");
// Video
types.put("3gp", "video/3gpp");
types.put("avi", "video/x-avi");
types.put("flv", "video/x-flv");
types.put("mov", "video/quicktime");
types.put("mp4", "video/mp4");
types.put("mpg", "video/mpeg");
types.put("mpeg", "video/mpeg");
types.put("vob", "video/mpeg");
types.put("wmv", "video/x-ms-wmv");
return types;
}
public static final Parcelable.Creator<TorrentFile> CREATOR = new Parcelable.Creator<TorrentFile>() {
public TorrentFile createFromParcel(Parcel in) {
return new TorrentFile(in);
}
public TorrentFile[] newArray(int size) {
return new TorrentFile[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(key);
dest.writeString(name);
dest.writeString(relativePath);
dest.writeString(fullPath);
dest.writeLong(downloaded);
dest.writeLong(totalSize);
dest.writeInt(priority.getCode());
}
}
|
#ifndef <API key>
#define <API key>
#ifdef _WIN32
#include <mozilla/Char16.h>
#endif
#include<string>
#ifdef __APPLE__
#include <stdint.h>
#endif
#ifdef _WIN32
#include <stdlib.h>
#endif
#include "nsStringAPI.h"
#include "nsEmbedString.h"
const char *nsStringToCString(const nsAString &str);
std::string nsStringToString(const nsEmbedString &str);
const char *nsStringToUTF8(const nsAString &str);
#endif
|
package cpw.mods.fml.common.event;
import java.io.File;
import java.security.CodeSource;
import java.security.cert.Certificate;
import java.util.Properties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.LoaderState.ModState;
import cpw.mods.fml.common.FMLModContainer;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.discovery.ASMDataTable;
public class <API key> extends FMLStateEvent
{
private ModMetadata modMetadata;
private File sourceFile;
private File configurationDir;
private File suggestedConfigFile;
private ASMDataTable asmData;
private ModContainer modContainer;
public <API key>(Object... data)
{
super(data);
this.asmData = (ASMDataTable)data[0];
this.configurationDir = (File)data[1];
}
@Override
public ModState getModState()
{
return ModState.PREINITIALIZED;
}
@Override
public void applyModContainer(ModContainer activeContainer)
{
this.modContainer = activeContainer;
this.modMetadata = activeContainer.getMetadata();
this.sourceFile = activeContainer.getSource();
this.suggestedConfigFile = new File(configurationDir, activeContainer.getModId()+".cfg");
}
public File getSourceFile()
{
return sourceFile;
}
public ModMetadata getModMetadata()
{
return modMetadata;
}
public File <API key>()
{
return configurationDir;
}
public File <API key>()
{
return suggestedConfigFile;
}
public ASMDataTable getAsmData()
{
return asmData;
}
public Properties <API key>()
{
if (this.modContainer instanceof FMLModContainer)
{
return ((FMLModContainer)this.modContainer).<API key>();
}
return null;
}
/**
* Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging!
* Configurations can be applied through the <code>config/logging.properties</code> file, specifying logging levels
* for your ModID. Use this!
*
* @return A logger
*/
public Logger getModLog()
{
Logger log = LogManager.getLogger(modContainer.getModId());
return log;
}
/**
* Retrieve the FML signing certificates, if any. Validate these against the
* published FML certificates in your mod, if you wish.
*
* Deprecated because mods should <b>NOT</b> trust this code. Rather
* they should copy this, or something like this, into their own mods.
*
* @return Certificates used to sign FML and Forge
*/
@Deprecated
public Certificate[] <API key>()
{
CodeSource codeSource = getClass().getClassLoader().getParent().getClass().getProtectionDomain().getCodeSource();
Certificate[] certs = codeSource.getCertificates();
if (certs == null)
{
return new Certificate[0];
}
else
{
return certs;
}
}
}
|
#include <math.h>
#include <float.h>
#include <stdio.h>
#include <math-tests.h>
static int errors = 0;
static void
check (const char *testname, int result)
{
if (!result) {
printf ("Failure: %s\n", testname);
errors++;
}
}
#define TEST_FUNC(NAME, FLOAT, SUFFIX, EPSILON, HUGEVAL) \
static void \
NAME (void) \
{ \
/* Variables are declared volatile to forbid some compiler \
optimizations. */ \
volatile FLOAT Inf_var, qNaN_var, zero_var, one_var; \
/* A sNaN is only guaranteed to be representable in variables with */ \
/* static (or thread-local) storage duration. */ \
static volatile FLOAT sNaN_var = __builtin_nans ## SUFFIX (""); \
static volatile FLOAT minus_sNaN_var = -__builtin_nans ## SUFFIX (""); \
FLOAT x1, x2; \
\
zero_var = 0.0; \
one_var = 1.0; \
qNaN_var = __builtin_nan ## SUFFIX (""); \
Inf_var = one_var / zero_var; \
\
(void) &zero_var; \
(void) &one_var; \
(void) &qNaN_var; \
(void) &sNaN_var; \
(void) &minus_sNaN_var; \
(void) &Inf_var; \
\
\
check (#FLOAT " isinf (inf) == 1", isinf (Inf_var) == 1); \
check (#FLOAT " isinf (-inf) == -1", isinf (-Inf_var) == -1); \
check (#FLOAT " !isinf (1)", !(isinf (one_var))); \
check (#FLOAT " !isinf (qNaN)", !(isinf (qNaN_var))); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " !isinf (sNaN)", !(isinf (sNaN_var))); \
\
check (#FLOAT " isnan (qNaN)", isnan (qNaN_var)); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " isnan (sNaN)", isnan (sNaN_var)); \
check (#FLOAT " isnan (-qNaN)", isnan (-qNaN_var)); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " isnan (-sNaN)", isnan (minus_sNaN_var)); \
check (#FLOAT " !isnan (1)", !(isnan (one_var))); \
check (#FLOAT " !isnan (inf)", !(isnan (Inf_var))); \
\
check (#FLOAT " !issignaling (qNaN)", !(issignaling (qNaN_var))); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " issignaling (sNaN)", issignaling (sNaN_var)); \
check (#FLOAT " !issignaling (-qNaN)", !(issignaling (-qNaN_var))); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " issignaling (-sNaN)", issignaling (minus_sNaN_var)); \
check (#FLOAT " !issignaling (1)", !(issignaling (one_var))); \
check (#FLOAT " !issignaling (inf)", !(issignaling (Inf_var))); \
\
check (#FLOAT " inf == inf", Inf_var == Inf_var); \
check (#FLOAT " -inf == -inf", -Inf_var == -Inf_var); \
check (#FLOAT " inf != -inf", Inf_var != -Inf_var); \
check (#FLOAT " qNaN != qNaN", qNaN_var != qNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " sNaN != sNaN", sNaN_var != sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " qNaN != sNaN", qNaN_var != sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " -sNaN != -sNaN", minus_sNaN_var != minus_sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " sNaN != -sNaN", sNaN_var != minus_sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " qNaN != -sNaN", qNaN_var != minus_sNaN_var); \
\
/* \
the same tests but this time with NAN from <bits/nan.h> \
NAN is a double const \
*/ \
check (#FLOAT " isnan (NAN)", isnan (NAN)); \
check (#FLOAT " isnan (-NAN)", isnan (-NAN)); \
check (#FLOAT " !isinf (NAN)", !(isinf (NAN))); \
check (#FLOAT " !isinf (-NAN)", !(isinf (-NAN))); \
check (#FLOAT " NAN != NAN", NAN != NAN); \
check (#FLOAT " NAN != qNaN", NAN != qNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " NAN != sNaN", NAN != sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " NAN != -sNaN", NAN != minus_sNaN_var); \
\
/* \
And again with the value returned by the `nan' function. \
*/ \
check (#FLOAT " isnan (nan (\"\"))", isnan (nan ## SUFFIX (""))); \
check (#FLOAT " isnan (-nan (\"\"))", isnan (-nan ## SUFFIX (""))); \
check (#FLOAT " !isinf (nan (\"\"))", !(isinf (nan ## SUFFIX ("")))); \
check (#FLOAT " !isinf (-nan (\"\"))", !(isinf (-nan ## SUFFIX ("")))); \
check (#FLOAT " nan (\"\") != nan (\"\")", \
nan ## SUFFIX ("") != nan ## SUFFIX ("")); \
check (#FLOAT " nan (\"\") != qNaN", nan ## SUFFIX ("") != qNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " nan (\"\") != sNaN", nan ## SUFFIX ("") != sNaN_var); \
if (SNAN_TESTS (FLOAT)) \
check (#FLOAT " nan (\"\") != -sNaN", \
nan ## SUFFIX ("") != minus_sNaN_var); \
\
/* test if EPSILON is ok */ \
x1 = 1.0; \
x2 = x1 + EPSILON; \
check (#FLOAT " 1 != 1+EPSILON", x1 != x2); \
\
x1 = 1.0; \
x2 = x1 - EPSILON; \
check (#FLOAT " 1 != 1-EPSILON", x1 != x2); \
\
/* test if HUGE_VALx is ok */ \
x1 = HUGEVAL; \
check (#FLOAT " isinf (HUGE_VALx) == +1", isinf (x1) == +1); \
x1 = - HUGEVAL; \
check (#FLOAT " isinf (-HUGE_VALx) == -1", isinf (x1) == -1); \
}
#define TEST_CONVERT(NAME, FLOAT, DOUBLE, SUFFIX) \
void \
NAME (void) \
{ \
volatile DOUBLE Inf_var, qNaN_var, zero_var, one_var; \
/* A sNaN is only guaranteed to be representable in variables with */ \
/* static (or thread-local) storage duration. */ \
static volatile DOUBLE sNaN_var = __builtin_nans ## SUFFIX (""); \
FLOAT x1, x2; \
\
zero_var = 0.0; \
one_var = 1.0; \
qNaN_var = __builtin_nan ## SUFFIX (""); \
Inf_var = one_var / zero_var; \
\
(void) &qNaN_var; \
(void) &sNaN_var; \
(void) &Inf_var; \
\
x1 = (FLOAT) qNaN_var; \
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") qNaN, isnan", isnan (x1)); \
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") qNaN, !issignaling", \
!issignaling (x1)); \
if (SNAN_TESTS (FLOAT)) \
{ \
x1 = (FLOAT) sNaN_var; \
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") sNaN, isnan", isnan (x1)); \
if (<API key>) \
{ \
/* Upon type conversion, a sNaN is converted into a qNaN plus an */ \
/* INVALID exception (not checked here). */ \
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") sNaN, !issignaling", \
!issignaling (x1)); \
} \
} \
x2 = (FLOAT) Inf_var; \
check (" "#FLOAT" x = ("#FLOAT") ("#DOUBLE") Inf", isinf (x2) != 0); \
}
TEST_FUNC (float_test, float, f, FLT_EPSILON, HUGE_VALF)
TEST_FUNC (double_test, double, , DBL_EPSILON, HUGE_VAL)
TEST_CONVERT (convert_dfsf_test, float, double, )
TEST_CONVERT (convert_sfdf_test, double, float, f)
#ifndef NO_LONG_DOUBLE
TEST_FUNC (ldouble_test, long double, l, LDBL_EPSILON, HUGE_VALL)
TEST_CONVERT (convert_tfsf_test, float, long double, l)
TEST_CONVERT (convert_sftf_test, long double, float, f)
TEST_CONVERT (convert_tfdf_test, double, long double, l)
TEST_CONVERT (convert_dftf_test, long double, double, )
#endif
int
do_test (void)
{
float_test ();
double_test ();
convert_dfsf_test();
convert_sfdf_test();
#ifndef NO_LONG_DOUBLE
ldouble_test ();
convert_tfsf_test();
convert_sftf_test();
convert_tfdf_test();
convert_dftf_test();
#endif
return errors != 0;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<TITLE>
XSSFAnchor (POI API Documentation)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="XSSFAnchor (POI API Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XSSFAnchor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/poi/xssf/usermodel/<API key>.html" title="enum in org.apache.poi.xssf.usermodel"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/poi/xssf/usermodel/XSSFAutoFilter.html" title="class in org.apache.poi.xssf.usermodel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/poi/xssf/usermodel/XSSFAnchor.html" target="_top"><B>FRAMES</B></A>
<A HREF="XSSFAnchor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
org.apache.poi.xssf.usermodel</FONT>
<BR>
Class XSSFAnchor</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.poi.xssf.usermodel.XSSFAnchor</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html" title="interface in org.apache.poi.ss.usermodel">ChildAnchor</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/poi/xssf/usermodel/XSSFChildAnchor.html" title="class in org.apache.poi.xssf.usermodel">XSSFChildAnchor</A>, <A HREF="../../../../../org/apache/poi/xssf/usermodel/XSSFClientAnchor.html" title="class in org.apache.poi.xssf.usermodel">XSSFClientAnchor</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>XSSFAnchor</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html" title="interface in org.apache.poi.ss.usermodel">ChildAnchor</A></DL>
</PRE>
<P>
An anchor is what specifics the position of a shape within a client object
or within another containing shape.
<P>
<P>
<HR>
<P>
<A NAME="constructor_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/poi/xssf/usermodel/XSSFAnchor.html#XSSFAnchor()">XSSFAnchor</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="method_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="<API key>.lang.Object"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<A NAME="<API key>.apache.poi.ss.usermodel.ChildAnchor"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from interface org.apache.poi.ss.usermodel.<A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html" title="interface in org.apache.poi.ss.usermodel">ChildAnchor</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#getDx1()">getDx1</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#getDx2()">getDx2</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#getDy1()">getDy1</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#getDy2()">getDy2</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#setDx1(int)">setDx1</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#setDx2(int)">setDx2</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#setDy1(int)">setDy1</A>, <A HREF="../../../../../org/apache/poi/ss/usermodel/ChildAnchor.html#setDy2(int)">setDy2</A></CODE></TD>
</TR>
</TABLE>
<P>
<A NAME="constructor_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="XSSFAnchor()"></A><H3>
XSSFAnchor</H3>
<PRE>
public <B>XSSFAnchor</B>()</PRE>
<DL>
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XSSFAnchor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/poi/xssf/usermodel/<API key>.html" title="enum in org.apache.poi.xssf.usermodel"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/poi/xssf/usermodel/XSSFAutoFilter.html" title="class in org.apache.poi.xssf.usermodel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/poi/xssf/usermodel/XSSFAnchor.html" target="_top"><B>FRAMES</B></A>
<A HREF="XSSFAnchor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
<i>Copyright 2017 The Apache Software Foundation or
its licensors, as applicable.</i>
</BODY>
</HTML>
|
#ifndef COLORFRAME_H_
#define COLORFRAME_H_
#include <QFrame>
#include <QColorDialog>
/*
*A simple widget that displays a color and allows the
* user to choose a new one with a QColorDialog
*/
class Colorframe : public QFrame
{
Q_OBJECT
public:
Colorframe(QWidget * parent, Qt::WindowFlags flags = 0) : QFrame(parent, flags){}
virtual void mousePressEvent ( QMouseEvent *)
{
QPalette palette = Colorframe::palette();
QColor temp = palette.color(QPalette::Normal, QPalette::Window);
temp = QColorDialog::getColor(temp);
if (temp.isValid()){
setColor(temp);
update();
}
}
QColor getColor(){return Colorframe::palette().color(QPalette::Normal, QPalette::Window);}
public slots:
void setColor(QColor c)
{
QPalette palette = Colorframe::palette();
palette.setColor(QPalette::Normal, QPalette::Window, c);
palette.setColor(QPalette::Disabled, QPalette::Window, c);
palette.setColor(QPalette::Inactive, QPalette::Window, c);
setPalette(palette);
update();
emit colorChanged(c);
}
signals:
void colorChanged(QColor c);
};
#endif /*COLORFRAME_H_*/
|
// Please update this list when adding new pins to Marlin.
// The order doesn't matter.
// Following this pattern is a must.
// If the new pin name is over 28 characters long then pinsDebug.h will need to be modified.
#if TARGET_LPC1768
#define ANALOG_OK(PN) (WITHIN(PN, P0_02, P0_03) || WITHIN(PN, P0_23, P0_26) || WITHIN(PN, P1_30, P1_31))
#else
#define ANALOG_OK(PN) WITHIN(PN, 0, NUM_ANALOG_INPUTS - 1)
#endif
#line 35 // set __LINE__ to a known value for both passes
// Analog Pin Assignments
#define _EXISTS(PN,V...) (defined(PN##V) && PN##V >= 0)
#if _EXISTS(EXT_AUX_A0)
#if ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif
#endif
#if _EXISTS(EXT_AUX_A1)
#if ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif
#endif
#if _EXISTS(EXT_AUX_A2)
#if ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif
#endif
#if _EXISTS(EXT_AUX_A3)
#if ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif
#endif
#if _EXISTS(EXT_AUX_A4)
#if ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif
#endif
#if PIN_EXISTS(FILWIDTH)
#if ANALOG_OK(FILWIDTH_PIN)
REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN)
#endif
#endif
#if PIN_EXISTS(<API key>)
#if ANALOG_OK(<API key>)
REPORT_NAME_ANALOG(__LINE__, <API key>)
#endif
#endif
#if PIN_EXISTS(<API key>)
#if ANALOG_OK(<API key>)
REPORT_NAME_ANALOG(__LINE__, <API key>)
#endif
#endif
#if PIN_EXISTS(<API key>)
#if ANALOG_OK(<API key>)
REPORT_NAME_ANALOG(__LINE__, <API key>)
#endif
#endif
#if !defined(ARDUINO_ARCH_SAM) && !defined(ARDUINO_ARCH_SAMD) // TC1 & TC2 are macros in the SAM/SAMD tool chain
#if _EXISTS(TC1)
#if ANALOG_OK(TC1)
REPORT_NAME_ANALOG(__LINE__, TC1)
#endif
#endif
#if _EXISTS(TC2)
#if ANALOG_OK(TC1)
REPORT_NAME_ANALOG(__LINE__, TC1)
#endif
#endif
#endif
#if PIN_EXISTS(TEMP_0)
#if ANALOG_OK(TEMP_0_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_1)
#if ANALOG_OK(TEMP_1_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_2)
#if ANALOG_OK(TEMP_2_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_3)
#if ANALOG_OK(TEMP_3_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_4)
#if ANALOG_OK(TEMP_4_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_5)
#if ANALOG_OK(TEMP_5_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_5_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_6)
#if ANALOG_OK(TEMP_6_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_6_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_7)
#if ANALOG_OK(TEMP_7_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_7_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_BED)
#if ANALOG_OK(TEMP_BED_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_BOARD)
#if ANALOG_OK(TEMP_BOARD_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_BOARD_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_CHAMBER)
#if ANALOG_OK(TEMP_CHAMBER_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_COOLER)
#if ANALOG_OK(TEMP_COOLER_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_COOLER_PIN)
#endif
#endif
#if PIN_EXISTS(TEMP_PROBE)
#if ANALOG_OK(TEMP_PROBE_PIN)
REPORT_NAME_ANALOG(__LINE__, TEMP_PROBE_PIN)
#endif
#endif
#if PIN_EXISTS(ADC_KEYPAD)
#if ANALOG_OK(ADC_KEYPAD_PIN)
REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN)
#endif
#endif
// Digital Pin Assignments
#if _EXISTS(__FD)
REPORT_NAME_DIGITAL(__LINE__, __FD)
#endif
#if _EXISTS(__FS)
REPORT_NAME_DIGITAL(__LINE__, __FS)
#endif
#if _EXISTS(__GD)
REPORT_NAME_DIGITAL(__LINE__, __GD)
#endif
#if _EXISTS(__GS)
REPORT_NAME_DIGITAL(__LINE__, __GS)
#endif
#if PIN_EXISTS(AVR_MISO)
REPORT_NAME_DIGITAL(__LINE__, AVR_MISO_PIN)
#endif
#if PIN_EXISTS(AVR_MOSI)
REPORT_NAME_DIGITAL(__LINE__, AVR_MOSI_PIN)
#endif
#if PIN_EXISTS(AVR_SCK)
REPORT_NAME_DIGITAL(__LINE__, AVR_SCK_PIN)
#endif
#if PIN_EXISTS(ALARM)
REPORT_NAME_DIGITAL(__LINE__, ALARM_PIN)
#endif
#if PIN_EXISTS(AVR_SS)
REPORT_NAME_DIGITAL(__LINE__, AVR_SS_PIN)
#endif
#if PIN_EXISTS(BEEPER)
REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN)
#endif
#if _EXISTS(BTN_BACK)
REPORT_NAME_DIGITAL(__LINE__, BTN_BACK)
#endif
#if _EXISTS(BTN_CENTER)
REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER)
#endif
#if _EXISTS(BTN_DOWN)
REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN)
#endif
#if _EXISTS(BTN_DWN)
REPORT_NAME_DIGITAL(__LINE__, BTN_DWN)
#endif
#if _EXISTS(BTN_EN1)
REPORT_NAME_DIGITAL(__LINE__, BTN_EN1)
#endif
#if _EXISTS(BTN_EN2)
REPORT_NAME_DIGITAL(__LINE__, BTN_EN2)
#endif
#if _EXISTS(BTN_ENC_EN)
REPORT_NAME_DIGITAL(__LINE__, BTN_ENC_EN)
#endif
#if _EXISTS(BTN_ENC)
REPORT_NAME_DIGITAL(__LINE__, BTN_ENC)
#endif
#if _EXISTS(BTN_HOME)
REPORT_NAME_DIGITAL(__LINE__, BTN_HOME)
#endif
#if _EXISTS(BTN_LEFT)
REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT)
#endif
#if _EXISTS(BTN_LFT)
REPORT_NAME_DIGITAL(__LINE__, BTN_LFT)
#endif
#if _EXISTS(BTN_RIGHT)
REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT)
#endif
#if _EXISTS(BTN_RT)
REPORT_NAME_DIGITAL(__LINE__, BTN_RT)
#endif
#if _EXISTS(BTN_UP)
REPORT_NAME_DIGITAL(__LINE__, BTN_UP)
#endif
#if PIN_EXISTS(JOY_X)
REPORT_NAME_DIGITAL(__LINE__, JOY_X_PIN)
#endif
#if PIN_EXISTS(JOY_Y)
REPORT_NAME_DIGITAL(__LINE__, JOY_Y_PIN)
#endif
#if PIN_EXISTS(JOY_Z)
REPORT_NAME_DIGITAL(__LINE__, JOY_Z_PIN)
#endif
#if PIN_EXISTS(JOY_EN)
REPORT_NAME_DIGITAL(__LINE__, JOY_EN_PIN)
#endif
#if PIN_EXISTS(BUTTON1)
REPORT_NAME_DIGITAL(__LINE__, BUTTON1_PIN)
#endif
#if PIN_EXISTS(BUTTON2)
REPORT_NAME_DIGITAL(__LINE__, BUTTON2_PIN)
#endif
#if PIN_EXISTS(BUTTON3)
REPORT_NAME_DIGITAL(__LINE__, BUTTON3_PIN)
#endif
#if PIN_EXISTS(BUTTON4)
REPORT_NAME_DIGITAL(__LINE__, BUTTON4_PIN)
#endif
#if PIN_EXISTS(BUTTON5)
REPORT_NAME_DIGITAL(__LINE__, BUTTON5_PIN)
#endif
#if PIN_EXISTS(BUTTON6)
REPORT_NAME_DIGITAL(__LINE__, BUTTON6_PIN)
#endif
#if PIN_EXISTS(BUTTON7)
REPORT_NAME_DIGITAL(__LINE__, BUTTON7_PIN)
#endif
#if PIN_EXISTS(BUTTON8)
REPORT_NAME_DIGITAL(__LINE__, BUTTON8_PIN)
#endif
#if PIN_EXISTS(BUTTON9)
REPORT_NAME_DIGITAL(__LINE__, BUTTON9_PIN)
#endif
#if PIN_EXISTS(BUTTON10)
REPORT_NAME_DIGITAL(__LINE__, BUTTON10_PIN)
#endif
#if PIN_EXISTS(BUTTON11)
REPORT_NAME_DIGITAL(__LINE__, BUTTON11_PIN)
#endif
#if PIN_EXISTS(BUTTON12)
REPORT_NAME_DIGITAL(__LINE__, BUTTON12_PIN)
#endif
#if PIN_EXISTS(BUTTON13)
REPORT_NAME_DIGITAL(__LINE__, BUTTON13_PIN)
#endif
#if PIN_EXISTS(BUTTON14)
REPORT_NAME_DIGITAL(__LINE__, BUTTON14_PIN)
#endif
#if PIN_EXISTS(BUTTON15)
REPORT_NAME_DIGITAL(__LINE__, BUTTON15_PIN)
#endif
#if PIN_EXISTS(BUTTON16)
REPORT_NAME_DIGITAL(__LINE__, BUTTON16_PIN)
#endif
#if PIN_EXISTS(BUTTON17)
REPORT_NAME_DIGITAL(__LINE__, BUTTON17_PIN)
#endif
#if PIN_EXISTS(BUTTON18)
REPORT_NAME_DIGITAL(__LINE__, BUTTON18_PIN)
#endif
#if PIN_EXISTS(BUTTON19)
REPORT_NAME_DIGITAL(__LINE__, BUTTON19_PIN)
#endif
#if PIN_EXISTS(BUTTON20)
REPORT_NAME_DIGITAL(__LINE__, BUTTON20_PIN)
#endif
#if PIN_EXISTS(BUTTON21)
REPORT_NAME_DIGITAL(__LINE__, BUTTON21_PIN)
#endif
#if PIN_EXISTS(BUTTON22)
REPORT_NAME_DIGITAL(__LINE__, BUTTON22_PIN)
#endif
#if PIN_EXISTS(BUTTON23)
REPORT_NAME_DIGITAL(__LINE__, BUTTON23_PIN)
#endif
#if PIN_EXISTS(BUTTON24)
REPORT_NAME_DIGITAL(__LINE__, BUTTON24_PIN)
#endif
#if PIN_EXISTS(BUTTON25)
REPORT_NAME_DIGITAL(__LINE__, BUTTON25_PIN)
#endif
#if PIN_EXISTS(CASE_LIGHT)
REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN)
#endif
#if PIN_EXISTS(CHAMBER_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(CONTROLLER_FAN)
REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN)
#endif
#if PIN_EXISTS(COOLANT_FLOOD)
REPORT_NAME_DIGITAL(__LINE__, COOLANT_FLOOD_PIN)
#endif
#if PIN_EXISTS(COOLANT_MIST)
REPORT_NAME_DIGITAL(__LINE__, COOLANT_MIST_PIN)
#endif
#if PIN_EXISTS(CUTOFF_RESET)
REPORT_NAME_DIGITAL(__LINE__, CUTOFF_RESET_PIN)
#endif
#if PIN_EXISTS(CUTOFF_TEST)
REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN)
#endif
#if _EXISTS(D57)
REPORT_NAME_DIGITAL(__LINE__, D57)
#endif
#if _EXISTS(D58)
REPORT_NAME_DIGITAL(__LINE__, D58)
#endif
#if PIN_EXISTS(DAC_DISABLE)
REPORT_NAME_DIGITAL(__LINE__, DAC_DISABLE_PIN)
#endif
#if PIN_EXISTS(DAC0_SYNC)
REPORT_NAME_DIGITAL(__LINE__, DAC0_SYNC_PIN)
#endif
#if PIN_EXISTS(DAC1_SYNC)
REPORT_NAME_DIGITAL(__LINE__, DAC1_SYNC_PIN)
#endif
#if PIN_EXISTS(DEBUG)
REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN)
#endif
#if _EXISTS(DIGIPOTS_I2C_SCL)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL)
#endif
#if _EXISTS(DIGIPOTS_I2C_SDA_E0)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0)
#endif
#if _EXISTS(DIGIPOTS_I2C_SDA_E1)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1)
#endif
#if _EXISTS(DIGIPOTS_I2C_SDA_X)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X)
#endif
#if _EXISTS(DIGIPOTS_I2C_SDA_Y)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y)
#endif
#if _EXISTS(DIGIPOTS_I2C_SDA_Z)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z)
#endif
#if PIN_EXISTS(DIGIPOTSS)
REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN)
#endif
#if PIN_EXISTS(LCD_RESET)
REPORT_NAME_DIGITAL(__LINE__, LCD_RESET_PIN)
#endif
#if _EXISTS(DOGLCD_A0)
REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0)
#endif
#if _EXISTS(DOGLCD_CS)
REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS)
#endif
#if _EXISTS(DOGLCD_MOSI)
REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI)
#endif
#if _EXISTS(DOGLCD_SCK)
REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK)
#endif
#if _EXISTS(TMC_SW_MISO)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO)
#endif
#if _EXISTS(TMC_SW_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI)
#endif
#if _EXISTS(TMC_SW_SCK)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK)
#endif
#if _EXISTS(TFTGLCD_CS)
REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS)
#endif
#if PIN_EXISTS(E_MUX0)
REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN)
#endif
#if PIN_EXISTS(E_MUX1)
REPORT_NAME_DIGITAL(__LINE__, E_MUX1_PIN)
#endif
#if PIN_EXISTS(E_MUX2)
REPORT_NAME_DIGITAL(__LINE__, E_MUX2_PIN)
#endif
#if PIN_EXISTS(E_STOP)
REPORT_NAME_DIGITAL(__LINE__, E_STOP_PIN)
#endif
#if PIN_EXISTS(E0_ATT)
REPORT_NAME_DIGITAL(__LINE__, E0_ATT_PIN)
#endif
#if PIN_EXISTS(E0_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E0_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E0_CS)
REPORT_NAME_DIGITAL(__LINE__, E0_CS_PIN)
#endif
#if PIN_EXISTS(E0_DIR)
REPORT_NAME_DIGITAL(__LINE__, E0_DIR_PIN)
#endif
#if PIN_EXISTS(E0_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E0_ENABLE_PIN)
#endif
#if PIN_EXISTS(E0_MS1)
REPORT_NAME_DIGITAL(__LINE__, E0_MS1_PIN)
#endif
#if PIN_EXISTS(E0_MS2)
REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN)
#endif
#if PIN_EXISTS(E0_MS3)
REPORT_NAME_DIGITAL(__LINE__, E0_MS3_PIN)
#endif
#if PIN_EXISTS(E0_STEP)
REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN)
#endif
#if PIN_EXISTS(E0_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E0_STDBY_PIN)
#endif
#if PIN_EXISTS(E1_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E1_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E1_CS)
REPORT_NAME_DIGITAL(__LINE__, E1_CS_PIN)
#endif
#if PIN_EXISTS(E1_DIR)
REPORT_NAME_DIGITAL(__LINE__, E1_DIR_PIN)
#endif
#if PIN_EXISTS(E1_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E1_ENABLE_PIN)
#endif
#if PIN_EXISTS(E1_MS1)
REPORT_NAME_DIGITAL(__LINE__, E1_MS1_PIN)
#endif
#if PIN_EXISTS(E1_MS2)
REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN)
#endif
#if PIN_EXISTS(E1_MS3)
REPORT_NAME_DIGITAL(__LINE__, E1_MS3_PIN)
#endif
#if PIN_EXISTS(E1_STEP)
REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN)
#endif
#if PIN_EXISTS(E1_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E1_STDBY_PIN)
#endif
#if PIN_EXISTS(E2_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E2_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E2_CS)
REPORT_NAME_DIGITAL(__LINE__, E2_CS_PIN)
#endif
#if PIN_EXISTS(E2_DIR)
REPORT_NAME_DIGITAL(__LINE__, E2_DIR_PIN)
#endif
#if PIN_EXISTS(E2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E2_ENABLE_PIN)
#endif
#if PIN_EXISTS(E2_MS1)
REPORT_NAME_DIGITAL(__LINE__, E2_MS1_PIN)
#endif
#if PIN_EXISTS(E2_MS2)
REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN)
#endif
#if PIN_EXISTS(E2_MS3)
REPORT_NAME_DIGITAL(__LINE__, E2_MS3_PIN)
#endif
#if PIN_EXISTS(E2_STEP)
REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN)
#endif
#if PIN_EXISTS(E2_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E2_STDBY_PIN)
#endif
#if PIN_EXISTS(E3_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E3_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E3_CS)
REPORT_NAME_DIGITAL(__LINE__, E3_CS_PIN)
#endif
#if PIN_EXISTS(E3_DIR)
REPORT_NAME_DIGITAL(__LINE__, E3_DIR_PIN)
#endif
#if PIN_EXISTS(E3_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E3_ENABLE_PIN)
#endif
#if PIN_EXISTS(E3_MS1)
REPORT_NAME_DIGITAL(__LINE__, E3_MS1_PIN)
#endif
#if PIN_EXISTS(E3_MS2)
REPORT_NAME_DIGITAL(__LINE__, E3_MS2_PIN)
#endif
#if PIN_EXISTS(E3_MS3)
REPORT_NAME_DIGITAL(__LINE__, E3_MS3_PIN)
#endif
#if PIN_EXISTS(E3_STEP)
REPORT_NAME_DIGITAL(__LINE__, E3_STEP_PIN)
#endif
#if PIN_EXISTS(E3_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E3_STDBY_PIN)
#endif
#if PIN_EXISTS(E4_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E4_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E4_CS)
REPORT_NAME_DIGITAL(__LINE__, E4_CS_PIN)
#endif
#if PIN_EXISTS(E4_DIR)
REPORT_NAME_DIGITAL(__LINE__, E4_DIR_PIN)
#endif
#if PIN_EXISTS(E4_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E4_ENABLE_PIN)
#endif
#if PIN_EXISTS(E4_MS1)
REPORT_NAME_DIGITAL(__LINE__, E4_MS1_PIN)
#endif
#if PIN_EXISTS(E4_MS2)
REPORT_NAME_DIGITAL(__LINE__, E4_MS2_PIN)
#endif
#if PIN_EXISTS(E4_MS3)
REPORT_NAME_DIGITAL(__LINE__, E4_MS3_PIN)
#endif
#if PIN_EXISTS(E4_STEP)
REPORT_NAME_DIGITAL(__LINE__, E4_STEP_PIN)
#endif
#if PIN_EXISTS(E4_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E4_STDBY_PIN)
#endif
#if PIN_EXISTS(E5_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E5_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E5_CS)
REPORT_NAME_DIGITAL(__LINE__, E5_CS_PIN)
#endif
#if PIN_EXISTS(E5_DIR)
REPORT_NAME_DIGITAL(__LINE__, E5_DIR_PIN)
#endif
#if PIN_EXISTS(E5_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E5_ENABLE_PIN)
#endif
#if PIN_EXISTS(E5_MS1)
REPORT_NAME_DIGITAL(__LINE__, E5_MS1_PIN)
#endif
#if PIN_EXISTS(E5_MS2)
REPORT_NAME_DIGITAL(__LINE__, E5_MS2_PIN)
#endif
#if PIN_EXISTS(E5_MS3)
REPORT_NAME_DIGITAL(__LINE__, E5_MS3_PIN)
#endif
#if PIN_EXISTS(E5_STEP)
REPORT_NAME_DIGITAL(__LINE__, E5_STEP_PIN)
#endif
#if PIN_EXISTS(E5_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E5_STDBY_PIN)
#endif
#if PIN_EXISTS(E6_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E6_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E6_CS)
REPORT_NAME_DIGITAL(__LINE__, E6_CS_PIN)
#endif
#if PIN_EXISTS(E6_DIR)
REPORT_NAME_DIGITAL(__LINE__, E6_DIR_PIN)
#endif
#if PIN_EXISTS(E6_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E6_ENABLE_PIN)
#endif
#if PIN_EXISTS(E6_MS1)
REPORT_NAME_DIGITAL(__LINE__, E6_MS1_PIN)
#endif
#if PIN_EXISTS(E6_MS2)
REPORT_NAME_DIGITAL(__LINE__, E6_MS2_PIN)
#endif
#if PIN_EXISTS(E6_MS3)
REPORT_NAME_DIGITAL(__LINE__, E6_MS3_PIN)
#endif
#if PIN_EXISTS(E6_STEP)
REPORT_NAME_DIGITAL(__LINE__, E6_STEP_PIN)
#endif
#if PIN_EXISTS(E6_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E6_STDBY_PIN)
#endif
#if PIN_EXISTS(E7_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, E7_AUTO_FAN_PIN)
#endif
#if PIN_EXISTS(E7_CS)
REPORT_NAME_DIGITAL(__LINE__, E7_CS_PIN)
#endif
#if PIN_EXISTS(E7_DIR)
REPORT_NAME_DIGITAL(__LINE__, E7_DIR_PIN)
#endif
#if PIN_EXISTS(E7_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, E7_ENABLE_PIN)
#endif
#if PIN_EXISTS(E7_MS1)
REPORT_NAME_DIGITAL(__LINE__, E7_MS1_PIN)
#endif
#if PIN_EXISTS(E7_MS2)
REPORT_NAME_DIGITAL(__LINE__, E7_MS2_PIN)
#endif
#if PIN_EXISTS(E7_MS3)
REPORT_NAME_DIGITAL(__LINE__, E7_MS3_PIN)
#endif
#if PIN_EXISTS(E7_STEP)
REPORT_NAME_DIGITAL(__LINE__, E7_STEP_PIN)
#endif
#if PIN_EXISTS(E7_STDBY)
REPORT_NAME_DIGITAL(__LINE__, E7_STDBY_PIN)
#endif
#if _EXISTS(ENET_CRS)
REPORT_NAME_DIGITAL(__LINE__, ENET_CRS)
#endif
#if _EXISTS(ENET_MDIO)
REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO)
#endif
#if _EXISTS(ENET_MOC)
REPORT_NAME_DIGITAL(__LINE__, ENET_MOC)
#endif
#if _EXISTS(ENET_RX_ER)
REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER)
#endif
#if _EXISTS(ENET_RXD0)
REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0)
#endif
#if _EXISTS(ENET_RXD1)
REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1)
#endif
#if _EXISTS(ENET_TX_EN)
REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN)
#endif
#if _EXISTS(ENET_TXD0)
REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0)
#endif
#if _EXISTS(ENET_TXD1)
REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1)
#endif
#if PIN_EXISTS(EXP_VOLTAGE_LEVEL)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if _EXISTS(EXT_AUX_A0_IO)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO)
#endif
#if _EXISTS(EXT_AUX_A1_IO)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO)
#endif
#if _EXISTS(EXT_AUX_A2_IO)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO)
#endif
#if _EXISTS(EXT_AUX_A3_IO)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO)
#endif
#if _EXISTS(EXT_AUX_A4_IO)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO)
#endif
#if _EXISTS(EXT_AUX_PWM_D24)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24)
#endif
#if _EXISTS(EXT_AUX_RX1_D2)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2)
#endif
#if _EXISTS(EXT_AUX_SCL_D0)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0)
#endif
#if _EXISTS(EXT_AUX_SDA_D1)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1)
#endif
#if _EXISTS(EXT_AUX_TX1_D3)
REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3)
#endif
#if _EXISTS(EXTRUDER_0_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN)
#endif
#if _EXISTS(EXTRUDER_1_AUTO_FAN)
REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN)
#endif
#if PIN_EXISTS(FAN)
REPORT_NAME_DIGITAL(__LINE__, FAN_PIN)
#endif
#if PIN_EXISTS(FAN1)
REPORT_NAME_DIGITAL(__LINE__, FAN1_PIN)
#endif
#if PIN_EXISTS(FAN2)
REPORT_NAME_DIGITAL(__LINE__, FAN2_PIN)
#endif
#if PIN_EXISTS(FAN3)
REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN)
#endif
#if PIN_EXISTS(FAN4)
REPORT_NAME_DIGITAL(__LINE__, FAN4_PIN)
#endif
#if PIN_EXISTS(FAN5)
REPORT_NAME_DIGITAL(__LINE__, FAN5_PIN)
#endif
#if PIN_EXISTS(FAN6)
REPORT_NAME_DIGITAL(__LINE__, FAN6_PIN)
#endif
#if PIN_EXISTS(FAN7)
REPORT_NAME_DIGITAL(__LINE__, FAN7_PIN)
#endif
#if PIN_EXISTS(FAN_MUX0)
REPORT_NAME_DIGITAL(__LINE__, FAN_MUX0_PIN)
#endif
#if PIN_EXISTS(FAN_MUX1)
REPORT_NAME_DIGITAL(__LINE__, FAN_MUX1_PIN)
#endif
#if PIN_EXISTS(FAN_MUX2)
REPORT_NAME_DIGITAL(__LINE__, FAN_MUX2_PIN)
#endif
#if PIN_EXISTS(POWER_LOSS)
REPORT_NAME_DIGITAL(__LINE__, POWER_LOSS_PIN)
#endif
#if PIN_EXISTS(SAFE_POWER)
REPORT_NAME_DIGITAL(__LINE__, SAFE_POWER_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT2)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT2_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT3)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT3_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT4)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT4_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT5)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT5_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT6)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT6_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT7)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT7_PIN)
#endif
#if PIN_EXISTS(FIL_RUNOUT8)
REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT8_PIN)
#endif
#if PIN_EXISTS(HEATER_0)
REPORT_NAME_DIGITAL(__LINE__, HEATER_0_PIN)
#endif
#if PIN_EXISTS(HEATER_1)
REPORT_NAME_DIGITAL(__LINE__, HEATER_1_PIN)
#endif
#if PIN_EXISTS(HEATER_2)
REPORT_NAME_DIGITAL(__LINE__, HEATER_2_PIN)
#endif
#if PIN_EXISTS(HEATER_3)
REPORT_NAME_DIGITAL(__LINE__, HEATER_3_PIN)
#endif
#if PIN_EXISTS(HEATER_4)
REPORT_NAME_DIGITAL(__LINE__, HEATER_4_PIN)
#endif
#if PIN_EXISTS(HEATER_5)
REPORT_NAME_DIGITAL(__LINE__, HEATER_5_PIN)
#endif
#if PIN_EXISTS(HEATER_6)
REPORT_NAME_DIGITAL(__LINE__, HEATER_6_PIN)
#endif
#if PIN_EXISTS(HEATER_7)
REPORT_NAME_DIGITAL(__LINE__, HEATER_7_PIN)
#endif
#if PIN_EXISTS(HEATER_BED)
REPORT_NAME_DIGITAL(__LINE__, HEATER_BED_PIN)
#endif
#if PIN_EXISTS(HEATER_CHAMBER)
REPORT_NAME_DIGITAL(__LINE__, HEATER_CHAMBER_PIN)
#endif
#if PIN_EXISTS(COOLER)
REPORT_NAME_DIGITAL(__LINE__, COOLER_PIN)
#endif
#if PIN_EXISTS(HOME)
REPORT_NAME_DIGITAL(__LINE__, HOME_PIN)
#endif
#if PIN_EXISTS(I2C_SCL)
REPORT_NAME_DIGITAL(__LINE__, I2C_SCL_PIN)
#endif
#if PIN_EXISTS(I2C_SDA)
REPORT_NAME_DIGITAL(__LINE__, I2C_SDA_PIN)
#endif
#if HAS_KILL
REPORT_NAME_DIGITAL(__LINE__, KILL_PIN)
#endif
#if HAS_FREEZE_PIN
REPORT_NAME_DIGITAL(__LINE__, FREEZE_PIN)
#endif
#if PIN_EXISTS(LCD_BACKLIGHT)
REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN)
#endif
#if _EXISTS(LCD_PINS_D4)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4)
#endif
#if _EXISTS(LCD_PINS_D5)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5)
#endif
#if _EXISTS(LCD_PINS_D6)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6)
#endif
#if _EXISTS(LCD_PINS_D7)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7)
#endif
#if _EXISTS(LCD_PINS_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE)
#endif
#if _EXISTS(LCD_PINS_RS)
REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS)
#endif
#if _EXISTS(LCD_SDSS)
REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS)
#endif
#if PIN_EXISTS(LED_GREEN)
REPORT_NAME_DIGITAL(__LINE__, LED_GREEN_PIN)
#endif
#if PIN_EXISTS(LED)
REPORT_NAME_DIGITAL(__LINE__, LED_PIN)
#endif
#if PIN_EXISTS(LED2)
REPORT_NAME_DIGITAL(__LINE__, LED2_PIN)
#endif
#if PIN_EXISTS(LED3)
REPORT_NAME_DIGITAL(__LINE__, LED3_PIN)
#endif
#if PIN_EXISTS(LED4)
REPORT_NAME_DIGITAL(__LINE__, LED4_PIN)
#endif
#if PIN_EXISTS(LED_RED)
REPORT_NAME_DIGITAL(__LINE__, LED_RED_PIN)
#endif
#if PIN_EXISTS(TEMP_0_CS)
REPORT_NAME_DIGITAL(__LINE__, TEMP_0_CS_PIN)
#endif
#if PIN_EXISTS(TEMP_0_SCK)
REPORT_NAME_DIGITAL(__LINE__, TEMP_0_SCK_PIN)
#endif
#if PIN_EXISTS(TEMP_0_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TEMP_0_MOSI_PIN)
#endif
#if PIN_EXISTS(TEMP_0_MISO)
REPORT_NAME_DIGITAL(__LINE__, TEMP_0_MISO_PIN)
#endif
#if PIN_EXISTS(TEMP_1_CS)
REPORT_NAME_DIGITAL(__LINE__, TEMP_1_CS_PIN)
#endif
#if PIN_EXISTS(TEMP_1_SCK)
REPORT_NAME_DIGITAL(__LINE__, TEMP_1_SCK_PIN)
#endif
#if PIN_EXISTS(TEMP_1_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TEMP_1_MOSI_PIN)
#endif
#if PIN_EXISTS(TEMP_1_MISO)
REPORT_NAME_DIGITAL(__LINE__, TEMP_1_MISO_PIN)
#endif
#if PIN_EXISTS(MAX7219_CLK)
REPORT_NAME_DIGITAL(__LINE__, MAX7219_CLK_PIN)
#endif
#if PIN_EXISTS(MAX7219_DIN)
REPORT_NAME_DIGITAL(__LINE__, MAX7219_DIN_PIN)
#endif
#if PIN_EXISTS(MAX7219_LOAD)
REPORT_NAME_DIGITAL(__LINE__, MAX7219_LOAD_PIN)
#endif
//#if _EXISTS(MISO)
// REPORT_NAME_DIGITAL(__LINE__, MISO)
//#endif
#if PIN_EXISTS(MISO)
REPORT_NAME_DIGITAL(__LINE__, SD_MISO_PIN)
#endif
#if PIN_EXISTS(MOSFET_A)
REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN)
#endif
#if PIN_EXISTS(MOSFET_B)
REPORT_NAME_DIGITAL(__LINE__, MOSFET_B_PIN)
#endif
#if PIN_EXISTS(MOSFET_C)
REPORT_NAME_DIGITAL(__LINE__, MOSFET_C_PIN)
#endif
#if PIN_EXISTS(MOSFET_D)
REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN)
#endif
//#if _EXISTS(MOSI)
// REPORT_NAME_DIGITAL(__LINE__, MOSI)
//#endif
#if PIN_EXISTS(MOSI)
REPORT_NAME_DIGITAL(__LINE__, SD_MOSI_PIN)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(MOTOR_FAULT)
REPORT_NAME_DIGITAL(__LINE__, MOTOR_FAULT_PIN)
#endif
#if PIN_EXISTS(PHOTOGRAPH)
REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN)
#endif
#if PIN_EXISTS(CHDK)
REPORT_NAME_DIGITAL(__LINE__, CHDK_PIN)
#endif
#if PIN_EXISTS(PS_ON)
REPORT_NAME_DIGITAL(__LINE__, PS_ON_PIN)
#endif
#if PIN_EXISTS(PWM_1)
REPORT_NAME_DIGITAL(__LINE__, PWM_1_PIN)
#endif
#if PIN_EXISTS(PWM_2)
REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN)
#endif
#if _EXISTS(REF_CLK)
REPORT_NAME_DIGITAL(__LINE__, REF_CLK)
#endif
#if PIN_EXISTS(NEOPIXEL)
REPORT_NAME_DIGITAL(__LINE__, NEOPIXEL_PIN)
#endif
#if PIN_EXISTS(NEOPIXEL2)
REPORT_NAME_DIGITAL(__LINE__, NEOPIXEL2_PIN)
#endif
#if PIN_EXISTS(RGB_LED_R)
REPORT_NAME_DIGITAL(__LINE__, RGB_LED_R_PIN)
#endif
#if PIN_EXISTS(RGB_LED_G)
REPORT_NAME_DIGITAL(__LINE__, RGB_LED_G_PIN)
#endif
#if PIN_EXISTS(RGB_LED_B)
REPORT_NAME_DIGITAL(__LINE__, RGB_LED_B_PIN)
#endif
#if PIN_EXISTS(RGB_LED_W)
REPORT_NAME_DIGITAL(__LINE__, RGB_LED_W_PIN)
#endif
#if PIN_EXISTS(RX_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, RX_ENABLE_PIN)
#endif
#if PIN_EXISTS(SAFETY_TRIGGERED)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
//#if _EXISTS(SCK)
// REPORT_NAME_DIGITAL(__LINE__, SCK)
//#endif
#if PIN_EXISTS(SCK)
REPORT_NAME_DIGITAL(__LINE__, SD_SCK_PIN)
#endif
//#if _EXISTS(SCL)
// REPORT_NAME_DIGITAL(__LINE__, SCL)
//#endif
#if PIN_EXISTS(SD_DETECT)
REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN)
#endif
//#if _EXISTS(SDA)
// REPORT_NAME_DIGITAL(__LINE__, SDA)
//#endif
#if PIN_EXISTS(SDPOWER)
REPORT_NAME_DIGITAL(__LINE__, SDPOWER_PIN)
#endif
#if _EXISTS(SDSS)
REPORT_NAME_DIGITAL(__LINE__, SDSS)
#endif
#if _EXISTS(SERVO0)
REPORT_NAME_DIGITAL(__LINE__, SERVO0)
#endif
#if PIN_EXISTS(SERVO0)
REPORT_NAME_DIGITAL(__LINE__, SERVO0_PIN)
#endif
#if PIN_EXISTS(SERVO1)
REPORT_NAME_DIGITAL(__LINE__, SERVO1_PIN)
#endif
#if PIN_EXISTS(SERVO2)
REPORT_NAME_DIGITAL(__LINE__, SERVO2_PIN)
#endif
#if PIN_EXISTS(SERVO3)
REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN)
#endif
#if PIN_EXISTS(SHIFT_CLK)
REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK_PIN)
#endif
#if PIN_EXISTS(SHIFT_EN)
REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN_PIN)
#endif
#if PIN_EXISTS(SHIFT_LD)
REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD_PIN)
#endif
#if PIN_EXISTS(SHIFT_OUT)
REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT_PIN)
#endif
#if PIN_EXISTS(SLED)
REPORT_NAME_DIGITAL(__LINE__, SLED_PIN)
#endif
#if PIN_EXISTS(SLEEP_WAKE)
REPORT_NAME_DIGITAL(__LINE__, SLEEP_WAKE_PIN)
#endif
#if PIN_EXISTS(SOL0)
REPORT_NAME_DIGITAL(__LINE__, SOL0_PIN)
#endif
#if PIN_EXISTS(SOL1)
REPORT_NAME_DIGITAL(__LINE__, SOL1_PIN)
#endif
#if PIN_EXISTS(SOL2)
REPORT_NAME_DIGITAL(__LINE__, SOL2_PIN)
#endif
#if PIN_EXISTS(SOL3)
REPORT_NAME_DIGITAL(__LINE__, SOL3_PIN)
#endif
#if PIN_EXISTS(SOL4)
REPORT_NAME_DIGITAL(__LINE__, SOL4_PIN)
#endif
#if PIN_EXISTS(SOL5)
REPORT_NAME_DIGITAL(__LINE__, SOL5_PIN)
#endif
#if PIN_EXISTS(SOL6)
REPORT_NAME_DIGITAL(__LINE__, SOL6_PIN)
#endif
#if PIN_EXISTS(SOL7)
REPORT_NAME_DIGITAL(__LINE__, SOL7_PIN)
#endif
#if _EXISTS(SPARE_IO)
REPORT_NAME_DIGITAL(__LINE__, SPARE_IO)
#endif
#if PIN_EXISTS(SPI_EEPROM1_CS)
REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM1_CS_PIN)
#endif
#if PIN_EXISTS(SPI_EEPROM2_CS)
REPORT_NAME_DIGITAL(__LINE__, SPI_EEPROM2_CS_PIN)
#endif
#if PIN_EXISTS(SPI_FLASH_CS)
REPORT_NAME_DIGITAL(__LINE__, SPI_FLASH_CS_PIN)
#endif
#if PIN_EXISTS(SPINDLE_DIR)
REPORT_NAME_DIGITAL(__LINE__, SPINDLE_DIR_PIN)
#endif
#if PIN_EXISTS(SPINDLE_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, SPINDLE_ENABLE_PIN)
#endif
#if PIN_EXISTS(SPINDLE_LASER_ENA)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(SPINDLE_LASER_PWM)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(SR_CLK)
REPORT_NAME_DIGITAL(__LINE__, SR_CLK_PIN)
#endif
#if PIN_EXISTS(SR_DATA)
REPORT_NAME_DIGITAL(__LINE__, SR_DATA_PIN)
#endif
#if PIN_EXISTS(SR_STROBE)
REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN)
#endif
#if PIN_EXISTS(SS)
REPORT_NAME_DIGITAL(__LINE__, SD_SS_PIN)
#endif
#if PIN_EXISTS(STAT_LED_BLUE)
REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN)
#endif
#if _EXISTS(STAT_LED_RED_LED)
REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED)
#endif
#if PIN_EXISTS(STAT_LED_RED)
REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_PIN)
#endif
#if PIN_EXISTS(STEPPER_RESET)
REPORT_NAME_DIGITAL(__LINE__, STEPPER_RESET_PIN)
#endif
#if PIN_EXISTS(SUICIDE)
REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN)
#endif
#if PIN_EXISTS(TLC_BLANK)
REPORT_NAME_DIGITAL(__LINE__, TLC_BLANK_PIN)
#endif
#if PIN_EXISTS(TLC_CLOCK)
REPORT_NAME_DIGITAL(__LINE__, TLC_CLOCK_PIN)
#endif
#if PIN_EXISTS(TLC_DATA)
REPORT_NAME_DIGITAL(__LINE__, TLC_DATA_PIN)
#endif
#if PIN_EXISTS(TLC_XLAT)
REPORT_NAME_DIGITAL(__LINE__, TLC_XLAT_PIN)
#endif
#if PIN_EXISTS(TOOL_0)
REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PIN)
#endif
#if PIN_EXISTS(TOOL_0_PWM)
REPORT_NAME_DIGITAL(__LINE__, TOOL_0_PWM_PIN)
#endif
#if PIN_EXISTS(TOOL_1)
REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PIN)
#endif
#if PIN_EXISTS(TOOL_1_PWM)
REPORT_NAME_DIGITAL(__LINE__, TOOL_1_PWM_PIN)
#endif
#if PIN_EXISTS(TOOL_2)
REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PIN)
#endif
#if PIN_EXISTS(TOOL_2_PWM)
REPORT_NAME_DIGITAL(__LINE__, TOOL_2_PWM_PIN)
#endif
#if PIN_EXISTS(TOOL_3)
REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PIN)
#endif
#if PIN_EXISTS(TOOL_3_PWM)
REPORT_NAME_DIGITAL(__LINE__, TOOL_3_PWM_PIN)
#endif
#if PIN_EXISTS(TOOL_PWM)
REPORT_NAME_DIGITAL(__LINE__, TOOL_PWM_PIN)
#endif
#if PIN_EXISTS(TX_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN)
#endif
#if _EXISTS(UI1)
REPORT_NAME_DIGITAL(__LINE__, UI1)
#endif
#if _EXISTS(UI2)
REPORT_NAME_DIGITAL(__LINE__, UI2)
#endif
#if _EXISTS(UNUSED_PWM)
REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM)
#endif
#if PIN_EXISTS(X_ATT)
REPORT_NAME_DIGITAL(__LINE__, X_ATT_PIN)
#endif
#if PIN_EXISTS(X_CS)
REPORT_NAME_DIGITAL(__LINE__, X_CS_PIN)
#endif
#if PIN_EXISTS(X_DIR)
REPORT_NAME_DIGITAL(__LINE__, X_DIR_PIN)
#endif
#if PIN_EXISTS(X_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, X_ENABLE_PIN)
#endif
#if PIN_EXISTS(X_MAX)
REPORT_NAME_DIGITAL(__LINE__, X_MAX_PIN)
#endif
#if PIN_EXISTS(X_MIN)
REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN)
#endif
#if PIN_EXISTS(X_DIAG)
REPORT_NAME_DIGITAL(__LINE__, X_DIAG_PIN)
#endif
#if PIN_EXISTS(X_MS1)
REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN)
#endif
#if PIN_EXISTS(X_MS2)
REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN)
#endif
#if PIN_EXISTS(X_MS3)
REPORT_NAME_DIGITAL(__LINE__, X_MS3_PIN)
#endif
#if PIN_EXISTS(X_STEP)
REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN)
#endif
#if PIN_EXISTS(X_STDBY)
REPORT_NAME_DIGITAL(__LINE__, X_STDBY_PIN)
#endif
#if PIN_EXISTS(X_STOP)
REPORT_NAME_DIGITAL(__LINE__, X_STOP_PIN)
#endif
#if PIN_EXISTS(X2_CS)
REPORT_NAME_DIGITAL(__LINE__, X2_CS_PIN)
#endif
#if PIN_EXISTS(X2_DIR)
REPORT_NAME_DIGITAL(__LINE__, X2_DIR_PIN)
#endif
#if PIN_EXISTS(X2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN)
#endif
#if PIN_EXISTS(X2_MAX)
REPORT_NAME_DIGITAL(__LINE__, X2_MAX_PIN)
#endif
#if PIN_EXISTS(X2_MIN)
REPORT_NAME_DIGITAL(__LINE__, X2_MIN_PIN)
#endif
#if PIN_EXISTS(X2_MS1)
REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN)
#endif
#if PIN_EXISTS(X2_MS2)
REPORT_NAME_DIGITAL(__LINE__, X2_MS2_PIN)
#endif
#if PIN_EXISTS(X2_MS3)
REPORT_NAME_DIGITAL(__LINE__, X2_MS3_PIN)
#endif
#if PIN_EXISTS(X2_STEP)
REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN)
#endif
#if PIN_EXISTS(Y_ATT)
REPORT_NAME_DIGITAL(__LINE__, Y_ATT_PIN)
#endif
#if PIN_EXISTS(Y_CS)
REPORT_NAME_DIGITAL(__LINE__, Y_CS_PIN)
#endif
#if PIN_EXISTS(Y_DIR)
REPORT_NAME_DIGITAL(__LINE__, Y_DIR_PIN)
#endif
#if PIN_EXISTS(Y_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Y_ENABLE_PIN)
#endif
#if PIN_EXISTS(Y_MAX)
REPORT_NAME_DIGITAL(__LINE__, Y_MAX_PIN)
#endif
#if PIN_EXISTS(Y_MIN)
REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN)
#endif
#if PIN_EXISTS(Y_DIAG)
REPORT_NAME_DIGITAL(__LINE__, Y_DIAG_PIN)
#endif
#if PIN_EXISTS(Y_MS1)
REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN)
#endif
#if PIN_EXISTS(Y_MS2)
REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN)
#endif
#if PIN_EXISTS(Y_MS3)
REPORT_NAME_DIGITAL(__LINE__, Y_MS3_PIN)
#endif
#if PIN_EXISTS(Y_STEP)
REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN)
#endif
#if PIN_EXISTS(Y_STDBY)
REPORT_NAME_DIGITAL(__LINE__, Y_STDBY_PIN)
#endif
#if PIN_EXISTS(Y_STOP)
REPORT_NAME_DIGITAL(__LINE__, Y_STOP_PIN)
#endif
#if PIN_EXISTS(Y2_CS)
REPORT_NAME_DIGITAL(__LINE__, Y2_CS_PIN)
#endif
#if PIN_EXISTS(Y2_DIR)
REPORT_NAME_DIGITAL(__LINE__, Y2_DIR_PIN)
#endif
#if PIN_EXISTS(Y2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN)
#endif
#if PIN_EXISTS(Y2_MAX)
REPORT_NAME_DIGITAL(__LINE__, Y2_MAX_PIN)
#endif
#if PIN_EXISTS(Y2_MIN)
REPORT_NAME_DIGITAL(__LINE__, Y2_MIN_PIN)
#endif
#if PIN_EXISTS(Y2_MS1)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN)
#endif
#if PIN_EXISTS(Y2_MS2)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS2_PIN)
#endif
#if PIN_EXISTS(Y2_MS3)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS3_PIN)
#endif
#if PIN_EXISTS(Y2_STEP)
REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN)
#endif
#if PIN_EXISTS(Z_ATT)
REPORT_NAME_DIGITAL(__LINE__, Z_ATT_PIN)
#endif
#if PIN_EXISTS(Z_CS)
REPORT_NAME_DIGITAL(__LINE__, Z_CS_PIN)
#endif
#if PIN_EXISTS(Z_DIR)
REPORT_NAME_DIGITAL(__LINE__, Z_DIR_PIN)
#endif
#if PIN_EXISTS(Z_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z_ENABLE_PIN)
#endif
#if PIN_EXISTS(Z_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z_MAX_PIN)
#endif
#if PIN_EXISTS(Z_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN)
#endif
#if PIN_EXISTS(Z_DIAG)
REPORT_NAME_DIGITAL(__LINE__, Z_DIAG_PIN)
#endif
#if PIN_EXISTS(Z_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN)
#endif
#if PIN_EXISTS(Z_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN)
#endif
#if PIN_EXISTS(Z_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z_MS3_PIN)
#endif
#if PIN_EXISTS(Z_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN)
#endif
#if PIN_EXISTS(Z_STDBY)
REPORT_NAME_DIGITAL(__LINE__, Z_STDBY_PIN)
#endif
#if PIN_EXISTS(Z_STOP)
REPORT_NAME_DIGITAL(__LINE__, Z_STOP_PIN)
#endif
#if PIN_EXISTS(Z2_CS)
REPORT_NAME_DIGITAL(__LINE__, Z2_CS_PIN)
#endif
#if PIN_EXISTS(Z2_DIR)
REPORT_NAME_DIGITAL(__LINE__, Z2_DIR_PIN)
#endif
#if PIN_EXISTS(Z2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN)
#endif
#if PIN_EXISTS(Z2_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z2_MAX_PIN)
#endif
#if PIN_EXISTS(Z2_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z2_MIN_PIN)
#endif
#if PIN_EXISTS(Z2_DIAG)
REPORT_NAME_DIGITAL(__LINE__, Z2_DIAG_PIN)
#endif
#if PIN_EXISTS(Z2_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN)
#endif
#if PIN_EXISTS(Z2_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z2_MS2_PIN)
#endif
#if PIN_EXISTS(Z2_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z2_MS3_PIN)
#endif
#if PIN_EXISTS(Z2_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z2_STEP_PIN)
#endif
#if PIN_EXISTS(Z2_STOP)
REPORT_NAME_DIGITAL(__LINE__, Z2_STOP_PIN)
#endif
#if PIN_EXISTS(Z3_CS)
REPORT_NAME_DIGITAL(__LINE__, Z3_CS_PIN)
#endif
#if PIN_EXISTS(Z3_DIR)
REPORT_NAME_DIGITAL(__LINE__, Z3_DIR_PIN)
#endif
#if PIN_EXISTS(Z3_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z3_ENABLE_PIN)
#endif
#if PIN_EXISTS(Z3_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z3_MAX_PIN)
#endif
#if PIN_EXISTS(Z3_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z3_MIN_PIN)
#endif
#if PIN_EXISTS(Z3_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z3_MS1_PIN)
#endif
#if PIN_EXISTS(Z3_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z3_MS2_PIN)
#endif
#if PIN_EXISTS(Z3_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z3_MS3_PIN)
#endif
#if PIN_EXISTS(Z3_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z3_STEP_PIN)
#endif
#if PIN_EXISTS(Z4_CS)
REPORT_NAME_DIGITAL(__LINE__, Z4_CS_PIN)
#endif
#if PIN_EXISTS(Z4_DIR)
REPORT_NAME_DIGITAL(__LINE__, Z4_DIR_PIN)
#endif
#if PIN_EXISTS(Z4_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z4_ENABLE_PIN)
#endif
#if PIN_EXISTS(Z4_MAX)
REPORT_NAME_DIGITAL(__LINE__, Z4_MAX_PIN)
#endif
#if PIN_EXISTS(Z4_MIN)
REPORT_NAME_DIGITAL(__LINE__, Z4_MIN_PIN)
#endif
#if PIN_EXISTS(Z4_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS1_PIN)
#endif
#if PIN_EXISTS(Z4_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS2_PIN)
#endif
#if PIN_EXISTS(Z4_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS3_PIN)
#endif
#if PIN_EXISTS(Z4_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z4_STEP_PIN)
#endif
#if PIN_EXISTS(Z_MIN_PROBE)
REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(PROBE_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, PROBE_ENABLE_PIN)
#endif
#if PIN_EXISTS(PROBE_TARE)
REPORT_NAME_DIGITAL(__LINE__, PROBE_TARE_PIN)
#endif
#if PIN_EXISTS(I_ATT)
REPORT_NAME_DIGITAL(__LINE__, I_ATT_PIN)
#endif
#if PIN_EXISTS(I_CS)
REPORT_NAME_DIGITAL(__LINE__, I_CS_PIN)
#endif
#if PIN_EXISTS(I_DIR)
REPORT_NAME_DIGITAL(__LINE__, I_DIR_PIN)
#endif
#if PIN_EXISTS(I_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, I_ENABLE_PIN)
#endif
#if PIN_EXISTS(I_MAX)
REPORT_NAME_DIGITAL(__LINE__, I_MAX_PIN)
#endif
#if PIN_EXISTS(I_MIN)
REPORT_NAME_DIGITAL(__LINE__, I_MIN_PIN)
#endif
#if PIN_EXISTS(I_MS1)
REPORT_NAME_DIGITAL(__LINE__, I_MS1_PIN)
#endif
#if PIN_EXISTS(I_MS2)
REPORT_NAME_DIGITAL(__LINE__, I_MS2_PIN)
#endif
#if PIN_EXISTS(I_MS3)
REPORT_NAME_DIGITAL(__LINE__, I_MS3_PIN)
#endif
#if PIN_EXISTS(I_STEP)
REPORT_NAME_DIGITAL(__LINE__, I_STEP_PIN)
#endif
#if PIN_EXISTS(I_STOP)
REPORT_NAME_DIGITAL(__LINE__, I_STOP_PIN)
#endif
#if PIN_EXISTS(J_ATT)
REPORT_NAME_DIGITAL(__LINE__, J_ATT_PIN)
#endif
#if PIN_EXISTS(J_CS)
REPORT_NAME_DIGITAL(__LINE__, J_CS_PIN)
#endif
#if PIN_EXISTS(J_DIR)
REPORT_NAME_DIGITAL(__LINE__, J_DIR_PIN)
#endif
#if PIN_EXISTS(J_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, J_ENABLE_PIN)
#endif
#if PIN_EXISTS(J_MAX)
REPORT_NAME_DIGITAL(__LINE__, J_MAX_PIN)
#endif
#if PIN_EXISTS(J_MIN)
REPORT_NAME_DIGITAL(__LINE__, J_MIN_PIN)
#endif
#if PIN_EXISTS(J_MS1)
REPORT_NAME_DIGITAL(__LINE__, J_MS1_PIN)
#endif
#if PIN_EXISTS(J_MS2)
REPORT_NAME_DIGITAL(__LINE__, J_MS2_PIN)
#endif
#if PIN_EXISTS(J_MS3)
REPORT_NAME_DIGITAL(__LINE__, J_MS3_PIN)
#endif
#if PIN_EXISTS(J_STEP)
REPORT_NAME_DIGITAL(__LINE__, J_STEP_PIN)
#endif
#if PIN_EXISTS(J_STOP)
REPORT_NAME_DIGITAL(__LINE__, J_STOP_PIN)
#endif
#if PIN_EXISTS(K_ATT)
REPORT_NAME_DIGITAL(__LINE__, K_ATT_PIN)
#endif
#if PIN_EXISTS(K_CS)
REPORT_NAME_DIGITAL(__LINE__, K_CS_PIN)
#endif
#if PIN_EXISTS(K_DIR)
REPORT_NAME_DIGITAL(__LINE__, K_DIR_PIN)
#endif
#if PIN_EXISTS(K_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, K_ENABLE_PIN)
#endif
#if PIN_EXISTS(K_MAX)
REPORT_NAME_DIGITAL(__LINE__, K_MAX_PIN)
#endif
#if PIN_EXISTS(K_MIN)
REPORT_NAME_DIGITAL(__LINE__, K_MIN_PIN)
#endif
#if PIN_EXISTS(K_MS1)
REPORT_NAME_DIGITAL(__LINE__, K_MS1_PIN)
#endif
#if PIN_EXISTS(K_MS2)
REPORT_NAME_DIGITAL(__LINE__, K_MS2_PIN)
#endif
#if PIN_EXISTS(K_MS3)
REPORT_NAME_DIGITAL(__LINE__, K_MS3_PIN)
#endif
#if PIN_EXISTS(K_STEP)
REPORT_NAME_DIGITAL(__LINE__, K_STEP_PIN)
#endif
#if PIN_EXISTS(K_STOP)
REPORT_NAME_DIGITAL(__LINE__, K_STOP_PIN)
#endif
#if PIN_EXISTS(ZRIB_V20_D6)
REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN)
#endif
#if PIN_EXISTS(ZRIB_V20_D9)
REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D9_PIN)
#endif
#if PIN_EXISTS(X_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(X_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, X_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(X2_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(X2_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, X2_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Y_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Y_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Y_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Y2_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Y2_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Y2_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Z_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Z_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Z2_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Z2_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z2_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Z3_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Z3_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Z3_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z3_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Z4_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Z4_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E0_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
#endif
#if PIN_EXISTS(E0_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E0_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E1_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E1_DIAG_PIN)
#endif
#if PIN_EXISTS(E1_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E1_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E2_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E2_DIAG_PIN)
#endif
#if PIN_EXISTS(E2_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E2_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E3_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E3_DIAG_PIN)
#endif
#if PIN_EXISTS(E3_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E3_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E4_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E4_DIAG_PIN)
#endif
#if PIN_EXISTS(E4_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E4_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E5_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E5_DIAG_PIN)
#endif
#if PIN_EXISTS(E5_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E5_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E6_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E6_DIAG_PIN)
#endif
#if PIN_EXISTS(E6_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E6_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E7_DIAG)
REPORT_NAME_DIGITAL(__LINE__, E7_DIAG_PIN)
#endif
#if PIN_EXISTS(E7_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(E7_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(I_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(I_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(J_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(J_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(K_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(K_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(L6470_CHAIN_SCK)
REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SCK_PIN)
#endif
#if PIN_EXISTS(L6470_CHAIN_MISO)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(L6470_CHAIN_MOSI)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(L6470_CHAIN_SS)
REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SS_PIN)
#endif
#if PIN_EXISTS(L6470_RESET_CHAIN)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(FET_SAFETY)
REPORT_NAME_DIGITAL(__LINE__, FET_SAFETY_PIN)
#endif
#if PIN_EXISTS(TOUCH_MISO)
REPORT_NAME_DIGITAL(__LINE__, TOUCH_MISO_PIN)
#endif
#if PIN_EXISTS(TOUCH_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TOUCH_MOSI_PIN)
#endif
#if PIN_EXISTS(TOUCH_SCK)
REPORT_NAME_DIGITAL(__LINE__, TOUCH_SCK_PIN)
#endif
#if PIN_EXISTS(TOUCH_CS)
REPORT_NAME_DIGITAL(__LINE__, TOUCH_CS_PIN)
#endif
#if PIN_EXISTS(TOUCH_INT)
REPORT_NAME_DIGITAL(__LINE__, TOUCH_INT_PIN)
#endif
#if PIN_EXISTS(USB_CS)
REPORT_NAME_DIGITAL(__LINE__, USB_CS_PIN)
#endif
#if PIN_EXISTS(USB_INTR)
REPORT_NAME_DIGITAL(__LINE__, USB_INTR_PIN)
#endif
#if PIN_EXISTS(MMU2_RST)
REPORT_NAME_DIGITAL(__LINE__, MMU2_RST_PIN)
#endif
#if PIN_EXISTS(CALIBRATION)
REPORT_NAME_DIGITAL(__LINE__, CALIBRATION_PIN)
#endif
#if PIN_EXISTS(SMART_EFFECTOR_MOD)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(CLOSED_LOOP_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
#if PIN_EXISTS(<API key>)
REPORT_NAME_DIGITAL(__LINE__, <API key>)
#endif
// TFT PINS
#if PIN_EXISTS(TFT_CS)
REPORT_NAME_DIGITAL(__LINE__, TFT_CS_PIN)
#endif
#if PIN_EXISTS(TFT_A0)
REPORT_NAME_DIGITAL(__LINE__, TFT_A0_PIN)
#endif
#if PIN_EXISTS(TFT_DC)
REPORT_NAME_DIGITAL(__LINE__, TFT_DC_PIN)
#endif
#if PIN_EXISTS(TFT_MISO)
REPORT_NAME_DIGITAL(__LINE__, TFT_MISO_PIN)
#endif
#if PIN_EXISTS(TFT_BACKLIGHT)
REPORT_NAME_DIGITAL(__LINE__, TFT_BACKLIGHT_PIN)
#endif
#if PIN_EXISTS(TFT_RESET)
REPORT_NAME_DIGITAL(__LINE__, TFT_RESET_PIN)
#endif
|
#include "private.h"
#include <ccan/likely/likely.h>
#include <ccan/asearch/asearch.h>
/* We keep an ordered array of offsets. */
static bool append(struct ntdb_context *ntdb,
ntdb_off_t **arr, size_t *num, ntdb_off_t off)
{
ntdb_off_t *new;
if (*num == 0) {
new = ntdb->alloc_fn(ntdb, sizeof(ntdb_off_t), ntdb->alloc_data);
} else {
new = ntdb->expand_fn(*arr, (*num + 1) * sizeof(ntdb_off_t),
ntdb->alloc_data);
}
if (!new)
return false;
new[(*num)++] = off;
*arr = new;
return true;
}
static enum NTDB_ERROR check_header(struct ntdb_context *ntdb,
ntdb_off_t *recovery,
uint64_t *features,
size_t *num_capabilities)
{
uint64_t hash_test;
struct ntdb_header hdr;
enum NTDB_ERROR ecode;
ntdb_off_t off, next;
ecode = ntdb_read_convert(ntdb, 0, &hdr, sizeof(hdr));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
/* magic food should not be converted, so convert back. */
ntdb_convert(ntdb, hdr.magic_food, sizeof(hdr.magic_food));
hash_test = NTDB_HASH_MAGIC;
hash_test = ntdb_hash(ntdb, &hash_test, sizeof(hash_test));
if (hdr.hash_test != hash_test) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"check: hash test %llu should be %llu",
(long long)hdr.hash_test,
(long long)hash_test);
}
if (strcmp(hdr.magic_food, NTDB_MAGIC_FOOD) != 0) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"check: bad magic '%.*s'",
(unsigned)sizeof(hdr.magic_food),
hdr.magic_food);
}
/* Features which are used must be a subset of features offered. */
if (hdr.features_used & ~hdr.features_offered) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"check: features used (0x%llx) which"
" are not offered (0x%llx)",
(long long)hdr.features_used,
(long long)hdr.features_offered);
}
*features = hdr.features_offered;
*recovery = hdr.recovery;
if (*recovery) {
if (*recovery < sizeof(hdr)
|| *recovery > ntdb->file->map_size) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check:"
" invalid recovery offset %zu",
(size_t)*recovery);
}
}
for (off = hdr.capabilities; off && ecode == NTDB_SUCCESS; off = next) {
const struct ntdb_capability *cap;
enum NTDB_ERROR e;
cap = ntdb_access_read(ntdb, off, sizeof(*cap), true);
if (NTDB_PTR_IS_ERR(cap)) {
return NTDB_PTR_ERR(cap);
}
/* All capabilities are unknown. */
e = unknown_capability(ntdb, "ntdb_check", cap->type);
next = cap->next;
ntdb_access_release(ntdb, cap);
if (e)
return e;
(*num_capabilities)++;
}
/* Don't check reserved: they *can* be used later. */
return NTDB_SUCCESS;
}
static int off_cmp(const ntdb_off_t *a, const ntdb_off_t *b)
{
/* Can overflow an int. */
return *a > *b ? 1
: *a < *b ? -1
: 0;
}
static enum NTDB_ERROR check_entry(struct ntdb_context *ntdb,
ntdb_off_t off_and_hash,
ntdb_len_t bucket,
ntdb_off_t used[],
size_t num_used,
size_t *num_found,
enum NTDB_ERROR (*check)(NTDB_DATA,
NTDB_DATA,
void *),
void *data)
{
enum NTDB_ERROR ecode;
const struct ntdb_used_record *r;
const unsigned char *kptr;
ntdb_len_t klen, dlen;
uint32_t hash;
ntdb_off_t off = off_and_hash & NTDB_OFF_MASK;
ntdb_off_t *p;
/* Empty bucket is fine. */
if (!off_and_hash) {
return NTDB_SUCCESS;
}
/* This can't point to a chain, we handled those at toplevel. */
if (off_and_hash & (1ULL << NTDB_OFF_CHAIN_BIT)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Invalid chain bit in offset "
" %llu", (long long)off_and_hash);
}
p = asearch(&off, used, num_used, off_cmp);
if (!p) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Invalid offset"
" %llu in hash", (long long)off);
}
/* Mark it invalid. */
*p ^= 1;
(*num_found)++;
r = ntdb_access_read(ntdb, off, sizeof(*r), true);
if (NTDB_PTR_IS_ERR(r)) {
return NTDB_PTR_ERR(r);
}
klen = rec_key_length(r);
dlen = rec_data_length(r);
ntdb_access_release(ntdb, r);
kptr = ntdb_access_read(ntdb, off + sizeof(*r), klen + dlen, false);
if (NTDB_PTR_IS_ERR(kptr)) {
return NTDB_PTR_ERR(kptr);
}
hash = ntdb_hash(ntdb, kptr, klen);
/* Are we in the right chain? */
if (bits_from(hash, 0, ntdb->hash_bits) != bucket) {
ecode = ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: Bad bucket %u vs %llu",
bits_from(hash, 0, ntdb->hash_bits),
(long long)bucket);
/* Next 8 bits should be the same as top bits of bucket. */
} else if (bits_from(hash, ntdb->hash_bits, <API key>)
!= bits_from(off_and_hash, <API key>,
<API key>)) {
ecode = ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: Bad hash bits %llu vs %llu",
(long long)off_and_hash,
(long long)hash);
} else if (check) {
NTDB_DATA k, d;
k = ntdb_mkdata(kptr, klen);
d = ntdb_mkdata(kptr + klen, dlen);
ecode = check(k, d, data);
} else {
ecode = NTDB_SUCCESS;
}
ntdb_access_release(ntdb, kptr);
return ecode;
}
static enum NTDB_ERROR check_hash_chain(struct ntdb_context *ntdb,
ntdb_off_t off,
ntdb_len_t bucket,
ntdb_off_t used[],
size_t num_used,
size_t *num_found,
enum NTDB_ERROR (*check)(NTDB_DATA,
NTDB_DATA,
void *),
void *data)
{
struct ntdb_used_record rec;
enum NTDB_ERROR ecode;
const ntdb_off_t *entries;
ntdb_len_t i, num;
/* This is a used entry. */
(*num_found)++;
ecode = ntdb_read_convert(ntdb, off, &rec, sizeof(rec));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (rec_magic(&rec) != NTDB_CHAIN_MAGIC) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash chain magic %llu",
(long long)rec_magic(&rec));
}
if (rec_data_length(&rec) % sizeof(ntdb_off_t)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash chain data length %llu",
(long long)rec_data_length(&rec));
}
if (rec_key_length(&rec) != 0) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash chain key length %llu",
(long long)rec_key_length(&rec));
}
off += sizeof(rec);
num = rec_data_length(&rec) / sizeof(ntdb_off_t);
entries = ntdb_access_read(ntdb, off, rec_data_length(&rec), true);
if (NTDB_PTR_IS_ERR(entries)) {
return NTDB_PTR_ERR(entries);
}
/* Check each non-deleted entry in chain. */
for (i = 0; i < num; i++) {
ecode = check_entry(ntdb, entries[i], bucket,
used, num_used, num_found, check, data);
if (ecode) {
break;
}
}
ntdb_access_release(ntdb, entries);
return ecode;
}
static enum NTDB_ERROR check_hash(struct ntdb_context *ntdb,
ntdb_off_t used[],
size_t num_used,
size_t num_other_used,
enum NTDB_ERROR (*check)(NTDB_DATA,
NTDB_DATA,
void *),
void *data)
{
enum NTDB_ERROR ecode;
struct ntdb_used_record rec;
const ntdb_off_t *entries;
ntdb_len_t i;
/* Free tables and capabilities also show up as used, as do we. */
size_t num_found = num_other_used + 1;
ecode = ntdb_read_convert(ntdb, NTDB_HASH_OFFSET, &rec, sizeof(rec));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (rec_magic(&rec) != NTDB_HTABLE_MAGIC) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash table magic %llu",
(long long)rec_magic(&rec));
}
if (rec_data_length(&rec) != (sizeof(ntdb_off_t) << ntdb->hash_bits)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash table data length %llu",
(long long)rec_data_length(&rec));
}
if (rec_key_length(&rec) != 0) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Bad hash table key length %llu",
(long long)rec_key_length(&rec));
}
entries = ntdb_access_read(ntdb, NTDB_HASH_OFFSET + sizeof(rec),
rec_data_length(&rec), true);
if (NTDB_PTR_IS_ERR(entries)) {
return NTDB_PTR_ERR(entries);
}
for (i = 0; i < (1 << ntdb->hash_bits); i++) {
ntdb_off_t off = entries[i] & NTDB_OFF_MASK;
if (entries[i] & (1ULL << NTDB_OFF_CHAIN_BIT)) {
ecode = check_hash_chain(ntdb, off, i,
used, num_used, &num_found,
check, data);
} else {
ecode = check_entry(ntdb, entries[i], i,
used, num_used, &num_found,
check, data);
}
if (ecode) {
break;
}
}
ntdb_access_release(ntdb, entries);
if (ecode == NTDB_SUCCESS && num_found != num_used) {
ecode = ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Not all entries are in hash");
}
return ecode;
}
static enum NTDB_ERROR check_free(struct ntdb_context *ntdb,
ntdb_off_t off,
const struct ntdb_free_record *frec,
ntdb_off_t prev, unsigned int ftable,
unsigned int bucket)
{
enum NTDB_ERROR ecode;
if (frec_magic(frec) != NTDB_FREE_MAGIC) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: offset %llu bad magic 0x%llx",
(long long)off,
(long long)frec->magic_and_prev);
}
if (frec_ftable(frec) != ftable) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: offset %llu bad freetable %u",
(long long)off, frec_ftable(frec));
}
ecode = ntdb_oob(ntdb, off,
frec_len(frec) + sizeof(struct ntdb_used_record),
false);
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (size_to_bucket(frec_len(frec)) != bucket) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: offset %llu in wrong bucket"
" (%u vs %u)",
(long long)off,
bucket, size_to_bucket(frec_len(frec)));
}
if (prev && prev != frec_prev(frec)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: offset %llu bad prev"
" (%llu vs %llu)",
(long long)off,
(long long)prev, (long long)frec_len(frec));
}
return NTDB_SUCCESS;
}
static enum NTDB_ERROR check_free_table(struct ntdb_context *ntdb,
ntdb_off_t ftable_off,
unsigned ftable_num,
ntdb_off_t fr[],
size_t num_free,
size_t *num_found)
{
struct ntdb_freetable ft;
ntdb_off_t h;
unsigned int i;
enum NTDB_ERROR ecode;
ecode = ntdb_read_convert(ntdb, ftable_off, &ft, sizeof(ft));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (rec_magic(&ft.hdr) != NTDB_FTABLE_MAGIC
|| rec_key_length(&ft.hdr) != 0
|| rec_data_length(&ft.hdr) != sizeof(ft) - sizeof(ft.hdr)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Invalid header on free table");
}
for (i = 0; i < NTDB_FREE_BUCKETS; i++) {
ntdb_off_t off, prev = 0, *p, first = 0;
struct ntdb_free_record f;
h = bucket_off(ftable_off, i);
for (off = ntdb_read_off(ntdb, h); off; off = f.next) {
if (NTDB_OFF_IS_ERR(off)) {
return NTDB_OFF_TO_ERR(off);
}
if (!first) {
off &= NTDB_OFF_MASK;
first = off;
}
ecode = ntdb_read_convert(ntdb, off, &f, sizeof(f));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
ecode = check_free(ntdb, off, &f, prev, ftable_num, i);
if (ecode != NTDB_SUCCESS) {
return ecode;
}
/* FIXME: Check hash bits */
p = asearch(&off, fr, num_free, off_cmp);
if (!p) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: Invalid offset"
" %llu in free table",
(long long)off);
}
/* Mark it invalid. */
*p ^= 1;
(*num_found)++;
prev = off;
}
if (first) {
/* Now we can check first back pointer. */
ecode = ntdb_read_convert(ntdb, first, &f, sizeof(f));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
ecode = check_free(ntdb, first, &f, prev, ftable_num, i);
if (ecode != NTDB_SUCCESS) {
return ecode;
}
}
}
return NTDB_SUCCESS;
}
/* Slow, but should be very rare. */
ntdb_off_t dead_space(struct ntdb_context *ntdb, ntdb_off_t off)
{
size_t len;
enum NTDB_ERROR ecode;
for (len = 0; off + len < ntdb->file->map_size; len++) {
char c;
ecode = ntdb->io->tread(ntdb, off, &c, 1);
if (ecode != NTDB_SUCCESS) {
return NTDB_ERR_TO_OFF(ecode);
}
if (c != 0 && c != 0x43)
break;
}
return len;
}
static enum NTDB_ERROR check_linear(struct ntdb_context *ntdb,
ntdb_off_t **used, size_t *num_used,
ntdb_off_t **fr, size_t *num_free,
uint64_t features, ntdb_off_t recovery)
{
ntdb_off_t off;
ntdb_len_t len;
enum NTDB_ERROR ecode;
bool found_recovery = false;
for (off = sizeof(struct ntdb_header);
off < ntdb->file->map_size;
off += len) {
union {
struct ntdb_used_record u;
struct ntdb_free_record f;
struct <API key> r;
} rec;
/* r is larger: only get that if we need to. */
ecode = ntdb_read_convert(ntdb, off, &rec, sizeof(rec.f));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
/* If we crash after ftruncate, we can get zeroes or fill. */
if (rec.r.magic == <API key>
|| rec.r.magic == <API key>) {
ecode = ntdb_read_convert(ntdb, off, &rec, sizeof(rec.r));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (recovery == off) {
found_recovery = true;
len = sizeof(rec.r) + rec.r.max_len;
} else {
len = dead_space(ntdb, off);
if (NTDB_OFF_IS_ERR(len)) {
return NTDB_OFF_TO_ERR(len);
}
if (len < sizeof(rec.r)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: invalid"
" dead space at %zu",
(size_t)off);
}
ntdb_logerr(ntdb, NTDB_SUCCESS, NTDB_LOG_WARNING,
"Dead space at %zu-%zu (of %zu)",
(size_t)off, (size_t)(off + len),
(size_t)ntdb->file->map_size);
}
} else if (rec.r.magic == NTDB_RECOVERY_MAGIC) {
ecode = ntdb_read_convert(ntdb, off, &rec, sizeof(rec.r));
if (ecode != NTDB_SUCCESS) {
return ecode;
}
if (recovery != off) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: unexpected"
" recovery record at offset"
" %zu",
(size_t)off);
}
if (rec.r.len > rec.r.max_len) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: invalid recovery"
" length %zu",
(size_t)rec.r.len);
}
if (rec.r.eof > ntdb->file->map_size) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: invalid old EOF"
" %zu", (size_t)rec.r.eof);
}
found_recovery = true;
len = sizeof(rec.r) + rec.r.max_len;
} else if (frec_magic(&rec.f) == NTDB_FREE_MAGIC) {
len = sizeof(rec.u) + frec_len(&rec.f);
if (off + len > ntdb->file->map_size) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: free overlength"
" %llu at offset %llu",
(long long)len,
(long long)off);
}
/* This record should be in free lists. */
if (frec_ftable(&rec.f) != NTDB_FTABLE_NONE
&& !append(ntdb, fr, num_free, off)) {
return ntdb_logerr(ntdb, NTDB_ERR_OOM,
NTDB_LOG_ERROR,
"ntdb_check: tracking %zu'th"
" free record.", *num_free);
}
} else if (rec_magic(&rec.u) == NTDB_USED_MAGIC
|| rec_magic(&rec.u) == NTDB_CHAIN_MAGIC
|| rec_magic(&rec.u) == NTDB_HTABLE_MAGIC
|| rec_magic(&rec.u) == NTDB_FTABLE_MAGIC
|| rec_magic(&rec.u) == NTDB_CAP_MAGIC) {
uint64_t klen, dlen, extra;
/* This record is used! */
if (!append(ntdb, used, num_used, off)) {
return ntdb_logerr(ntdb, NTDB_ERR_OOM,
NTDB_LOG_ERROR,
"ntdb_check: tracking %zu'th"
" used record.", *num_used);
}
klen = rec_key_length(&rec.u);
dlen = rec_data_length(&rec.u);
extra = rec_extra_padding(&rec.u);
len = sizeof(rec.u) + klen + dlen + extra;
if (off + len > ntdb->file->map_size) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: used overlength"
" %llu at offset %llu",
(long long)len,
(long long)off);
}
if (len < sizeof(rec.f)) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: too short record"
" %llu at %llu",
(long long)len,
(long long)off);
}
/* Check that records have correct 0 at end (but may
* not in future). */
if (extra && !features
&& rec_magic(&rec.u) != NTDB_CAP_MAGIC) {
const char *p;
char c;
p = ntdb_access_read(ntdb, off + sizeof(rec.u)
+ klen + dlen, 1, false);
if (NTDB_PTR_IS_ERR(p))
return NTDB_PTR_ERR(p);
c = *p;
ntdb_access_release(ntdb, p);
if (c != '\0') {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check:"
" non-zero extra"
" at %llu",
(long long)off);
}
}
} else {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT,
NTDB_LOG_ERROR,
"ntdb_check: Bad magic 0x%llx"
" at offset %zu",
(long long)rec_magic(&rec.u),
(size_t)off);
}
}
/* We must have found recovery area if there was one. */
if (recovery != 0 && !found_recovery) {
return ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: expected a recovery area at %zu",
(size_t)recovery);
}
return NTDB_SUCCESS;
}
_PUBLIC_ enum NTDB_ERROR ntdb_check_(struct ntdb_context *ntdb,
enum NTDB_ERROR (*check)(NTDB_DATA, NTDB_DATA, void *),
void *data)
{
ntdb_off_t *fr = NULL, *used = NULL, ft, recovery;
size_t num_free = 0, num_used = 0, num_found = 0, num_ftables = 0,
num_capabilities = 0;
uint64_t features;
enum NTDB_ERROR ecode;
if (ntdb->flags & NTDB_CANT_CHECK) {
return ntdb_logerr(ntdb, NTDB_SUCCESS, NTDB_LOG_WARNING,
"ntdb_check: database has unknown capability,"
" cannot check.");
}
ecode = ntdb_allrecord_lock(ntdb, F_RDLCK, NTDB_LOCK_WAIT, false);
if (ecode != NTDB_SUCCESS) {
return ecode;
}
ecode = ntdb_lock_expand(ntdb, F_RDLCK);
if (ecode != NTDB_SUCCESS) {
<API key>(ntdb, F_RDLCK);
return ecode;
}
ecode = check_header(ntdb, &recovery, &features, &num_capabilities);
if (ecode != NTDB_SUCCESS)
goto out;
/* First we do a linear scan, checking all records. */
ecode = check_linear(ntdb, &used, &num_used, &fr, &num_free, features,
recovery);
if (ecode != NTDB_SUCCESS)
goto out;
for (ft = first_ftable(ntdb); ft; ft = next_ftable(ntdb, ft)) {
if (NTDB_OFF_IS_ERR(ft)) {
ecode = NTDB_OFF_TO_ERR(ft);
goto out;
}
ecode = check_free_table(ntdb, ft, num_ftables, fr, num_free,
&num_found);
if (ecode != NTDB_SUCCESS)
goto out;
num_ftables++;
}
/* FIXME: Check key uniqueness? */
ecode = check_hash(ntdb, used, num_used, num_ftables + num_capabilities,
check, data);
if (ecode != NTDB_SUCCESS)
goto out;
if (num_found != num_free) {
ecode = ntdb_logerr(ntdb, NTDB_ERR_CORRUPT, NTDB_LOG_ERROR,
"ntdb_check: Not all entries are in"
" free table");
}
out:
<API key>(ntdb, F_RDLCK);
ntdb_unlock_expand(ntdb, F_RDLCK);
ntdb->free_fn(fr, ntdb->alloc_data);
ntdb->free_fn(used, ntdb->alloc_data);
return ecode;
}
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#ifndef <API key>
#define <API key>
#include "transport.hpp"
#include <list>
namespace ndn {
template<class BaseTransport, class Protocol>
class StreamTransportImpl
{
public:
typedef StreamTransportImpl<BaseTransport,Protocol> Impl;
typedef std::list<Block> BlockSequence;
typedef std::list<BlockSequence> TransmissionQueue;
StreamTransportImpl(BaseTransport& transport, boost::asio::io_service& ioService)
: m_transport(transport)
, m_socket(ioService)
, m_inputBufferSize(0)
, <API key>(false)
, m_connectTimer(ioService)
{
}
void
connectHandler(const boost::system::error_code& error)
{
<API key> = false;
m_connectTimer.cancel();
if (!error)
{
resume();
m_transport.m_isConnected = true;
if (!m_transmissionQueue.empty()) {
boost::asio::async_write(m_socket, *m_transmissionQueue.begin(),
bind(&Impl::handleAsyncWrite, this, _1,
m_transmissionQueue.begin()));
}
}
else
{
// may need to throw exception
m_transport.m_isConnected = false;
m_transport.close();
throw Transport::Error(error, "error while connecting to the forwarder");
}
}
void
<API key>(const boost::system::error_code& error)
{
if (error) // e.g., cancelled timer
return;
m_transport.close();
throw Transport::Error(error, "error while connecting to the forwarder");
}
void
connect(const typename Protocol::endpoint& endpoint)
{
if (!<API key>) {
<API key> = true;
// Wait at most 4 seconds to connect
@todo Decide whether this number should be configurable
m_connectTimer.expires_from_now(boost::posix_time::seconds(4));
m_connectTimer.async_wait(bind(&Impl::<API key>, this, _1));
m_socket.open();
m_socket.async_connect(endpoint,
bind(&Impl::connectHandler, this, _1));
}
}
void
close()
{
<API key> = false;
boost::system::error_code error; // to silently ignore all errors
m_connectTimer.cancel(error);
m_socket.cancel(error);
m_socket.close(error);
m_transport.m_isConnected = false;
m_transport.m_isExpectingData = false;
m_transmissionQueue.clear();
}
void
pause()
{
if (<API key>)
return;
if (m_transport.m_isExpectingData)
{
m_transport.m_isExpectingData = false;
m_socket.cancel();
}
}
/**
* @warning Must not be called directly or indirectly from within handleAsyncReceive invocation
*/
void
resume()
{
if (<API key>)
return;
if (!m_transport.m_isExpectingData)
{
m_transport.m_isExpectingData = true;
m_inputBufferSize = 0;
m_socket.async_receive(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE), 0,
bind(&Impl::handleAsyncReceive, this, _1, _2));
}
}
void
send(const Block& wire)
{
BlockSequence sequence;
sequence.push_back(wire);
m_transmissionQueue.push_back(sequence);
if (m_transport.m_isConnected && m_transmissionQueue.size() == 1) {
boost::asio::async_write(m_socket, *m_transmissionQueue.begin(),
bind(&Impl::handleAsyncWrite, this, _1,
m_transmissionQueue.begin()));
}
// if not connected or there is transmission in progress (m_transmissionQueue.size() > 1),
// next write will be scheduled either in connectHandler or in asyncWriteHandler
}
void
send(const Block& header, const Block& payload)
{
BlockSequence sequence;
sequence.push_back(header);
sequence.push_back(payload);
m_transmissionQueue.push_back(sequence);
if (m_transport.m_isConnected && m_transmissionQueue.size() == 1) {
boost::asio::async_write(m_socket, *m_transmissionQueue.begin(),
bind(&Impl::handleAsyncWrite, this, _1,
m_transmissionQueue.begin()));
}
// if not connected or there is transmission in progress (m_transmissionQueue.size() > 1),
// next write will be scheduled either in connectHandler or in asyncWriteHandler
}
void
handleAsyncWrite(const boost::system::error_code& error,
TransmissionQueue::iterator queueItem)
{
if (error)
{
if (error == boost::system::errc::operation_canceled) {
// async receive has been explicitly cancelled (e.g., socket close)
return;
}
m_transport.close();
throw Transport::Error(error, "error while sending data to socket");
}
m_transmissionQueue.erase(queueItem);
if (!m_transmissionQueue.empty()) {
boost::asio::async_write(m_socket, *m_transmissionQueue.begin(),
bind(&Impl::handleAsyncWrite, this, _1,
m_transmissionQueue.begin()));
}
}
bool
processAll(uint8_t* buffer, size_t& offset, size_t nBytesAvailable)
{
while (offset < nBytesAvailable) {
bool isOk = false;
Block element;
std::tie(isOk, element) = Block::fromBuffer(buffer + offset, nBytesAvailable - offset);
if (!isOk)
return false;
m_transport.receive(element);
offset += element.size();
}
return true;
}
void
handleAsyncReceive(const boost::system::error_code& error, std::size_t nBytesRecvd)
{
if (error)
{
if (error == boost::system::errc::operation_canceled) {
// async receive has been explicitly cancelled (e.g., socket close)
return;
}
m_transport.close();
throw Transport::Error(error, "error while receiving data from socket");
}
m_inputBufferSize += nBytesRecvd;
// do magic
std::size_t offset = 0;
bool hasProcessedSome = processAll(m_inputBuffer, offset, m_inputBufferSize);
if (!hasProcessedSome && m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0)
{
m_transport.close();
throw Transport::Error(boost::system::error_code(),
"input buffer full, but a valid TLV cannot be decoded");
}
if (offset > 0)
{
if (offset != m_inputBufferSize)
{
std::copy(m_inputBuffer + offset, m_inputBuffer + m_inputBufferSize,
m_inputBuffer);
m_inputBufferSize -= offset;
}
else
{
m_inputBufferSize = 0;
}
}
m_socket.async_receive(boost::asio::buffer(m_inputBuffer + m_inputBufferSize,
MAX_NDN_PACKET_SIZE - m_inputBufferSize), 0,
bind(&Impl::handleAsyncReceive, this, _1, _2));
}
protected:
BaseTransport& m_transport;
typename Protocol::socket m_socket;
uint8_t m_inputBuffer[MAX_NDN_PACKET_SIZE];
size_t m_inputBufferSize;
TransmissionQueue m_transmissionQueue;
bool <API key>;
boost::asio::deadline_timer m_connectTimer;
};
template<class BaseTransport, class Protocol>
class <API key> : public StreamTransportImpl<BaseTransport, Protocol>
{
public:
typedef <API key><BaseTransport,Protocol> Impl;
<API key>(BaseTransport& transport, boost::asio::io_service& ioService)
: StreamTransportImpl<BaseTransport, Protocol>(transport, ioService)
{
}
void
resolveHandler(const boost::system::error_code& error,
typename Protocol::resolver::iterator endpoint,
const shared_ptr<typename Protocol::resolver>&)
{
if (error)
{
if (error == boost::system::errc::operation_canceled)
return;
throw Transport::Error(error, "Error during resolution of host or port");
}
typename Protocol::resolver::iterator end;
if (endpoint == end)
{
this->m_transport.close();
throw Transport::Error(error, "Unable to resolve because host or port");
}
this->m_socket.async_connect(*endpoint,
bind(&Impl::connectHandler, this, _1));
}
void
connect(const typename Protocol::resolver::query& query)
{
if (!this-><API key>) {
this-><API key> = true;
// Wait at most 4 seconds to connect
@todo Decide whether this number should be configurable
this->m_connectTimer.expires_from_now(boost::posix_time::seconds(4));
this->m_connectTimer.async_wait(bind(&Impl::<API key>, this, _1));
// typename boost::asio::ip::basic_resolver< Protocol > resolver;
shared_ptr<typename Protocol::resolver> resolver =
make_shared<typename Protocol::resolver>(ref(this->m_socket.get_io_service()));
resolver->async_resolve(query, bind(&Impl::resolveHandler, this, _1, _2, resolver));
}
}
};
} // namespace ndn
#endif // <API key>
|
/*# sourceMappingURL=kendo.dataviz.flat.min.css.map */
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<TITLE>
Uses of Package org.apache.poi.poifs.property (POI API Documentation)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.apache.poi.poifs.property (POI API Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/poi/poifs/property/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
<B>Uses of Package<br>org.apache.poi.poifs.property</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.poi.poifs.dev"><B>org.apache.poi.poifs.dev</B></A></TD>
<TD>DEV package serves two purposes. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.poi.poifs.filesystem"><B>org.apache.poi.poifs.filesystem</B></A></TD>
<TD>filesystem package maps OLE 2 Compound document files to a more familiar filesystem interface. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.poi.poifs.property"><B>org.apache.poi.poifs.property</B></A></TD>
<TD>property package contains high and low level Property structures for POIFS. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.poi.poifs.storage"><B>org.apache.poi.poifs.storage</B></A></TD>
<TD>storage package contains low level binary structures for POIFS's implementation of the OLE 2
Compound Document Format. </TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.poi.poifs.dev"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A> used by <A HREF="../../../../../org/apache/poi/poifs/dev/package-summary.html">org.apache.poi.poifs.dev</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/DirectoryProperty.html#org.apache.poi.poifs.dev"><B>DirectoryProperty</B></A></B>
<BR>
Directory property</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/PropertyTable.html#org.apache.poi.poifs.dev"><B>PropertyTable</B></A></B>
<BR>
This class embodies the Property Table for the <A HREF="../../../../../org/apache/poi/poifs/filesystem/POIFSFileSystem.html" title="class in org.apache.poi.poifs.filesystem"><CODE>POIFSFileSystem</CODE></A>;
this is basically the directory for all of the documents in the
filesystem.</TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.poi.poifs.filesystem"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A> used by <A HREF="../../../../../org/apache/poi/poifs/filesystem/package-summary.html">org.apache.poi.poifs.filesystem</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/DocumentProperty.html#org.apache.poi.poifs.filesystem"><B>DocumentProperty</B></A></B>
<BR>
Trivial extension of Property for POIFSDocuments</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/NPropertyTable.html#org.apache.poi.poifs.filesystem"><B>NPropertyTable</B></A></B>
<BR>
This class embodies the Property Table for a <A HREF="../../../../../org/apache/poi/poifs/filesystem/NPOIFSFileSystem.html" title="class in org.apache.poi.poifs.filesystem"><CODE>NPOIFSFileSystem</CODE></A>;
this is basically the directory for all of the documents in the
filesystem.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/Property.html#org.apache.poi.poifs.filesystem"><B>Property</B></A></B>
<BR>
This abstract base class is the ancestor of all classes
implementing POIFS Property behavior.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/RootProperty.html#org.apache.poi.poifs.filesystem"><B>RootProperty</B></A></B>
<BR>
Root property</TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.poi.poifs.property"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A> used by <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/Child.html#org.apache.poi.poifs.property"><B>Child</B></A></B>
<BR>
This interface defines methods for finding and setting sibling
Property instances</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/DirectoryProperty.html#org.apache.poi.poifs.property"><B>DirectoryProperty</B></A></B>
<BR>
Directory property</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/Parent.html#org.apache.poi.poifs.property"><B>Parent</B></A></B>
<BR>
Behavior for parent (directory) properties</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/Property.html#org.apache.poi.poifs.property"><B>Property</B></A></B>
<BR>
This abstract base class is the ancestor of all classes
implementing POIFS Property behavior.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/PropertyTableBase.html#org.apache.poi.poifs.property"><B>PropertyTableBase</B></A></B>
<BR>
This class embodies the Property Table for the filesystem,
which looks up entries in the filesystem to their
chain of blocks.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/RootProperty.html#org.apache.poi.poifs.property"><B>RootProperty</B></A></B>
<BR>
Root property</TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.poi.poifs.storage"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Classes in <A HREF="../../../../../org/apache/poi/poifs/property/package-summary.html">org.apache.poi.poifs.property</A> used by <A HREF="../../../../../org/apache/poi/poifs/storage/package-summary.html">org.apache.poi.poifs.storage</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/Property.html#org.apache.poi.poifs.storage"><B>Property</B></A></B>
<BR>
This abstract base class is the ancestor of all classes
implementing POIFS Property behavior.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><B><A HREF="../../../../../org/apache/poi/poifs/property/class-use/RootProperty.html#org.apache.poi.poifs.storage"><B>RootProperty</B></A></B>
<BR>
Root property</TD>
</TR>
</TABLE>
<P>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/poi/poifs/property/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
<i>Copyright 2017 The Apache Software Foundation or
its licensors, as applicable.</i>
</BODY>
</HTML>
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_34) on Thu Jan 07 14:13:57 GMT 2016 -->
<TITLE>
IFGraphicContext (Apache FOP 2.1 API)
</TITLE>
<META NAME="date" CONTENT="2016-01-07">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IFGraphicContext (Apache FOP 2.1 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IFGraphicContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 2.1</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/fop/render/intermediate/IFException.html" title="class in org.apache.fop.render.intermediate"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/fop/render/intermediate/IFGraphicContext.html" target="_top"><B>FRAMES</B></A>
<A HREF="IFGraphicContext.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#<API key>">NESTED</A> | <A HREF="#<API key>.apache.xmlgraphics.java2d.GraphicContext">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
org.apache.fop.render.intermediate</FONT>
<BR>
Class IFGraphicContext</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">org.apache.xmlgraphics.java2d.GraphicContext
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.fop.render.intermediate.IFGraphicContext</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>IFGraphicContext</B><DT>extends org.apache.xmlgraphics.java2d.GraphicContext</DL>
</PRE>
<P>
Specialized graphic context class for the intermediate format renderer.
<P>
<P>
<HR>
<P>
<A NAME="<API key>"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A></B></CODE>
<BR>
a group</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Viewport.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Viewport</A></B></CODE>
<BR>
a viewport</TD>
</TR>
</TABLE>
<A NAME="field_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="<API key>.apache.xmlgraphics.java2d.GraphicContext"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Fields inherited from class org.apache.xmlgraphics.java2d.GraphicContext</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>background, clip, composite, defaultTransform, font, foreground, hints, paint, stroke, transform, transformStack, transformStackValid</CODE></TD>
</TR>
</TABLE>
<A NAME="constructor_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#IFGraphicContext()">IFGraphicContext</A></B>()</CODE>
<BR>
Default constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#IFGraphicContext(org.apache.fop.render.intermediate.IFGraphicContext)">IFGraphicContext</A></B>(<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext</A> graphicContext)</CODE>
<BR>
Copy constructor.</TD>
</TR>
</TABLE>
<A NAME="method_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#clone()">clone</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#dropGroups()">dropGroups</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#getGroups()">getGroups</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#getGroupStackSize()">getGroupStackSize</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html#pushGroup(org.apache.fop.render.intermediate.IFGraphicContext.Group)">pushGroup</A></B>(<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A> group)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="<API key>.apache.xmlgraphics.java2d.GraphicContext"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from class org.apache.xmlgraphics.java2d.GraphicContext</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>addRenderingHints, clip, clipRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, <API key>, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, getTransformStack, <API key>, <API key>, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setRenderingHint, setRenderingHints, setStroke, setTransform, shear, transform, translate, translate, <API key></CODE></TD>
</TR>
</TABLE>
<A NAME="<API key>.lang.Object"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<A NAME="constructor_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="IFGraphicContext()"></A><H3>
IFGraphicContext</H3>
<PRE>
public <B>IFGraphicContext</B>()</PRE>
<DL>
<DD>Default constructor.
<P>
</DL>
<HR>
<A NAME="IFGraphicContext(org.apache.fop.render.intermediate.IFGraphicContext)"></A><H3>
IFGraphicContext</H3>
<PRE>
protected <B>IFGraphicContext</B>(<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext</A> graphicContext)</PRE>
<DL>
<DD>Copy constructor.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>graphicContext</CODE> - the graphic context to make a copy of</DL>
</DL>
<A NAME="method_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="clone()"></A><H3>
clone</H3>
<PRE>
public java.lang.Object <B>clone</B>()</PRE>
<DL>
<DD>
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>clone</CODE> in class <CODE>org.apache.xmlgraphics.java2d.GraphicContext</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="pushGroup(org.apache.fop.render.intermediate.IFGraphicContext.Group)"></A><H3>
pushGroup</H3>
<PRE>
public void <B>pushGroup</B>(<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A> group)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>group</CODE> - a group</DL>
</DD>
</DL>
<HR>
<A NAME="getGroups()"></A><H3>
getGroups</H3>
<PRE>
public <A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A>[] <B>getGroups</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>array of groups</DL>
</DD>
</DL>
<HR>
<A NAME="dropGroups()"></A><H3>
dropGroups</H3>
<PRE>
public <A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate">IFGraphicContext.Group</A>[] <B>dropGroups</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>array of groups after clearing group list</DL>
</DD>
</DL>
<HR>
<A NAME="getGroupStackSize()"></A><H3>
getGroupStackSize</H3>
<PRE>
public int <B>getGroupStackSize</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>size of group list</DL>
</DD>
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IFGraphicContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 2.1</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/fop/render/intermediate/IFException.html" title="class in org.apache.fop.render.intermediate"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/fop/render/intermediate/IFGraphicContext.Group.html" title="class in org.apache.fop.render.intermediate"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/fop/render/intermediate/IFGraphicContext.html" target="_top"><B>FRAMES</B></A>
<A HREF="IFGraphicContext.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#<API key>">NESTED</A> | <A HREF="#<API key>.apache.xmlgraphics.java2d.GraphicContext">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
|
#ifndef IsotropyModel_H
#define IsotropyModel_H
#include "IOdictionary.H"
#include "autoPtr.H"
#include "<API key>.H"
#include "CloudSubModelBase.H"
namespace Foam
{
// Forward declaration of classes
class TimeScaleModel;
template<class CloudType>
class IsotropyModel
:
public CloudSubModelBase<CloudType>
{
protected:
//- Time scale model
autoPtr<TimeScaleModel> timeScaleModel_;
public:
//- Runtime type information
TypeName("isotropyModel");
//- Declare runtime constructor selection table
<API key>
(
autoPtr,
IsotropyModel,
dictionary,
(
const dictionary& dict,
CloudType& owner
),
(dict, owner)
);
// Constructors
//- Construct null from owner
IsotropyModel(CloudType& owner);
//- Construct from components
IsotropyModel
(
const dictionary& dict,
CloudType& owner,
const word& type
);
//- Construct a copy
IsotropyModel(const IsotropyModel<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<IsotropyModel<CloudType>> clone() const = 0;
//- Destructor
virtual ~IsotropyModel();
//- Selector
static autoPtr<IsotropyModel<CloudType>> New
(
const dictionary& dict,
CloudType& owner
);
//- Member Functions
//- Calculate velocities
virtual void calculate() = 0;
};
} // End namespace Foam
#define makeIsotropyModel(CloudType) \
\
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
<API key> \
( \
Foam::IsotropyModel<MPPICCloudType>, \
0 \
); \
\
namespace Foam \
{ \
<API key> \
( \
IsotropyModel<MPPICCloudType>, \
dictionary \
); \
}
#define <API key>(SS, CloudType) \
\
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
<API key> \
(Foam::IsotropyModels::SS<MPPICCloudType>, 0); \
\
Foam::IsotropyModel<MPPICCloudType>:: \
<API key> \
<Foam::IsotropyModels::SS<MPPICCloudType>> \
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
#ifdef NoRepository
#include "IsotropyModel.C"
#endif
#endif
|
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by lib/unicore/mktables from the Unicode
# database, Version 9.0.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice. Don't
# use it directly. Use Unicode::UCD to access the Unicode character data
# base.
return <<'END';
V226
64337
64338
64339
64340
64343
64344
64347
64348
64351
64352
64355
64356
64359
64360
64363
64364
64367
64368
64371
64372
64375
64376
64379
64380
64383
64384
64387
64388
64389
64390
64391
64392
64393
64394
64395
64396
64397
64398
64399
64400
64403
64404
64407
64408
64411
64412
64415
64416
64417
64418
64421
64422
64423
64424
64427
64428
64431
64432
64433
64434
64468
64469
64472
64473
64474
64475
64476
64477
64479
64480
64481
64482
64483
64484
64485
64486
64491
64492
64493
64494
64495
64496
64497
64498
64499
64500
64501
64502
64503
64504
64506
64507
64509
64510
64612
64663
64785
64813
64828
64829
64849
64850
64856
64857
64858
64860
64862
64864
64866
64867
64868
64869
64870
64872
64873
64875
64876
64877
64878
64880
64881
64882
64884
64887
64888
64893
64894
64899
64900
64902
64903
64904
64907
64908
64918
64920
64921
64925
64926
64948
64950
64952
64953
64954
64955
64963
64966
64968
65154
65155
65156
65157
65158
65159
65160
65161
65162
65163
65166
65167
65168
65169
65172
65173
65174
65175
65178
65179
65182
65183
65186
65187
65190
65191
65194
65195
65196
65197
65198
65199
65200
65201
65202
65203
65206
65207
65210
65211
65214
65215
65218
65219
65222
65223
65226
65227
65230
65231
65234
65235
65238
65239
65242
65243
65246
65247
65250
65251
65254
65255
65258
65259
65262
65263
65264
65265
65266
65267
65270
65271
65272
65273
65274
65275
65276
65277
END
|
#ifndef __GDIPLUS_ENUMS_H
#define __GDIPLUS_ENUMS_H
#pragma GCC system_header
#include <_mingw.h>
/*
* GDI+ enumerations
*/
typedef enum BrushType {
BrushTypeSolidColor = 0,
BrushTypeHatchFill = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4
} BrushType;
typedef enum CombineMode {
CombineModeReplace = 0,
<API key> = 1,
CombineModeUnion = 2,
CombineModeXor = 3,
CombineModeExclude = 4,
<API key> = 5
} CombineMode;
typedef enum CompositingMode {
<API key> = 0,
<API key> = 1
} CompositingMode;
typedef enum CompositingQuality {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4
} CompositingQuality;
typedef enum CoordinateSpace {
<API key> = 0,
CoordinateSpacePage = 1,
<API key> = 2
} CoordinateSpace;
typedef enum CustomLineCapType {
<API key> = 0,
<API key> = 1
} CustomLineCapType;
typedef enum DashCap {
DashCapFlat = 0,
DashCapRound = 2,
DashCapTriangle = 3
} DashCap;
typedef enum DashStyle {
DashStyleSolid = 0,
DashStyleDash = 1,
DashStyleDot = 2,
DashStyleDashDot = 3,
DashStyleDashDotDot = 4,
DashStyleCustom = 5
} DashStyle;
typedef enum DitherType {
DitherTypeNone = 0,
DitherTypeSolid = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
DitherTypeSpiral4x4 = 6,
DitherTypeSpiral8x8 = 7,
<API key> = 8,
<API key> = 9,
<API key> = 10
} DitherType;
typedef enum DriverStringOptions {
<API key> = 1,
<API key> = 2,
<API key> = 4,
<API key> = 8
} DriverStringOptions;
#define <API key>(meta) ((meta) | 0x10000)
#define <API key> (0x4000)
typedef enum EmfPlusRecordType {
<API key> = <API key>(META_SETBKCOLOR),
<API key> = <API key>(META_SETBKMODE),
<API key> = <API key>(META_SETMAPMODE),
<API key> = <API key>(META_SETROP2),
<API key> = <API key>(META_SETRELABS),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
<API key> = <API key>(META_SETTEXTCOLOR),
<API key> = <API key>(<API key>),
<API key> = <API key>(META_SETWINDOWORG),
<API key> = <API key>(META_SETWINDOWEXT),
<API key> = <API key>(META_SETVIEWPORTORG),
<API key> = <API key>(META_SETVIEWPORTEXT),
<API key> = <API key>(<API key>),
<API key> = <API key>(META_SCALEWINDOWEXT),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
WmfRecordTypeLineTo = <API key>(META_LINETO),
WmfRecordTypeMoveTo = <API key>(META_MOVETO),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
WmfRecordTypeArc = <API key>(META_ARC),
<API key> = <API key>(META_ELLIPSE),
<API key> = <API key>(META_FLOODFILL),
WmfRecordTypePie = <API key>(META_PIE),
<API key> = <API key>(META_RECTANGLE),
<API key> = <API key>(META_ROUNDRECT),
WmfRecordTypePatBlt = <API key>(META_PATBLT),
WmfRecordTypeSaveDC = <API key>(META_SAVEDC),
<API key> = <API key>(META_SETPIXEL),
<API key> = <API key>(META_OFFSETCLIPRGN),
<API key> = <API key>(META_TEXTOUT),
WmfRecordTypeBitBlt = <API key>(META_BITBLT),
<API key> = <API key>(META_STRETCHBLT),
<API key> = <API key>(META_POLYGON),
<API key> = <API key>(META_POLYLINE),
WmfRecordTypeEscape = <API key>(META_ESCAPE),
<API key> = <API key>(META_RESTOREDC),
<API key> = <API key>(META_FILLREGION),
<API key> = <API key>(META_FRAMEREGION),
<API key> = <API key>(META_INVERTREGION),
<API key> = <API key>(META_PAINTREGION),
<API key> = <API key>(<API key>),
<API key> = <API key>(META_SELECTOBJECT),
<API key> = <API key>(META_SETTEXTALIGN),
<API key> = <API key>(0x062F),
WmfRecordTypeChord = <API key>(META_CHORD),
<API key> = <API key>(META_SETMAPPERFLAGS),
<API key> = <API key>(META_EXTTEXTOUT),
<API key> = <API key>(META_SETDIBTODEV),
<API key> = <API key>(META_SELECTPALETTE),
<API key> = <API key>(META_REALIZEPALETTE),
<API key> = <API key>(META_ANIMATEPALETTE),
<API key> = <API key>(META_SETPALENTRIES),
<API key> = <API key>(META_POLYPOLYGON),
<API key> = <API key>(META_RESIZEPALETTE),
<API key> = <API key>(META_DIBBITBLT),
<API key> = <API key>(META_DIBSTRETCHBLT),
<API key> = <API key>(<API key>),
<API key> = <API key>(META_STRETCHDIB),
<API key> = <API key>(META_EXTFLOODFILL),
<API key> = <API key>(0x0149),
<API key> = <API key>(0x014C),
<API key> = <API key>(0x014D),
<API key> = <API key>(0x004F),
<API key> = <API key>(0x0050),
<API key> = <API key>(0x0052),
WmfRecordTypeEndDoc = <API key>(0x005E),
<API key> = <API key>(META_DELETEOBJECT),
<API key> = <API key>(META_CREATEPALETTE),
<API key> = <API key>(0x00F8),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
<API key> = <API key>(<API key>),
<API key> = <API key>(0x02FD),
<API key> = <API key>(0x06FE),
<API key> = <API key>(META_CREATEREGION),
EmfRecordTypeHeader = EMR_HEADER,
<API key> = EMR_POLYBEZIER,
<API key> = EMR_POLYGON,
<API key> = EMR_POLYLINE,
<API key> = EMR_POLYBEZIERTO,
<API key> = EMR_POLYLINETO,
<API key> = EMR_POLYPOLYLINE,
<API key> = EMR_POLYPOLYGON,
<API key> = EMR_SETWINDOWEXTEX,
<API key> = EMR_SETWINDOWORGEX,
<API key> = <API key>,
<API key> = <API key>,
<API key> = EMR_SETBRUSHORGEX,
EmfRecordTypeEOF = EMR_EOF,
<API key> = EMR_SETPIXELV,
<API key> = EMR_SETMAPPERFLAGS,
<API key> = EMR_SETMAPMODE,
<API key> = EMR_SETBKMODE,
<API key> = EMR_SETPOLYFILLMODE,
<API key> = EMR_SETROP2,
<API key> = <API key>,
<API key> = EMR_SETTEXTALIGN,
<API key> = <API key>,
<API key> = EMR_SETTEXTCOLOR,
<API key> = EMR_SETBKCOLOR,
<API key> = EMR_OFFSETCLIPRGN,
<API key> = EMR_MOVETOEX,
<API key> = EMR_SETMETARGN,
<API key> = EMR_EXCLUDECLIPRECT,
<API key> = <API key>,
<API key> = <API key>,
<API key> = <API key>,
EmfRecordTypeSaveDC = EMR_SAVEDC,
<API key> = EMR_RESTOREDC,
<API key> = <API key>,
<API key> = <API key>,
<API key> = EMR_SELECTOBJECT,
<API key> = EMR_CREATEPEN,
<API key> = <API key>,
<API key> = EMR_DELETEOBJECT,
<API key> = EMR_ANGLEARC,
<API key> = EMR_ELLIPSE,
<API key> = EMR_RECTANGLE,
<API key> = EMR_ROUNDRECT,
EmfRecordTypeArc = EMR_ARC,
EmfRecordTypeChord = EMR_CHORD,
EmfRecordTypePie = EMR_PIE,
<API key> = EMR_SELECTPALETTE,
<API key> = EMR_CREATEPALETTE,
<API key> = <API key>,
<API key> = EMR_RESIZEPALETTE,
<API key> = EMR_REALIZEPALETTE,
<API key> = EMR_EXTFLOODFILL,
EmfRecordTypeLineTo = EMR_LINETO,
EmfRecordTypeArcTo = EMR_ARCTO,
<API key> = EMR_POLYDRAW,
<API key> = EMR_SETARCDIRECTION,
<API key> = EMR_SETMITERLIMIT,
<API key> = EMR_BEGINPATH,
<API key> = EMR_ENDPATH,
<API key> = EMR_CLOSEFIGURE,
<API key> = EMR_FILLPATH,
<API key> = <API key>,
<API key> = EMR_STROKEPATH,
<API key> = EMR_FLATTENPATH,
<API key> = EMR_WIDENPATH,
<API key> = EMR_SELECTCLIPPATH,
<API key> = EMR_ABORTPATH,
<API key> = 69,
<API key> = EMR_GDICOMMENT,
<API key> = EMR_FILLRGN,
<API key> = EMR_FRAMERGN,
<API key> = EMR_INVERTRGN,
<API key> = EMR_PAINTRGN,
<API key> = <API key>,
EmfRecordTypeBitBlt = EMR_BITBLT,
<API key> = EMR_STRETCHBLT,
<API key> = EMR_MASKBLT,
EmfRecordTypePlgBlt = EMR_PLGBLT,
<API key> = <API key>,
<API key> = EMR_STRETCHDIBITS,
<API key> = <API key>,
<API key> = EMR_EXTTEXTOUTA,
<API key> = EMR_EXTTEXTOUTW,
<API key> = EMR_POLYBEZIER16,
<API key> = EMR_POLYGON16,
<API key> = EMR_POLYLINE16,
<API key> = EMR_POLYBEZIERTO16,
<API key> = EMR_POLYLINETO16,
<API key> = EMR_POLYPOLYLINE16,
<API key> = EMR_POLYPOLYGON16,
<API key> = EMR_POLYDRAW16,
<API key> = EMR_CREATEMONOBRUSH,
<API key> = <API key>,
<API key> = EMR_EXTCREATEPEN,
<API key> = EMR_POLYTEXTOUTA,
<API key> = EMR_POLYTEXTOUTW,
<API key> = 98,
<API key> = 99,
<API key> = 100,
<API key> = 101,
<API key> = 102,
<API key> = 103,
<API key> = 104,
<API key> = 105,
<API key> = 106,
<API key> = 107,
<API key> = 108,
<API key> = 109,
<API key> = 110,
<API key> = 111,
<API key> = 112,
<API key> = 113,
<API key> = 114,
<API key> = 115,
<API key> = 116,
<API key> = 117,
<API key> = 118,
<API key> = 119,
<API key> = 120,
<API key> = 121,
<API key> = 122,
EmfRecordTypeMax = 122,
EmfRecordTypeMin = 1,
<API key> = <API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
EmfPlusRecordTotal,
<API key> = <API key>,
<API key> = <API key>
} EmfPlusRecordType;
typedef enum EmfToWmfBitsFlags {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 4
} EmfToWmfBitsFlags;
typedef enum EmfType {
EmfTypeEmfOnly = 3,
EmfTypeEmfPlusOnly = 4,
EmfTypeEmfPlusDual = 5
} EmfType;
typedef enum <API key> {
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
<API key> = 7,
<API key> = 8,
<API key> = 9
} <API key>;
typedef enum EncoderValue {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
<API key> = 7,
<API key> = 8,
<API key> = 9,
<API key> = 10,
<API key> = 11,
<API key> = 12,
<API key> = 13,
<API key> = 14,
<API key> = 15,
<API key> = 16,
<API key> = 17,
<API key> = 18,
<API key> = 19,
EncoderValueFlush = 20,
<API key> = 21,
<API key> = 22,
<API key> = 23
} EncoderValue;
typedef enum FillMode {
FillModeAlternate = 0,
FillModeWinding = 1
} FillMode;
typedef enum FlushIntention {
FlushIntentionFlush = 0,
FlushIntentionSync = 1
} FlushIntention;
typedef enum FontStyle {
FontStyleRegular = 0,
FontStyleBold = 1,
FontStyleItalic = 2,
FontStyleBoldItalic = 3,
FontStyleUnderline = 4,
FontStyleStrikeout = 8
} FontStyle;
typedef enum HatchStyle {
<API key> = 0,
HatchStyleVertical = 1,
<API key> = 2,
<API key> = 3,
HatchStyleCross = 4,
HatchStyleLargeGrid = 4,
<API key> = 5,
HatchStyle05Percent = 6,
HatchStyle10Percent = 7,
HatchStyle20Percent = 8,
HatchStyle25Percent = 9,
HatchStyle30Percent = 10,
HatchStyle40Percent = 11,
HatchStyle50Percent = 12,
HatchStyle60Percent = 13,
HatchStyle70Percent = 14,
HatchStyle75Percent = 15,
HatchStyle80Percent = 16,
HatchStyle90Percent = 17,
<API key> = 18,
<API key> = 19,
<API key> = 20,
<API key> = 21,
<API key> = 22,
<API key> = 23,
<API key> = 24,
<API key> = 25,
<API key> = 26,
<API key> = 27,
<API key> = 28,
<API key> = 29,
<API key> = 30,
<API key> = 31,
<API key> = 32,
<API key> = 33,
<API key> = 34,
<API key> = 35,
HatchStyleZigZag = 36,
HatchStyleWave = 37,
<API key> = 38,
<API key> = 39,
HatchStyleWeave = 40,
HatchStylePlaid = 41,
HatchStyleDivot = 42,
<API key> = 43,
<API key> = 44,
HatchStyleShingle = 45,
HatchStyleTrellis = 46,
HatchStyleSphere = 47,
HatchStyleSmallGrid = 48,
<API key> = 49,
<API key> = 50,
<API key> = 51,
<API key> = 52,
HatchStyleTotal = 53,
HatchStyleMin = <API key>,
HatchStyleMax = HatchStyleTotal - 1
} HatchStyle;
typedef enum HotkeyPrefix {
HotkeyPrefixNone = 0,
HotkeyPrefixShow = 1,
HotkeyPrefixHide = 2
} HotkeyPrefix;
typedef enum ImageType {
ImageTypeUnknown = 0,
ImageTypeBitmap = 1,
ImageTypeMetafile = 2
} ImageType;
/* TODO: InterpolationMode */
typedef enum InterpolationMode {
/*<API key> = QualityModeInvalid,*/
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
<API key> = 7
} InterpolationMode;
typedef enum LinearGradientMode {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3
} LinearGradientMode;
typedef enum LineCap {
LineCapFlat = 0,
LineCapSquare = 1,
LineCapRound = 2,
LineCapTriangle = 3,
LineCapNoAnchor = 16,
LineCapSquareAnchor = 17,
LineCapRoundAnchor = 18,
<API key> = 19,
LineCapArrowAnchor = 20,
LineCapCustom = 255
} LineCap;
typedef enum LineJoin {
LineJoinMiter = 0,
LineJoinBevel = 1,
LineJoinRound = 2,
<API key> = 3
} LineJoin;
typedef enum MatrixOrder {
MatrixOrderPrepend = 0,
MatrixOrderAppend = 1
} MatrixOrder;
typedef enum MetafileFrameUnit {
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
<API key> = 7
} MetafileFrameUnit;
typedef enum MetafileType {
MetafileTypeInvalid = 0,
MetafileTypeWmf = 1,
<API key> = 2,
MetafileTypeEmf = 3,
<API key> = 4,
<API key> = 5
} MetafileType;
typedef enum ObjectType {
ObjectTypeInvalid = 0,
ObjectTypeBrush = 1,
ObjectTypePen = 2,
ObjectTypePath = 3,
ObjectTypeRegion = 4,
ObjectTypeFont = 5,
<API key> = 6,
<API key> = 7,
<API key> = 8,
ObjectTypeGraphics = 9,
ObjectTypeMin = ObjectTypeBrush,
ObjectTypeMax = ObjectTypeGraphics
} ObjectType;
typedef enum PathPointType {
PathPointTypeStart = 0x00,
PathPointTypeLine = 0x01,
PathPointTypeBezier = 0x03,
<API key> = 0x03,
<API key> = 0x07,
<API key> = 0x10,
<API key> = 0x20,
<API key> = 0x80
} PathPointType;
typedef enum PenAlignment {
PenAlignmentCenter = 0,
PenAlignmentInset = 1
} PenAlignment;
typedef enum PenType {
PenTypeUnknown = -1,
PenTypeSolidColor = 0,
PenTypeHatchFill = 1,
PenTypeTextureFill = 2,
PenTypePathGradient = 3,
<API key> = 4
} PenType;
/* TODO: PixelOffsetMode */
typedef enum PixelOffsetMode {
/*<API key> = QualityModeInvalid,*/
<API key> = 0,
<API key> = 1,
<API key> = 2,
PixelOffsetModeNone = 3,
PixelOffsetModeHalf = 4
} PixelOffsetMode;
/* TODO: QualityMode */
typedef enum QualityMode {
/*QualityModeInvalid = ?,*/
QualityModeDefault = 0,
QualityModeLow = 1,
QualityModeHigh = 2
} QualityMode;
/* TODO: SmoothingMode */
typedef enum SmoothingMode {
/*<API key> = QualityModeInvalid,*/
<API key> = 0,
<API key> = 1,
<API key> = 2,
SmoothingModeNone = 3,
<API key> = 4,
<API key> = 4,
<API key> = 5
} SmoothingMode;
typedef enum StringAlignment {
StringAlignmentNear = 0,
<API key> = 1,
StringAlignmentFar = 2
} StringAlignment;
typedef enum <API key> {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3
} <API key>;
typedef enum StringFormatFlags {
<API key> = 0x00000001,
<API key> = 0x00000002,
<API key> = 0x00000004,
<API key> = 0x00000020,
<API key> = 0x00000400,
<API key> = 0x00000800,
<API key> = 0x00001000,
<API key> = 0x00002000,
<API key> = 0x00004000
} StringFormatFlags;
typedef enum StringTrimming {
StringTrimmingNone = 0,
<API key> = 1,
StringTrimmingWord = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5
} StringTrimming;
typedef enum TextRenderingHint {
<API key> = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5
} TextRenderingHint;
typedef enum Unit {
UnitWorld = 0,
UnitDisplay = 1,
UnitPixel = 2,
UnitPoint = 3,
UnitInch = 4,
UnitDocument = 5,
UnitMillimeter = 6
} Unit;
typedef enum WarpMode {
WarpModePerspective = 0,
WarpModeBilinear = 1
} WarpMode;
typedef enum WrapMode {
WrapModeTile = 0,
WrapModeTileFlipX = 1,
WrapModeTileFlipY = 2,
WrapModeTileFlipXY = 3,
WrapModeClamp = 4
} WrapMode;
typedef enum GpTestControlEnum {
<API key> = 0,
<API key> = 1,
<API key> = 2
} GpTestControlEnum;
/* Opaque handles to information blocks on an internal GDI+ stack. */
typedef DWORD GraphicsContainer;
typedef DWORD GraphicsState;
/* Default flatness for GraphicsPath methods Flatten, Outline, Warp, Widen */
/* FIXME: Is FlatnessDefault = 0.25f correct? */
#ifdef __cplusplus
const REAL FlatnessDefault = 0.25f;
#else
#define FlatnessDefault ((REAL) 0.25f)
#endif
static __inline__ BOOL ObjectTypeIsValid(ObjectType type)
{
switch (type) {
case ObjectTypeBrush:
case ObjectTypePen:
case ObjectTypePath:
case ObjectTypeRegion:
case ObjectTypeFont:
case <API key>:
case <API key>:
case <API key>:
case ObjectTypeGraphics:
return TRUE;
default:
return FALSE;
}
}
#endif /* __GDIPLUS_ENUMS_H */
|
--TEST
IntlCalendar::setTime(): bad arguments
--INI
date.timezone=Atlantic/Azores
--SKIPIF
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE
<?php
ini_set("intl.error_level", E_WARNING);
$c = new <API key>(NULL, 'pt_PT');
var_dump($c->setTime(1, 2));
var_dump($c->setTime("jjj"));
var_dump(intlcal_set_time($c, 1, 2));
var_dump(intlcal_set_time(1));
--EXPECTF
Warning: IntlCalendar::setTime() expects exactly 1 parameter, 2 given in %s on line %d
Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d
bool(false)
Warning: IntlCalendar::setTime() expects parameter 1 to be double, string given in %s on line %d
Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d
bool(false)
Warning: intlcal_set_time() expects exactly 2 parameters, 3 given in %s on line %d
Warning: intlcal_set_time(): intlcal_set_time: bad arguments in %s on line %d
bool(false)
Catchable fatal error: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, integer given in %s on line %d
|
package fr.xephi.authme.security.crypts;
import fr.xephi.authme.security.crypts.description.HasSalt;
import fr.xephi.authme.security.crypts.description.Recommendation;
import fr.xephi.authme.security.crypts.description.SaltType;
import fr.xephi.authme.security.crypts.description.Usage;
import fr.xephi.authme.util.RandomStringUtils;
import static fr.xephi.authme.security.HashUtils.md5;
@Recommendation(Usage.ACCEPTABLE)
@HasSalt(value = SaltType.TEXT, length = 5)
public class Ipb3 extends SeparateSaltMethod {
@Override
public String computeHash(String password, String salt, String name) {
return md5(md5(salt) + md5(password));
}
@Override
public String generateSalt() {
return RandomStringUtils.generateHex(5);
}
}
|
<!DOCTYPE html>
<html>
<head>
<title>Stretchy munderover</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<!-- See bug 687807 -->
<math>
<munderover>
<mo stretchy="true">→</mo>
<mtext>AAAAAA</mtext>
<mtext>BBBBBB</mtext>
</munderover>
</math>
</body>
</html>
|
//! CSS table formatting contexts.
#![deny(unsafe_code)]
use app_units::Au;
use block::{BlockFlow, <API key>};
use context::LayoutContext;
use cssparser::{Color, RGBA};
use <API key>::{<API key>, BorderPaintingMode};
use euclid::{Point2D, Rect};
use flow::{self, <API key>, Flow, FlowClass, ImmutableFlowUtils, OpaqueFlow};
use flow_list::MutFlowListIterator;
use fragment::{Fragment, <API key>};
use gfx::display_list::DisplayList;
use layout_debug;
use model::MaybeAuto;
use rustc_serialize::{Encodable, Encoder};
use std::cmp::max;
use std::fmt;
use std::iter::{Enumerate, IntoIterator, Peekable};
use std::sync::Arc;
use style::computed_values::{border_collapse, border_spacing, border_top_style};
use style::properties::ComputedValues;
use style::values::computed::<API key>;
use table::{<API key>, <API key>, InternalTable, VecExt};
use table_cell::{<API key>, TableCellFlow};
use util::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
use util::print_tree::PrintTree;
A single row of a table.
pub struct TableRowFlow {
Fields common to all block flows.
pub block_flow: BlockFlow,
Information about the intrinsic inline-sizes of each cell.
pub <API key>: Vec<<API key>>,
Information about the computed inline-sizes of each column.
pub <API key>: Vec<<API key>>,
The spacing for this row, propagated down from the table during the inline-size assignment
phase.
pub spacing: border_spacing::T,
The direction of the columns, propagated down from the table during the inline-size
assignment phase.
pub table_writing_mode: WritingMode,
Information about the borders for each cell that we bubble up to our parent. This is only
computed if `border-collapse` is `collapse`.
pub <API key>: <API key>,
Information about the borders for each cell, post-collapse. This is only computed if
`border-collapse` is `collapse`.
pub <API key>: <API key>,
The computed cell spacing widths post-collapse.
pub <API key>: <API key>,
}
impl Encodable for TableRowFlow {
fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
self.block_flow.encode(e)
}
}
Information about the column inline size and span for each cell.
#[derive(RustcEncodable, Copy, Clone)]
pub struct <API key> {
Inline sizes that this cell contributes to the column.
pub column_size: <API key>,
The column span of this cell.
pub column_span: u32,
}
impl TableRowFlow {
pub fn from_fragment(fragment: Fragment) -> TableRowFlow {
let writing_mode = fragment.style().writing_mode;
TableRowFlow {
block_flow: BlockFlow::from_fragment(fragment, None),
<API key>: Vec::new(),
<API key>: Vec::new(),
spacing: border_spacing::T {
horizontal: Au(0),
vertical: Au(0),
},
table_writing_mode: writing_mode,
<API key>: <API key>::new(),
<API key>: <API key>::new(),
<API key>: <API key>::new(),
}
}
Assign block-size for table-row flow.
TODO(pcwalton): This doesn't handle floats and positioned elements right.
inline(always) because this is only ever called by in-order or non-in-order top-level
methods
#[inline(always)]
fn <API key>(&mut self, layout_context: &LayoutContext) {
// cells).
let mut max_block_size = Au(0);
let thread_id = self.block_flow.base.thread_id;
for kid in self.block_flow.base.child_iter() {
kid.<API key>(layout_context);
if !flow::base(kid).flags.is_float() {
kid.<API key>(layout_context, thread_id);
}
{
let child_fragment = kid.as_mut_table_cell().fragment();
// TODO: Percentage block-size
let <API key> =
MaybeAuto::from_style(child_fragment.style().content_block_size(),
Au(0)).specified_or_zero();
max_block_size =
max(max_block_size,
<API key> +
child_fragment.border_padding.block_start_end());
}
let child_node = flow::mut_base(kid);
child_node.position.start.b = Au(0);
max_block_size = max(max_block_size, child_node.position.size.block);
}
let mut block_size = max_block_size;
// TODO: Percentage block-size
block_size = match MaybeAuto::from_style(self.block_flow
.fragment
.style()
.content_block_size(),
Au(0)) {
MaybeAuto::Auto => block_size,
MaybeAuto::Specified(value) => max(value, block_size),
};
// Assign the block-size of own fragment
let mut position = self.block_flow.fragment.border_box;
position.size.block = block_size;
self.block_flow.fragment.border_box = position;
self.block_flow.base.position.size.block = block_size;
// Assign the block-size of kid fragments, which is the same value as own block-size.
for kid in self.block_flow.base.child_iter() {
let child_table_cell = kid.as_mut_table_cell();
{
let kid_fragment = child_table_cell.mut_fragment();
let mut position = kid_fragment.border_box;
position.size.block = block_size;
kid_fragment.border_box = position;
}
// Assign the child's block size.
child_table_cell.block_flow.base.position.size.block = block_size;
// Write in the size of the relative containing block for children. (This information
// is also needed to handle RTL.)
child_table_cell.block_flow.base.<API key> =
<API key> {
<API key>: self.block_flow.fragment.content_box().size,
<API key>: self.block_flow.fragment.style().writing_mode,
};
}
}
pub fn <API key><'a, I>(
&mut self,
<API key>: &[Au],
<API key>: &mut Peekable<I>)
where I: Iterator<Item=&'a Au> {
self.<API key>.inline.clear();
self.<API key>
.inline
.extend(<API key>.into_iter().map(|x| *x));
if let Some(<API key>) =
<API key>.next() {
self.<API key>.block_start =
*<API key>
}
if let Some(<API key>) =
<API key>.peek() {
self.<API key>.block_end =
**<API key>
}
}
}
impl Flow for TableRowFlow {
fn class(&self) -> FlowClass {
FlowClass::TableRow
}
fn as_mut_table_row(&mut self) -> &mut TableRowFlow {
self
}
fn as_table_row(&self) -> &TableRowFlow {
self
}
fn as_mut_block(&mut self) -> &mut BlockFlow {
&mut self.block_flow
}
fn as_block(&self) -> &BlockFlow {
&self.block_flow
}
fn <API key>(&mut self) -> &mut Vec<<API key>> {
panic!("can't call <API key>() on table row")
}
fn <API key>(&mut self) -> &mut Vec<<API key>> {
&mut self.<API key>
}
Recursively (bottom-up) determines the context's preferred and minimum inline-sizes. When
called on this context, all child contexts have had their min/pref inline-sizes set. This
function must decide min/pref inline-sizes based on child context inline-sizes and
dimensions of any fragments it is responsible for flowing.
Min/pref inline-sizes set by this function are used in automatic table layout calculation.
The specified column inline-sizes of children cells are used in fixed table layout
calculation.
fn bubble_inline_sizes(&mut self) {
let _scope = layout_debug_scope!("table_row::bubble_inline_sizes {:x}",
self.block_flow.base.debug_id());
// Bubble up the specified inline-sizes from child table cells.
let (mut min_inline_size, mut pref_inline_size) = (Au(0), Au(0));
let collapsing_borders = self.block_flow
.fragment
.style()
.get_inheritedtable()
.border_collapse == border_collapse::T::collapse;
// FIXME(pcwalton): Shouldn't use `CollapsedBorder::new()` here.
self.<API key>.reset(CollapsedBorder::new());
{
let mut iterator = self.block_flow.base.child_iter().enumerate().peekable();
while let Some((i, kid)) = iterator.next() {
assert!(kid.is_table_cell());
// Collect the specified column inline-size of the cell. This is used in both
// fixed and automatic table layout calculation.
let <API key>;
let child_column_span;
{
let child_table_cell = kid.as_mut_table_cell();
<API key> = child_table_cell.block_flow
.fragment
.style
.content_inline_size();
child_column_span = child_table_cell.column_span;
// Perform border collapse if necessary.
if collapsing_borders {
<API key>(
i,
child_table_cell,
&mut iterator,
&mut self.<API key>)
}
}
// Collect minimum and preferred inline-sizes of the cell for automatic table layout
// calculation.
let child_base = flow::mut_base(kid);
let <API key> = <API key> {
minimum_length: match <API key> {
<API key>::Auto |
<API key>::Calc(_) |
<API key>::Percentage(_) => {
child_base.<API key>.minimum_inline_size
}
<API key>::Length(length) => length,
},
percentage: match <API key> {
<API key>::Auto |
<API key>::Calc(_) |
<API key>::Length(_) => 0.0,
<API key>::Percentage(percentage) => percentage,
},
preferred: child_base.<API key>.<API key>,
constrained: match <API key> {
<API key>::Length(_) => true,
<API key>::Auto |
<API key>::Calc(_) |
<API key>::Percentage(_) => false,
},
};
min_inline_size = min_inline_size + <API key>.minimum_length;
pref_inline_size = pref_inline_size + <API key>.preferred;
self.<API key>.push(<API key> {
column_size: <API key>,
column_span: child_column_span,
});
}
}
self.block_flow.base.<API key>.minimum_inline_size = min_inline_size;
self.block_flow.base.<API key>.<API key> = max(min_inline_size,
pref_inline_size);
}
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
let _scope = layout_debug_scope!("table_row::assign_inline_sizes {:x}",
self.block_flow.base.debug_id());
debug!("assign_inline_sizes({}): assigning inline_size for flow", "table_row");
// The position was set to the containing block by the flow's parent.
let <API key> = self.block_flow.base.<API key>;
// FIXME: In case of border-collapse: collapse, <API key> should be
// border_inline_start.
let <API key> = Au(0);
let <API key> = Au(0);
let <API key> = InternalTable {
border_collapse: self.block_flow.fragment.style.get_inheritedtable().border_collapse,
};
<API key>.<API key>(&mut self.block_flow,
layout_context,
<API key>);
// Spread out the completed inline sizes among columns with spans > 1.
let mut <API key> = Vec::new();
let mut <API key> = self.<API key>.iter();
for <API key> in &self.<API key> {
// Start with the computed inline size for the first column in the span.
let mut <API key> =
match <API key>.next() {
Some(<API key>) => *<API key>,
None => {
// We're in fixed layout mode and there are more cells in this row than
// now undefined. So just use zero.
// FIXME(pcwalton): $10 says this isn't Web compatible.
<API key> {
size: Au(0),
}
}
};
// Add in computed inline sizes for any extra columns in the span.
for _ in 1..<API key>.column_span {
let <API key> =
match <API key>.next() {
Some(<API key>) => <API key>,
None => break,
};
<API key>.size = <API key>.size +
<API key>.size;
}
<API key>.push(<API key>)
}
// Set up border collapse info.
let <API key> =
match self.block_flow.fragment.style().get_inheritedtable().border_collapse {
border_collapse::T::collapse => {
Some(<API key> {
<API key>: &self.<API key>,
<API key>: &self.<API key>,
})
}
border_collapse::T::separate => None,
};
// Push those inline sizes down to the cells.
let spacing = self.spacing;
let row_writing_mode = self.block_flow.base.writing_mode;
let table_writing_mode = self.table_writing_mode;
self.block_flow.<API key>(layout_context,
<API key>,
<API key>,
<API key>,
|child_flow,
child_index,
content_inline_size,
_writing_mode,
<API key>,
<API key>| {
<API key>(
child_flow,
child_index,
row_writing_mode,
table_writing_mode,
&<API key>,
&spacing,
&<API key>,
content_inline_size,
<API key>,
<API key>);
})
}
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table_row");
self.<API key>(layout_context);
}
fn <API key>(&mut self, layout_context: &LayoutContext) {
self.block_flow.<API key>(layout_context)
}
fn <API key>(&mut self, inline_position: Au) {
self.block_flow.<API key>(inline_position)
}
fn <API key>(&mut self, block_position: Au) {
self.block_flow.<API key>(block_position)
}
fn build_display_list(&mut self, layout_context: &LayoutContext) {
let <API key> = match self.block_flow
.fragment
.style
.get_inheritedtable()
.border_collapse {
border_collapse::T::separate => BorderPaintingMode::Separate,
border_collapse::T::collapse => BorderPaintingMode::Hidden,
};
self.block_flow.<API key>(box DisplayList::new(),
layout_context,
<API key>);
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}
fn compute_overflow(&self) -> Rect<Au> {
self.block_flow.compute_overflow()
}
fn <API key>(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
self.block_flow.<API key>(flow)
}
fn <API key>(&self,
iterator: &mut <API key>,
level: i32,
<API key>: &Point2D<Au>) {
self.block_flow.<API key>(iterator, level, <API key>)
}
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
self.block_flow.mutate_fragments(mutator)
}
fn <API key>(&self, print_tree: &mut PrintTree) {
self.block_flow.<API key>(print_tree);
}
}
impl fmt::Debug for TableRowFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableRowFlow: {:?}", self.block_flow)
}
}
#[derive(Clone, Debug)]
pub struct <API key> {
The size of this vector should be equal to the number of cells plus one.
pub inline: Vec<CollapsedBorder>,
The size of this vector should be equal to the number of cells.
pub block_start: Vec<CollapsedBorder>,
The size of this vector should be equal to the number of cells.
pub block_end: Vec<CollapsedBorder>,
}
impl <API key> {
pub fn new() -> <API key> {
<API key> {
inline: Vec::new(),
block_start: Vec::new(),
block_end: Vec::new(),
}
}
pub fn reset(&mut self, first_inline_border: CollapsedBorder) {
self.inline.clear();
self.inline.push(first_inline_border);
self.block_start.clear();
self.block_end.clear()
}
}
#[derive(Clone, Debug)]
pub struct <API key> {
The spacing in between each column.
inline: Vec<Au>,
The spacing above this row.
pub block_start: Au,
The spacing below this row.
block_end: Au,
}
impl <API key> {
fn new() -> <API key> {
<API key> {
inline: Vec::new(),
block_start: Au(0),
block_end: Au(0),
}
}
}
All aspects of a border that can collapse with adjacent borders. See CSS 2.1 § 17.6.2.1.
#[derive(Copy, Clone, Debug)]
pub struct CollapsedBorder {
The style of the border.
pub style: border_top_style::T,
The width of the border.
pub width: Au,
The color of the border.
pub color: Color,
The type of item that this border comes from.
pub provenance: <API key>,
}
impl Encodable for CollapsedBorder {
fn encode<S: Encoder>(&self, _: &mut S) -> Result<(), S::Error> {
Ok(())
}
}
Where a border style comes from.
The integer values here correspond to the border conflict resolution rules in CSS 2.1 §
17.6.2.1. Higher values override lower values.
// FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn,
// <API key> are unused
#[allow(dead_code)]
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable)]
pub enum <API key> {
<API key> = 6,
FromNextTableCell = 5,
FromTableRow = 4,
FromTableRowGroup = 3,
FromTableColumn = 2,
<API key> = 1,
FromTable = 0,
}
impl CollapsedBorder {
Creates a collapsible border style for no border.
pub fn new() -> CollapsedBorder {
CollapsedBorder {
style: border_top_style::T::none,
width: Au(0),
color: Color::RGBA(RGBA {
red: 0.0,
green: 0.0,
blue: 0.0,
alpha: 0.0,
}),
provenance: <API key>::FromTable,
}
}
Creates a collapsed border from the block-start border described in the given CSS style
object.
fn top(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_top_style,
width: css_style.get_border().border_top_width,
color: css_style.get_border().border_top_color,
provenance: provenance,
}
}
Creates a collapsed border style from the right border described in the given CSS style
object.
fn right(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_right_style,
width: css_style.get_border().border_right_width,
color: css_style.get_border().border_right_color,
provenance: provenance,
}
}
Creates a collapsed border style from the bottom border described in the given CSS style
object.
fn bottom(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_bottom_style,
width: css_style.get_border().border_bottom_width,
color: css_style.get_border().border_bottom_color,
provenance: provenance,
}
}
Creates a collapsed border style from the left border described in the given CSS style
object.
fn left(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_left_style,
width: css_style.get_border().border_left_width,
color: css_style.get_border().border_left_color,
provenance: provenance,
}
}
Creates a collapsed border style from the given physical side.
fn from_side(side: PhysicalSide,
css_style: &ComputedValues,
provenance: <API key>)
-> CollapsedBorder {
match side {
PhysicalSide::Top => CollapsedBorder::top(css_style, provenance),
PhysicalSide::Right => CollapsedBorder::right(css_style, provenance),
PhysicalSide::Bottom => CollapsedBorder::bottom(css_style, provenance),
PhysicalSide::Left => CollapsedBorder::left(css_style, provenance),
}
}
Creates a collapsed border style from the inline-start border described in the given CSS
style object.
pub fn inline_start(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.<API key>(),
css_style,
provenance)
}
Creates a collapsed border style from the inline-start border described in the given CSS
style object.
pub fn inline_end(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.<API key>(),
css_style,
provenance)
}
Creates a collapsed border style from the block-start border described in the given CSS
style object.
pub fn block_start(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.<API key>(),
css_style,
provenance)
}
Creates a collapsed border style from the block-end border described in the given CSS style
object.
pub fn block_end(css_style: &ComputedValues, provenance: <API key>)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.<API key>(),
css_style,
provenance)
}
If `other` has a higher priority per CSS 2.1 § 17.6.2.1, replaces `self` with it.
pub fn combine(&mut self, other: &CollapsedBorder) {
match (self.style, other.style) {
// Step 1.
(border_top_style::T::hidden, _) => {}
(_, border_top_style::T::hidden) => *self = *other,
// Step 2.
(border_top_style::T::none, _) => *self = *other,
(_, border_top_style::T::none) => {}
// Step 3.
_ if self.width > other.width => {}
_ if self.width < other.width => *self = *other,
(this_style, other_style) if this_style > other_style => {}
(this_style, other_style) if this_style < other_style => *self = *other,
// Step 4.
_ if (self.provenance as i8) >= other.provenance as i8 => {}
_ => *self = *other,
}
}
}
Pushes column inline size and border collapse info down to a child.
pub fn <API key>(
child_flow: &mut Flow,
table_writing_mode: WritingMode,
<API key>: &[<API key>],
border_spacing: &border_spacing::T) {
// If the child is a row group or a row, the column inline-size info should be copied from its
// parent.
// FIXME(pcwalton): This seems inefficient. Reference count it instead?
match child_flow.class() {
FlowClass::Table => {
let child_table_flow = child_flow.as_mut_table();
child_table_flow.<API key> = <API key>.to_vec();
}
FlowClass::TableRowGroup => {
let <API key> = child_flow.<API key>();
<API key>.<API key> =
<API key>.to_vec();
<API key>.spacing = *border_spacing;
<API key>.table_writing_mode = table_writing_mode;
}
FlowClass::TableRow => {
let <API key> = child_flow.as_mut_table_row();
<API key>.<API key> =
<API key>.to_vec();
<API key>.spacing = *border_spacing;
<API key>.table_writing_mode = table_writing_mode;
}
c => warn!("unexpected flow in table {:?}", c)
}
}
Lay out table cells inline according to the computer column sizes.
fn <API key>(
child_flow: &mut Flow,
child_index: usize,
row_writing_mode: WritingMode,
table_writing_mode: WritingMode,
<API key>: &[<API key>],
border_spacing: &border_spacing::T,
<API key>: &Option<<API key>>,
<API key>: Au,
<API key>: &mut Au,
<API key>: &mut Au) {
if !child_flow.is_table_cell() {
return
}
let <API key> = table_writing_mode.is_bidi_ltr() != row_writing_mode.is_bidi_ltr();
// Handle border collapsing, if necessary.
let child_table_cell = child_flow.as_mut_table_cell();
match *<API key> {
Some(ref <API key>) => {
// Write in the child's border collapse state.
child_table_cell.collapsed_borders = <API key> {
inline_start_border: <API key>.<API key>
.inline
.get(child_index)
.map_or(CollapsedBorder::new(), |x| *x),
inline_end_border: <API key>.<API key>
.inline
.get(child_index + 1)
.map_or(CollapsedBorder::new(), |x| *x),
block_start_border: <API key>.<API key>
.block_start
.get(child_index)
.map_or(CollapsedBorder::new(), |x| *x),
block_end_border: <API key>.<API key>
.block_end
.get(child_index)
.map_or(CollapsedBorder::new(), |x| *x),
inline_start_width: <API key>.<API key>
.inline
.get(child_index)
.map_or(Au(0), |x| *x),
inline_end_width: <API key>.<API key>
.inline
.get(child_index + 1)
.map_or(Au(0), |x| *x),
block_start_width: <API key>.<API key>
.block_start,
block_end_width: <API key>.<API key>.block_end,
};
// Move over past the collapsed border.
if <API key> {
*<API key> = *<API key> +
child_table_cell.collapsed_borders.inline_start_width
} else {
*<API key> = *<API key> +
child_table_cell.collapsed_borders.inline_start_width
}
}
None => {
// Take spacing into account.
if <API key> {
*<API key> = *<API key> + border_spacing.horizontal
} else {
*<API key> = *<API key> + border_spacing.horizontal
}
}
}
let column_inline_size = <API key>[child_index].size;
let kid_base = &mut child_table_cell.block_flow.base;
kid_base.<API key> = column_inline_size;
if <API key> {
// Columns begin from the inline-end edge.
kid_base.position.start.i =
<API key> - *<API key> - column_inline_size;
*<API key> = *<API key> + column_inline_size;
} else {
// Columns begin from the inline-start edge.
kid_base.position.start.i = *<API key>;
*<API key> = *<API key> + column_inline_size;
}
}
#[derive(Copy, Clone)]
pub struct <API key><'a> {
<API key>: &'a <API key>,
<API key>: &'a <API key>,
}
Performs border-collapse in the inline direction for all the cells' inside borders in the
inline-direction cells and propagates the outside borders (the far left and right) up to the
table row. This is done eagerly here so that at least the inline inside border collapse
computations can be parallelized across all the rows of the table.
fn <API key>(
child_index: usize,
child_table_cell: &mut TableCellFlow,
iterator: &mut Peekable<Enumerate<MutFlowListIterator>>,
<API key>: &mut <API key>) {
let <API key> = <API key>.inline.push_or_mutate(
child_index + 1,
CollapsedBorder::inline_end(&*child_table_cell.block_flow.fragment.style,
<API key>::<API key>));
if let Some(&(_, ref next_child_flow)) = iterator.peek() {
let next_child_flow = next_child_flow.as_block();
<API key>.combine(
&CollapsedBorder::inline_start(&*next_child_flow.fragment.style,
<API key>::FromNextTableCell))
};
let block_start_border =
CollapsedBorder::block_start(&*child_table_cell.block_flow.fragment.style,
<API key>::FromNextTableCell);
<API key>.block_start.push_or_mutate(child_index, block_start_border);
let block_end_border =
CollapsedBorder::block_end(&*child_table_cell.block_flow.fragment.style,
<API key>::<API key>);
<API key>.block_end.push_or_mutate(child_index, block_end_border);
}
|
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.six.moves import input
from treeherder.model.models import Datasource, Repository
class Command(BaseCommand):
help = ("Populate the datasource table and"
"create the connected databases")
option_list = BaseCommand.option_list + (
make_option('--reset',
action='store_true',
dest='reset',
default=False,
help='Reset the datasources if they already exists'),
)
def handle(self, *args, **options):
if options["reset"]:
confirm = input("""You have requested an init of the datasources.
This will IRREVERSIBLY DESTROY all data in the per-project databases.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: """)
if confirm == "yes":
for ds in Datasource.objects.all():
ds.delete()
projects = Repository.objects.filter(active_status='active').values_list('name', flat=True)
for project in projects:
Datasource.objects.get_or_create(project=project)
Datasource.reset_cache()
|
<!-- GENERATED FILE, DO NOT EDIT -->
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'/>
<title>
Mochitest wrapper for WebGL Conformance Test Suite tests
</title>
<link rel='stylesheet' type='text/css' href='../iframe-passthrough.css'/>
<script src='/tests/SimpleTest/SimpleTest.js'></script>
<link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
</head>
<body>
<iframe src='../mochi-single.html?checkout/conformance/glsl/functions/<API key>.html'></iframe>
</body>
</html>
|
package com.mifos.objects.accounts.loan;
import android.os.Parcel;
import android.os.Parcelable;
import com.mifos.api.local.MifosBaseModel;
import com.mifos.api.local.MifosDatabase;
import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ModelContainer;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
@Table(database = MifosDatabase.class, name = "LoanStatus")
@ModelContainer
public class Status extends MifosBaseModel implements Parcelable {
@PrimaryKey
Integer id;
@Column
String code;
@Column
String value;
@Column
Boolean pendingApproval;
@Column
Boolean waitingForDisbursal;
@Column
Boolean active;
@Column
Boolean <API key>;
@Column
Boolean closedWrittenOff;
@Column
Boolean closedRescheduled;
@Column
Boolean closed;
@Column
Boolean overpaid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Status withId(Integer id) {
this.id = id;
return this;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Status withCode(String code) {
this.code = code;
return this;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Status withValue(String value) {
this.value = value;
return this;
}
public Boolean getPendingApproval() {
return pendingApproval;
}
public void setPendingApproval(Boolean pendingApproval) {
this.pendingApproval = pendingApproval;
}
public Status withPendingApproval(Boolean pendingApproval) {
this.pendingApproval = pendingApproval;
return this;
}
public Boolean <API key>() {
return waitingForDisbursal;
}
public void <API key>(Boolean waitingForDisbursal) {
this.waitingForDisbursal = waitingForDisbursal;
}
public Status <API key>(Boolean waitingForDisbursal) {
this.waitingForDisbursal = waitingForDisbursal;
return this;
}
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
public Status withActive(Boolean active) {
this.active = active;
return this;
}
public Boolean <API key>() {
return <API key>;
}
public void <API key>(Boolean <API key>) {
this.<API key> = <API key>;
}
public Status <API key>(Boolean <API key>) {
this.<API key> = <API key>;
return this;
}
public Boolean getClosedWrittenOff() {
return closedWrittenOff;
}
public void setClosedWrittenOff(Boolean closedWrittenOff) {
this.closedWrittenOff = closedWrittenOff;
}
public Status <API key>(Boolean closedWrittenOff) {
this.closedWrittenOff = closedWrittenOff;
return this;
}
public Boolean <API key>() {
return closedRescheduled;
}
public void <API key>(Boolean closedRescheduled) {
this.closedRescheduled = closedRescheduled;
}
public Status <API key>(Boolean closedRescheduled) {
this.closedRescheduled = closedRescheduled;
return this;
}
public Boolean getClosed() {
return closed;
}
public void setClosed(Boolean closed) {
this.closed = closed;
}
public Status withClosed(Boolean closed) {
this.closed = closed;
return this;
}
public Boolean getOverpaid() {
return overpaid;
}
public void setOverpaid(Boolean overpaid) {
this.overpaid = overpaid;
}
public Status withOverpaid(Boolean overpaid) {
this.overpaid = overpaid;
return this;
}
@Override
public String toString() {
return "Status{" +
"id=" + id +
", code='" + code + '\'' +
", value='" + value + '\'' +
", pendingApproval=" + pendingApproval +
", waitingForDisbursal=" + waitingForDisbursal +
", active=" + active +
", <API key>=" + <API key> +
", closedWrittenOff=" + closedWrittenOff +
", closedRescheduled=" + closedRescheduled +
", closed=" + closed +
", overpaid=" + overpaid +
'}';
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(this.id);
dest.writeString(this.code);
dest.writeString(this.value);
dest.writeValue(this.pendingApproval);
dest.writeValue(this.waitingForDisbursal);
dest.writeValue(this.active);
dest.writeValue(this.<API key>);
dest.writeValue(this.closedWrittenOff);
dest.writeValue(this.closedRescheduled);
dest.writeValue(this.closed);
dest.writeValue(this.overpaid);
}
public Status() {
}
protected Status(Parcel in) {
this.id = (Integer) in.readValue(Integer.class.getClassLoader());
this.code = in.readString();
this.value = in.readString();
this.pendingApproval = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.waitingForDisbursal = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.active = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.<API key> = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.closedWrittenOff = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.closedRescheduled = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.closed = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.overpaid = (Boolean) in.readValue(Boolean.class.getClassLoader());
}
public static final Parcelable.Creator<Status> CREATOR = new Parcelable.Creator<Status>() {
@Override
public Status createFromParcel(Parcel source) {
return new Status(source);
}
@Override
public Status[] newArray(int size) {
return new Status[size];
}
};
}
|
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
body>div { margin: 50px 20px; width: 100px; height: 150px; border: 5px solid blue; }
.abc { display: inline-block; border: 2px solid red; inline-size: 30px; }
.test { background: #aaa; width: 2em; }
.vrl { writing-mode: vertical-rl; }
.rel { position: relative; }
img { position: absolute; background: green; border: 5px solid yellow; }
</style>
<body>
<div class="vrl">
<div class="test rel"><span class="abc">abc</span><img src="blue-32x32.png"></div>
</div>
|
# -*- coding: utf-8 -*-
# OpenERP, Open Source Management Solution
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
from datetime import datetime, timedelta
import time
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.tools import <API key>, <API key>
import openerp.addons.decimal_precision as dp
from openerp import workflow
class res_company(osv.Model):
_inherit = "res.company"
_columns = {
'sale_note': fields.text('Default Terms and Conditions', translate=True, help="Default terms and conditions for quotations."),
}
class sale_order(osv.osv):
_name = "sale.order"
_inherit = ['mail.thread', 'ir.needaction_mixin']
_description = "Sales Order"
_track = {
'state': {
'sale.mt_order_confirmed': lambda self, cr, uid, obj, ctx=None: obj.state in ['manual'],
'sale.mt_order_sent': lambda self, cr, uid, obj, ctx=None: obj.state in ['sent']
},
}
def _amount_line_tax(self, cr, uid, line, context=None):
val = 0.0
for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']:
val += c.get('amount', 0.0)
return val
def _amount_all_wrapper(self, cr, uid, ids, field_name, arg, context=None):
""" Wrapper because of direct method passing as parameter for function fields """
return self._amount_all(cr, uid, ids, field_name, arg, context=context)
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
cur_obj = self.pool.get('res.currency')
res = {}
for order in self.browse(cr, uid, ids, context=context):
res[order.id] = {
'amount_untaxed': 0.0,
'amount_tax': 0.0,
'amount_total': 0.0,
}
val = val1 = 0.0
cur = order.pricelist_id.currency_id
for line in order.order_line:
val1 += line.price_subtotal
val += self._amount_line_tax(cr, uid, line, context=context)
res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
res[order.id]['amount_untaxed'] = cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total'] = res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
return res
def _invoiced_rate(self, cursor, user, ids, name, arg, context=None):
res = {}
for sale in self.browse(cursor, user, ids, context=context):
if sale.invoiced:
res[sale.id] = 100.0
continue
tot = 0.0
for invoice in sale.invoice_ids:
if invoice.state not in ('draft', 'cancel'):
tot += invoice.amount_untaxed
if tot:
res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
else:
res[sale.id] = 0.0
return res
def _invoice_exists(self, cursor, user, ids, name, arg, context=None):
res = {}
for sale in self.browse(cursor, user, ids, context=context):
res[sale.id] = False
if sale.invoice_ids:
res[sale.id] = True
return res
def _invoiced(self, cursor, user, ids, name, arg, context=None):
res = {}
for sale in self.browse(cursor, user, ids, context=context):
res[sale.id] = True
invoice_existence = False
for invoice in sale.invoice_ids:
if invoice.state!='cancel':
invoice_existence = True
if invoice.state != 'paid':
res[sale.id] = False
break
if not invoice_existence or sale.state == 'manual':
res[sale.id] = False
return res
def _invoiced_search(self, cursor, user, obj, name, args, context=None):
if not len(args):
return []
clause = ''
sale_clause = ''
no_invoiced = False
for arg in args:
if (arg[1] == '=' and arg[2]) or (arg[1] == '!=' and not arg[2]):
clause += 'AND inv.state = \'paid\''
else:
clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id '
sale_clause = ', sale_order AS sale '
no_invoiced = True
cursor.execute('SELECT rel.order_id ' \
'FROM <API key> AS rel, account_invoice AS inv '+ sale_clause + \
'WHERE rel.invoice_id = inv.id ' + clause)
res = cursor.fetchall()
if no_invoiced:
cursor.execute('SELECT sale.id ' \
'FROM sale_order AS sale ' \
'WHERE sale.id NOT IN ' \
'(SELECT rel.order_id ' \
'FROM <API key> AS rel) and sale.state != \'cancel\'')
res.extend(cursor.fetchall())
if not res:
return [('id', '=', 0)]
return [('id', 'in', [x[0] for x in res])]
def _get_order(self, cr, uid, ids, context=None):
result = {}
for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context):
result[line.order_id.id] = True
return result.keys()
def <API key>(self, cr, uid, context=None):
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
if not company_id:
raise osv.except_osv(_('Error!'), _('There is no default company for the current user!'))
return company_id
def <API key>(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
section_id = self.<API key>(cr, uid, context=context) or False
if not section_id:
section_id = self.pool.get('res.users').browse(cr, uid, uid, context).default_section_id.id or False
return section_id
def <API key>(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
context key, or None if it cannot be resolved to a single
Sales Team.
"""
if context is None:
context = {}
if type(context.get('default_section_id')) in (int, long):
return context.get('default_section_id')
if isinstance(context.get('default_section_id'), basestring):
section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=context['default_section_id'], context=context)
if len(section_ids) == 1:
return int(section_ids[0][0])
return None
#This function automatically sets the currency to EUR.
def <API key>(self, cr, uid, context=None):
res = self.pool.get('res.company').search(cr, uid, [('currency_id','=','EUR')], context=context)
return res and res[0] or False
_columns = {
#This fills the Many2one with all data from res.currency
'<API key>': fields.many2one('res.currency', string="Valuta", required=True),
'name': fields.char('Order Reference', required=True, copy=False,
readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True),
'origin': fields.char('Source Document', help="Reference of the document that generated this sales order request."),
'client_order_ref': fields.char('Reference/Description', copy=False),
'state': fields.selection([
('draft', 'Draft Quotation'),
('sent', 'Quotation Sent'),
('cancel', 'Cancelled'),
('waiting_date', 'Waiting Schedule'),
('progress', 'Sales Order'),
('manual', 'Sale to Invoice'),
('shipping_except', 'Shipping Exception'),
('invoice_except', 'Invoice Exception'),
('done', 'Done'),
], 'Status', readonly=True, copy=False, help="Gives the status of the quotation or sales order.\
\nThe exception status is automatically set when a cancel operation occurs \
in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception).\nThe 'Waiting Schedule' status is set when the invoice is confirmed\
but waiting for the scheduler to run on the order date.", select=True),
'date_order': fields.datetime('Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, copy=False),
'create_date': fields.datetime('Creation Date', readonly=True, select=True, help="Date on which sales order is created."),
'date_confirm': fields.date('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed.", copy=False),
'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True, track_visibility='onchange'),
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility='always'),
'partner_invoice_id': fields.many2one('res.partner', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order."),
'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Delivery address for current sales order."),
'order_policy': fields.selection([
('manual', 'On Demand'),
], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
help="""This field controls how invoice and delivery operations are synchronized."""),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order."),
'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", string="Currency", readonly=True, required=True),
'project_id': fields.many2one('account.analytic.account', 'Contract / Analytic', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."),
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, copy=True),
'invoice_ids': fields.many2many('account.invoice', '<API key>', 'order_id', 'invoice_id', 'Invoices', readonly=True, copy=False, help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."),
'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced Ratio', type='float'),
'invoiced': fields.function(_invoiced, string='Paid',
fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid."),
'invoice_exists': fields.function(_invoice_exists, string='Invoiced',
fnct_search=_invoiced_search, type='boolean', help="It indicates that sales order has at least one invoice."),
'note': fields.text('Terms and conditions'),
'amount_untaxed': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Untaxed Amount',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The amount without tax.", track_visibility='always'),
'amount_tax': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Taxes',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The tax amount."),
'amount_total': fields.function(_amount_all_wrapper, digits_compute=dp.get_precision('Account'), string='Total',
store={
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The total amount."),
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'company_id': fields.many2one('res.company', 'Company'),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'<API key>': fields.many2one('procurement.group', 'Procurement group', copy=False),
'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product'),
}
_defaults = {
#This makes the function go off that sets EUR.
'<API key>': <API key>,
'date_order': fields.datetime.now,
'order_policy': 'manual',
'company_id': <API key>,
'state': 'draft',
'user_id': lambda obj, cr, uid, context: uid,
'name': lambda obj, cr, uid, context: '/',
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
'note': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note,
'section_id': lambda s, cr, uid, c: s.<API key>(cr, uid, c),
}
_sql_constraints = [
('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'),
]
_order = 'date_order desc, id desc'
# Form filling
def unlink(self, cr, uid, ids, context=None):
sale_orders = self.read(cr, uid, ids, ['state'], context=context)
unlink_ids = []
for s in sale_orders:
if s['state'] in ['draft', 'cancel']:
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it before!'))
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
def copy_quotation(self, cr, uid, ids, context=None):
id = self.copy(cr, uid, ids[0], context=context)
view_ref = self.pool.get('ir.model.data').<API key>(cr, uid, 'sale', 'view_order_form')
view_id = view_ref and view_ref[1] or False,
return {
'type': 'ir.actions.act_window',
'name': _('Sales Order'),
'res_model': 'sale.order',
'res_id': id,
'view_type': 'form',
'view_mode': 'form',
'view_id': view_id,
'target': 'current',
'nodestroy': True,
}
def <API key>(self, cr, uid, ids, pricelist_id, order_lines, context=None):
context = context or {}
if not pricelist_id:
return {}
value = {
'currency_id': self.pool.get('product.pricelist').browse(cr, uid, pricelist_id, context=context).currency_id.id
}
if not order_lines or order_lines == [(6, 0, [])]:
return {'value': value}
warning = {
'title': _('Pricelist Warning!'),
'message' : _('If you change the pricelist of this order (and eventually the currency), prices of existing order lines will not be updated.')
}
return {'warning': warning, 'value': value}
def get_salenote(self, cr, uid, ids, partner_id, context=None):
context_lang = context.copy()
if partner_id:
partner_lang = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context).lang
context_lang.update({'lang': partner_lang})
return self.pool.get('res.users').browse(cr, uid, uid, context=context_lang).company_id.sale_note
def <API key>(self, cr, uid, ids, company_id, partner_id, delivery_id, fiscal_position, context=None):
r = {'value': {}}
if not fiscal_position:
if not company_id:
company_id = self.<API key>(cr, uid, context=context)
fiscal_position = self.pool['account.fiscal.position'].get_fiscal_position(cr, uid, company_id, partner_id, delivery_id, context=context)
if fiscal_position:
r['value']['fiscal_position'] = fiscal_position
return r
def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}}
part = self.pool.get('res.partner').browse(cr, uid, part, context=context)
addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact'])
pricelist = part.<API key> and part.<API key>.id or False
payment_term = part.<API key> and part.<API key>.id or False
dedicated_salesman = part.user_id and part.user_id.id or uid
val = {
'partner_invoice_id': addr['invoice'],
'partner_shipping_id': addr['delivery'],
'payment_term': payment_term,
'user_id': dedicated_salesman,
}
delivery_onchange = self.<API key>(cr, uid, ids, False, part.id, addr['delivery'], False, context=context)
val.update(delivery_onchange['value'])
if pricelist:
val['pricelist_id'] = pricelist
sale_note = self.get_salenote(cr, uid, ids, part.id, context=context)
if sale_note: val.update({'note': sale_note})
return {'value': val}
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if vals.get('name', '/') == '/':
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'sale.order') or '/'
if vals.get('partner_id') and any(f not in vals for f in ['partner_invoice_id', 'partner_shipping_id', 'pricelist_id', 'fiscal_position']):
defaults = self.onchange_partner_id(cr, uid, [], vals['partner_id'], context=context)['value']
if not vals.get('fiscal_position') and vals.get('partner_shipping_id'):
delivery_onchange = self.<API key>(cr, uid, [], vals.get('company_id'), None, vals['partner_id'], vals.get('partner_shipping_id'), context=context)
defaults.update(delivery_onchange['value'])
vals = dict(defaults, **vals)
ctx = dict(context or {}, mail_create_nolog=True)
new_id = super(sale_order, self).create(cr, uid, vals, context=ctx)
self.message_post(cr, uid, [new_id], body=_("Quotation created"), context=ctx)
return new_id
def button_dummy(self, cr, uid, ids, context=None):
return True
# FIXME: deprecated method, overriders should be using _prepare_invoice() instead.
# can be removed after 6.1.
def _inv_get(self, cr, uid, order, context=None):
return {}
def _prepare_invoice(self, cr, uid, order, lines, context=None):
"""Prepare the dict of values to create the new invoice for a
sales order. This method may be overridden to implement custom
invoice generation (making sure to call super() to establish
a clean extension chain).
:param browse_record order: sale.order record to invoice
:param list(int) line: list of invoice line IDs that must be
attached to the invoice
:return: dict of value to create() the invoice
"""
if context is None:
context = {}
journal_ids = self.pool.get('account.journal').search(cr, uid,
[('type', '=', 'sale'), ('company_id', '=', order.company_id.id)],
limit=1)
if not journal_ids:
raise osv.except_osv(_('Error!'),
_('Please define sales journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id))
invoice_vals = {
'name': order.client_order_ref or '',
'origin': order.name,
'type': 'out_invoice',
'reference': order.client_order_ref or order.name,
'account_id': order.partner_id.<API key>.id,
'partner_id': order.partner_invoice_id.id,
'journal_id': journal_ids[0],
'invoice_line': [(6, 0, lines)],
'currency_id': order.pricelist_id.currency_id.id,
'comment': order.note,
'payment_term': order.payment_term and order.payment_term.id or False,
'fiscal_position': order.fiscal_position.id or order.partner_id.<API key>.id,
'date_invoice': context.get('date_invoice', False),
'company_id': order.company_id.id,
'user_id': order.user_id and order.user_id.id or False,
'section_id' : order.section_id.id
}
# Care for deprecated _inv_get() hook - FIXME: to be removed after 6.1
invoice_vals.update(self._inv_get(cr, uid, order, context=context))
return invoice_vals
def _make_invoice(self, cr, uid, order, lines, context=None):
inv_obj = self.pool.get('account.invoice')
obj_invoice_line = self.pool.get('account.invoice.line')
if context is None:
context = {}
<API key> = self.pool.get('sale.order.line').search(cr, uid, [('order_id', '=', order.id), ('invoiced', '=', True)], context=context)
<API key> = []
for <API key> in self.pool.get('sale.order.line').browse(cr, uid, <API key>, context=context):
for invoice_line_id in <API key>.invoice_lines:
if invoice_line_id.invoice_id.id not in <API key>:
<API key>.append(invoice_line_id.invoice_id.id)
for preinv in order.invoice_ids:
if preinv.state not in ('cancel',) and preinv.id not in <API key>:
for preline in preinv.invoice_line:
inv_line_id = obj_invoice_line.copy(cr, uid, preline.id, {'invoice_id': False, 'price_unit': -preline.price_unit})
lines.append(inv_line_id)
inv = self._prepare_invoice(cr, uid, order, lines, context=context)
inv_id = inv_obj.create(cr, uid, inv, context=context)
data = inv_obj.<API key>(cr, uid, [inv_id], inv['payment_term'], time.strftime(<API key>))
if data.get('value', False):
inv_obj.write(cr, uid, [inv_id], data['value'], context=context)
inv_obj.button_compute(cr, uid, [inv_id])
return inv_id
def print_quotation(self, cr, uid, ids, context=None):
'''
This function prints the sales order and mark it as sent, so that we can see more easily the next step of the workflow
'''
assert len(ids) == 1, 'This option should only be used for a single id at a time'
self.signal_workflow(cr, uid, ids, 'quotation_sent')
return self.pool['report'].get_action(cr, uid, ids, 'sale.report_saleorder', context=context)
def manual_invoice(self, cr, uid, ids, context=None):
""" create invoices for the given sales orders (ids), and open the form
view of one of the newly created invoices
"""
mod_obj = self.pool.get('ir.model.data')
# create invoices through the sales orders' workflow
inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
self.signal_workflow(cr, uid, ids, 'manual_invoice')
inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
# determine newly created invoices
new_inv_ids = list(inv_ids1 - inv_ids0)
res = mod_obj.<API key>(cr, uid, 'account', 'invoice_form')
res_id = res and res[1] or False,
return {
'name': _('Customer Invoices'),
'view_type': 'form',
'view_mode': 'form',
'view_id': [res_id],
'res_model': 'account.invoice',
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'current',
'res_id': new_inv_ids and new_inv_ids[0] or False,
}
def action_view_invoice(self, cr, uid, ids, context=None):
'''
This function returns an action that display existing invoices of given sales order ids. It can either be a in a list or in a form view, if there is only one invoice to show.
'''
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
result = mod_obj.<API key>(cr, uid, 'account', '<API key>')
id = result and result[1] or False
result = act_obj.read(cr, uid, [id], context=context)[0]
#compute the number of invoices to display
inv_ids = []
for so in self.browse(cr, uid, ids, context=context):
inv_ids += [invoice.id for invoice in so.invoice_ids]
#choose the view_mode accordingly
if len(inv_ids)>1:
result['domain'] = "[('id','in',["+','.join(map(str, inv_ids))+"])]"
else:
res = mod_obj.<API key>(cr, uid, 'account', 'invoice_form')
result['views'] = [(res and res[1] or False, 'form')]
result['res_id'] = inv_ids and inv_ids[0] or False
return result
def test_no_product(self, cr, uid, order, context):
for line in order.order_line:
if line.product_id and (line.product_id.type<>'service'):
return False
return True
def <API key>(self, cr, uid, ids, grouped=False, states=None, date_invoice = False, context=None):
if states is None:
states = ['confirmed', 'done', 'exception']
res = False
invoices = {}
invoice_ids = []
invoice = self.pool.get('account.invoice')
obj_sale_order_line = self.pool.get('sale.order.line')
partner_currency = {}
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
# last day of the last month as invoice date
if date_invoice:
context = dict(context or {}, date_invoice=date_invoice)
for o in self.browse(cr, uid, ids, context=context):
currency_id = o.pricelist_id.currency_id.id
if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id):
raise osv.except_osv(
_('Error!'),
_('You cannot group sales having different currencies for the same partner.'))
partner_currency[o.partner_id.id] = currency_id
lines = []
for line in o.order_line:
if line.invoiced:
continue
elif (line.state in states):
lines.append(line.id)
created_lines = obj_sale_order_line.invoice_line_create(cr, uid, lines)
if created_lines:
invoices.setdefault(o.partner_invoice_id.id or o.partner_id.id, []).append((o, created_lines))
if not invoices:
for o in self.browse(cr, uid, ids, context=context):
for i in o.invoice_ids:
if i.state == 'draft':
return i.id
for val in invoices.values():
if grouped:
res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x, y: x + y, [l for o, l in val], []), context=context)
invoice_ref = ''
origin_ref = ''
for o, l in val:
invoice_ref += (o.client_order_ref or o.name) + '|'
origin_ref += (o.origin or o.name) + '|'
self.write(cr, uid, [o.id], {'state': 'progress'})
cr.execute('insert into <API key> (order_id,invoice_id) values (%s,%s)', (o.id, res))
self.invalidate_cache(cr, uid, ['invoice_ids'], [o.id], context=context)
#remove last '|' in invoice_ref
if len(invoice_ref) >= 1:
invoice_ref = invoice_ref[:-1]
if len(origin_ref) >= 1:
origin_ref = origin_ref[:-1]
invoice.write(cr, uid, [res], {'origin': origin_ref, 'name': invoice_ref})
else:
for order, il in val:
res = self._make_invoice(cr, uid, order, il, context=context)
invoice_ids.append(res)
self.write(cr, uid, [order.id], {'state': 'progress'})
cr.execute('insert into <API key> (order_id,invoice_id) values (%s,%s)', (order.id, res))
self.invalidate_cache(cr, uid, ['invoice_ids'], [order.id], context=context)
return res
def <API key>(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'invoice_except'}, context=context)
return True
def action_invoice_end(self, cr, uid, ids, context=None):
for this in self.browse(cr, uid, ids, context=context):
for line in this.order_line:
if line.state == 'exception':
line.write({'state': 'confirmed'})
if this.state == 'invoice_except':
this.write({'state': 'progress'})
return True
def action_cancel(self, cr, uid, ids, context=None):
if context is None:
context = {}
sale_order_line_obj = self.pool.get('sale.order.line')
account_invoice_obj = self.pool.get('account.invoice')
for sale in self.browse(cr, uid, ids, context=context):
for inv in sale.invoice_ids:
if inv.state not in ('draft', 'cancel'):
raise osv.except_osv(
_('Cannot cancel this sales order!'),
_('First cancel all invoices attached to this sales order.'))
inv.signal_workflow('invoice_cancel')
sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
{'state': 'cancel'})
self.write(cr, uid, ids, {'state': 'cancel'})
return True
def <API key>(self, cr, uid, ids, context=None):
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
self.signal_workflow(cr, uid, ids, 'order_confirm')
return True
def action_wait(self, cr, uid, ids, context=None):
context = context or {}
for o in self.browse(cr, uid, ids):
if not o.order_line:
raise osv.except_osv(_('Error!'),_('You cannot confirm a sales order which has no line.'))
noprod = self.test_no_product(cr, uid, o, context)
if (o.order_policy == 'manual') or noprod:
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': fields.date.context_today(self, cr, uid, context=context)})
else:
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': fields.date.context_today(self, cr, uid, context=context)})
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
return True
def <API key>(self, cr, uid, ids, context=None):
'''
This function opens a window to compose an email, with the edi sale template message loaded by default
'''
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
ir_model_data = self.pool.get('ir.model.data')
try:
template_id = ir_model_data.<API key>(cr, uid, 'sale', '<API key>')[1]
except ValueError:
template_id = False
try:
compose_form_id = ir_model_data.<API key>(cr, uid, 'mail', '<API key>')[1]
except ValueError:
compose_form_id = False
ctx = dict()
ctx.update({
'default_model': 'sale.order',
'default_res_id': ids[0],
'<API key>': bool(template_id),
'default_template_id': template_id,
'<API key>': 'comment',
'mark_so_as_sent': True
})
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
def action_done(self, cr, uid, ids, context=None):
for order in self.browse(cr, uid, ids, context=context):
self.pool.get('sale.order.line').write(cr, uid, [line.id for line in order.order_line], {'state': 'done'}, context=context)
return self.write(cr, uid, ids, {'state': 'done'}, context=context)
def <API key>(self, cr, uid, order, line, group_id=False, context=None):
date_planned = self._get_date_planned(cr, uid, order, line, order.date_order, context=context)
return {
'name': line.name,
'origin': order.name,
'date_planned': date_planned,
'product_id': line.product_id.id,
'product_qty': line.product_uom_qty,
'product_uom': line.product_uom.id,
'product_uos_qty': (line.product_uos and line.product_uos_qty) or line.product_uom_qty,
'product_uos': (line.product_uos and line.product_uos.id) or line.product_uom.id,
'company_id': order.company_id.id,
'group_id': group_id,
'invoice_state': (order.order_policy == 'picking') and '2binvoiced' or 'none',
'sale_line_id': line.id
}
def _get_date_planned(self, cr, uid, order, line, start_date, context=None):
date_planned = datetime.strptime(start_date, <API key>) + timedelta(days=line.delay or 0.0)
return date_planned
def <API key>(self, cr, uid, order, context=None):
return {'name': order.name, 'partner_id': order.partner_shipping_id.id}
def procurement_needed(self, cr, uid, ids, context=None):
#when sale is installed only, there is no need to create procurements, that's only
#further installed modules (sale_service, sale_stock) that will change this.
sale_line_obj = self.pool.get('sale.order.line')
res = []
for order in self.browse(cr, uid, ids, context=context):
res.append(sale_line_obj.need_procurement(cr, uid, [line.id for line in order.order_line], context=context))
return any(res)
def <API key>(self, cr, uid, ids, context=None):
for sale_order in self.browse(cr, uid, ids, context=context):
self.write(cr, uid, ids, {'state': 'progress' if sale_order.invoice_exists else 'manual'}, context=context)
return True
def action_ship_create(self, cr, uid, ids, context=None):
"""Create the required procurements to supply sales order lines, also connecting
the procurements to appropriate stock moves in order to bring the goods to the
sales order's requested location.
:return: True
"""
procurement_obj = self.pool.get('procurement.order')
sale_line_obj = self.pool.get('sale.order.line')
for order in self.browse(cr, uid, ids, context=context):
proc_ids = []
vals = self.<API key>(cr, uid, order, context=context)
if not order.<API key>:
group_id = self.pool.get("procurement.group").create(cr, uid, vals, context=context)
order.write({'<API key>': group_id}, context=context)
for line in order.order_line:
#Try to fix exception procurement (possible when after a shipping exception the user choose to recreate)
if line.procurement_ids:
#first check them to see if they are in exception or not (one of the related moves is cancelled)
procurement_obj.check(cr, uid, [x.id for x in line.procurement_ids if x.state not in ['cancel', 'done']])
line.refresh()
#run again procurement that are in exception in order to trigger another move
proc_ids += [x.id for x in line.procurement_ids if x.state in ('exception', 'cancel')]
elif sale_line_obj.need_procurement(cr, uid, [line.id], context=context):
if (line.state == 'done') or not line.product_id:
continue
vals = self.<API key>(cr, uid, order, line, group_id=group_id, context=context)
proc_id = procurement_obj.create(cr, uid, vals, context=context)
proc_ids.append(proc_id)
#Confirm procurement order such that rules will be applied on it
#note that the workflow normally ensure proc_ids isn't an empty list
procurement_obj.run(cr, uid, proc_ids, context=context)
#if shipping was in exception and the user choose to recreate the delivery order, write the new status of SO
if order.state == 'shipping_except':
val = {'state': 'progress', 'shipped': False}
if (order.order_policy == 'manual'):
for line in order.order_line:
if (not line.invoiced) and (line.state not in ('cancel', 'draft')):
val['state'] = 'manual'
break
order.write(val)
return True
def <API key>(self, cr, uid, ids, fiscal_position, order_lines, context=None):
'''Update taxes of order lines for each line where a product is defined
:param list ids: not used
:param int fiscal_position: sale order fiscal position
:param list order_lines: command list for one2many write method
'''
order_line = []
fiscal_obj = self.pool.get('account.fiscal.position')
product_obj = self.pool.get('product.product')
line_obj = self.pool.get('sale.order.line')
fpos = False
if fiscal_position:
fpos = fiscal_obj.browse(cr, uid, fiscal_position, context=context)
for line in order_lines:
# create (0, 0, { fields })
# update (1, ID, { fields })
if line[0] in [0, 1]:
prod = None
if line[2].get('product_id'):
prod = product_obj.browse(cr, uid, line[2]['product_id'], context=context)
elif line[1]:
prod = line_obj.browse(cr, uid, line[1], context=context).product_id
if prod and prod.taxes_id:
line[2]['tax_id'] = [[6, 0, fiscal_obj.map_tax(cr, uid, fpos, prod.taxes_id)]]
order_line.append(line)
# link (4, ID)
# link all (6, 0, IDS)
elif line[0] in [4, 6]:
line_ids = line[0] == 4 and [line[1]] or line[2]
for line_id in line_ids:
prod = line_obj.browse(cr, uid, line_id, context=context).product_id
if prod and prod.taxes_id:
order_line.append([1, line_id, {'tax_id': [[6, 0, fiscal_obj.map_tax(cr, uid, fpos, prod.taxes_id)]]}])
else:
order_line.append([4, line_id])
else:
order_line.append(line)
return {'value': {'order_line': order_line}}
def <API key>(self, cr, uid, ids, context=None):
for sale in self.browse(cr, uid, ids, context=context):
for line in sale.order_line:
if not all([x.state == 'done' for x in line.procurement_ids]):
return False
return True
def <API key>(self, cr, uid, ids, context=None):
for sale in self.browse(cr, uid, ids, context=context):
for line in sale.order_line:
if any([x.state == 'cancel' for x in line.procurement_ids]):
return True
return False
# TODO add a field price_unit_uos
# - update it on change product and unit price
# - use it in report if there is a uos
class sale_order_line(osv.osv):
def need_procurement(self, cr, uid, ids, context=None):
#when sale is installed only, there is no need to create procurements, that's only
#further installed modules (sale_service, sale_stock) that will change this.
prod_obj = self.pool.get('product.product')
for line in self.browse(cr, uid, ids, context=context):
if prod_obj.need_procurement(cr, uid, [line.product_id.id], context=context):
return True
return False
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
res = {}
if context is None:
context = {}
for line in self.browse(cr, uid, ids, context=context):
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty, line.product_id, line.order_id.partner_id)
cur = line.order_id.pricelist_id.currency_id
res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
return res
def _get_uom_id(self, cr, uid, *args):
try:
proxy = self.pool.get('ir.model.data')
result = proxy.<API key>(cr, uid, 'product', 'product_uom_unit')
return result[1]
except Exception, ex:
return False
def _fnct_line_invoiced(self, cr, uid, ids, field_name, args, context=None):
res = dict.fromkeys(ids, False)
for this in self.browse(cr, uid, ids, context=context):
res[this.id] = this.invoice_lines and \
all(iline.invoice_id.state != 'cancel' for iline in this.invoice_lines)
return res
def <API key>(self, cr, uid, ids, context=None):
# direct access to the m2m table is the less convoluted way to achieve this (and is ok ACL-wise)
cr.execute("""SELECT DISTINCT sol.id FROM <API key> rel JOIN
sale_order_line sol ON (sol.order_id = rel.order_id)
WHERE rel.invoice_id = ANY(%s)""", (list(ids),))
return [i[0] for i in cr.fetchall()]
_name = 'sale.order.line'
_description = 'Sales Order Line'
_columns = {
'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}),
'name': fields.text('Description', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sales order lines."),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True, readonly=True, states={'draft': [('readonly', False)]}, ondelete='restrict'),
'invoice_lines': fields.many2many('account.invoice.line', '<API key>', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True, copy=False),
'invoiced': fields.function(_fnct_line_invoiced, string='Invoiced', type='boolean',
store={
'account.invoice': (<API key>, ['state'], 10),
'sale.order.line': (lambda self,cr,uid,ids,ctx=None: ids, ['invoice_lines'], 10)
}),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price'), readonly=True, states={'draft': [('readonly', False)]}),
'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Account')),
'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft': [('readonly', False)]}),
'<API key>': fields.many2one('res.partner', 'Allotment Partner',help="A partner to whom the particular product needs to be allotted."),
'product_uom_qty': fields.float('Quantity', digits_compute= dp.get_precision('Product UoS'), required=True, readonly=True, states={'draft': [('readonly', False)]}),
'product_uom': fields.many2one('product.uom', 'Unit of Measure ', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'product_uos_qty': fields.float('Quantity (UoS)' ,digits_compute= dp.get_precision('Product UoS'), readonly=True, states={'draft': [('readonly', False)]}),
'product_uos': fields.many2one('product.uom', 'Product UoS'),
'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount'), readonly=True, states={'draft': [('readonly', False)]}),
'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}),
'state': fields.selection(
[('cancel', 'Cancelled'),('draft', 'Draft'),('confirmed', 'Confirmed'),('exception', 'Exception'),('done', 'Done')],
'Status', required=True, readonly=True, copy=False,
help='* The \'Draft\' status is set when the related sales order in draft status. \
\n* The \'Confirmed\' status is set when the related sales order is confirmed. \
\n* The \'Exception\' status is set when the related sales order is set as exception. \
\n* The \'Done\' status is set when the sales order line has been picked. \
\n* The \'Cancelled\' status is set when a user cancel the sales order related.'),
'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', store=True, string='Customer'),
'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesperson'),
'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation and the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}),
'procurement_ids': fields.one2many('procurement.order', 'sale_line_id', 'Procurements'),
}
_order = 'order_id desc, sequence, id'
_defaults = {
'product_uom' : _get_uom_id,
'discount': 0.0,
'product_uom_qty': 1,
'product_uos_qty': 1,
'sequence': 10,
'state': 'draft',
'price_unit': 0.0,
'delay': 0.0,
}
def _get_line_qty(self, cr, uid, line, context=None):
if line.product_uos:
return line.product_uos_qty or 0.0
return line.product_uom_qty
def _get_line_uom(self, cr, uid, line, context=None):
if line.product_uos:
return line.product_uos.id
return line.product_uom.id
def <API key>(self, cr, uid, line, account_id=False, context=None):
"""Prepare the dict of values to create the new invoice line for a
sales order line. This method may be overridden to implement custom
invoice generation (making sure to call super() to establish
a clean extension chain).
:param browse_record line: sale.order.line record to invoice
:param int account_id: optional ID of a G/L account to force
(this is used for returning products including service)
:return: dict of values to create() the invoice line
"""
res = {}
if not line.invoiced:
if not account_id:
if line.product_id:
account_id = line.product_id.<API key>.id
if not account_id:
account_id = line.product_id.categ_id.<API key>.id
if not account_id:
raise osv.except_osv(_('Error!'),
_('Please define income account for this product: "%s" (id:%d).') % \
(line.product_id.name, line.product_id.id,))
else:
prop = self.pool.get('ir.property').get(cr, uid,
'<API key>', 'product.category',
context=context)
account_id = prop and prop.id or False
uosqty = self._get_line_qty(cr, uid, line, context=context)
uos_id = self._get_line_uom(cr, uid, line, context=context)
pu = 0.0
if uosqty:
pu = round(line.price_unit * line.product_uom_qty / uosqty,
self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price'))
fpos = line.order_id.fiscal_position or False
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, account_id)
if not account_id:
raise osv.except_osv(_('Error!'),
_('There is no Fiscal Position defined or Income category account defined for default properties of Product categories.'))
res = {
'name': line.name,
'sequence': line.sequence,
'origin': line.order_id.name,
'account_id': account_id,
'price_unit': pu,
'quantity': uosqty,
'discount': line.discount,
'uos_id': uos_id,
'product_id': line.product_id.id or False,
'invoice_line_tax_id': [(6, 0, [x.id for x in line.tax_id])],
'account_analytic_id': line.order_id.project_id and line.order_id.project_id.id or False,
}
return res
def invoice_line_create(self, cr, uid, ids, context=None):
if context is None:
context = {}
create_ids = []
sales = set()
for line in self.browse(cr, uid, ids, context=context):
vals = self.<API key>(cr, uid, line, False, context)
if vals:
inv_id = self.pool.get('account.invoice.line').create(cr, uid, vals, context=context)
self.write(cr, uid, [line.id], {'invoice_lines': [(4, inv_id)]}, context=context)
sales.add(line.order_id.id)
create_ids.append(inv_id)
# Trigger workflow events
for sale_id in sales:
workflow.trg_write(uid, 'sale.order', sale_id, cr)
return create_ids
def button_cancel(self, cr, uid, ids, context=None):
for line in self.browse(cr, uid, ids, context=context):
if line.invoiced:
raise osv.except_osv(_('Invalid Action!'), _('You cannot cancel a sales order line that has already been invoiced.'))
return self.write(cr, uid, ids, {'state': 'cancel'})
def button_confirm(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'confirmed'})
def button_done(self, cr, uid, ids, context=None):
res = self.write(cr, uid, ids, {'state': 'done'})
for line in self.browse(cr, uid, ids, context=context):
workflow.trg_write(uid, 'sale.order', line.order_id.id, cr)
return res
def uos_change(self, cr, uid, ids, product_uos, product_uos_qty=0, product_id=None):
product_obj = self.pool.get('product.product')
if not product_id:
return {'value': {'product_uom': product_uos,
'product_uom_qty': product_uos_qty}, 'domain': {}}
product = product_obj.browse(cr, uid, product_id)
value = {
'product_uom': product.uom_id.id,
}
# FIXME must depend on uos/uom of the product and not only of the coeff.
try:
value.update({
'product_uom_qty': product_uos_qty / product.uos_coeff,
'th_weight': product_uos_qty / product.uos_coeff * product.weight
})
except ZeroDivisionError:
pass
return {'value': value}
def create(self, cr, uid, values, context=None):
if values.get('order_id') and values.get('product_id') and any(f not in values for f in ['name', 'price_unit', 'type', 'product_uom_qty', 'product_uom']):
order = self.pool['sale.order'].read(cr, uid, values['order_id'], ['pricelist_id', 'partner_id', 'date_order', 'fiscal_position'], context=context)
defaults = self.product_id_change(cr, uid, [], order['pricelist_id'][0], values['product_id'],
qty=float(values.get('product_uom_qty', False)),
uom=values.get('product_uom', False),
qty_uos=float(values.get('product_uos_qty', False)),
uos=values.get('product_uos', False),
name=values.get('name', False),
partner_id=order['partner_id'][0],
date_order=order['date_order'],
fiscal_position=order['fiscal_position'][0] if order['fiscal_position'] else False,
flag=False, # Force name update
context=context
)['value']
if defaults.get('tax_id'):
defaults['tax_id'] = [[6, 0, defaults['tax_id']]]
values = dict(defaults, **values)
return super(sale_order_line, self).create(cr, uid, values, context=context)
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
context = context or {}
lang = lang or context.get('lang', False)
if not partner_id:
raise osv.except_osv(_('No Customer Defined!'), _('Before choosing a product,\n select a customer in the sales form.'))
warning = False
product_uom_obj = self.pool.get('product.uom')
partner_obj = self.pool.get('res.partner')
product_obj = self.pool.get('product.product')
context = {'lang': lang, 'partner_id': partner_id}
partner = partner_obj.browse(cr, uid, partner_id)
lang = partner.lang
context_partner = {'lang': lang, 'partner_id': partner_id}
if not product:
return {'value': {'th_weight': 0,
'product_uos_qty': qty}, 'domain': {'product_uom': [],
'product_uos': []}}
if not date_order:
date_order = time.strftime(<API key>)
result = {}
warning_msgs = ''
product_obj = product_obj.browse(cr, uid, product, context=context_partner)
uom2 = False
if uom:
uom2 = product_uom_obj.browse(cr, uid, uom)
if product_obj.uom_id.category_id.id != uom2.category_id.id:
uom = False
if uos:
if product_obj.uos_id:
uos2 = product_uom_obj.browse(cr, uid, uos)
if product_obj.uos_id.category_id.id != uos2.category_id.id:
uos = False
else:
uos = False
fpos = False
if not fiscal_position:
fpos = partner.<API key> or False
else:
fpos = self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position)
if update_tax: #The quantity only have changed
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
if not flag:
result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
if product_obj.description_sale:
result['name'] += '\n'+product_obj.description_sale
domain = {}
if (not uom) and (not uos):
result['product_uom'] = product_obj.uom_id.id
if product_obj.uos_id:
result['product_uos'] = product_obj.uos_id.id
result['product_uos_qty'] = qty * product_obj.uos_coeff
uos_category_id = product_obj.uos_id.category_id.id
else:
result['product_uos'] = False
result['product_uos_qty'] = qty
uos_category_id = False
result['th_weight'] = qty * product_obj.weight
domain = {'product_uom':
[('category_id', '=', product_obj.uom_id.category_id.id)],
'product_uos':
[('category_id', '=', uos_category_id)]}
elif uos and not uom: # only happens if uom is False
result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id
result['product_uom_qty'] = qty_uos / product_obj.uos_coeff
result['th_weight'] = result['product_uom_qty'] * product_obj.weight
elif uom: # whether uos is set or not
default_uom = product_obj.uom_id and product_obj.uom_id.id
q = product_uom_obj._compute_qty(cr, uid, uom, qty, default_uom)
if product_obj.uos_id:
result['product_uos'] = product_obj.uos_id.id
result['product_uos_qty'] = qty * product_obj.uos_coeff
else:
result['product_uos'] = False
result['product_uos_qty'] = qty
result['th_weight'] = q * product_obj.weight # Round the quantity up
if not uom2:
uom2 = product_obj.uom_id
# get unit price
if not pricelist:
warn_msg = _('You have to select a pricelist or a customer in the sales form !\n'
'Please set one before choosing a product.')
warning_msgs += _("No Pricelist ! : ") + warn_msg +"\n\n"
else:
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
product, qty or 1.0, partner_id, {
'uom': uom or result.get('product_uom'),
'date': date_order,
})[pricelist]
if price is False:
warn_msg = _("Cannot find a pricelist line matching this product and quantity.\n"
"You have to change either the product, the quantity or the pricelist.")
warning_msgs += _("No valid pricelist line found ! :") + warn_msg +"\n\n"
else:
result.update({'price_unit': price})
if warning_msgs:
warning = {
'title': _('Configuration Error!'),
'message' : warning_msgs
}
return {'value': result, 'domain': domain, 'warning': warning}
def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, context=None):
context = context or {}
lang = lang or ('lang' in context and context['lang'])
if not uom:
return {'value': {'price_unit': 0.0, 'product_uom' : uom or False}}
return self.product_id_change(cursor, user, ids, pricelist, product,
qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name,
partner_id=partner_id, lang=lang, update_tax=update_tax,
date_order=date_order, context=context)
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
"""Allows to delete sales order lines in draft,cancel states"""
for rec in self.browse(cr, uid, ids, context=context):
if rec.state not in ['draft', 'cancel']:
raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a sales order line which is in state \'%s\'.') %(rec.state,))
return super(sale_order_line, self).unlink(cr, uid, ids, context=context)
class <API key>(osv.Model):
_inherit = 'mail.compose.message'
def send_mail(self, cr, uid, ids, context=None):
context = context or {}
if context.get('default_model') == 'sale.order' and context.get('default_res_id') and context.get('mark_so_as_sent'):
context = dict(context, <API key>=True)
self.pool.get('sale.order').signal_workflow(cr, uid, [context['default_res_id']], 'quotation_sent')
return super(<API key>, self).send_mail(cr, uid, ids, context=context)
class account_invoice(osv.Model):
_inherit = 'account.invoice'
def <API key>(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
section_id = self.<API key>(cr, uid, context=context) or False
if not section_id:
section_id = self.pool.get('res.users').browse(cr, uid, uid, context).default_section_id.id or False
return section_id
def <API key>(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
context key, or None if it cannot be resolved to a single
Sales Team.
"""
if context is None:
context = {}
if type(context.get('default_section_id')) in (int, long):
return context.get('default_section_id')
if isinstance(context.get('default_section_id'), basestring):
section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=context['default_section_id'], context=context)
if len(section_ids) == 1:
return int(section_ids[0][0])
return None
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
_defaults = {
'section_id': lambda self, cr, uid, c=None: self.<API key>(cr, uid, context=c)
}
def confirm_paid(self, cr, uid, ids, context=None):
sale_order_obj = self.pool.get('sale.order')
res = super(account_invoice, self).confirm_paid(cr, uid, ids, context=context)
so_ids = sale_order_obj.search(cr, uid, [('invoice_ids', 'in', ids)], context=context)
for so_id in so_ids:
sale_order_obj.message_post(cr, uid, so_id, body=_("Invoice paid"), context=context)
return res
def unlink(self, cr, uid, ids, context=None):
""" Overwrite unlink method of account invoice to send a trigger to the sale workflow upon invoice deletion """
invoice_ids = self.search(cr, uid, [('id', 'in', ids), ('state', 'in', ['draft', 'cancel'])], context=context)
#if we can't cancel all invoices, do nothing
if len(invoice_ids) == len(ids):
#Cancel invoice(s) first before deleting them so that if any sale order is associated with them
#it will trigger the workflow to put the sale order in an 'invoice exception' state
for id in ids:
workflow.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
return super(account_invoice, self).unlink(cr, uid, ids, context=context)
class procurement_order(osv.osv):
_inherit = 'procurement.order'
_columns = {
'sale_line_id': fields.many2one('sale.order.line', string='Sale Order Line'),
}
def write(self, cr, uid, ids, vals, context=None):
if isinstance(ids, (int, long)):
ids = [ids]
res = super(procurement_order, self).write(cr, uid, ids, vals, context=context)
from openerp import workflow
if vals.get('state') in ['done', 'cancel', 'exception']:
for proc in self.browse(cr, uid, ids, context=context):
if proc.sale_line_id and proc.sale_line_id.order_id:
order_id = proc.sale_line_id.order_id.id
if self.pool.get('sale.order').<API key>(cr, uid, [order_id], context=context):
workflow.trg_validate(uid, 'sale.order', order_id, 'ship_end', cr)
if self.pool.get('sale.order').<API key>(cr, uid, [order_id], context=context):
workflow.trg_validate(uid, 'sale.order', order_id, 'ship_except', cr)
return res
class product_product(osv.Model):
_inherit = 'product.product'
def _sales_count(self, cr, uid, ids, field_name, arg, context=None):
SaleOrderLine = self.pool['sale.order.line']
return {
product_id: SaleOrderLine.search_count(cr,uid, [('product_id', '=', product_id)], context=context)
for product_id in ids
}
_columns = {
'sales_count': fields.function(_sales_count, string='# Sales', type='integer'),
}
class product_template(osv.Model):
_inherit = 'product.template'
def _sales_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict.fromkeys(ids, 0)
for template in self.browse(cr, uid, ids, context=context):
res[template.id] = sum([p.sales_count for p in template.product_variant_ids])
return res
def action_view_sales(self, cr, uid, ids, context=None):
act_obj = self.pool.get('ir.actions.act_window')
mod_obj = self.pool.get('ir.model.data')
product_ids = []
for template in self.browse(cr, uid, ids, context=context):
product_ids += [x.id for x in template.product_variant_ids]
result = mod_obj.xmlid_to_res_id(cr, uid, 'sale.<API key>',raise_if_not_found=True)
result = act_obj.read(cr, uid, [result], context=context)[0]
result['domain'] = "[('product_id','in',[" + ','.join(map(str, product_ids)) + "])]"
return result
_columns = {
'sales_count': fields.function(_sales_count, string='# Sales', type='integer'),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
<?php
// See the LICENCE file in the repository root for full licence text.
namespace App\Notifications;
use App\Models\User;
use App\Models\UserReport;
use GuzzleHttp\RequestOptions;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
class <API key> extends Notification implements ShouldQueue
{
use Queueable;
const HTTP_OPTIONS = [
RequestOptions::CONNECT_TIMEOUT => 5,
RequestOptions::TIMEOUT => 5,
];
private $reporter;
public function __construct(User $reporter)
{
$this->reporter = $reporter;
}
public function toSlack(UserReport $notifiable): SlackMessage
{
return (new SlackMessage())
->http(static::HTTP_OPTIONS)
->attachment(function ($attachment) use ($notifiable) {
$reportable = $notifiable->reportable;
$reportableUrl = null;
if (method_exists($reportable, 'url')) {
$reportableUrl = $reportable->url();
}
$user = optional($notifiable->user)->username ?? "User {$notifiable->user_id}";
$userUrl = route('users.show', ['user' => $notifiable->user_id]);
$reportedText =
$reportableUrl !== null
? "<{$reportableUrl}|{$notifiable->reportable_type} {$notifiable->reportable_id}>"
: "{$notifiable->reportable_type} {$notifiable->reportable_id}";
$attachment
->color('warning')
->content($notifiable->comments)
->fields([
'Reporter' => "<{$this->reporter->url()}|{$this->reporter->username}>",
'Reported' => $reportedText,
'User' => "<{$userUrl}|{$user}>",
'Reason' => $notifiable->reason,
]);
});
}
public function via($notifiable)
{
return ['slack'];
}
}
|
# <API key>: true
require 'rails_helper'
describe SearchService, type: :service do
subject { described_class.new }
describe '#call' do
describe 'with a blank query' do
it 'returns empty results without searching' do
allow(<API key>).to receive(:new)
allow(Tag).to receive(:search_for)
results = subject.call('', nil, 10)
expect(results).to eq(empty_results)
expect(<API key>).not_to have_received(:new)
expect(Tag).not_to have_received(:search_for)
end
end
describe 'with an url query' do
before do
@query = 'http://test.host/query'
end
context 'that does not find anything' do
it 'returns the empty results' do
service = double(call: nil)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10)
expect(service).to have_received(:call).with(@query, on_behalf_of: nil)
expect(results).to eq empty_results
end
end
context 'that finds an account' do
it 'includes the account in the results' do
account = Account.new
service = double(call: account)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10)
expect(service).to have_received(:call).with(@query, on_behalf_of: nil)
expect(results).to eq empty_results.merge(accounts: [account])
end
end
context 'that finds a status' do
it 'includes the status in the results' do
status = Status.new
service = double(call: status)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10)
expect(service).to have_received(:call).with(@query, on_behalf_of: nil)
expect(results).to eq empty_results.merge(statuses: [status])
end
end
end
describe 'with a non-url query' do
context 'that matches an account' do
it 'includes the account in the results' do
query = 'username'
account = Account.new
service = double(call: [account])
allow(<API key>).to receive(:new).and_return(service)
results = subject.call(query, nil, 10)
expect(service).to have_received(:call).with(query, nil, limit: 10, offset: 0, resolve: false)
expect(results).to eq empty_results.merge(accounts: [account])
end
end
context 'that matches a tag' do
it 'includes the tag in the results' do
query = '#tag'
tag = Tag.new
allow(Tag).to receive(:search_for).with('tag', 10, 0).and_return([tag])
results = subject.call(query, nil, 10)
expect(Tag).to have_received(:search_for).with('tag', 10, 0)
expect(results).to eq empty_results.merge(hashtags: [tag])
end
it 'does not include tag when starts with @ character' do
query = '@username'
allow(Tag).to receive(:search_for)
results = subject.call(query, nil, 10)
expect(Tag).not_to have_received(:search_for)
expect(results).to eq empty_results
end
end
end
end
def empty_results
{ accounts: [], hashtags: [], statuses: [] }
end
end
|
# Numenta Platform for Intelligent Computing (NuPIC)
# following terms and conditions apply:
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
import unittest2 as unittest
from nupic.bindings.algorithms import SpatialPooler as CPPSpatialPooler
import <API key>
<API key>.SpatialPooler = CPPSpatialPooler
<API key> = <API key>.<API key>
if __name__ == "__main__":
unittest.main()
|
package org.kuali.coeus.common.budget.framework.core;
public class BudgetException extends RuntimeException {
}
|
define( [ 'Backbone', 'instance-admin/models/contact' ], function ( Backbone, ContactModel ) {
"use strict";
var ContactCollection = Backbone.Collection.extend({
model: ContactModel
});
return ContactCollection;
});
|
package org.kuali.kra.award.paymentreports.paymentschedule;
import org.kuali.kra.infrastructure.KeyConstants;
import org.kuali.coeus.sys.framework.rule.<API key>;
import org.kuali.rice.krad.util.GlobalVariables;
import java.util.List;
/**
* The <API key>
*/
public class <API key> extends <API key>
implements <API key> {
private static final String DUE_DATE_ERROR_PARM = "Due Date (Due Date)";
/**
*
* @see org.kuali.kra.award.paymentreports.paymentschedule.<API key>#<API key>(
* org.kuali.kra.award.paymentreports.paymentschedule.<API key>)
*/
public boolean <API key>(<API key> event) {
return <API key>(event);
}
/**
*
* This method processes new <API key> rules
*
* @param event
* @return
*/
public boolean <API key>(<API key> event) {
return <API key>(event);
}
private boolean <API key>(<API key> event) {
<API key> paymentScheduleItem = event.<API key>();
List<<API key>> items = event.getAward().<API key>();
return isUnique(items, paymentScheduleItem);
}
/**
* An payment schedule item is unique if no other matching items are in the collection
* To know if this is a new add or an edit of an existing equipment item, we check
* the identifier for nullity. If null, this is an add; otherwise, it's an update
* If an update, then we expect to find one match in the collection (itself). If an add,
* we expect to find no matches in the collection
* @param <API key>
* @param paymentScheduleItem
* @return
*/
boolean isUnique(List<<API key>> <API key>, <API key> paymentScheduleItem) {
boolean duplicateFound = false;
for(<API key> listItem: <API key>) {
duplicateFound = paymentScheduleItem != listItem && listItem.equals(paymentScheduleItem);
if(duplicateFound) {
break;
}
}
if(duplicateFound) {
if(!<API key>()) {
reportError(<API key>,
KeyConstants.<API key>, DUE_DATE_ERROR_PARM);
}
}
return !duplicateFound;
}
private boolean <API key>() {
return GlobalVariables.getMessageMap().containsMessageKey(KeyConstants.<API key>);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.